/* Q-IND bundle kit — shared styles on top of common-libs/css/qind-theme.css (the studio look:
   --bg, --surface, --accent, .header, .tab-bar, .stat-card, .btn …): header extras, cards and
   tiles, tables, inputs and selects, forms, switches, checkboxes, status pills, About, the update
   badge, phone rules. Loaded before the bundle's css/app.css, which may override any of it.

   Part of the Q-IND bundle kit (q-bundle-kit): served at kit/css/kit.css, not edited in a bundle. */

.help-btn { display: flex; padding: 4px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); }
.help-btn[hidden] { display: none; }
.help-btn:hover { color: var(--text); border-color: var(--border); }
.help-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-brand { width: 26px; height: 26px; object-fit: contain; margin-right: 10px; }   /* square logo: set both sides (the theme sets 22×22) */
.header-title .brand { color: var(--accent); }

/* Image version next to the title (tooltip: build date) */
.app-version { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #777; margin-left: 8px; letter-spacing: 0; }

.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 8px; padding: 14px 16px; margin-top: 14px; }
.card h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { margin: 0; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
code { font-family: var(--mono); font-size: 12px; color: #ccc; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.stat-value.alarm { color: var(--danger); }
.stat-value.ok { color: var(--accent); }
/* 1.5: update-check.js fills [data-kit-update] (an Overview tile) */
[data-kit-update][data-state="ok"] { color: var(--accent); }
[data-kit-update][data-state="new"] { color: var(--warn); }
[data-kit-update][data-state="off"], [data-kit-update][data-state="unknown"] { color: var(--muted); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--accent); }
.status-warn { color: var(--warn); }
.status-bad { color: var(--danger); }
.status-ok::before { box-shadow: 0 0 6px rgba(76, 175, 80, 0.6); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-soft); }
.table th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; }
.table .num { text-align: right; font-family: var(--mono); }

.input { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 4px; padding: 0 10px; height: 32px; font: inherit; font-size: 13px; }
.input:focus { outline: none; border-color: var(--accent); }
/* selects look like the inputs next to them: same height, own chevron */
select.input { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--surface); color: var(--text); }
/* The open list follows the theme too where the browser can draw it (Chrome 135+:
   customizable select); elsewhere it stays the system's menu. */
@supports (appearance: base-select) {
  select.input, select.input::picker(select) { appearance: base-select; }
  /* the customizable select is a box of its own: center its text and chevron like an input's */
  select.input { background-image: none; padding-right: 10px; display: inline-flex; align-items: center; gap: 8px; }
  select.input::picker-icon { margin-left: auto; }
  label > select.input { display: flex; }
  select.input::picker-icon { color: var(--muted); transition: rotate 0.15s; }
  select.input:open::picker-icon { rotate: 180deg; }
  select.input::picker(select) { background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
    border-radius: 8px; padding: 4px; margin-top: 4px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
  select.input option { background: transparent; padding: 7px 10px; border-radius: 5px; font-size: 13px; }
  select.input option:hover, select.input option:focus-visible { background: var(--surface-3); }
  select.input option:checked { color: var(--accent); font-weight: 600; }
  select.input option::checkmark { color: var(--accent); }
}
/* qDialog (common-libs/components/dialogs.js): the kit paints its title white */
.qdlg-title { color: var(--text); }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.save-state { font-size: 12px; color: var(--muted); transition: opacity 0.2s; min-height: 16px; }
.save-state.ok { color: var(--accent); }
.save-state.bad { color: var(--danger); }
.save-state.busy { font-style: italic; }
.form .input:invalid { border-color: var(--danger); }
.form[data-readonly="true"] .input { opacity: 0.6; pointer-events: none; }
.form[data-readonly="true"] .btn { display: none; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); min-width: 0; overflow-wrap: anywhere; }

/* About */
.about { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.about .card { margin-top: 0; }
.about-id-row { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.about-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.about-name { flex: 1; min-width: 0; }
.about-title { font-family: 'Nasalization', 'Segoe UI', sans-serif; font-size: 17px; letter-spacing: 0.5px; color: #fff; }
.about-title .brand { color: var(--accent); }
.about-sub { margin-top: 4px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 11px; line-height: 18px; padding: 0 9px; border-radius: 9px; white-space: nowrap;
        background: rgba(76, 175, 80, 0.12); color: var(--accent); border: 1px solid rgba(76, 175, 80, 0.35); }
.about-ant { flex-shrink: 0; opacity: 0.75; transition: opacity 0.15s; }
.about-ant:hover { opacity: 1; }
.about-ant img { height: 30px; width: auto; display: block; }
.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 14px; }
.fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact.fact-wide { grid-column: 1 / -1; }   /* 1.3: About's Display line */
.fact-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.fact-value { font-family: var(--mono); font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact-value.ok { color: var(--accent); }
.fact-value.bad { color: var(--danger); }
.fact-value.warn { color: #42a5f5; }   /* a newer version: the blue of the update badge */
.about-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.about-pair .code { margin-bottom: 10px; }
.about-pair:has(> :only-child) { grid-template-columns: 1fr; }   /* a bundle: just the session card */
.code { margin: 0 0 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 6px; font-family: var(--mono); font-size: 12px; color: #ccc; overflow-x: auto; }
/* the kit line under the facts: "Kit q-bundle-base 1.0.0 · from template 0.1.14" */
.about-kit { padding-top: 10px; margin-top: 12px; border-top: 1px solid var(--border-soft); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.about-kit:empty { display: none; }

/* ── Responsive: phones and narrow embeds ──
   Header wraps, tab bar scrolls sideways, grids collapse to one column,
   tables scroll. The theme file has no phone rules; keep them here. */
.container { overflow-y: auto; }
.table-wrap { overflow-x: auto; }
@media (max-width: 720px) {
  .header { height: auto; min-height: 40px; flex-wrap: wrap; row-gap: 4px; padding: 6px 10px; }
  .header-brands { display: none; }
  .header-right { margin-left: auto; }
  .tab-bar { height: auto; min-height: 30px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab-item { flex: 0 0 auto; }
  .container { padding: 4px 8px 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .stat-value { font-size: 18px; }
  .card { padding: 12px; }
  .card-head { flex-wrap: wrap; }
  .card-head .input { width: 100%; }
  .about-title { font-size: 15px; }
  .form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; font-size: 11px; text-transform: uppercase; }
  .about-pair { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-ant img { height: 22px; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 5px 6px; }
}
@media (max-width: 420px) { .header-title { font-size: 13px; } }
@media (max-width: 340px) { .stats { grid-template-columns: 1fr !important; } }

.status-dot.online { background: var(--accent); }
.status-dot.offline { background: var(--danger); }

/* Checkboxes and radios like the studio's: dark grey box, accent fill with a white tick
   (radio: accent dot). Accent from the theme, so every theme gets its own color. */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none; margin: 0; flex-shrink: 0; cursor: pointer;
  width: 16px; height: 16px; display: inline-grid; place-content: center; vertical-align: -3px;
  background: var(--surface-3); border: 1px solid var(--border); transition: background 0.12s, border-color 0.12s;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before {
  content: ""; width: 9px; height: 9px; transform: scale(0); transition: transform 0.12s;
  background: var(--on-accent, #fff); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="radio"]::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; transform: scale(0); transition: transform 0.12s;
  background: var(--accent);
}
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input[type="radio"]:checked { border-color: var(--accent); }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--accent); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: 0.45; cursor: not-allowed; }

/* language button in the header (EN / ES) */
.lang-btn { background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font: 600 11px/1 var(--mono);
  letter-spacing: .5px; padding: 4px 6px; cursor: pointer; }
.lang-btn:hover { color: var(--accent); border-color: var(--accent); }
/* a translated span inside a .hint is running text: the theme's `.hint span` (nowrap chips) is not for it */
.hint span[data-i18n], .hint span[data-i18n-html] { margin: 0; white-space: normal; }

/* ── Update check (js/update-check.js): badge next to the version, the Modules Manager's blue
   Update button (administrators), progress while the studio updates this bundle ── */
#update-slot { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; vertical-align: middle; }
#update-slot.update-float { position: fixed; top: 10px; right: 12px; z-index: 50; margin: 0; }
.update-badge { font: 500 11px/1 var(--mono, ui-monospace, Menlo, monospace); letter-spacing: 0; text-transform: none;
  color: #64b5f6; background: rgba(30, 136, 229, 0.12); border: 1px solid rgba(30, 136, 229, 0.55);
  border-radius: 10px; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
.update-badge:hover { background: rgba(30, 136, 229, 0.25); color: #fff; }
.update-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0; text-transform: none;
  color: #fff; background: #1e88e5; border: 1px solid #1e88e5; border-radius: 14px; padding: 5px 12px 5px 9px; }
.update-btn:hover { background: #2196f3; border-color: #2196f3; }
.update-btn svg, .update-progress .qdlg-title svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.update-progress .qdlg-title svg { color: #42a5f5; }
.update-bar { height: 6px; border-radius: 3px; background: var(--surface-3, #333); overflow: hidden; margin: 4px 0 10px; }
.update-bar i { display: block; height: 100%; width: 3%; background: #1e88e5; transition: width 0.4s; }
.update-bar.indeterminate i { width: 35%; animation: update-slide 1.2s ease-in-out infinite; }
@keyframes update-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.update-step { font-size: 12px; color: var(--muted); min-height: 1.4em; }
@media (max-width: 720px) {
  .update-btn span { display: none; }            /* the icon only: the tooltip says what it does */
  .update-btn { padding: 5px 7px; }
}
@media (max-width: 420px) { .update-badge { display: none; } }

/* On/off switch (a boolean setting): green on, grey off — unmistakable at a glance */
.form label.switch-row { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; gap: 10px; cursor: pointer; color: var(--text); font-size: 13px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text .hint { font-size: 12px; }
input[type="checkbox"].switch { width: 34px; height: 18px; border-radius: 9px; margin-top: 1px; background: #555; border-color: #555;
  display: inline-block; position: relative; }
input[type="checkbox"].switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; clip-path: none; transform: none; transition: left 0.15s; }
input[type="checkbox"].switch:checked { background: #4caf50; border-color: #4caf50; }
input[type="checkbox"].switch:checked::before { left: 18px; transform: none; }
.form[data-readonly="true"] .switch-row { opacity: 0.6; pointer-events: none; }

/* ── 1.1: permissions (data-perm), collapsible cards, the kit's Settings sections ── */
/* until api/kit/permissions answers (QIND.ready: 3 s at most), elements with data-perm keep their
   place but do not show: no forbidden button flashes before it hides */
.qind-perms-pending [data-perm] { visibility: hidden !important; }
.qind-perm-hidden { display: none !important; }
.qind-perm-disabled { opacity: 0.45; cursor: not-allowed !important; }
.qind-perm-disabled:not(button):not(input):not(select):not(textarea) { pointer-events: none; }
.btn.qind-perm-disabled:hover { filter: none; }

/* data-collapsible: the header folds the card */
.qind-collapse-head { cursor: pointer; user-select: none; }
.card-head.qind-collapse-head, h3.qind-collapse-head { display: flex; align-items: center; gap: 12px; }
.qind-collapse-btn { margin-left: auto; order: 99; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; background: none; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; }
.qind-collapse-btn:hover { color: var(--text); border-color: var(--border); }
.qind-collapse-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.qind-collapsed > .qind-collapse-head .qind-collapse-btn svg { transform: rotate(-90deg); }
.qind-collapsed > :not(.qind-collapse-head) { display: none !important; }
.qind-collapsed > .qind-collapse-head { margin-bottom: 0; }

/* the kit's Settings sections (js/kit-settings.js) */
.kit-settings { display: flex; flex-direction: column; }
.kit-card .card-head { flex-wrap: wrap; margin-bottom: 8px; }
.kit-card .card-head h3 .hint { margin-left: 6px; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.kit-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.card-head .kit-actions { margin-top: 0; }
.kit-card .form { margin-top: 4px; }
.kit-card .kit-foot { margin: 8px 0 0; }
.kit-perm-table th.kit-role, .kit-perm-table td.kit-role { text-align: center; white-space: nowrap; width: 1%; padding-left: 12px; padding-right: 12px; }
.kit-perm-table th.kit-role { text-transform: none; font-size: 12px; color: var(--text); }
.kit-perm-table td.kit-role input { vertical-align: middle; }
.kit-perm-table .kit-perm-group th { padding-top: 14px; color: var(--accent); font-size: 11px; letter-spacing: 0.6px; border-bottom-color: var(--border); }
.kit-perm-name { min-width: 220px; }
.kit-perm-name code { margin-left: 6px; color: var(--muted); font-size: 11px; }
.kit-perm-name .badge { margin-left: 6px; }
.kit-perm-name small { display: block; margin-top: 2px; }
.kit-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.kit-toolbar .kit-search { flex: 1 1 220px; min-width: 160px; }
.kit-toolbar .kit-remove { margin-left: auto; }
.kit-texts-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--border-soft); border-radius: 6px; }
.kit-texts-table { table-layout: fixed; }
.kit-texts-table thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.kit-texts-table th:nth-child(1) { width: 22%; }
.kit-texts-table th:last-child { width: 36px; }
.kit-texts-table td { vertical-align: top; overflow-wrap: anywhere; font-size: 12px; }
.kit-texts-table .kit-key code { font-size: 11px; }
.kit-texts-table .kit-src { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kit-texts-table .kit-en { color: var(--muted); }
.kit-texts-table textarea.input { width: 100%; min-height: 30px; height: auto; padding: 6px 8px; resize: vertical; line-height: 1.4; font-size: 12px; box-sizing: border-box; }
.kit-texts-table tr.kit-changed .kit-plant textarea { border-color: var(--accent); }
.kit-texts-table tr.kit-missing .kit-img { color: var(--danger); }
.kit-texts-table .kit-not-in-image { color: var(--muted); font-style: italic; font-size: 12px; }
.kit-revert { width: 26px; height: 26px; border-radius: 6px; font-size: 15px; line-height: 1; }
@media (max-width: 720px) {
  .kit-texts-table { table-layout: auto; min-width: 640px; }
  .kit-toolbar .input { width: auto; }
  .kit-perm-name { min-width: 160px; }
}
/* About → Updates: "Check now" (update-check.js) */
.update-now { align-self: flex-start; margin-top: 2px; padding: 0; background: none; border: none; font: inherit; font-size: 11px;
  color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.update-now:hover { color: var(--accent); }
.update-now:disabled { cursor: progress; text-decoration: none; opacity: 0.7; }
/* Texts: suggested rows, the translation memory's list under the field */
.kit-toolbar-end { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.kit-tm-hint { margin: -4px 0 8px; }
.kit-texts-table tr.kit-suggested .kit-plant textarea { border-color: var(--warn); border-style: dashed; }
.kit-texts-table .kit-sug { display: inline-block; margin-bottom: 4px; }
.kit-texts-table textarea.kit-bad { border-color: var(--danger) !important; }
.kit-texts-table .kit-rev { white-space: nowrap; }
.kit-mini { width: 26px; height: 26px; border-radius: 6px; font-size: 15px; line-height: 1; }
.kit-mini + .kit-mini { margin-left: 4px; }
.kit-review { color: var(--warn); }
.kit-tm { position: fixed; z-index: 1000; max-width: 560px; max-height: 320px; overflow: auto; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); padding: 4px; font-size: 12px; }
.kit-tm[hidden] { display: none; }
.kit-tm-head { padding: 4px 8px 6px; font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.kit-tm-item { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.kit-tm-item.active, .kit-tm-item:hover { background: var(--surface-3); }
.kit-tm-item.active { box-shadow: inset 2px 0 0 var(--accent); }
.kit-tm-text { color: var(--text); overflow-wrap: anywhere; }
.kit-tm-src { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.kit-tm-src i { font-style: normal; opacity: 0.85; }
.kit-tm-warn { color: var(--danger); font-weight: 500; margin-left: 4px; }
/* Texts → AI (1.2): the model line, the per-row button, the plan and the progress dialog */
.kit-ai-note { margin: -4px 0 8px; }
.kit-ai-note.kit-ai-off { color: var(--warn); }
.kit-ai-row { width: auto; min-width: 26px; padding: 0 5px; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; color: var(--accent); }
.kit-ai-row.busy { cursor: progress; opacity: 0.6; }
.kit-ai-plan { margin: 0 0 8px; padding-left: 18px; line-height: 1.6; }
.kit-ai-progress { min-width: min(420px, 90vw); }
.kit-bar { height: 8px; border-radius: 4px; background: var(--surface-3, #333); overflow: hidden; margin: 4px 0 8px; }
.kit-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
.kit-bar.busy { background: linear-gradient(90deg, var(--surface-3, #333) 0%, rgba(76, 175, 80, 0.35) 50%, var(--surface-3, #333) 100%);
  background-size: 200% 100%; animation: kit-bar-busy 1.4s linear infinite; }
@keyframes kit-bar-busy { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* Permissions: exceptions per user, the preview, the change log */
.kit-sub { margin: 18px 0 4px; font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text); }
.kit-exc-table td { vertical-align: middle; }
.kit-exc-table .pill { margin-left: 6px; }
.kit-exc-table select.input { height: 28px; }
.kit-exc-add input.input { flex: 1 1 200px; min-width: 160px; }
.kit-preview-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kit-preview-cols h4 { margin: 4px 0 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kit-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.kit-preview li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kit-preview .badge { min-width: 84px; text-align: center; }
.kit-audit { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; font-size: 12px; border-top: 1px solid var(--border-soft); }
.kit-audit li { padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.kit-audit-when { font-family: var(--mono); color: var(--muted); }
.kit-audit-change { margin: 2px 0 0 12px; color: var(--muted); }
.kit-audit-change b { color: var(--text); font-weight: 500; }
@media (max-width: 720px) { .kit-preview-cols { grid-template-columns: 1fr; } }
/* the assistant's floating button (bottom right) never covers the end of the page: room to scroll past it */
body:has(.q-assistant-toggle) .tab-pane.active::after { content: ""; display: block; flex: 0 0 auto; grid-column: 1 / -1; height: 64px; }
/* Texts 1.2.1: the kit's own dialogs (the AI's model, the review before saving) */
.qdlg.kit-modal { max-width: min(560px, calc(100vw - 32px)); width: 100%; min-width: 0; box-sizing: border-box; }
.qdlg.kit-import { max-width: min(980px, calc(100vw - 32px)); }
.kit-modal .kit-modal-body { max-height: calc(100vh - 160px); overflow: auto; }
.kit-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kit-field .input { text-transform: none; letter-spacing: 0; font-size: 13px; }
.kit-ai-pick { margin: 10px 0 6px; }
.kit-ai-pick select { width: 100%; }
.kit-ai-cost { margin: 0 0 8px; color: var(--accent); font-weight: 500; }
.kit-ai-pick-hint { margin: 0 0 6px; }
.kit-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }
.kit-check input { margin: 0; accent-color: var(--accent); }
.kit-import .kit-check { display: flex; margin: 6px 0; }
.kit-check[hidden] { display: none !important; }
.kit-imp-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.kit-imp-lang { width: 120px; font-family: var(--mono); }
.kit-imp-sum { margin: 8px 0 6px; font-size: 12px; }
.kit-imp-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--border-soft); border-radius: 6px; }
.kit-imp-table { table-layout: fixed; font-size: 12px; }
.kit-imp-table thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.kit-imp-table th:nth-child(1) { width: 26%; }
.kit-imp-table th:nth-child(4) { width: 170px; }
.kit-imp-table .badge { white-space: nowrap; }
.kit-imp-table .j-ph { color: var(--warn); font-weight: 600; }
.kit-imp-table .j-tag { color: #f78c6c; }
.kit-imp-table td { vertical-align: top; overflow-wrap: anywhere; }
.kit-imp-table code { font-size: 11px; }
.kit-imp-table .kit-en { color: var(--muted); }
.kit-imp-table .kit-was { display: block; margin-top: 3px; color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(239, 83, 80, 0.6); }
.kit-imp-table tr.kit-imp-same td { opacity: 0.55; }
.kit-badge-same { background: var(--surface-3); color: var(--muted); }
.kit-json-err { color: var(--danger); }
/* Texts 1.2.1: View JSON — highlighted, numbered lines; the editor is a transparent text area over it */
.kit-json-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; }
.kit-json-editing { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); }
.kit-json-hint { margin: 0 0 8px; }
.kit-code-wrap { --gut: 52px; position: relative; max-height: 62vh; overflow: auto; border: 1px solid var(--border-soft); border-radius: 6px;
  background: var(--bg); }
.kit-code-stack { position: relative; min-height: 120px; }
.kit-code, .kit-code-input { margin: 0; padding: 8px 12px 8px 0; border: 0; box-sizing: border-box; font: 12px/1.6 var(--mono); letter-spacing: 0;
  tab-size: 2; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; text-align: left; }
.kit-code { counter-reset: kl; color: var(--text); min-height: 120px; background: none; }
.kit-code .kl { display: block; position: relative; padding-left: var(--gut); min-height: 1.6em; }
.kit-code .kl::before { counter-increment: kl; content: counter(kl); position: absolute; left: 0; width: calc(var(--gut) - 14px); text-align: right;
  color: var(--muted); opacity: 0.6; user-select: none; }
.kit-code .kl-bad { background: rgba(239, 83, 80, 0.14); }
.kit-code .kl-bad::before { color: var(--danger); opacity: 1; font-weight: 600; }
.kit-code .kl-ok::before { color: var(--accent); opacity: 1; }
.kit-code .j-key { color: #82b1ff; }
.kit-code .j-str { color: #c3e88d; }
.kit-code .j-ph { color: var(--warn); font-weight: 600; }
.kit-code .j-tag { color: #f78c6c; }
.kit-code .j-n { color: #f78c6c; }
.kit-code .j-p { color: var(--muted); }
.kit-code .j-com { color: var(--muted); font-style: italic; }
.kit-code-input { position: absolute; inset: 0; width: 100%; height: 100%; padding-left: var(--gut); resize: none; overflow: hidden; outline: none;
  background: transparent; color: transparent; caret-color: var(--text); -webkit-text-fill-color: transparent; }
.kit-code-input::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); }
.kit-code-input::selection { background: rgba(76, 175, 80, 0.3); }
.kit-code-wrap:focus-within { border-color: var(--accent); }
.kit-nowrap .kit-code-stack { width: max-content; min-width: 100%; }
.kit-nowrap .kit-code, .kit-nowrap .kit-code-input { white-space: pre; overflow-wrap: normal; }
.kit-json-status { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 8px; font-size: 12px; }
.kit-json-sum { color: var(--text); margin-bottom: 2px; }
.kit-json-issue { padding: 1px 0; background: none; border: 0; font: inherit; font-size: 12px; color: var(--danger); cursor: pointer; text-align: left; }
.kit-json-issue:hover { text-decoration: underline; }
.kit-json-issue code { font-size: 11px; color: var(--text); }
/* 1.3 Presentation (qind-bundle.js): chrome=tabs|none|header, or the plant's Settings → Display */
html.qind-no-header body > .header, html.qind-no-header [data-qind-chrome="header"] { display: none !important; }
html.qind-no-tabs body > .tab-bar, html.qind-no-tabs [data-qind-chrome="tabs"] { display: none !important; }
/* content only (e.g. a studio menu entry that opens one screen): the studio's own frame is the edge */
html[data-chrome="none"] .container { padding-top: 6px; }
/* the ⋯ menu: the way back when the header or the tab bar is hidden (settings.view, administrators) */
.qind-more { position: fixed; top: 2px; right: 2px; z-index: 900; }
.qind-more[hidden] { display: none; }
.qind-more-btn { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer;
  opacity: 0; transition: opacity 0.15s, background 0.15s, border-color 0.15s; }
.qind-more-btn svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.qind-more:hover .qind-more-btn, .qind-more-btn:focus-visible, .qind-more.open .qind-more-btn {
  opacity: 1; background: var(--surface); border-color: var(--border); color: var(--text); }
.qind-more-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: none) { .qind-more-btn { opacity: 0.45; } }        /* touch: no hover to reveal it */
.qind-more-menu { position: absolute; top: 26px; right: 0; min-width: 220px; max-width: min(320px, calc(100vw - 16px));
  max-height: calc(100vh - 40px); overflow: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.qind-more-menu[hidden] { display: none; }
.qind-more-head { padding: 6px 10px 4px; font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); }
.qind-more-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border: 0; border-radius: 5px;
  background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; white-space: nowrap; }
.qind-more-item:hover, .qind-more-item:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.qind-more-item.active { color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.qind-more-ic { display: inline-flex; width: 15px; flex-shrink: 0; color: var(--muted); }
.qind-more-item.active .qind-more-ic { color: var(--accent); }
.qind-more-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qind-more-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.qind-more-item kbd { font: 10px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; }
.qind-more-sep { height: 1px; margin: 4px 6px; background: var(--border-soft); }
.qind-more-update { font-family: var(--mono); font-size: 12px; color: #90caf9; }
.qind-more-update-btn { color: #64b5f6; }
.qind-more-update-btn .qind-more-ic { color: #64b5f6; }
/* Settings → Display: a link preview */
.kit-display-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kit-display-link code { flex: 1 1 260px; min-width: 0; padding: 5px 8px; border-radius: 4px; background: var(--bg);
  font: 12px var(--mono); overflow-wrap: anywhere; color: var(--text); }
.kit-display-tab { grid-column: 1; }
.kit-display-tab-hint { grid-column: 2 / -1; align-self: end; padding-bottom: 8px; }
@media (max-width: 720px) { .kit-display-tab-hint { grid-column: 1 / -1; padding-bottom: 0; } }
.kit-display-now { margin: 10px 0 0; }
.kit-display-row { max-width: 720px; }
.kit-display-last { grid-column: 1 / -1; }
.kit-display-titles { max-width: 900px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
/* 1.5: the bundle's own settings card ([data-bundle-settings]) while it has no field */
.qind-bundle-settings-empty, [data-bundle-settings][hidden] { display: none !important; }
.switch-row.is-locked { opacity: .7; }
/* A link styled as a button looks exactly like one (1.4): same box, height, font and alignment
   as <button class="btn">, never underlined or recoloured by the page's link styles. */
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box;
  line-height: normal; vertical-align: middle; text-decoration: none; font-size: 13px; font-family: inherit;
  border: none; width: auto; height: auto; padding: 6px 14px; }
a.btn:hover, a.btn:focus, a.btn:visited { text-decoration: none; color: #fff; }
a.btn.btn-ghost { color: #ccc; border: 1px solid var(--border); }
a.btn.btn-sm { padding: 3px 10px; font-size: 12px; }
.btn .ic { flex: none; }

/* ── Acquisition health (1.4, js/tagfeed.js): the bundle's TagFeed ── */
.kit-tagfeed { display: block; }
.kit-tf + .kit-tf { margin-top: 12px; }
.kit-tf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.kit-tf-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 12px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.kit-tf-pill.kit-tf-ok { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.kit-tf-pill.kit-tf-warn { border-color: var(--warn); color: var(--warn); }
.kit-tf-pill.kit-tf-bad { border-color: var(--danger); color: var(--danger); }
.kit-tf-pill.kit-tf-warn .status-dot { background: var(--warn); box-shadow: none; }
/* own tiles (not .stat-card: bundles restyle that one) */
.kit-tf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.kit-tf-tile { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 9px 12px; border-radius: 6px;
  background: var(--surface-2, rgba(255,255,255,.04)); border: 1px solid var(--border-soft, var(--border)); }
.kit-tf-label { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kit-tf-value { font: 600 20px/1.2 var(--mono, monospace); color: var(--text); }
.kit-tf-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.35; }
.kit-tf-tile.warn .kit-tf-value { color: var(--warn); }
.kit-tf-tile.bad .kit-tf-value { color: var(--danger); }
.kit-tf-how { margin: 8px 0 0; }
.kit-tf-compact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.kit-tf-gap { color: var(--warn); }
