/* ============================================================================
   QCC-DS — Qaid Control Center component library (v0.12 · 2026-09-27)
   Child of the sealed POS-DS. REQUIRES pos.css loaded first (tokens + 5 themes).

   RULES OF USE (full text in ENGINEER_GUIDE.md):
   · Never hardcode a color. Every color is var(--pos-*) or var(--qcc-*).
   · Emerald (--pos-pay) = GL post / period seal ONLY. Champagne (--pos-accent) = the PRIMARY /
     management action (.qcc-btn--primary: grant/activate/create/save-continue). Status colours
     (green/brick/amber) live on pills & dots, never on an action button. No blue.
   · Champagne (--pos-accent) = focus / active / summoned / account codes.
   · Brick (--pos-danger) = outflow / reversal / destructive.
   · Money, account codes, voucher numbers, kbd hints = var(--pos-mono), always.
   · Money is comma-grouped; rates/counts/ids are NOT.
   · Use logical properties (inline-start/end) — RTL must work by construction.
   · Class prefix is qcc- ; do not restyle these classes locally. Missing something?
     → COMMUNICATION_PROTOCOL.md, don't invent.
   ============================================================================ */

/* ---- 0 · QCC semantic token layer (over POS tokens) ---------------------- */
:root {
  --qcc-debit:      var(--pos-text);
  --qcc-credit:     var(--pos-text);
  --qcc-inflow:     var(--pos-pay-hi);
  --qcc-outflow:    var(--pos-danger-hi);
  --qcc-draft:      var(--pos-warn);
  --qcc-draft-soft: var(--pos-warn-soft);
  --qcc-sealed:     var(--pos-accent);
  --qcc-panel-elev: 0 24px 70px rgba(0,0,0,0.5), 0 4px 18px rgba(0,0,0,0.35);
  --qcc-panel-rule: var(--pos-accent-line);
  --qcc-r-sm: 6px;   /* kbd, chips-inner, inputs-small */
  --qcc-r-md: 9px;   /* icon squares, inputs */
  --qcc-r-lg: 12px;  /* cards, tiles, action cards */
  --qcc-r-xl: 16px;  /* panels, command bar, modals */
}
:root[data-theme="light"] {
  --qcc-panel-elev: 0 24px 70px rgba(40,36,28,0.22), 0 4px 18px rgba(40,36,28,0.14);
}

/* ---- 1 · Base ------------------------------------------------------------ */
.qcc-app {
  font-family: var(--pos-font);
  background: var(--pos-bg);
  color: var(--pos-text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.qcc-app *, .qcc-app *::before, .qcc-app *::after { box-sizing: border-box; }
.qcc-ar { font-family: 'Cairo', var(--pos-font); direction: rtl; }
[dir="rtl"] .qcc-app, .qcc-app[dir="rtl"] { font-family: 'Cairo', var(--pos-font); }
.qcc-mono { font-family: var(--pos-mono); font-variant-numeric: tabular-nums; }

/* Money — the sacred text role. Grouped digits, mono, semantic color by role only. */
.qcc-money { font-family: var(--pos-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.qcc-money--in  { color: var(--qcc-inflow); }
.qcc-money--out { color: var(--qcc-outflow); }
.qcc-money--nil { color: var(--pos-text-3); }
.qcc-money .qcc-money-cur { font-size: 0.72em; color: var(--pos-text-3); font-weight: 400; }

/* Account code — mono champagne, everywhere it appears */
.qcc-code { font-family: var(--pos-mono); font-size: 12.5px; color: var(--pos-accent); }

/* Eyebrow — 11px uppercase tracked section label */
.qcc-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--pos-text-3); font-weight: 700;
}

/* kbd hint */
.qcc-kbd {
  font-family: var(--pos-mono); font-size: 11px; color: var(--pos-text-3);
  border: 1px solid var(--pos-line); border-radius: 5px; padding: 2px 7px;
  background: var(--pos-bg-2); white-space: nowrap;
}

/* ---- 2 · Shell (CC0) ------------------------------------------------------ */
.qcc-topbar {
  display: flex; align-items: center; gap: 14px;
  height: 54px; padding-inline: 18px;
  background: var(--pos-bg-2); border-bottom: 1px solid var(--pos-line);
}
.qcc-topbar-brand { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.qcc-topbar-brand em { font-style: normal; color: var(--pos-accent); }
.qcc-topbar-spacer { flex: 1; }

/* Context chip — company · FY · period · currency */
.qcc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding-inline: 11px;
  border: 1px solid var(--pos-line); border-radius: 999px;
  background: var(--pos-surface); color: var(--pos-text-2); font-size: 12.5px;
}
.qcc-chip .qcc-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--pos-pay-hi); }
.qcc-chip .qcc-dot--warn { background: var(--pos-warn); }
.qcc-chip .qcc-dot--sealed { background: var(--qcc-sealed); }
.qcc-chip--active { border-color: var(--pos-accent-line); color: var(--pos-text); background: var(--pos-accent-soft); }

/* ---- 3 · Command bar (CB1) ------------------------------------------------ */
.qcc-cmdbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding-inline: 16px;
  background: var(--pos-surface); border: 1px solid var(--pos-line);
  border-radius: var(--qcc-r-xl); cursor: text;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.qcc-cmdbar:hover { border-color: var(--pos-line-strong); }
.qcc-cmdbar:focus-within, .qcc-cmdbar--focused {
  border-color: var(--pos-accent-line);
  box-shadow: 0 0 0 3px var(--pos-accent-soft);
}
.qcc-cmdbar-icon { width: 19px; height: 19px; color: var(--pos-accent); flex: none; }
.qcc-cmdbar-input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--pos-text); font: inherit; font-size: 15px;
}
.qcc-cmdbar-input::placeholder { color: var(--pos-text-3); }

/* Palette overlay (focused state) */
.qcc-palette {
  background: var(--pos-elevated); border: 1px solid var(--pos-line-strong);
  border-radius: var(--qcc-r-xl); box-shadow: var(--qcc-panel-elev);
  overflow: hidden;
}
.qcc-palette-group { padding: 10px 6px 4px; }
.qcc-palette-group > .qcc-eyebrow { padding-inline: 12px; display: block; margin-bottom: 4px; }
.qcc-palette-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--pos-text); font: inherit; font-size: 13.5px;
  cursor: pointer; text-align: start;
}
.qcc-palette-item:hover, .qcc-palette-item--active { background: var(--pos-accent-soft); }
.qcc-palette-item .qcc-kbd { margin-inline-start: auto; }

/* Try-chip (idle suggestions) */
.qcc-trychip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding-inline: 10px;
  border: 1px dashed var(--pos-line-strong); border-radius: 999px;
  background: transparent; color: var(--pos-text-2); font-size: 12px; cursor: pointer;
}
.qcc-trychip:hover { color: var(--pos-text); border-color: var(--pos-accent-line); }

/* ---- 4 · Decks: action card (AD1) — panels/lists only; the DECK itself is §46 ------- */
.qcc-actioncard {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding-inline: 14px; width: 100%;
  background: var(--pos-surface); border: 1px solid var(--pos-line);
  border-radius: var(--qcc-r-lg); color: var(--pos-text); font: inherit;
  cursor: pointer; transition: border-color 150ms ease, background 150ms ease;
  text-align: start;
}
.qcc-actioncard:hover { border-color: var(--pos-accent-line); background: var(--pos-surface-2); }
.qcc-actioncard-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--qcc-r-md); flex: none;
  background: var(--pos-accent-soft); color: var(--pos-accent);
}
.qcc-actioncard-icon--in  { background: var(--pos-pay-soft);    color: var(--pos-pay-hi); }
.qcc-actioncard-icon--out { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }
.qcc-actioncard-label { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.qcc-actioncard-label b { font-size: 14px; font-weight: 700; }
.qcc-actioncard-label .qcc-ar { font-size: 12.5px; color: var(--pos-text-2); }
.qcc-actioncard .qcc-kbd { flex: none; }

.qcc-mgmtcard { min-height: 46px; border-radius: 10px; }         /* modifier: use with .qcc-actioncard */
.qcc-mgmtcard .qcc-actioncard-icon { width: 28px; height: 28px; border-radius: 7px; }
.qcc-mgmtcard .qcc-actioncard-label b { font-size: 13px; }

/* ---- 5 · The pool (PL1): strip + tabs ------------------------------------- */
.qcc-poolstrip {
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; padding: 6px 2px;
}
.qcc-pooltab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding-inline: 12px; flex: none; max-width: 260px;
  background: var(--pos-surface); border: 1px solid var(--pos-line);
  border-radius: 9px; color: var(--pos-text-2); font: inherit; font-size: 12.5px;
  cursor: pointer;
}
.qcc-pooltab:hover { color: var(--pos-text); border-color: var(--pos-line-strong); }
.qcc-pooltab--active {
  color: var(--pos-text); background: var(--pos-accent-soft);
  border-color: var(--pos-accent-line);
}
.qcc-pooltab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-pooltab-dirty { width: 7px; height: 7px; border-radius: 999px; background: var(--qcc-draft); flex: none; }
.qcc-pooltab-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border: 0; border-radius: 5px; flex: none;
  background: transparent; color: var(--pos-text-3); cursor: pointer; font-size: 13px; line-height: 1;
}
.qcc-pooltab-close:hover { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }

/* ---- 6 · Summoned panel (PN1) --------------------------------------------- */
.qcc-panel {
  display: flex; flex-direction: column;
  background: var(--pos-elevated); border: 1px solid var(--pos-line-strong);
  border-radius: var(--qcc-r-xl); box-shadow: var(--qcc-panel-elev);
  border-block-start: 2px solid var(--qcc-panel-rule);
  overflow: hidden;
}
.qcc-panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--pos-line);
}
.qcc-panel-title { font-size: 15.5px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.qcc-panel-title .qcc-ar { font-size: 13px; color: var(--pos-text-2); font-weight: 400; }
.qcc-panel-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.qcc-panel-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-top: 1px solid var(--pos-line);
  background: var(--pos-bg-2);
}

/* State pills — the constitution made visible */
.qcc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding-inline: 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em;
  border: 1px solid transparent;
}
.qcc-pill--draft    { background: var(--qcc-draft-soft);   color: var(--qcc-draft);      border-color: var(--qcc-draft); }
.qcc-pill--posted   { background: var(--pos-pay-soft);     color: var(--pos-pay-hi); }
.qcc-pill--sealed   { background: var(--pos-accent-soft);  color: var(--qcc-sealed);     border-color: var(--pos-accent-line); }
.qcc-pill--reversed { background: var(--pos-danger-soft);  color: var(--pos-danger-hi); }
.qcc-pill--open     { background: var(--pos-surface-2);    color: var(--pos-text-2);     border-color: var(--pos-line); }

/* ---- 7 · Buttons ----------------------------------------------------------- */
.qcc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding-inline: 16px;
  border: 1px solid var(--pos-line-strong); border-radius: var(--qcc-r-md);
  background: var(--pos-surface-2); color: var(--pos-text);
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}
.qcc-btn:hover { background: var(--pos-surface-3); }
.qcc-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); border-color: var(--pos-accent-line); }
.qcc-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Primary / management commit — CHAMPAGNE. Grant / activate / create / save-and-continue.
   The default prominent action across hubs & ceremonies. (v0.2 · DQ-108.) One per surface. */
.qcc-btn--primary { background: var(--pos-accent); border-color: var(--pos-accent); color: var(--pos-text-on-accent); }
.qcc-btn--primary:hover { background: var(--pos-accent-hi); border-color: var(--pos-accent-hi); }

/* Commit — EMERALD. Post / period seal ONLY — never grant/activate/create/save. One per surface. */
.qcc-btn--commit { background: var(--pos-pay); border-color: var(--pos-pay); color: #fff; }
.qcc-btn--commit:hover { background: var(--pos-pay-hi); }

/* Destructive-reversible (void line, remove row): filled brick */
.qcc-btn--danger { background: var(--pos-danger); border-color: var(--pos-danger); color: #fff; }
.qcc-btn--danger:hover { background: var(--pos-danger-hi); }

/* Destructive-IRREVERSIBLE (reverse posted doc): outline + warning text nearby (C2) */
.qcc-btn--danger-outline { background: transparent; border-color: var(--pos-danger); color: var(--pos-danger-hi); }
.qcc-btn--danger-outline:hover { background: var(--pos-danger-soft); }

.qcc-btn--ghost { background: transparent; border-color: transparent; color: var(--pos-text-2); }
.qcc-btn--ghost:hover { background: var(--pos-surface-2); color: var(--pos-text); }
.qcc-btn--sm { height: 30px; padding-inline: 11px; font-size: 12.5px; }
.qcc-btn { white-space: nowrap; } /* v0.3: a button label never wraps (it wrapped in a tight tab head) */

/* ---- 8 · Forms ------------------------------------------------------------- */
.qcc-field { display: flex; flex-direction: column; gap: 6px; }
.qcc-label { font-size: 12px; font-weight: 700; color: var(--pos-text-2); }
.qcc-label .qcc-ar { font-weight: 400; color: var(--pos-text-3); }
.qcc-input, .qcc-select, .qcc-textarea {
  height: 38px; padding-inline: 12px; width: 100%;
  background: var(--pos-bg-2); border: 1px solid var(--pos-line);
  border-radius: var(--qcc-r-md); color: var(--pos-text); font: inherit; font-size: 13.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.qcc-textarea { height: auto; min-height: 74px; padding-block: 9px; resize: vertical; }
.qcc-input:focus, .qcc-select:focus, .qcc-textarea:focus {
  outline: 0; border-color: var(--pos-accent-line); box-shadow: 0 0 0 3px var(--pos-accent-soft);
}
.qcc-input::placeholder { color: var(--pos-text-3); }
.qcc-input--money { font-family: var(--pos-mono); text-align: end; font-variant-numeric: tabular-nums; }
.qcc-input--invalid { border-color: var(--pos-danger); }
.qcc-help { font-size: 11.5px; color: var(--pos-text-3); }
.qcc-help--error { color: var(--pos-danger-hi); }

/* ---- 9 · Voucher grid (VG1) + balance meter (BM1) --------------------------- */
.qcc-vgrid-header, .qcc-vgrid-row {
  display: grid; grid-template-columns: 1fr 150px 140px 140px;
  gap: 0 14px; align-items: center; padding: 13px 2px;
}
.qcc-vgrid-header {
  padding-block: 10px 8px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--pos-text-3); font-weight: 700;
  border-bottom: 1px solid var(--pos-line);
}
.qcc-vgrid-row { border-bottom: 1px solid var(--pos-line-faint); font-size: 14px; }
.qcc-vgrid-row:focus-within { background: var(--pos-accent-soft); }
.qcc-vgrid-cell--num { text-align: end; font-family: var(--pos-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.qcc-vgrid-cell--nil { color: var(--pos-text-3); }
.qcc-vgrid-ghost {
  display: flex; align-items: center; gap: 8px; padding: 12px 2px;
  color: var(--pos-text-3); font-size: 13px; cursor: pointer; border: 0; background: none; width: 100%;
}
.qcc-vgrid-ghost:hover { color: var(--pos-accent); }

.qcc-balance { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; }
.qcc-balance--ok  { color: var(--pos-pay-hi); }
.qcc-balance--off { color: var(--pos-warn); }

/* ---- 10 · Table (lists, registers) ------------------------------------------ */
.qcc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.qcc-table th {
  text-align: start; padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--pos-text-3); font-weight: 700; border-bottom: 1px solid var(--pos-line);
}
.qcc-table td { padding: 12px; border-bottom: 1px solid var(--pos-line-faint); }
.qcc-table tbody tr { cursor: pointer; }
.qcc-table tbody tr:hover { background: var(--pos-surface-2); }
.qcc-table .qcc-td--num { text-align: end; font-family: var(--pos-mono); font-variant-numeric: tabular-nums; }

/* ---- 11 · Modal (confirm) — the ONLY dialog. Native confirm() is banned (C4). -- */
.qcc-scrim {
  position: fixed; inset: 0; background: var(--pos-scrim);
  display: flex; align-items: center; justify-content: center; z-index: 90;
}
.qcc-modal {
  width: min(480px, calc(100vw - 48px));
  background: var(--pos-elevated); border: 1px solid var(--pos-line-strong);
  border-radius: var(--qcc-r-xl); box-shadow: var(--qcc-panel-elev);
  border-block-start: 2px solid var(--qcc-panel-rule);
}
.qcc-modal-head { padding: 16px 18px 4px; font-size: 15px; font-weight: 800; }
.qcc-modal-body { padding: 8px 18px 16px; color: var(--pos-text-2); font-size: 13.5px; }
.qcc-modal-body .qcc-modal-warn { color: var(--pos-danger-hi); font-weight: 700; }
.qcc-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 18px 16px; }

/* ---- 12 · Toast — bottom center, one at a time --------------------------------- */
.qcc-toast {
  position: fixed; bottom: 26px; inset-inline-start: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 11px; z-index: 100;
  background: var(--pos-elevated); border: 1px solid var(--pos-line-strong);
  box-shadow: var(--qcc-panel-elev); font-size: 13.5px; font-weight: 600;
}
[dir="rtl"] .qcc-toast { transform: translateX(50%); }
.qcc-toast-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.qcc-toast--success .qcc-toast-dot { background: var(--pos-pay-hi); }
.qcc-toast--error   .qcc-toast-dot { background: var(--pos-danger-hi); }
.qcc-toast--info    .qcc-toast-dot { background: var(--pos-info); }

/* ---- 13 · Pulse tile (PT1) ------------------------------------------------------ */
.qcc-pulse {
  display: flex; flex-direction: column; gap: 6px;
  padding: 13px 15px; background: var(--pos-surface);
  border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg);
}
.qcc-pulse-label { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--pos-text-2); font-weight: 700; }
.qcc-pulse-label .qcc-ar { font-weight: 400; color: var(--pos-text-3); font-size: 11.5px; }
.qcc-pulse-value { font-family: var(--pos-mono); font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qcc-pulse-value--in  { color: var(--qcc-inflow); }
.qcc-pulse-value--out { color: var(--qcc-outflow); }
.qcc-pulse-value--warn{ color: var(--qcc-draft); }

/* ---- 14 · Stream (ST1) ------------------------------------------------------------ */
.qcc-stream { display: flex; flex-direction: column; }
.qcc-stream-item {
  display: grid; grid-template-columns: 14px 1fr; gap: 0 11px;
  padding: 11px 2px; border-bottom: 1px solid var(--pos-line-faint);
}
.qcc-stream-dot { width: 8px; height: 8px; border-radius: 999px; margin-block-start: 5px; background: var(--pos-text-3); }
.qcc-stream-dot--in  { background: var(--qcc-inflow); }
.qcc-stream-dot--out { background: var(--qcc-outflow); }
.qcc-stream-dot--rev { background: var(--pos-danger); box-shadow: 0 0 0 3px var(--pos-danger-soft); }
.qcc-stream-line1 { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.qcc-stream-line1 .qcc-mono { font-size: 12px; color: var(--pos-accent); }
.qcc-stream-line1 .qcc-ar { font-size: 12px; color: var(--pos-text-2); }
.qcc-stream-sub  { font-size: 12.5px; color: var(--pos-text-2); margin-block-start: 2px; }
.qcc-stream-meta { font-size: 11.5px; color: var(--pos-text-3); margin-block-start: 3px; }
.qcc-stream-rev  { font-size: 12px; color: var(--pos-danger-hi); margin-block-start: 2px; }

/* ---- 15 · Period ribbon (PR1) ------------------------------------------------------ */
.qcc-period {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; border: 1px solid var(--pos-line); border-radius: 10px;
  background: var(--pos-surface); font-size: 12.5px;
}
.qcc-period--sealed { border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-period-name { font-weight: 700; }
.qcc-period .qcc-pill { margin-inline-start: auto; }

/* ---- 16 · Cards & layout helpers ---------------------------------------------------- */
.qcc-card {
  background: var(--pos-surface); border: 1px solid var(--pos-line);
  border-radius: var(--qcc-r-lg); padding: 16px;
}
.qcc-card-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.qcc-card-title b { font-size: 14.5px; font-weight: 800; }
.qcc-hairline { border: 0; border-top: 1px solid var(--pos-line); margin-block: 14px; }
.qcc-row { display: flex; align-items: center; gap: 12px; }
.qcc-stack { display: flex; flex-direction: column; gap: 12px; }

/* ---- 17 · Paper surface (PN1-R report viewer) — light even in dark themes ------------- */
.qcc-paper {
  background: #f7f3e8; color: #211f1b;
  border-radius: 6px; padding: 34px 38px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
  font-size: 13px;
}
.qcc-paper .qcc-code { color: #7a6428; }
.qcc-paper .qcc-eyebrow { color: #8d8468; }
.qcc-paper hr { border: 0; border-top: 1px solid #e3ddcc; }
.qcc-paper .qcc-paper-total { border-top: 2px solid #211f1b; font-weight: 700; }

/* ---- 18 · Scrollbars ------------------------------------------------------------------- */
.qcc-app ::-webkit-scrollbar { width: 9px; height: 9px; }
.qcc-app ::-webkit-scrollbar-thumb { background: var(--pos-line-strong); border-radius: 999px; }
.qcc-app ::-webkit-scrollbar-track { background: transparent; }
/* DQ-177 / DQ-203 (v0.12): NO zone sets scrollbar-width — in Chrome any non-auto value switches the ::-webkit-scrollbar theme above OFF.
   Browsers without ::-webkit-scrollbar (Firefox) get the thin themed bar here instead. The pool strip keeps scrollbar-width: none (hidden on purpose). */
@supports not selector(::-webkit-scrollbar) { .qcc-app * { scrollbar-width: thin; scrollbar-color: var(--pos-line-strong) transparent; } }

/* ============================================================================
   v0.2 ADDITIONS (2026-07-17) — shell-independent CONTENT components.
   Harvested from the accepted drop-001b Users & Access hub. These compose INSIDE
   the locked production shell (R4) — none of them draws shell/pool chrome.
   Additive only; no v0.1 class above was changed except §7 (the --primary button).
   ============================================================================ */

/* ---- 19 · Segmented tabs — sub-registry nav (People · Access · Groups · …) ------------- */
.qcc-tabs {
  display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 4px; background: var(--pos-bg-2);
  border: 1px solid var(--pos-line); border-radius: var(--qcc-r-md);
}
.qcc-tab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding-inline: 13px; border: 0; border-radius: 7px;
  background: transparent; color: var(--pos-text-2); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background 150ms ease, color 150ms ease;
}
.qcc-tab:hover { color: var(--pos-text); }
.qcc-tab--active { background: var(--pos-surface); color: var(--pos-text); box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.qcc-tab-count {
  font-family: var(--pos-mono); font-size: 11px; font-weight: 500; line-height: 1;
  padding: 3px 6px; border-radius: 999px; background: var(--pos-surface-3); color: var(--pos-text-3);
}
.qcc-tab--active .qcc-tab-count { background: var(--pos-accent-soft); color: var(--pos-accent); }

/* ---- 20 · Registry toolbar — search + filters (shell-independent; drop into any list) --- */
.qcc-toolbar { display: flex; align-items: center; gap: 10px; padding-block: 14px 12px; flex-wrap: wrap; }
.qcc-search {
  display: flex; align-items: center; gap: 9px; flex: 1; min-width: 200px;
  height: 38px; padding-inline: 12px;
  background: var(--pos-bg-2); border: 1px solid var(--pos-line); border-radius: var(--qcc-r-md);
}
.qcc-search:focus-within { border-color: var(--pos-accent-line); box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-search svg { width: 16px; height: 16px; color: var(--pos-text-3); flex: none; }
.qcc-search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--pos-text); font: inherit; font-size: 13.5px; }
.qcc-search input::placeholder { color: var(--pos-text-3); }
.qcc-filter {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding-inline: 12px;
  background: var(--pos-surface); border: 1px solid var(--pos-line); border-radius: var(--qcc-r-md);
  color: var(--pos-text-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.qcc-filter:hover { color: var(--pos-text); border-color: var(--pos-line-strong); }
.qcc-filter--on { color: var(--pos-accent); border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }

/* ---- 21 · Definition list — record detail (paired label / value) ---------------------- */
.qcc-deflist { display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; align-items: baseline; }
.qcc-deflist dt { font-size: 12px; font-weight: 700; color: var(--pos-text-3); }
.qcc-deflist dd { margin: 0; font-size: 13.5px; color: var(--pos-text); }

/* ---- 22 · Level grid + segment control — authority levels (e.g. view›manage›block) ----- */
.qcc-levelrow {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 12px 2px; border-bottom: 1px solid var(--pos-line-faint);
}
.qcc-levelrow:last-child { border-bottom: 0; }
.qcc-levelrow-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qcc-levelrow-name b { font-size: 13.5px; font-weight: 600; }
.qcc-levelrow-name small { font-size: 12px; color: var(--pos-text-3); }
.qcc-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--pos-bg-2); border: 1px solid var(--pos-line); border-radius: 8px;
}
.qcc-seg-opt {
  height: 28px; padding-inline: 12px; border: 0; border-radius: 6px;
  background: transparent; color: var(--pos-text-3); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.qcc-seg-opt:hover { color: var(--pos-text-2); }
.qcc-seg-opt--on { background: var(--pos-surface); color: var(--pos-text); }
.qcc-seg-opt--on.qcc-seg-opt--manage { background: var(--pos-accent-soft); color: var(--pos-accent); }
.qcc-seg-opt--on.qcc-seg-opt--view   { background: var(--pos-surface-3); color: var(--pos-text); }
.qcc-seg-opt--on.qcc-seg-opt--block  { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }

/* ---- 23 · Identity cell + read-only note (list rows / degradation) --------------------- */
.qcc-idcell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.qcc-avatar {
  width: 34px; height: 34px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--pos-surface-3); color: var(--pos-text);
}
.qcc-idcell-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qcc-idcell-text b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-idcell-text small { font-size: 12px; color: var(--pos-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Read-depth note: the calm sentence that replaces an absent create/edit affordance (never a red lock). */
.qcc-readonly-note { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--pos-text-3); }
.qcc-readonly-note svg { width: 15px; height: 15px; flex: none; }

/* ---- 24 · License / declaration registry card — declarative, sovereign (DQ-104) --------- */
/* First-class form of the drop-001b State-F table. Fixed-column grid so rows hold and the
   trailing action never strands, at any container width. Depth uses .qcc-pill tones. */
.qcc-license { border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg); overflow: hidden; }
.qcc-license-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  background: var(--pos-bg-2); border-bottom: 1px solid var(--pos-line);
}
.qcc-license-head b { font-size: 13.5px; font-weight: 800; }
.qcc-license-row {
  display: grid; grid-template-columns: minmax(150px,1fr) 96px 116px 128px; gap: 14px; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--pos-line-faint); font-size: 13.5px;
}
.qcc-license-row:last-child { border-bottom: 0; }
.qcc-license-row--head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--pos-text-3); font-weight: 700; }
.qcc-license-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qcc-license-name small { font-size: 11.5px; color: var(--pos-text-3); }
.qcc-license-act { display: flex; justify-content: flex-end; }
.qcc-lstate { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.qcc-lstate .qcc-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; background: var(--pos-text-3); }
.qcc-lstate--active   { color: var(--pos-pay-hi); } .qcc-lstate--active .qcc-dot { background: var(--pos-pay-hi); box-shadow: 0 0 0 3px var(--pos-pay-soft); }
.qcc-lstate--licensed { color: var(--pos-accent); }  .qcc-lstate--licensed .qcc-dot { background: var(--pos-accent); }
.qcc-lstate--absent   { color: var(--pos-text-3); }

/* ============================================================================
   v0.3 ADDITIONS (2026-09-20) — the DOCUMENT family (brief 2026-09-20, trails D1–D10).
   ONE document editor, six doors on it. Everything below is shell-independent and composes
   inside the locked production shell (R4). Additive: no v0.1/v0.2 selector changed.
   ============================================================================ */

/* ---- 25 · Document grid — VG1-edit (D1). <table class="qcc-docgrid qcc-docgrid--voucher|--invoice">
   Column sets are <col> classes; cells are borderless inputs that fill the cell. -------------- */
.qcc-docgrid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
.qcc-docgrid col.qcc-col--no    { width: 40px; }
.qcc-docgrid col.qcc-col--qty   { width: 84px; }
.qcc-docgrid col.qcc-col--money { width: 128px; }
.qcc-docgrid col.qcc-col--tax   { width: 118px; }
.qcc-docgrid col.qcc-col--act   { width: 38px; }
.qcc-docgrid th {
  text-align: start; padding: 9px 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--pos-text-3); font-weight: 700;
  border-bottom: 1px solid var(--pos-line); white-space: nowrap;
}
.qcc-docgrid th.qcc-th--num { text-align: end; }
.qcc-docgrid td { padding: 0; border-bottom: 1px solid var(--pos-line-faint); vertical-align: top; height: 42px; }
.qcc-docgrid td.qcc-td--no { padding: 12px 10px; font-family: var(--pos-mono); font-size: 12px; color: var(--pos-text-3); }
.qcc-docgrid tr.is-focus td { background: var(--pos-accent-soft); }
.qcc-docgrid tr.is-focus td.qcc-td--no { color: var(--pos-accent); }
/* the cell control — one class for input, select and read-only span */
.qcc-cell {
  display: block; width: 100%; min-height: 42px; padding: 11px 10px; margin: 0;
  background: transparent; border: 0; border-radius: 0; color: var(--pos-text);
  font: inherit; font-size: 13.5px; line-height: 1.45; outline: 0;
  box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .12s;
}
.qcc-cell::placeholder { color: var(--pos-text-3); }
.qcc-cell:focus, .qcc-cell.is-focus { box-shadow: inset 0 0 0 1.5px var(--pos-accent); background: var(--pos-bg-2); }
.qcc-cell--money { text-align: end; font-family: var(--pos-mono); font-variant-numeric: tabular-nums; }
.qcc-cell--code  { font-family: var(--pos-mono); }
.qcc-cell--auto  { color: var(--pos-text-3); }                        /* rule 13: auto-filled, untouched */
.qcc-cell--ro    { color: var(--pos-text-2); cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* fixed line (receipt/payment line 1) — locked cell reads as a fact, not a control */
.qcc-cell--locked { display: flex; align-items: center; gap: 8px; color: var(--pos-text-2); cursor: default; white-space: nowrap; overflow: hidden; }
.qcc-cell--locked svg { width: 13px; height: 13px; flex: none; color: var(--pos-text-3); }
.qcc-cell--locked .qcc-code { font-size: 13px; }
tr.qcc-docgrid-row--locked td { background: var(--pos-surface-2); }
tr.qcc-docgrid-row--locked td.qcc-td--no::after { content: ""; }
/* invalid cell — the refusal is a sentence on its field (rule 11) */
td.qcc-cell--invalid .qcc-cell { box-shadow: inset 0 -2px 0 0 var(--pos-danger); }
td.qcc-cell--invalid .qcc-cell:focus { box-shadow: inset 0 0 0 1.5px var(--pos-danger); }
.qcc-cell-msg { display: block; padding: 0 10px 9px; font-size: 11.5px; color: var(--pos-danger-hi); line-height: 1.35; }
.qcc-cell-msg .qcc-ar { color: var(--pos-danger-hi); opacity: .85; }
/* row action (delete line, F4) — quiet ghost, reddens on hover */
.qcc-cell-act {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 42px;
  border: 0; background: transparent; color: var(--pos-text-3); cursor: pointer; border-radius: 0;
}
.qcc-cell-act:hover { color: var(--pos-danger-hi); background: var(--pos-danger-soft); }
.qcc-cell-act svg { width: 14px; height: 14px; }
/* ghost add-line row (rule 2) */
.qcc-docgrid-add td { padding: 0; border-bottom: 1px solid var(--pos-line); }
.qcc-docgrid-add button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding-inline: 10px;
  border: 0; background: transparent; color: var(--pos-text-3); font: inherit; font-size: 13px; cursor: pointer;
}
.qcc-docgrid-add button:hover { color: var(--pos-accent); background: var(--pos-surface-2); }
.qcc-docgrid-add .qcc-kbd { margin-inline-start: auto; }
/* footer totals (rule 5) */
.qcc-docgrid tfoot td { padding: 11px 10px; border-bottom: 0; font-weight: 700; height: auto; }
.qcc-docgrid tfoot .qcc-td--num { text-align: end; font-family: var(--pos-mono); font-variant-numeric: tabular-nums; font-size: 14px; }
.qcc-docgrid tfoot .qcc-td--label { color: var(--pos-text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
/* the grid lives in a hairlined frame so the header row reads as a header */
.qcc-docgrid-frame { border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg); background: var(--pos-surface); } /* overflow stays visible: the picker drops out of the frame */
.qcc-docgrid-frame .qcc-docgrid thead th { background: var(--pos-surface-2); }
.qcc-docgrid-frame .qcc-docgrid thead th:first-child { border-start-start-radius: var(--qcc-r-lg); }
.qcc-docgrid-frame .qcc-docgrid thead th:last-child { border-start-end-radius: var(--qcc-r-lg); }

/* ---- 26 · Picker dropdown (D2) — account · party; keyboard-only; anchored under its cell -------- */
.qcc-picker-anchor { position: relative; }
.qcc-picker {
  position: absolute; inset-inline-start: 0; top: calc(100% + 4px); z-index: 60;
  width: min(460px, 92vw); background: var(--pos-elevated); border: 1px solid var(--pos-line-strong);
  border-radius: var(--qcc-r-lg); box-shadow: var(--qcc-panel-elev); overflow: hidden;
}
.qcc-picker-q {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--pos-line);
  font-size: 12.5px; color: var(--pos-text-2);
}
.qcc-picker-q b { color: var(--pos-text); font-family: var(--pos-mono); }
.qcc-picker-list { max-height: 264px; overflow-y: auto; }
.qcc-picker-item {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 12px; cursor: pointer; font-size: 13.5px; border-bottom: 1px solid var(--pos-line-faint);
}
.qcc-picker-item:last-child { border-bottom: 0; }
.qcc-picker-item .qcc-code { font-size: 12.5px; }
.qcc-picker-item mark { background: transparent; color: var(--pos-accent-hi); font-weight: 700; }
.qcc-picker-item small { color: var(--pos-text-3); font-size: 11.5px; white-space: nowrap; }
.qcc-picker-item:hover { background: var(--pos-surface-2); }
.qcc-picker-item--hi { background: var(--pos-accent-soft); }
.qcc-picker-item--hi .qcc-code { color: var(--pos-accent-hi); }
.qcc-picker-empty { padding: 14px 12px; color: var(--pos-text-3); font-size: 13px; }
.qcc-picker-create {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; border-top: 1px solid var(--pos-line); background: var(--pos-surface);
  color: var(--pos-accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-align: start;
}
.qcc-picker-create:hover { background: var(--pos-accent-soft); }
.qcc-picker-create .qcc-kbd { margin-inline-start: auto; }
.qcc-picker-foot { display: flex; gap: 12px; padding: 7px 12px; border-top: 1px solid var(--pos-line); font-size: 11.5px; color: var(--pos-text-3); background: var(--pos-bg-2); }

/* ---- 27 · Document state strip — docbar (D4). Lives in the panel FOOT (Q3). ------------------- */
.qcc-docbar { display: flex; flex-direction: column; gap: 10px; }
.qcc-docbar-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.qcc-docbar-row .qcc-balance { white-space: nowrap; flex: none; }
.qcc-docbar-state { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.qcc-docbar-no { font-family: var(--pos-mono); font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.qcc-docbar-no--draft { color: var(--qcc-draft); }
.qcc-docbar-no--posted { color: var(--pos-text); }
.qcc-docbar-meta { font-size: 12px; color: var(--pos-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qcc-docbar-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; flex: none; }
.qcc-docbar-refusal {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px;
  border: 1px solid var(--pos-danger); border-radius: 9px; background: var(--pos-danger-soft);
  font-size: 13px; color: var(--pos-text);
}
.qcc-docbar-refusal::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--pos-danger-hi); margin-block-start: 6px; flex: none; }
.qcc-docbar-refusal .qcc-ar { color: var(--pos-text-2); }

/* ---- 28 · Key legend (D5) — <details class="qcc-legend">; collapsed by default, remembered per user (Q4) --- */
.qcc-legend { display: inline-block; }
.qcc-legend summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding-inline: 10px;
  border: 1px solid var(--pos-line); border-radius: 8px; background: var(--pos-surface); color: var(--pos-text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none;
}
.qcc-legend summary::-webkit-details-marker { display: none; }
.qcc-legend summary:hover { color: var(--pos-text); border-color: var(--pos-line-strong); }
.qcc-legend[open] summary { border-color: var(--pos-accent-line); color: var(--pos-text); background: var(--pos-accent-soft); }
.qcc-legend-items { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 2px 2px; }
.qcc-legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--pos-text-2); white-space: nowrap; }

/* ---- 29 · Pagination (D6) --------------------------------------------------------------------- */
.qcc-pager { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--pos-text-2); }
.qcc-pager-info { margin-inline-end: auto; font-variant-numeric: tabular-nums; }
.qcc-pager-btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding-inline: 8px;
  border: 1px solid var(--pos-line); border-radius: 7px; background: var(--pos-surface); color: var(--pos-text-2);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.qcc-pager-btn:hover { color: var(--pos-text); border-color: var(--pos-line-strong); }
.qcc-pager-btn--on { background: var(--pos-accent-soft); border-color: var(--pos-accent-line); color: var(--pos-text); }
.qcc-pager-btn[disabled] { opacity: .4; cursor: default; }
.qcc-pager-btn svg { width: 14px; height: 14px; }
[dir="rtl"] .qcc-pager-btn svg { transform: scaleX(-1); }

/* ---- 30 · Empty state (D6 · RP1 §2.3 · DQ-101 promoted) --------------------------------------- */
.qcc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 56px 24px; text-align: center; }
.qcc-empty svg { width: 34px; height: 34px; color: var(--pos-text-3); opacity: .7; margin-block-end: 4px; }
.qcc-empty-title { font-size: 14.5px; font-weight: 700; color: var(--pos-text-2); }
.qcc-empty-hint { font-size: 12.5px; color: var(--pos-text-3); max-width: 42ch; }
.qcc-empty .qcc-btn { margin-block-start: 8px; }

/* ---- 31 · Date range (D6) — two native date inputs + presets; the picker POPUP stays native ---- */
.qcc-daterange { display: inline-flex; align-items: center; gap: 6px; }
.qcc-daterange .qcc-input { height: 34px; width: 138px; font-family: var(--pos-mono); font-size: 12.5px; padding-inline: 9px; }
.qcc-daterange-sep { color: var(--pos-text-3); font-size: 12px; }
.qcc-daterange .qcc-filter { height: 34px; }

/* ---- 32 · Totals block (D10) + tax tag ------------------------------------------------------- */
.qcc-totals { display: grid; grid-template-columns: max-content minmax(150px, max-content); gap: 7px 22px; align-items: baseline; justify-content: end; font-size: 13.5px; }
.qcc-totals dt { color: var(--pos-text-2); font-weight: 600; margin: 0; }
.qcc-totals dd { margin: 0; text-align: end; font-family: var(--pos-mono); font-variant-numeric: tabular-nums; }
.qcc-totals .qcc-totals-grand { border-top: 1px solid var(--pos-line-strong); padding-top: 8px; margin-top: 2px; font-weight: 700; font-size: 15px; }
.qcc-totals dt.qcc-totals-grand { color: var(--pos-text); }
.qcc-tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding-inline: 8px; border-radius: 6px;
  border: 1px solid var(--pos-line); background: var(--pos-surface-2); color: var(--pos-text-2);
  font-size: 11.5px; font-weight: 700; font-family: var(--pos-mono); white-space: nowrap;
}
.qcc-tag--tax { color: var(--pos-accent); border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-tag--exempt { color: var(--pos-text-3); }

/* ---- 33 · Drafts list under the Record deck (D7 · Q5) ---------------------------------------- */
.qcc-drafts { display: flex; flex-direction: column; gap: 4px; }
.qcc-drafts-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--pos-text-3); font-weight: 700; }
.qcc-drafts-head .qcc-drafts-count { color: var(--qcc-draft); }
.qcc-drafts-head a, .qcc-drafts-head button { margin-inline-start: auto; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--pos-text-2); background: none; border: 0; cursor: pointer; font-family: inherit; }
.qcc-draft-item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) max-content; gap: 0 8px; align-items: center;
  width: 100%; min-width: 0; padding: 8px 8px; border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--pos-text); font: inherit; text-align: start; cursor: pointer;
}
.qcc-draft-item:hover { background: var(--pos-surface); border-color: var(--pos-line); }
.qcc-draft-item .qcc-kbd { justify-self: center; padding: 1px 5px; color: var(--pos-text-2); }
.qcc-draft-item b { font-size: 13px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-draft-item small { display: block; font-size: 11.5px; color: var(--pos-text-3); }
.qcc-draft-item .qcc-money { font-size: 11.5px; color: var(--pos-text-2); }
.qcc-drafts-none { padding: 8px 10px; font-size: 12.5px; color: var(--pos-text-3); }

/* ---- 34 · Form header grid + Print-sheet additions to .qcc-paper (D8, D9) -------------------- */
.qcc-formgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.qcc-formgrid .qcc-field { grid-column: span 3; min-width: 0; }
.qcc-formgrid .qcc-field--w2 { grid-column: span 2; }
.qcc-formgrid .qcc-field--w4 { grid-column: span 4; }
.qcc-formgrid .qcc-field--w6 { grid-column: span 6; }
.qcc-formgrid .qcc-field--w8 { grid-column: span 8; }   /* v0.8 */
.qcc-formgrid .qcc-field--w12 { grid-column: span 12; }
.qcc-input--ro { color: var(--pos-text-2); background: var(--pos-surface-2); border-style: dashed; }
.qcc-paper-sheet { max-width: 820px; margin: 0 auto; }
.qcc-paper-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: start; padding-bottom: 14px; border-bottom: 2px solid #211f1b; }
.qcc-paper-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.qcc-paper-title .qcc-ar { font-size: 17px; font-weight: 700; color: #3d382e; }
.qcc-paper-no { font-family: var(--pos-mono); font-size: 15px; font-weight: 600; text-align: end; }
.qcc-paper-meta { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px 18px; padding: 14px 0; }
.qcc-paper-meta dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #8d8468; font-weight: 700; }
.qcc-paper-meta dd { margin: 2px 0 0; font-size: 13px; }
.qcc-paper-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.qcc-paper-table th { text-align: start; padding: 8px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #8d8468; border-bottom: 1px solid #211f1b; }
.qcc-paper-table td { padding: 8px; border-bottom: 1px solid #e3ddcc; vertical-align: top; }
.qcc-paper-table .qcc-td--num, .qcc-paper-table th.qcc-th--num { text-align: end; font-family: var(--pos-mono); font-variant-numeric: tabular-nums; }
.qcc-paper-table tfoot td { border-top: 2px solid #211f1b; border-bottom: 0; font-weight: 700; }
.qcc-paper-words { padding: 12px 0 0; font-size: 12.5px; color: #3d382e; }
.qcc-paper-words b { color: #211f1b; }
.qcc-paper-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-top: 44px; }
.qcc-paper-sign div { border-top: 1px solid #211f1b; padding-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #8d8468; text-align: center; }
.qcc-paper-stamp { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1.5px solid #211f1b; border-radius: 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.qcc-paper-stamp--draft { color: #8d8468; border-color: #8d8468; border-style: dashed; }
.qcc-paper-stamp--reversed { color: #9a3a34; border-color: #9a3a34; }
.qcc-paper--landscape { max-width: 1120px; }
@media print {
  .qcc-paper { box-shadow: none; border-radius: 0; background: #fff; padding: 0; }
  .qcc-paper--landscape { page: landscape; }
}

/* ============================================================================
   v0.4 ADDITIONS (2026-09-20) — answers to the documents build's DQ-127 · 128 · 129.
   Additive; no v0.1–v0.3 selector changed.
   ============================================================================ */

/* ---- 35 · Cancelled tone (DQ-127) — a document that NEVER took effect. Quiet, dashed, struck;
        never brick (brick = something happened and was undone = reversed). ---------------------- */
.qcc-pill--cancelled { background: transparent; color: var(--pos-text-3); border-style: dashed; border-color: var(--pos-line-strong); text-decoration: line-through; text-decoration-thickness: 1px; }
.qcc-docbar-no--cancelled { color: var(--pos-text-3); text-decoration: line-through; }
.qcc-paper-stamp--cancelled { color: #8d8468; border-color: #8d8468; border-style: dashed; text-decoration: line-through; }
.qcc-table tr.qcc-tr--cancelled td, .qcc-docgrid tr.qcc-tr--cancelled td { color: var(--pos-text-3); }

/* ---- 36 · Column geometry behind the door modifiers (DQ-128). The face writes a bare <colgroup>
        with the right COUNT of <col>; the modifier sizes them. .qcc-col--* stay as overrides. ---- */
.qcc-docgrid--voucher col:nth-child(1) { width: 40px; }
.qcc-docgrid--voucher col:nth-child(2) { width: 21%; }
.qcc-docgrid--voucher col:nth-child(3) { width: 16%; }
.qcc-docgrid--voucher col:nth-child(4) { width: 10%; }
.qcc-docgrid--voucher col:nth-child(6), .qcc-docgrid--voucher col:nth-child(7) { width: 128px; }
.qcc-docgrid--voucher col:nth-child(8) { width: 38px; }
.qcc-docgrid--invoice col:nth-child(1) { width: 40px; }
.qcc-docgrid--invoice col:nth-child(3) { width: 84px; }
.qcc-docgrid--invoice col:nth-child(4), .qcc-docgrid--invoice col:nth-child(6) { width: 128px; }
.qcc-docgrid--invoice col:nth-child(5) { width: 118px; }
.qcc-docgrid--invoice col:nth-child(7) { width: 38px; }
/* read-only sheets drop the trailing ⋯ column: 7 cols voucher / 6 cols invoice — the nth-child rules
   above still fit because the action column is last. */

/* ---- 36b · Invoice set WITHOUT the tax column (DQ-141) — six columns: № · Item · Qty · Unit price · Line total · ⋯.
        Add --notax beside --invoice; the face drops the modifier for nothing. Read-only sheets drop the last col. */
.qcc-docgrid--invoice.qcc-docgrid--notax col:nth-child(4), .qcc-docgrid--invoice.qcc-docgrid--notax col:nth-child(5) { width: 128px; }
.qcc-docgrid--invoice.qcc-docgrid--notax col:nth-child(6) { width: 38px; }
.qcc-docgrid--invoice.qcc-docgrid--notax col:nth-child(7) { width: auto; }

/* ---- 37 · Server-owned line on a read-only sheet (DQ-129). The locked row keeps its class at EVERY
        status; on the paper the № cell carries the glyph. ------------------------------------------ */
tr.qcc-docgrid-row--locked td.qcc-td--no { color: var(--pos-text-3); white-space: nowrap; padding-inline: 6px; }
tr.qcc-docgrid-row--locked td.qcc-td--no svg { width: 11px; height: 11px; vertical-align: -1px; margin-inline-end: 4px; }
.qcc-paper-table tr.qcc-paper-row--locked td:first-child svg { width: 10px; height: 10px; vertical-align: -1px; margin-inline-end: 3px; color: #8d8468; }
.qcc-paper-table tr.qcc-paper-row--locked td { color: #3d382e; }

/* ============================================================================
   v0.5 ADDITIONS (2026-09-20, evening) — the documents WALK findings (DQ-142…146).
   Additive. TWO declared changes to old rules: §8 .qcc-input/.qcc-select border (--line → --line-strong)
   and §5 .qcc-pooltab-close (glyph slot). Everything else new.
   ============================================================================ */

/* ---- 38 · Where to type (DQ-142). An EMPTY editable cell shows a faint inset field; a filled cell is flat.
        Header inputs get a stronger hairline so the box is seen. ------------------------------------------- */
.qcc-input, .qcc-select, .qcc-textarea { border-color: var(--pos-line-strong); }
.qcc-input:hover, .qcc-select:hover, .qcc-textarea:hover { border-color: var(--pos-accent-line); }
.qcc-cell:placeholder-shown:not(:focus) { box-shadow: inset 0 0 0 1px var(--pos-line); background: var(--pos-bg-2); border-radius: 6px; }
.qcc-cell:placeholder-shown:not(:focus):hover { box-shadow: inset 0 0 0 1px var(--pos-line-strong); }
.qcc-docgrid td { padding: 2px 3px; }                    /* room for the inset field to breathe */
.qcc-docgrid td.qcc-td--no { padding: 12px 10px; }
.qcc-cell { min-height: 38px; padding: 9px 8px; border-radius: 6px; }
.qcc-cell--empty { box-shadow: inset 0 0 0 1px var(--pos-line); background: var(--pos-bg-2); }  /* explicit twin for spans / no placeholder */
select.qcc-cell:invalid, select.qcc-cell.is-empty { box-shadow: inset 0 0 0 1px var(--pos-line); background: var(--pos-bg-2); color: var(--pos-text-3); }

/* ---- 39 · Pool tab close = a drawn glyph (DQ-143). Text × retired; the SVG slot below. ---------------- */
.qcc-pooltab-close { font-size: 0; }
.qcc-pooltab-close svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.qcc-pooltab--active .qcc-pooltab-close { color: var(--pos-text-2); }
.qcc-pooltab-close:hover svg { stroke-width: 2.6; }
.qcc-panel-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--pos-text-2); cursor: pointer; }
.qcc-panel-close svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.qcc-panel-close:hover { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }

/* ---- 40 · Select with "+" (DQ-144a). <div class="qcc-selectplus"><select class="qcc-select"><button class="qcc-selectplus-btn"> */
.qcc-selectplus { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: stretch; }
.qcc-selectplus .qcc-select { height: 38px; min-width: 0; }
.qcc-selectplus .qcc-select { border-start-end-radius: 0; border-end-end-radius: 0; }
.qcc-selectplus-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 38px;
  border: 1px solid var(--pos-line-strong); border-inline-start: 0;
  border-start-start-radius: 0; border-end-start-radius: 0; border-start-end-radius: 9px; border-end-end-radius: 9px;
  background: var(--pos-surface-2); color: var(--pos-accent); cursor: pointer;
}
.qcc-selectplus-btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.qcc-selectplus-btn:hover { background: var(--pos-accent-soft); border-color: var(--pos-accent-line); }
.qcc-selectplus-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-selectplus--empty .qcc-select { color: var(--pos-text-3); border-style: dashed; }
.qcc-selectplus--empty .qcc-selectplus-btn { background: var(--pos-accent-soft); border-color: var(--pos-accent-line); border-style: dashed; }
/* the "returned and selected" moment: one calm pulse of the accent ring, then flat */
.qcc-select.is-fresh, .qcc-input.is-fresh { border-color: var(--pos-accent-line); box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-field-fresh { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--pos-accent); }
.qcc-field-fresh svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2; fill: none; }

/* ---- 41 · Quick-create panel (DQ-144a) — the management form, small, over the tab. .qcc-modal + --form. -- */
.qcc-modal--form { width: min(560px, calc(100vw - 48px)); }
.qcc-modal--form .qcc-modal-head { display: flex; align-items: center; gap: 10px; padding-block-end: 10px; border-bottom: 1px solid var(--pos-line); }
.qcc-modal--form .qcc-modal-head .qcc-eyebrow { font-weight: 700; }
.qcc-modal--form .qcc-modal-head .qcc-panel-close { margin-inline-start: auto; }
.qcc-modal--form .qcc-modal-body { padding-block: 16px; color: var(--pos-text); }
.qcc-modal--form .qcc-modal-foot { border-top: 1px solid var(--pos-line); padding-block-start: 12px; }
.qcc-modal-foot .qcc-modal-note { margin-inline-end: auto; font-size: 12px; color: var(--pos-text-3); align-self: center; }

/* ---- 42 · Stale hint (DQ-144b) — the world changed under a dirty tab. -------------------------------- */
.qcc-stale {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding-inline: 10px;
  border: 1px solid var(--pos-line-strong); border-radius: 999px; background: var(--pos-surface-2);
  font-size: 12px; color: var(--pos-text-2); white-space: nowrap;
}
.qcc-stale svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.qcc-stale button { border: 0; background: none; color: var(--pos-accent); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.qcc-stale button:hover { text-decoration: underline; }

/* ---- 43 · Readiness note (DQ-145) — the not-ready door. Above the header; sheet stays visible. -------- */
.qcc-readiness {
  display: grid; grid-template-columns: 18px 1fr; gap: 6px 12px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--pos-line-strong); border-inline-start: 3px solid var(--pos-warn);
  border-radius: 10px; background: var(--pos-surface);
}
.qcc-readiness > svg { width: 16px; height: 16px; margin-block-start: 2px; color: var(--pos-warn); stroke: currentColor; stroke-width: 2; fill: none; }
.qcc-readiness-title { font-size: 13.5px; font-weight: 700; }
.qcc-readiness-title .qcc-ar { font-weight: 600; color: var(--pos-text-2); }
.qcc-readiness-items { grid-column: 2; display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.qcc-readiness-item { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--pos-text-2); }
.qcc-readiness-item::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--pos-warn); flex: none; align-self: center; }
.qcc-readiness-item a { color: var(--pos-accent); font-weight: 700; text-decoration: none; white-space: nowrap; margin-inline-start: auto; }
.qcc-readiness-item a:hover { text-decoration: underline; }
.qcc-readiness-item a::after { content: " ›"; }
.qcc-readiness-item.is-met { color: var(--pos-text-3); text-decoration: line-through; }
.qcc-readiness-item.is-met::before { background: var(--pos-pay-hi); }
.qcc-readiness-foot { grid-column: 2; font-size: 12px; color: var(--pos-text-3); }
.qcc-docbar-state .qcc-readiness-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pos-warn); font-weight: 700; }

/* ---- 44 · Refused-save echo in the foot (DQ-146) — blessed: .qcc-docbar-refusal + a jump link. ------- */
.qcc-docbar-refusal a { color: var(--pos-accent); font-weight: 700; text-decoration: none; margin-inline-start: auto; white-space: nowrap; }
.qcc-docbar-refusal a:hover { text-decoration: underline; }
.qcc-docbar-refusal--warn { border-color: var(--pos-warn); background: var(--pos-warn-soft); }
.qcc-docbar-refusal--warn::before { background: var(--pos-warn); }


/* ============================================================================
   v0.6 ADDITIONS (2026-09-21) — THE DECK'S DENSITY (brief 2026-09-21, DQ-152…157).
   Additive. ONE declared change to an old rule: §4 .qcc-mgmtcard is SUPERSEDED by §46 .qcc-tile
   (kept for one release, then retired). .qcc-actioncard stays for panels; the DECK uses §46.
   Laid out for 1366×768 FIRST (R-A). Every number below is the drop's number (brief §4).
   ============================================================================ */

/* ---- 45 · Deck geometry (DQ-152). Page 8 px · gap 10 px · rails 256 px fixed · stage fluid.
        The grid never scrolls; a RAIL never scrolls at 768 tall when it holds ≤ its ceiling (ENGINEER_GUIDE §11).
        <div class="qcc-deck"><aside class="qcc-rail">…</aside><main class="qcc-stage">…</main><aside class="qcc-rail">…</aside></div> */
:root {
  --qcc-rail-w: 256px;      /* both rails, same width (R-B) — v0.7 §52 re-declares this as a clamp that grows with the screen */
  --qcc-deck-pad: 8px;      /* page padding — was 16/24 */
  --qcc-deck-gap: 10px;     /* column + row gap — was 16 */
  --qcc-tile-h: 36px;       /* text skin row */
  --qcc-door-h: 60px;       /* icon skin tile */
  --qcc-rail-gap: 6px;      /* between tiles in a rail grid */
}
.qcc-deck {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: var(--qcc-rail-w) minmax(0, 1fr) var(--qcc-rail-w);
  gap: var(--qcc-deck-gap);
}
.qcc-deckpage { display: flex; flex-direction: column; gap: var(--qcc-deck-gap); padding: var(--qcc-deck-pad); height: 100%; min-height: 0; }
.qcc-rail { display: flex; flex-direction: column; gap: var(--qcc-deck-gap); min-width: 0; min-height: 0; overflow-y: auto; }
.qcc-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.qcc-railsec {
  display: flex; flex-direction: column; gap: 6px; flex: none;
  padding: 8px; background: var(--pos-surface); border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg);
}
.qcc-railsec-head { display: flex; align-items: center; gap: 8px; min-height: 18px; padding-inline: 2px; }
.qcc-railsec-head .qcc-eyebrow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-railgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--qcc-rail-gap); }
.qcc-railgrid > * { min-width: 0; }
.qcc-railgrid--1 { grid-template-columns: minmax(0, 1fr); }

/* ---- 46 · One compact shape, two skins (DQ-152, R-C). .qcc-tile = text skin (MANAGEMENT, REPORTS, slot, drawer
        items). .qcc-door = icon skin (RECORD): icon + word + key badge stacked so the word never fights the badge.
        MARKUP (two real buttons, never nested — HTML forbids a button in a button):
        <div class="qcc-tile"><button class="qcc-mark">…</button><button class="qcc-tile-btn"><b>Name</b></button></div>
        The wrapper carries the shape; .qcc-tile-btn fills it and leaves 16 px at the inline-start for the §51 mark. */
.qcc-tile, .qcc-door {
  position: relative; display: flex; width: 100%; min-width: 0;
  border: 1px solid var(--pos-line); border-radius: 8px; background: var(--pos-surface-2); color: var(--pos-text);
  transition: border-color .15s, background .15s;
}
.qcc-tile-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; text-align: start;
  border: 0; background: none; color: inherit; cursor: pointer; font: inherit; border-radius: 7px;
  padding: 4px 8px 4px 16px; padding-inline: 16px 8px;
}
.qcc-tile { min-height: var(--qcc-tile-h); font-size: 12.5px; font-weight: 700; line-height: 1.15; }
.qcc-tile b { font-weight: 700; overflow-wrap: anywhere; }
.qcc-tile:hover, .qcc-door:hover { border-color: var(--pos-accent-line); background: var(--pos-surface-3); }
.qcc-tile:has(.qcc-tile-btn:focus-visible), .qcc-door:has(.qcc-tile-btn:focus-visible) { box-shadow: 0 0 0 3px var(--pos-accent-soft); border-color: var(--pos-accent-line); }
.qcc-tile-btn:focus-visible { outline: 0; }
.qcc-tile-btn[disabled] { color: var(--pos-text-3); cursor: not-allowed; }
.qcc-tile:has(.qcc-tile-btn[disabled]):hover { border-color: var(--pos-line); background: var(--pos-surface); }
.qcc-tile .qcc-kbd { margin-inline-start: auto; padding: 1px 5px; font-size: 10px; }
.qcc-tile .qcc-soon { display: none; }                       /* in a tile the state is the dashed muted shape; the word lives in the drawer */
.qcc-tile:has(.qcc-tile-btn[disabled]) { background: var(--pos-surface); border-style: dashed; }
.qcc-door { min-height: var(--qcc-door-h); }
.qcc-door .qcc-tile-btn { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 5px; padding-block: 6px; }
.qcc-door-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.qcc-door-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: var(--pos-accent-soft); color: var(--pos-accent);
}
.qcc-door-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qcc-door-icon--in  { background: var(--pos-pay-soft);    color: var(--pos-pay-hi); }
.qcc-door-icon--out { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }
.qcc-door .qcc-kbd { padding: 1px 5px; font-size: 10px; }
.qcc-door-label { font-size: 12.5px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }

/* ---- 47 · Zone 1 shared (DQ-153, R-E). The bar takes 46 % (min 380 px), the four balance chips the rest.
        <div class="qcc-zone1"><div class="qcc-cmdbar qcc-cmdbar--zone1">…</div><div class="qcc-balchips">4 × .qcc-balchip</div></div> */
.qcc-zone1 { display: flex; align-items: stretch; gap: var(--qcc-deck-gap); min-height: 40px; }
.qcc-cmdbar--zone1 { flex: 0 1 38%; min-width: 340px; min-height: 40px; padding-inline: 12px; gap: 10px; border-radius: 10px; }
.qcc-cmdbar--zone1 .qcc-cmdbar-input { font-size: 13.5px; }
.qcc-balchips { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--qcc-rail-gap); }
.qcc-balchip {
  display: flex; align-items: center; gap: 8px; min-width: 0; height: 100%; min-height: 40px; padding-inline: 10px;
  border: 1px solid var(--pos-line); border-radius: 10px; background: var(--pos-surface); cursor: pointer; text-align: start; font: inherit; color: inherit;
}
.qcc-balchip:hover { border-color: var(--pos-accent-line); background: var(--pos-surface-2); }
.qcc-balchip:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-balchip-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--pos-text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcc-balchip-value { margin-inline-start: auto; font-family: var(--pos-mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; white-space: nowrap; flex: none; direction: ltr; }
.qcc-balchip-cur { font-family: var(--pos-mono); font-size: 10px; color: var(--pos-text-3); flex: none; }
.qcc-balchip--nil .qcc-balchip-value { color: var(--pos-text-3); font-weight: 400; }
.qcc-balchip-note { font-size: 11px; color: var(--pos-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 1500px) { .qcc-balchip-note { display: none; } }   /* at 1366 the note lives in title= only */

/* ---- 48 · The working empty stage (DQ-154, R-F). Four boxes, two by two, centred; each row opens a tab.
        <div class="qcc-stagegrid"><section class="qcc-stagebox"><header class="qcc-stagebox-head">…</header><div class="qcc-stagebox-list">rows</div></section>…</div> */
.qcc-stagegrid {
  flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
  gap: var(--qcc-deck-gap); width: 100%; max-width: 1040px; margin-inline: auto; align-self: center; height: 100%;
}
.qcc-stagebox { display: flex; flex-direction: column; min-height: 0; background: var(--pos-surface); border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg); overflow: hidden; }
.qcc-stagebox-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px 8px; border-bottom: 1px solid var(--pos-line); }
.qcc-stagebox-head .qcc-eyebrow { flex: 1; }
.qcc-stagebox-count { font-family: var(--pos-mono); font-size: 11.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--pos-line-strong); color: var(--pos-text-2); }
.qcc-stagebox-count--warn { color: var(--qcc-draft); border-color: var(--pos-warn); background: var(--qcc-draft-soft); }
.qcc-stagebox-count--danger { color: var(--pos-danger-hi); border-color: var(--pos-danger); background: var(--pos-danger-soft); }
.qcc-stagebox-head a, .qcc-stagebox-head button.qcc-linkbtn { font-size: 12px; font-weight: 600; color: var(--pos-text-2); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.qcc-stagebox-head a:hover, .qcc-stagebox-head button.qcc-linkbtn:hover { color: var(--pos-accent); text-decoration: underline; }
.qcc-stagebox-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 4px; gap: 2px; }
.qcc-stagebox-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 34px; padding: 5px 8px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--pos-text); font: inherit; text-align: start; cursor: pointer; width: 100%;
}
.qcc-stagebox-row:hover { background: var(--pos-surface-2); border-color: var(--pos-line); }
.qcc-stagebox-row:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-stagebox-row .qcc-code { font-size: 11.5px; min-width: 62px; }
.qcc-stagebox-row .qcc-stagebox-text { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcc-stagebox-row .qcc-stagebox-text small { color: var(--pos-text-3); font-size: 11.5px; }
.qcc-stagebox-row .qcc-money { font-size: 12px; color: var(--pos-text-2); }
.qcc-stagebox-row .qcc-pill { font-size: 10.5px; }
.qcc-stagebox-none { padding: 14px 12px; font-size: 12.5px; color: var(--pos-text-3); }
/* Drafts rows are the shipped .qcc-draft-item (§33) re-homed: same class, same shape. */
.qcc-stagebox-list .qcc-draft-item { min-height: 34px; }

/* ---- 49 · More + the drawer (DQ-155, R-G). The More button is the ONLY thing in the deck foot; the drawer is a
        bottom sheet (.qcc-scrim--drawer aligns it) listing the 19 sections in columns. Esc closes. -------------------- */
.qcc-deckfoot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; min-height: 28px; }
.qcc-more {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding-inline: 10px 8px;
  border: 1px solid var(--pos-line-strong); border-radius: 999px; background: var(--pos-surface-2); color: var(--pos-text-2);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.qcc-more svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.qcc-more:hover { color: var(--pos-text); border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-more[aria-expanded="true"] { color: var(--pos-text); border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-more .qcc-kbd { padding: 0 5px; font-size: 10px; }
.qcc-scrim--drawer { align-items: flex-end; justify-content: stretch; padding: 0; }
.qcc-drawer {
  display: flex; flex-direction: column; width: 100%; max-height: calc(100% - 54px);
  background: var(--pos-elevated); border-top: 1px solid var(--qcc-panel-rule); border-radius: 16px 16px 0 0;
  box-shadow: var(--qcc-panel-elev);
}
.qcc-drawer-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px 10px; border-bottom: 1px solid var(--pos-line); flex: none; }
.qcc-drawer-title { font-size: 15px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.qcc-drawer-title small { font-size: 12px; font-weight: 400; color: var(--pos-text-3); }
.qcc-drawer-search { display: flex; align-items: center; gap: 8px; height: 32px; padding-inline: 10px; flex: 0 1 360px; min-width: 200px; border: 1px solid var(--pos-line-strong); border-radius: 9px; background: var(--pos-surface); }
.qcc-drawer-search svg { width: 14px; height: 14px; stroke: var(--pos-text-3); stroke-width: 2; fill: none; flex: none; }
.qcc-drawer-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--pos-text); font: inherit; font-size: 13px; }
.qcc-drawer-search input::placeholder { color: var(--pos-text-3); }
.qcc-drawer-search:focus-within { border-color: var(--pos-accent-line); box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-drawer-head .qcc-panel-close { margin-inline-start: auto; }
.qcc-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 20px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 6px 18px; align-items: start; grid-auto-flow: dense; }
.qcc-drawer-sec { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qcc-drawer-sec-head { display: flex; align-items: center; gap: 8px; min-height: 24px; padding-inline: 2px 4px; }
.qcc-drawer-sec-head .qcc-eyebrow { flex: 1; min-width: 0; }
.qcc-drawer-sec-head .qcc-soon { margin-inline-start: auto; }
/* <div class="qcc-drawer-item"><button class="qcc-mark">…</button><button class="qcc-tile-btn"><span>Name</span></button></div> */
.qcc-drawer-item { position: relative; display: flex; min-height: 28px; border-radius: 7px; color: var(--pos-text); font-size: 12.5px; font-weight: 600; width: 100%; }
.qcc-drawer-item .qcc-tile-btn { padding: 3px 8px 3px 18px; padding-inline: 18px 8px; gap: 8px; }
.qcc-drawer-item:hover { background: var(--pos-surface-2); }
.qcc-drawer-item:has(.qcc-tile-btn:focus-visible) { box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-drawer-item .qcc-kbd { margin-inline-start: auto; padding: 0 5px; font-size: 10px; }
.qcc-drawer-item--soon { color: var(--pos-text-3); font-weight: 500; align-items: center; gap: 8px; padding: 3px 8px 3px 18px; padding-inline: 18px 8px; }
.qcc-drawer-item--soon:hover { background: none; }
.qcc-drawer-item.is-pinned .qcc-tile-btn::after { content: ""; width: 5px; height: 5px; border-radius: 999px; background: var(--pos-accent); margin-inline-start: auto; flex: none; }
.qcc-drawer-item.is-pinned .qcc-kbd { margin-inline-start: 0; }
.qcc-drawer-item.is-open { color: var(--pos-accent); }
.qcc-soon { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--pos-text-3); border: 1px dashed var(--pos-line-strong); border-radius: 999px; padding: 0 6px; line-height: 16px; white-space: nowrap; flex: none; }
.qcc-drawer-item--soon .qcc-soon { margin-inline-start: auto; }
.qcc-drawer-sec.is-hidden, .qcc-drawer-item.is-hidden { display: none; }
.qcc-drawer-empty { grid-column: 1 / -1; padding: 24px; text-align: center; color: var(--pos-text-3); font-size: 13px; }

/* ---- 50 · The slot (DQ-156, R-H). A .qcc-railsec whose content swaps. Default title "Pinned". -------------------- */
.qcc-slot { margin-block-start: auto; }     /* sits at the rail's bottom; grows upward */
.qcc-slot .qcc-railsec-head .qcc-eyebrow { color: var(--pos-text-2); }
.qcc-slot--picked { border-color: var(--pos-accent-line); }
.qcc-slot--picked .qcc-railsec-head .qcc-eyebrow { color: var(--pos-accent); }
.qcc-slot-from { font-size: 10.5px; color: var(--pos-text-3); white-space: nowrap; }
.qcc-slot-count { font-family: var(--pos-mono); font-size: 10.5px; color: var(--pos-accent); border: 1px solid var(--pos-accent-line); border-radius: 999px; padding: 0 6px; line-height: 15px; }
.qcc-slot-body { display: grid; }             /* the swap: two layers, the leaving one fades */
.qcc-slot-body > * { grid-area: 1 / 1; }
.qcc-slot-body > .is-leaving { opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .16s, transform .16s; }
.qcc-slot-body > .is-entering { animation: qcc-slot-in .18s ease-out; }
@keyframes qcc-slot-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.qcc-slot-none { padding: 8px 6px 4px; font-size: 12px; color: var(--pos-text-3); line-height: 1.4; }
.qcc-slot-none .qcc-markglyph { display: inline-block; vertical-align: -2px; }

/* ---- 51 · The three-dot mark (DQ-157, R-I). Lives INSIDE the tile's 16 px start padding; never widens the grid.
        Idle: invisible. Tile hover: faint. Mark hover / focus: full. Open: champagne. Dropdown = .qcc-menu. ------------ */
.qcc-mark {
  position: absolute; inset-inline-start: 0; inset-block: 0; width: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--pos-text-3); cursor: pointer; padding: 0; opacity: 0; border-radius: 8px 0 0 8px;
  border-start-start-radius: 8px; border-end-start-radius: 8px; border-start-end-radius: 0; border-end-end-radius: 0;
  transition: opacity .12s;
}
.qcc-tile:hover .qcc-mark, .qcc-door:hover .qcc-mark, .qcc-drawer-item:hover .qcc-mark { opacity: .55; }
.qcc-mark:hover, .qcc-mark:focus-visible { opacity: 1; background: var(--pos-surface-3); outline: 0; }
.qcc-mark[aria-expanded="true"] { opacity: 1; color: var(--pos-accent); background: var(--pos-accent-soft); }
.qcc-markglyph { width: 3px; height: 13px; fill: currentColor; stroke: none; }
.qcc-door .qcc-mark { align-items: flex-start; padding-block-start: 12px; }
.qcc-drawer-item--soon .qcc-mark { display: none; }
.qcc-menu {
  position: absolute; z-index: 60; min-width: 160px; padding: 4px;
  background: var(--pos-elevated); border: 1px solid var(--pos-line-strong); border-radius: 9px; box-shadow: var(--qcc-panel-elev);
  display: flex; flex-direction: column; gap: 1px;
}
.qcc-menu-item {
  display: flex; align-items: center; gap: 9px; height: 30px; padding-inline: 9px; border: 0; border-radius: 6px;
  background: none; color: var(--pos-text); font: inherit; font-size: 12.5px; font-weight: 600; text-align: start; cursor: pointer; white-space: nowrap;
}
.qcc-menu-item svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; color: var(--pos-text-2); }
.qcc-menu-item:hover, .qcc-menu-item:focus-visible { background: var(--pos-accent-soft); outline: 0; }
.qcc-menu-item:hover svg { color: var(--pos-accent); }
.qcc-menu-item--danger:hover { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }
.qcc-menu-item--danger:hover svg { color: var(--pos-danger-hi); }
.qcc-menu-hint { padding: 4px 9px 5px; font-size: 11px; color: var(--pos-text-3); border-top: 1px solid var(--pos-line); margin-block-start: 2px; }


/* ============================================================================
   v0.7 ADDITIONS (2026-09-21, evening) — THE DECK ON A BIG SCREEN + THE LINE'S CONTROLS
   (brief 2026-09-21 evening; DQ-148 · 158 · 159 · 160 · 161 · 162 · 163 · 164 · 165 · the in-grid select, Darya's shot).
   Additive. TWO declared changes to old rules: §45 --qcc-rail-w becomes a clamp (256 at 1366, 344 from 1690);
   §4 .qcc-mgmtcard is DELETED (superseded in v0.6, kept one release as promised). Nothing else touched.
   ============================================================================ */

/* ---- 52 · Rail width that grows (DQ-161, A1). Linear through (1366 → 256) and (1600 → 320); capped 344 from 1690.
        At 1366 nothing changes (the proof screen holds). At 1600 a two-column tile is 148 px wide → 124 px of text:
        every TWO-word label in the deck (Posting Settings · Vendor Statements · Voucher Types · Tax Treatments · Users & Access)
        sits on one line at 12.5/700 and the tile drops to its 36 px minimum. Four-word labels (Chart of Accounts Activation)
        still wrap — by design; renaming is the owner's call, not the library's. The stage grid keeps its 1040 cap. ---- */
:root { --qcc-rail-w: clamp(256px, 27.35vw - 118px, 344px); }
.qcc-tile b, .qcc-door-label { text-wrap: balance; }             /* when a label must wrap, it wraps evenly, never 3 words + 1 */

/* ---- 53 · The filled rail (DQ-162, A2) — the CUT tile. The RULE lives in specs/deck-big-screen.md §2; the library only
        draws what the rule needs: a "+N more" tile that ends a filled section and opens the drawer on that family,
        and the pin dot a rail tile wears when the same item is pinned (the slot never duplicates it). ---------------- */
.qcc-tile--more { border-style: dashed; background: var(--pos-surface); color: var(--pos-text-2); }
.qcc-tile--more .qcc-tile-btn { justify-content: center; padding-inline: 8px; font-weight: 700; }
.qcc-tile--more .qcc-tile-btn b { font-family: var(--pos-mono); font-weight: 600; font-size: 12px; }
.qcc-tile--more:hover { color: var(--pos-text); border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-tile.is-pinned .qcc-tile-btn::after, .qcc-door.is-pinned .qcc-door-top::after {
  content: ""; width: 5px; height: 5px; border-radius: 999px; background: var(--pos-accent); flex: none; margin-inline-start: auto;
}
.qcc-tile.is-pinned .qcc-kbd { margin-inline-start: 0; }

/* ---- 54 · Shell chips that open (DQ-163, A3). A chip that opens is a <button class="qcc-chip qcc-chip--menu"> with a
        10 px chevron at its end; open = champagne ring + flipped chevron. The dropdown is §51's .qcc-menu with the
        --chip variant: a head line (eyebrow + current value), items that may carry .is-current (check glyph), and a
        foot item that jumps to the owning hub. One menu open at a time; Esc / outside-click close and return focus. -- */
.qcc-chip--menu { cursor: pointer; font: inherit; font-size: 12.5px; padding-inline-end: 8px; transition: border-color .15s, background .15s; }
.qcc-chip--menu:hover { border-color: var(--pos-line-strong); color: var(--pos-text); }
.qcc-chip--menu:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); border-color: var(--pos-accent-line); }
.qcc-chip-caret { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .7; transition: transform .15s; }
.qcc-chip--menu[aria-expanded="true"] { border-color: var(--pos-accent-line); background: var(--pos-accent-soft); color: var(--pos-text); }
.qcc-chip--menu[aria-expanded="true"] .qcc-chip-caret { transform: rotate(180deg); opacity: 1; }
.qcc-chip--menu .qcc-chip-value { font-weight: 700; color: var(--pos-text); }
.qcc-menu--chip { min-width: 224px; max-width: 320px; }
.qcc-menu-head { display: flex; flex-direction: column; gap: 1px; padding: 6px 9px 7px; border-bottom: 1px solid var(--pos-line); margin-block-end: 3px; }
.qcc-menu-head .qcc-eyebrow { font-size: 10px; }
.qcc-menu-head b { font-size: 13px; font-weight: 700; }
.qcc-menu-head small { font-size: 11.5px; color: var(--pos-text-3); }
.qcc-menu-item .qcc-menu-check { width: 13px; height: 13px; flex: none; opacity: 0; color: var(--pos-accent); }
.qcc-menu-item.is-current { color: var(--pos-text); }
.qcc-menu-item.is-current .qcc-menu-check { opacity: 1; }
.qcc-menu-item .qcc-menu-meta { margin-inline-start: auto; font-family: var(--pos-mono); font-size: 11px; color: var(--pos-text-3); font-weight: 400; padding-inline-start: 12px; }
.qcc-menu-item .qcc-pill { margin-inline-start: auto; font-size: 10px; height: 18px; }
.qcc-menu-item--foot { border-top: 1px solid var(--pos-line); border-radius: 0 0 6px 6px; margin-block-start: 2px; color: var(--pos-text-2); font-weight: 600; }
.qcc-menu-item--foot svg { color: var(--pos-text-3); }
.qcc-menu-item[aria-disabled="true"] { color: var(--pos-text-3); cursor: default; }
.qcc-menu-item[aria-disabled="true"]:hover { background: none; }
.qcc-menu-sep { height: 1px; background: var(--pos-line); margin: 3px 0; }

/* ---- 55 · The line's ⋯ cell = ONE control, two states (DQ-164 B1 · DQ-148 B2).
        <td class="qcc-td--act"><label class="qcc-cell-act qcc-cell-act--delete" title="Delete line · F4">
             <input type="checkbox" class="qcc-cell-act-input" name="…-DELETE"><svg class="qcc-cell-act-x">…</svg></label></td>
        The DELETE checkbox is the no-JS fallback — visually hidden, still focusable, still submits. The label draws the glyph.
        Idle nearly invisible (.35) · row hover .8 · own hover brick. Balancer state: swap `--delete` for `--balance` on the LAST line's
        cell when the document is off-balance and the hand is in that line; the glyph turns to the scale in champagne;
        double-click / Enter / Space fills the empty side. Balanced → back to `--delete`. Journal doors only. ----------------- */
.qcc-cell-act { position: relative; width: 38px; height: 42px; opacity: .35; transition: opacity .12s, color .12s, background .12s; }
.qcc-docgrid tr:hover .qcc-cell-act, .qcc-docgrid tr.is-focus .qcc-cell-act { opacity: .8; }
.qcc-cell-act:hover, .qcc-cell-act:focus-within, .qcc-cell-act:focus-visible { opacity: 1; }
.qcc-cell-act-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.qcc-cell-act:has(.qcc-cell-act-input:focus-visible) { box-shadow: inset 0 0 0 1.5px var(--pos-accent); outline: 0; }
.qcc-cell-act svg, .qcc-cell-act-x, .qcc-cell-act-scale { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.qcc-cell-act--delete:hover, .qcc-cell-act--delete:focus-within { color: var(--pos-danger-hi); background: var(--pos-danger-soft); }
/* no-JS path: a checked DELETE strikes the row until the form posts */
.qcc-docgrid tr:has(.qcc-cell-act-input:checked) td { background: var(--pos-danger-soft); }
.qcc-docgrid tr:has(.qcc-cell-act-input:checked) .qcc-cell { text-decoration: line-through; color: var(--pos-text-3); }
.qcc-docgrid tr:has(.qcc-cell-act-input:checked) .qcc-cell-act { opacity: 1; color: var(--pos-danger-hi); }
/* balancer state */
.qcc-cell-act--balance { color: var(--pos-accent); opacity: .9; }
.qcc-cell-act--balance:hover, .qcc-cell-act--balance:focus-visible, .qcc-cell-act--balance:focus-within { color: var(--pos-accent-hi); background: var(--pos-accent-soft); opacity: 1; }
.qcc-cell-act--balance .qcc-cell-act-scale { animation: qcc-act-swap .16s ease-out; }
@keyframes qcc-act-swap { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.qcc-docgrid th.qcc-th--act { padding-inline: 0; text-align: center; }

/* ---- 56 · The stage's fill/scroll child (DQ-158). One blessed class for the empty-state wrapper AND every tab body:
        fills the stage, never grows it, scrolls inside. .qcc-stagegrid inside it keeps its 100 % height. ----------------- */
.qcc-stage-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.qcc-stage-body > .qcc-stagegrid { flex: 1; }
.qcc-stage-body--tab { overflow-y: auto; padding-inline-end: 8px; }   /* DQ-165 (1): the scrollbar never hugs the tab's own border — the library's rule now, never revert */

/* ---- 57 · The inert stage-box row (DQ-159). A fact with no door: same shape, no pointer, no hover. Either the modifier or a
        plain <div> row (a row that is not a <button>/<a> is inert by construction). ----------------------------------- */
.qcc-stagebox-row--inert, div.qcc-stagebox-row:not([tabindex]) { cursor: default; }
.qcc-stagebox-row--inert:hover, div.qcc-stagebox-row:not([tabindex]):hover { background: none; border-color: transparent; }
.qcc-stagebox-row--inert .qcc-stagebox-text, div.qcc-stagebox-row:not([tabindex]) .qcc-stagebox-text { color: var(--pos-text-2); }

/* ---- 58 · The pool bar (DQ-160, closes the DQ-112 inline frame). A 40 px bar that STATES its height; the strip and tab
        shrink INSIDE it (28 px tabs, 12 px type) — global .qcc-pooltab (34) is untouched for panels/lists.
        <div class="qcc-poolbar"><span class="qcc-eyebrow">Pool</span><div class="qcc-poolstrip" role="tablist">…</div>
             <span class="qcc-readonly-note qcc-poolbar-empty">Nothing open yet…</span><span class="qcc-readonly-note qcc-poolbar-note">…</span></div> */
.qcc-poolbar {
  display: flex; align-items: center; gap: 12px; height: 40px; padding-inline: 12px; flex: none; min-width: 0;
  border: 1px solid var(--pos-line); border-radius: 10px; background: var(--pos-surface-2);
}
.qcc-poolbar > .qcc-eyebrow { flex: none; }
.qcc-poolbar .qcc-poolstrip { flex: 1; min-width: 0; padding: 0; gap: 6px; height: 100%; align-items: center; scrollbar-width: none; }
.qcc-poolbar .qcc-poolstrip::-webkit-scrollbar { display: none; }
.qcc-poolbar .qcc-pooltab { height: 28px; padding-inline: 10px; gap: 7px; font-size: 12px; border-radius: 7px; max-width: 220px; }
.qcc-poolbar .qcc-pooltab-close { width: 16px; height: 16px; }
.qcc-poolbar .qcc-pooltab-close svg { width: 11px; height: 11px; }
.qcc-poolbar .qcc-pooltab-dirty { width: 6px; height: 6px; }
.qcc-poolbar-empty { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qcc-poolbar-note { flex: none; }
@media (max-width: 1400px) { .qcc-poolbar-note { display: none; } }

/* ---- 59 · The panel head's trailing meta (DQ-165 (2), Darya's walk). "Last saved: <date>" leaves the header row and
        sits at the END of .qcc-panel-head, after the key hint, pushed to the far end. One help line less under the fields.
        <div class="qcc-panel-head">…<span class="qcc-kbd">Enter</span><span class="qcc-head-meta">Last saved 10:42</span></div> */
.qcc-head-meta { margin-inline-start: auto; font-size: 11.5px; color: var(--pos-text-3); white-space: nowrap; flex: none; padding-inline-start: 12px; }
.qcc-head-meta time, .qcc-head-meta .qcc-mono { font-family: var(--pos-mono); color: var(--pos-text-2); }
.qcc-panel-head .qcc-panel-close ~ .qcc-head-meta, .qcc-panel-head .qcc-head-meta + .qcc-panel-close { margin-inline-start: 0; }  /* when a close button follows, the meta stops before it */
.qcc-panel-head:has(.qcc-head-meta) .qcc-panel-close { margin-inline-start: 10px; }

/* ---- 60 · The in-grid SELECT (Darya's shot, 2026-09-21 evening — "they look like orphans"). A <select class="qcc-cell"> lost its
        chevron outside the field and had no field box while empty. Rule: the native arrow goes; a drawn chevron sits INSIDE the cell at
        its inline-end (currentColor, so it follows every theme); an empty select wears the §38 inset field like an empty input.
        <span class="qcc-cell-select"><select class="qcc-cell"><option value="">— optional</option>…</select></span>
        The wrapper carries the chevron (a <select> cannot carry ::after). Use it for every select inside .qcc-docgrid. ------------ */
.qcc-cell-select { position: relative; display: block; min-width: 0; }
.qcc-cell-select > select.qcc-cell { appearance: none; -webkit-appearance: none; width: 100%; padding-inline-end: 28px; cursor: pointer; background-image: none; }
.qcc-cell-select > select.qcc-cell::-ms-expand { display: none; }
.qcc-cell-select::after {
  content: ""; position: absolute; inset-inline-end: 12px; top: 50%; width: 6px; height: 6px; pointer-events: none;
  border-inline-end: 1.6px solid var(--pos-text-3); border-block-end: 1.6px solid var(--pos-text-3);
  transform: translateY(-70%) rotate(45deg); transition: border-color .12s;
}
.qcc-cell-select:hover::after, .qcc-cell-select:focus-within::after { border-color: var(--pos-accent); }
/* empty = the placeholder option is the one selected (value="") → the same inset field as an empty input (§38) */
.qcc-cell-select > select.qcc-cell:has(option[value=""]:checked):not(:focus) { box-shadow: inset 0 0 0 1px var(--pos-line); background: var(--pos-bg-2); color: var(--pos-text-3); }
.qcc-cell-select > select.qcc-cell:has(option[value=""]:checked):not(:focus):hover { box-shadow: inset 0 0 0 1px var(--pos-line-strong); }
.qcc-cell-select > select.qcc-cell:focus { color: var(--pos-text); }
.qcc-cell-select > select.qcc-cell option { background: var(--pos-elevated); color: var(--pos-text); }
/* the header's .qcc-select gets the same drawn chevron when wrapped (optional; the header box was never the complaint) */
.qcc-cell-select > .qcc-select { appearance: none; -webkit-appearance: none; width: 100%; padding-inline-end: 28px; }

/* ============================================================================
   v0.8 — A POOL PANEL FILLS ITS STAGE + HEADER CONTROLS THAT SHOW THEIR WHOLE VALUE
   (brief 2026-09-21 night "the-panel-fills-its-stage" · DQ-173 · Darya's chat ask on truncated selects/inputs)
   ============================================================================ */

/* ---- 61 · A pool panel FILLS its stage — head fixed · lines flexible · foot pinned (DQ-173).
        Darya: "everything is hanged to the ceiling" → then, on the stretch: "the items below the line must be fixed at the bottom,
        the space must be reserved to the added lines … the total, notes, the action bar must stay on the screen at the bottom."
        OPT-IN: `.qcc-panel--fill` on the tab's .qcc-panel. A panel without it (a register, a management list) is untouched — it sits at
        content height and §56's tab body scrolls it, exactly as today. Markup the face renders:
        <div class="qcc-stage-body qcc-stage-body--tab">
          <div class="qcc-panel qcc-panel--fill">
            <div class="qcc-panel-head">title · pill · hint · .qcc-head-meta</div>                         ZONE 1 · fixed
            <div class="qcc-panel-body">
              <form class="qcc-panel-form">
                <div class="qcc-panel-fixed">readiness · .qcc-formgrid</div>                                  ZONE 1 · fixed
                <div class="qcc-panel-lines"><div class="qcc-docgrid-frame"><table class="qcc-docgrid">thead + tbody (+ Add line) — NO tfoot</table></div></div>
                                                                                                             ZONE 2 · takes ALL the leftover height · the ONLY scroller
                <div class="qcc-panel-pinned">
                  <div class="qcc-panel-totals"><div class="qcc-docgrid-frame qcc-docgrid-frame--totals"><table class="qcc-docgrid">same colgroup · tfoot only</table></div></div>
                  notes · .qcc-docbar                                                                          ZONE 3 · pinned, always on screen
                </div>
              </form>
            </div>
          </div>
        </div>
        The tfoot LEAVES the lines table and becomes its own one-row table under the scroller with the SAME colgroup — table-layout is
        fixed, so Debit/Credit line up with the columns above; both boxes reserve the scrollbar gutter (scrollbar-gutter: stable) so the
        totals never drift by a scrollbar's width. The lines frame grows to the totals (the reserved space reads as part of the grid);
        with more lines than fit, the frame overflows and .qcc-panel-lines scrolls with its <thead> sticky. ----------------------------- */
.qcc-stage-body--tab > .qcc-panel--fill { flex: 1 1 auto; }
.qcc-panel--fill { display: flex; flex-direction: column; min-height: 0; }
.qcc-panel--fill > .qcc-panel-head { flex: none; padding-block: 11px; }                      /* 14 → 11: three px given to the lines */
.qcc-panel--fill > .qcc-panel-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-block: 12px 14px; } /* 16 → 12 above: breath, not a shelf */
.qcc-panel-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.qcc-panel-fixed { flex: none; display: flex; flex-direction: column; gap: 12px; margin-block-end: 12px; }
.qcc-panel-lines {
  flex: 1 1 auto; min-height: 88px; min-width: 0; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable;  /* DQ-177: no scrollbar-width here — it switches off §18 in Chrome */
}
.qcc-panel-lines > .qcc-docgrid-frame { flex: 1 0 auto; border-end-start-radius: 0; border-end-end-radius: 0; border-block-end: 0; }
.qcc-panel-lines .qcc-docgrid thead th { position: sticky; top: 0; z-index: 2; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--pos-line); }
.qcc-panel-lines .qcc-docgrid-add td { border-bottom: 0; }                                   /* the totals' own top hairline closes the grid */
.qcc-panel-pinned { flex: none; display: flex; flex-direction: column; gap: 12px; }
.qcc-panel-totals { overflow: hidden; scrollbar-gutter: stable; }                            /* same gutter as the scroller above → columns align */
.qcc-docgrid-frame--totals { border-start-start-radius: 0; border-start-end-radius: 0; }
.qcc-docgrid-frame--totals .qcc-docgrid tfoot td { padding-block: 10px; }
/* notes in the pinned foot: two lines by default, grows to four while typing, never a 74 px shelf under the grid */
.qcc-panel-pinned .qcc-textarea { min-height: 46px; max-height: 96px; padding-block: 6px; field-sizing: content; resize: none; }
/* the picker (§26) is position:absolute under its cell; inside the scroller it would be clipped — the face lifts it to fixed (guide §13) */
.qcc-panel-lines .qcc-picker.is-lifted { position: fixed; inset-inline-start: auto; top: auto; }

/* ---- 62 · The document header on TWO ROWS (Darya, 2026-09-21 night: "the poor accountant needs to see the things on the screen, not a few
        letters then cut" → "put them on two rows"). OPT-IN on the header grid: `.qcc-formgrid--2row`. Every field spans 4 of the 12 columns —
        six fields shelve 3 + 3 at EVERY width (a fifth-and-sixth never squeeze); controls keep their 38 px; a selected voucher type, project or
        reference reads whole because the field is a third of the panel, not a sixth. Nothing grows taller than it was. The row this costs is
        given back by §61's trims (head 3 · body top 4) and comes out of the lines zone, which is the zone built to give.
        A header that needs a wider field (Description) keeps its own span class — `--w8`/`--w12` still win over the shelf.
        <div class="qcc-formgrid qcc-formgrid--2row">six .qcc-field</div> -------------------------------------------------------------- */
.qcc-formgrid--2row > .qcc-field { grid-column: span 4; }
.qcc-formgrid--2row > .qcc-field--w6 { grid-column: span 6; }
.qcc-formgrid--2row > .qcc-field--w8 { grid-column: span 8; }
.qcc-formgrid--2row > .qcc-field--w12 { grid-column: span 12; }
.qcc-formgrid--2row .qcc-select, .qcc-formgrid--2row .qcc-input { text-overflow: ellipsis; }   /* a value longer than a third of the panel is a data problem — it still says so */


/* ============================================================================
   v0.9 — ATTACHMENTS + PRINT ON THE DOCUMENT · THE FOOT ON A SHORT SCREEN
   (brief 2026-09-23 "attachments-and-print" · law: specs/2026-09-22-attachments-and-print-design.md P1–P15 · A1–A12 ·
    DQ-178 "the foot falls off the short screen"). Additive, plus ONE declared change to §61 (the filled body may scroll).
   The rule that places everything below:  THE HEAD HOLDS WHAT A READER HAS · THE FOOT HOLDS WHAT A WRITER HAS.
   Files and Print are read-depth (everyone who opens the qaid sees its files and may print it) → they live in the panel
   HEAD, which never scrolls and costs no height. Save · Post · Cancel · Delete stay in the foot's docbar.
   ============================================================================ */

/* ---- 63 · The filled panel on a screen it does not fit (DQ-178). DECLARED CHANGE to §61: the body was overflow:hidden.
        Now it scrolls ONLY when head + the lines zone at its 88 px minimum + the foot exceed it; whenever they fit, nothing
        moves and the three-zone rule holds exactly as walked. One scroller at a time: the lines zone scrolls while there is
        room; below the minimum the body takes over and the foot (Save, the refusal line) is always reachable.
        + the 7-cell shelf: on --2row a field marked --short spans 3 of 12, so a receipt/payment/invoice/bill header
        (Date · Due date · Reference · Currency + rate on row 1 — Party · Project · Branch on row 2) costs TWO rows like the
        journal. A 9-cell header (tax ON + discount) still takes three rows; the fallback scroll carries it. ------------- */
.qcc-panel--fill > .qcc-panel-body { overflow-y: auto; overflow-x: hidden; position: relative; }
.qcc-formgrid--2row > .qcc-field--short { grid-column: span 3; }

/* ---- 64 · Head tools (Files · Print). A group at the head's inline-end, before .qcc-head-meta. Buttons are 30 px, quiet,
        a count in mono. Narrow head (the panel under 900 px, i.e. 1366): the key-hint note leaves the head — it is in Keys.
        <div class="qcc-head-tools">
          <button class="qcc-headbtn" aria-expanded="false" aria-controls="tray">clip · Attachments <span class="qcc-headbtn-count">3</span></button>
          <button class="qcc-headbtn">printer · Print</button>
        </div> */
.qcc-panel--fill > .qcc-panel-head { container-type: inline-size; container-name: qcc-head; }
.qcc-head-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; flex: none; }
.qcc-head-tools + .qcc-head-meta { margin-inline-start: 0; padding-inline-start: 6px; }
.qcc-headbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding-inline: 10px; flex: none;
  border: 1px solid var(--pos-line); border-radius: 8px; background: var(--pos-surface); color: var(--pos-text-2);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s;
}
.qcc-headbtn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.qcc-headbtn:hover { color: var(--pos-text); border-color: var(--pos-line-strong); background: var(--pos-surface-2); }
.qcc-headbtn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); border-color: var(--pos-accent-line); }
.qcc-headbtn[aria-expanded="true"] { color: var(--pos-text); border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-headbtn-count { font-family: var(--pos-mono); font-size: 11px; font-weight: 600; min-width: 18px; padding: 1px 5px; border-radius: 999px; text-align: center; background: var(--pos-surface-3); color: var(--pos-text); }
.qcc-headbtn[aria-expanded="true"] .qcc-headbtn-count { background: var(--pos-accent); color: var(--pos-text-on-accent); }
.qcc-headbtn--none { border-style: dashed; }                                   /* no file yet — an invitation, never a warning */
.qcc-headbtn--none .qcc-headbtn-count { background: transparent; color: var(--pos-text-3); }
.qcc-headbtn.is-busy .qcc-headbtn-count { background: var(--pos-accent-soft); color: var(--pos-accent); }   /* an upload is running */
@container qcc-head (max-width: 900px) {
  .qcc-panel-head:has(.qcc-head-tools) > .qcc-readonly-note { display: none; }
}

/* ---- 65 · The attachments tray (A5–A9). A popover under the head tools, inside the filled body (position:relative, §63),
        anchored at the inline-end. Esc / outside-click / the button close it; focus returns to the button. It may cover the
        foot while open; closed, it costs the panel nothing. Order: head · drop zone (can_attach only) · list · foot.
        <div class="qcc-tray" id="tray" role="dialog" aria-label="Attachments">
          <div class="qcc-tray-head"><span class="qcc-eyebrow">Attachments</span><span class="qcc-headbtn-count">3</span><button class="qcc-btn qcc-btn--sm">Upload</button></div>
          <label class="qcc-drop"><input type="file" name="file" multiple hidden> clip · <b>Drop files here</b> or Upload <small>…50 MB each</small></label>
          <ul class="qcc-tray-list"> .qcc-file rows </ul>
          <div class="qcc-tray-foot"><button class="qcc-linkbtn">Show replaced (1)</button> | .qcc-readonly-note</div>
        </div>
        FILE ROW — the name is the link (viewable → the viewer tab; not viewable → download). One line of meta: TYPE · size.
        <li class="qcc-file [--uploading|--refused|--replaced]">
          <span class="qcc-file-glyph">PDF</span>
          <span class="qcc-file-main"><a class="qcc-file-name" dir="auto" href="…/view/">name</a><span class="qcc-file-meta">PDF · 2.4 MB</span></span>
          <span class="qcc-file-acts"><a class="qcc-file-act" title="Open in a tab">↗</a><button class="qcc-file-act" title="Replace">⟳</button><button class="qcc-file-act qcc-file-act--danger" title="Delete">🗑</button></span>
        </li>
        Delete is ABSENT from the DOM on posted / reversed (replace is the only way) and every control is absent when !can_attach. */
.qcc-tray {
  position: absolute; z-index: 40; top: 6px; inset-inline-end: 14px; width: min(440px, calc(100% - 28px)); max-height: calc(100% - 12px);
  display: flex; flex-direction: column; min-height: 0;
  background: var(--pos-elevated); border: 1px solid var(--pos-line-strong); border-radius: 12px; box-shadow: var(--qcc-panel-elev);
}
.qcc-tray-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 9px; border-bottom: 1px solid var(--pos-line); flex: none; }
.qcc-tray-head .qcc-eyebrow { color: var(--pos-text-2); }
.qcc-tray-head .qcc-btn { margin-inline-start: auto; }
.qcc-tray-head .qcc-panel-close { width: 26px; height: 26px; }
.qcc-tray-head .qcc-btn + .qcc-panel-close { margin-inline-start: 0; }
.qcc-tray-head > .qcc-panel-close:only-of-type { margin-inline-start: auto; }
.qcc-drop {
  display: flex; align-items: center; gap: 10px; margin: 10px 12px 2px; padding: 11px 12px; flex: none; cursor: pointer;
  border: 1.5px dashed var(--pos-line-strong); border-radius: 10px; background: var(--pos-bg-2); color: var(--pos-text-2); font-size: 12.5px;
  transition: border-color .15s, background .15s;
}
.qcc-drop svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; color: var(--pos-accent); }
.qcc-drop b { color: var(--pos-text); font-weight: 700; }
.qcc-drop small { display: block; font-size: 11.5px; color: var(--pos-text-3); margin-block-start: 1px; }
.qcc-drop:hover, .qcc-drop:focus-within { border-color: var(--pos-accent-line); background: var(--pos-accent-soft); }
.qcc-tray-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.qcc-tray-empty { padding: 18px 12px 16px; text-align: center; font-size: 12.5px; color: var(--pos-text-3); }
.qcc-tray-foot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--pos-line); flex: none; font-size: 12px; }
.qcc-tray-foot .qcc-readonly-note { font-size: 12px; }
.qcc-linkbtn { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--pos-accent); cursor: pointer; }
.qcc-linkbtn:hover { text-decoration: underline; }
.qcc-linkbtn[aria-pressed="true"] { color: var(--pos-text-2); }

.qcc-file { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 6px 7px 8px; border-radius: 8px; min-height: 48px; }
.qcc-file:hover { background: var(--pos-surface-2); }
.qcc-file-glyph {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 7px;
  background: var(--pos-surface-3); color: var(--pos-text-2); font-family: var(--pos-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .02em;
}
.qcc-file-glyph--view { background: var(--pos-accent-soft); color: var(--pos-accent); }          /* opens inside QCC (PDF, images) */
.qcc-file-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qcc-file-name {
  font-size: 13px; font-weight: 600; color: var(--pos-text); text-decoration: none; line-height: 1.3;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; unicode-bidi: plaintext; text-align: match-parent;   /* an Arabic name in an English UI keeps the UI's edge */
}
a.qcc-file-name:hover { color: var(--pos-accent-hi); text-decoration: underline; text-underline-offset: 2px; }
.qcc-file-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--pos-text-3); min-width: 0; white-space: nowrap; }
.qcc-file-meta .qcc-mono { font-size: 11px; }
.qcc-file-acts { display: flex; align-items: center; gap: 2px; }
.qcc-file-act {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 7px;
  background: transparent; color: var(--pos-text-3); cursor: pointer; text-decoration: none; transition: background .12s, color .12s, opacity .12s;
}
.qcc-file-act svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qcc-file-act:hover, .qcc-file-act:focus-visible { background: var(--pos-surface-3); color: var(--pos-text); outline: 0; }
.qcc-file-act--danger:hover, .qcc-file-act--danger:focus-visible { background: var(--pos-danger-soft); color: var(--pos-danger-hi); }
.qcc-file:not(:hover):not(:focus-within) .qcc-file-act--hover { opacity: .0; }            /* replace/delete surface on hover or focus; the open glyph always shows */
/* uploading — the row exists at once; a 3 px bar replaces the meta; the × cancels the request */
.qcc-file-bar { position: relative; height: 3px; border-radius: 999px; background: var(--pos-surface-3); overflow: hidden; margin-block: 5px 1px; }
.qcc-file-bar > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 999px; background: var(--pos-accent); }
.qcc-file--uploading .qcc-file-name { color: var(--pos-text-2); }
.qcc-file--uploading .qcc-file-glyph { background: var(--pos-surface-2); color: var(--pos-text-3); }
/* refused — the engine's ONE sentence, inline under the name; never a toast. The row leaves on × or the next upload. */
.qcc-file--refused { background: var(--pos-danger-soft); }
.qcc-file--refused:hover { background: var(--pos-danger-soft); }
.qcc-file--refused .qcc-file-glyph { background: transparent; box-shadow: inset 0 0 0 1px var(--pos-danger); color: var(--pos-danger-hi); }
.qcc-file--refused .qcc-file-name { color: var(--pos-text-2); }
.qcc-file-refusal { font-size: 12px; color: var(--pos-danger-hi); line-height: 1.35; white-space: normal; }
/* replaced — hidden by default (?replaced=1 brings it back); quiet, dashed glyph, the newer file named */
.qcc-file--replaced .qcc-file-glyph { background: transparent; box-shadow: inset 0 0 0 1px var(--pos-line-strong); color: var(--pos-text-3); }
.qcc-file--replaced .qcc-file-name { color: var(--pos-text-2); font-weight: 400; }
.qcc-file-life { display: inline-flex; align-items: center; height: 17px; padding-inline: 6px; border-radius: 5px; border: 1px dashed var(--pos-line-strong); font-size: 10.5px; font-weight: 700; color: var(--pos-text-3); flex: none; }
.qcc-file-sep { width: 3px; height: 3px; border-radius: 999px; background: var(--pos-text-3); opacity: .6; flex: none; }

/* ---- 66 · Drag-drop onto the document (A9). While a drag with files is over a filled panel whose can_attach is true,
        the face adds .is-dragover to the panel; the veil covers the BODY (the head stays readable). Drop = one request per
        file; the tray opens with an uploading row for each. No veil when !can_attach (the drop is ignored, nothing drawn). */
.qcc-dropveil {
  position: absolute; inset: 8px 10px; z-index: 45; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--pos-accent); border-radius: 12px; text-align: center; pointer-events: none;
  background: color-mix(in oklab, var(--pos-elevated) 90%, transparent);
}
.qcc-panel.is-dragover .qcc-dropveil { display: flex; }
.qcc-dropveil svg { width: 26px; height: 26px; stroke: var(--pos-accent); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qcc-dropveil b { font-size: 15px; font-weight: 800; color: var(--pos-text); }
.qcc-dropveil small { font-size: 12px; color: var(--pos-text-2); }

/* ---- 67 · The viewer tab (A8 · T5 · P1) — ONE tab kind for a file AND for a print preview. A filled panel whose body is
        the frame, edge to edge: no padding, no card inside, the browser draws the file (its own PDF toolbar included).
        <div class="qcc-panel qcc-panel--fill qcc-panel--viewer">
          <div class="qcc-panel-head"><span class="qcc-file-glyph qcc-file-glyph--view">PDF</span><span class="qcc-viewer-title" dir="auto">name</span>
            <span class="qcc-viewer-meta">PDF · 2.4 MB · from <a>JV-0142</a></span>
            <div class="qcc-head-tools">[print only: .qcc-seg lang] <a class="qcc-headbtn" download>Download</a> [print only: <button class="qcc-btn qcc-btn--sm qcc-btn--primary">Print</button>]</div></div>
          <div class="qcc-panel-body"><iframe class="qcc-viewer-frame" src="…/view/"></iframe></div>
        </div>
        Pool tab title = the file name (print: the document number); .qcc-pooltab-kind carries PDF / JPG / PRINT in front.
        A non-viewable file never opens a tab — its click downloads (the desktop opens it in its own program). */
.qcc-panel--viewer > .qcc-panel-body { padding: 0; overflow: hidden; }
.qcc-panel--viewer > .qcc-panel-head { gap: 10px; }
.qcc-panel--viewer .qcc-file-glyph { width: 28px; height: 28px; font-size: 9px; }
.qcc-viewer-title { font-size: 14.5px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: match-parent; flex: 0 1 auto; }
.qcc-viewer-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--pos-text-3); white-space: nowrap; flex: none; }
.qcc-viewer-meta a { color: var(--pos-accent); font-family: var(--pos-mono); text-decoration: none; font-weight: 600; }
.qcc-viewer-meta a:hover { text-decoration: underline; }
.qcc-viewer-frame { display: block; width: 100%; height: 100%; flex: 1 1 auto; min-height: 0; border: 0; background: var(--pos-surface-3); }
.qcc-panel--viewer .qcc-seg-opt { height: 24px; padding-inline: 10px; }
.qcc-panel--viewer .qcc-seg { padding: 2px; }
.qcc-panel--viewer .qcc-panel-head .qcc-pill { white-space: nowrap; flex: none; }
.qcc-pooltab-kind { font-family: var(--pos-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .03em; padding: 1px 4px; border-radius: 4px; background: var(--pos-surface-3); color: var(--pos-text-2); flex: none; }
.qcc-pooltab--active .qcc-pooltab-kind { background: var(--pos-accent-soft); color: var(--pos-accent); }
.qcc-pooltab-title { unicode-bidi: plaintext; }


/* ============================================================================
   v0.10 ADDITIONS (2026-09-25) — THE SESSION LOCK (brief 2026-09-24-DESIGN_BRIEF_session-lock-screen).
   Additive. No old selector changed. ONE new layer that beats every other layer (z 1000 > toast 100 >
   scrim 90 > picker/menu 60 > dropveil 45 > tray 40). Travels with qcc-drop-007-session-lock/.
   ============================================================================ */

/* ---- 68 · The lock layer + card. A LAYER over the deck, never a page: the deck stays mounted under it.
        <div class="qcc-lock" role="dialog" aria-modal="true" aria-labelledby="…">      ← locked / expired: the deck is HIDDEN (figures unreadable)
        <div class="qcc-lock qcc-lock--warn" …>                                         ← warning + the Set-a-PIN offer: the deck stays readable
          <div class="qcc-lock-card">
            <div class="qcc-lock-top"><span class="qcc-lock-mark [--warn|--ended]">svg</span><h2 class="qcc-lock-title">…</h2><p class="qcc-lock-lede">…</p></div>
            <div class="qcc-lock-who">.qcc-avatar + .qcc-idcell-text (name · email, read-only)</div>
            <form class="qcc-lock-form">label · .qcc-pin | .qcc-input · .qcc-lock-msg · .qcc-btn--primary · [.qcc-lock-or · Microsoft]</form>
            | <div class="qcc-lock-ask">…the one question…</div>
            <button class="qcc-linkbtn qcc-lock-alt">Use password instead</button>
            <div class="qcc-lock-foot"><button class="qcc-linkbtn">Sign in as a different user</button></div>
          </div></div>
        Esc belongs to the layer and does nothing. Focus is trapped in the card. ------------------------------------------------ */
.qcc-lock {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto; background: color-mix(in oklab, var(--pos-bg) 97%, transparent);
}
.qcc-lock[hidden] { display: none; }
.qcc-lock--warn { background: var(--pos-scrim); }
.qcc-lock-card {
  width: min(400px, 100%); margin-block: auto; display: flex; flex-direction: column; gap: 16px;
  padding: 26px 26px 16px; background: var(--pos-elevated); border: 1px solid var(--pos-line-strong);
  border-block-start: 2px solid var(--qcc-panel-rule); border-radius: var(--qcc-r-xl); box-shadow: var(--qcc-panel-elev);
}
.qcc-lock-top { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.qcc-lock-mark { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; margin-block-end: 3px; background: var(--pos-accent-soft); color: var(--pos-accent); }
.qcc-lock-mark svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qcc-lock-mark--warn  { background: var(--pos-warn-soft); color: var(--pos-warn); }
.qcc-lock-mark--ended { background: var(--pos-surface-3); color: var(--pos-text-2); }
.qcc-lock-title { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.25; color: var(--pos-text); }
.qcc-lock-lede { margin: 0; max-width: 36ch; font-size: 13px; line-height: 1.5; color: var(--pos-text-2); text-wrap: pretty; }
.qcc-lock-who { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 9px 12px; border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg); background: var(--pos-bg-2); }
.qcc-lock-who .qcc-idcell-text small { font-family: var(--pos-mono); font-size: 11.5px; direction: ltr; unicode-bidi: plaintext; text-align: start; }
.qcc-lock-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.qcc-lock-form > .qcc-btn { width: 100%; margin-block-start: 4px; }
.qcc-lock-msg { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--pos-danger-hi); text-wrap: pretty; }
.qcc-lock-msg svg { width: 15px; height: 15px; flex: none; margin-block-start: 1px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qcc-lock-msg--warn { color: var(--pos-warn); }
.qcc-lock-or { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pos-text-3); }
.qcc-lock-or::before, .qcc-lock-or::after { content: ""; flex: 1; height: 1px; background: var(--pos-line); }
.qcc-lock-alt { align-self: center; }
.qcc-lock-foot { display: flex; justify-content: center; gap: 18px; padding-block-start: 12px; border-top: 1px solid var(--pos-line); }
.qcc-lock-foot .qcc-linkbtn { color: var(--pos-text-2); font-weight: 600; }
.qcc-lock-foot .qcc-linkbtn:hover { color: var(--pos-text); }
.qcc-lock-count { font-family: var(--pos-mono); font-size: 44px; font-weight: 600; line-height: 1; text-align: center; direction: ltr; color: var(--pos-warn); font-variant-numeric: tabular-nums; }
/* the one question — someone else's PIN / account, or unsaved tabs before a sign-out. It REPLACES the form while it is up. */
.qcc-lock-ask { display: flex; flex-direction: column; gap: 12px; padding: 13px 14px; border-radius: var(--qcc-r-lg); background: var(--pos-warn-soft); border: 1px solid color-mix(in oklab, var(--pos-warn) 45%, transparent); }
.qcc-lock-ask p { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--pos-text); text-wrap: pretty; }
.qcc-lock-ask-acts { display: flex; gap: 8px; }
.qcc-lock-ask-acts .qcc-btn { flex: 1 1 0; min-width: 0; }
.qcc-lock-acts { display: flex; gap: 8px; margin-block-start: 4px; }
.qcc-lock-acts .qcc-btn { flex: 1 1 0; min-width: 0; }
/* a third-party sign-in mark inside a button (the ERP's own microsoft-5.svg) */
.qcc-btn-logo { width: 16px; height: 16px; flex: none; display: block; }

/* ---- 69 · PIN field — ONE real input (inputmode=numeric, maxlength 6, autocomplete=off, dir=ltr) laid over six cells.
        Typing, paste and the OS keyboard all go to the input; the cells only SHOW the count. Always LTR, in every UI language.
        <div class="qcc-pin [--error|--busy]"><input class="qcc-pin-input" …><span class="qcc-pin-cell [is-filled|is-next]" aria-hidden="true"></span>×6</div> */
.qcc-pin { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; direction: ltr; }
.qcc-pin-input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; cursor: text; }
.qcc-pin-cell { height: 50px; display: grid; place-items: center; border: 1px solid var(--pos-line-strong); border-radius: var(--qcc-r-md); background: var(--pos-bg-2); transition: border-color 150ms ease, box-shadow 150ms ease; }
.qcc-pin-cell::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--pos-text); transform: scale(0); transition: transform 120ms ease; }
.qcc-pin-cell.is-filled::after { transform: scale(1); }
.qcc-pin:focus-within .qcc-pin-cell.is-next { border-color: var(--pos-accent-line); box-shadow: 0 0 0 3px var(--pos-accent-soft); }
.qcc-pin--error .qcc-pin-cell { border-color: var(--pos-danger); }
.qcc-pin--busy .qcc-pin-cell { opacity: .55; }
.qcc-pin--busy .qcc-pin-input { pointer-events: none; }
.qcc-pin--sm .qcc-pin-cell { height: 38px; }

/* ---- 70 · PIN pad — optional. Hidden where there is a keyboard; shown on a touch screen (pointer: coarse) or by --on.
        Keys write into the §69 input; the last row is [ Clear ] [ 0 ] [ ⌫ ]. Never the only way in. */
.qcc-pinpad { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; direction: ltr; }
@media (pointer: coarse) { .qcc-pinpad { display: grid; } }
.qcc-pinpad--on { display: grid; }
.qcc-pinpad-key { height: 44px; display: grid; place-items: center; border: 1px solid var(--pos-line); border-radius: var(--qcc-r-md); background: var(--pos-surface-2); color: var(--pos-text); font: inherit; font-family: var(--pos-mono); font-size: 19px; font-weight: 600; cursor: pointer; transition: background 150ms ease; }
.qcc-pinpad-key:hover { background: var(--pos-surface-3); }
.qcc-pinpad-key:active { background: var(--pos-accent-soft); }
.qcc-pinpad-key:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--pos-accent-soft); border-color: var(--pos-accent-line); }
.qcc-pinpad-key--quiet { background: transparent; border-color: transparent; color: var(--pos-text-2); font-family: inherit; font-size: 12.5px; font-weight: 700; }
.qcc-pinpad-key svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---- 71 · Busy button — the request is out. The label stays (no "Checking…" word); a small ring leads it; clicks are ignored.
        <button class="qcc-btn qcc-btn--primary is-busy" aria-busy="true"> */
.qcc-btn.is-busy { pointer-events: none; }
.qcc-btn.is-busy::before { content: ""; width: 13px; height: 13px; flex: none; border-radius: 999px; border: 2px solid currentColor; border-inline-end-color: transparent; animation: qcc-spin 800ms linear infinite; }
@keyframes qcc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .qcc-btn.is-busy::before { animation-duration: 2400ms; } }

/* ---- 72 · The lock settings in Users & Access — a card under the identity card of a person's detail.
        OWN row: PIN (•••••• or Not set) + Set a PIN | Edit · Remove, and "Lock the screen after" (1·2·5·10·15·30 minutes).
        SOMEONE ELSE's row, access manager: PIN + Clear only (never digits) + the read-only note. No minutes row.
        <dl class="qcc-lockprefs"><dt>PIN</dt><dd><span class="qcc-pindots">••••••</span></dd><div class="qcc-lockprefs-acts">…</div> …</dl>
        <form class="qcc-pinform">password · PIN · confirm · .qcc-pinform-foot</form>  ← opens IN the card, under its row */
.qcc-lockprefs { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; gap: 12px 22px; align-items: center; margin: 0; }
.qcc-lockprefs dt { font-size: 12px; font-weight: 700; color: var(--pos-text-3); }
.qcc-lockprefs dd { margin: 0; min-width: 0; font-size: 13.5px; color: var(--pos-text); }
.qcc-lockprefs .qcc-select { width: auto; min-width: 150px; height: 34px; }
.qcc-lockprefs-acts { display: flex; justify-content: flex-end; gap: 6px; }
.qcc-lockprefs-none { color: var(--pos-text-3); }
.qcc-pindots { display: inline-block; direction: ltr; font-family: var(--pos-mono); letter-spacing: .28em; color: var(--pos-text-2); }
.qcc-pinform { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 0; padding: 14px; border: 1px solid var(--pos-line); border-radius: var(--qcc-r-lg); background: var(--pos-bg-2); }
.qcc-pinform-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.qcc-pinform-foot .qcc-lock-msg { margin-inline-end: auto; }


/* ============================================================================
   v0.11 ADDITIONS (2026-09-27) — THE CASH ACCOUNT FOLLOWS THE BRANCH
   Brief 2026-09-26-DESIGN_BRIEF_cash-account-by-branch.md · drop-008. Additive, −0.
   ============================================================================ */

/* ---- 73 · The cash row with a choice. Line 1 of Receipt/Payment keeps its locked row (grey, server-owned amount);
        only the Account cell becomes a control when the user has MORE THAN ONE cash account to choose from.
        One choice = today's .qcc-cell--locked (padlock), unchanged. Company with no Cash Accounts = today's row, unchanged.
        <td class="qcc-cashcell"><select class="qcc-cell qcc-cell--cash" aria-label="Cash Account">
             <optgroup label="{branch}"><option>1812 · {cash account name}</option>…</optgroup></select>
          <svg class="qcc-cashcell-chev">chevron-down</svg></td>
        Branch change → the face re-selects and adds .is-followed for 900 ms (no sentence; aria-live on the cell). -- */
.qcc-cashcell { position: relative; }
tr.qcc-docgrid-row--locked select.qcc-cell--cash {
  appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-size: 13.5px;
  color: var(--pos-text); background: var(--pos-bg-2); box-shadow: inset 0 0 0 1px var(--pos-line-strong);
  padding-inline-end: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
tr.qcc-docgrid-row--locked select.qcc-cell--cash:hover { box-shadow: inset 0 0 0 1px var(--pos-accent-line); }
tr.qcc-docgrid-row--locked select.qcc-cell--cash:focus { box-shadow: inset 0 0 0 1.5px var(--pos-accent); }
.qcc-cashcell-chev { position: absolute; inset-inline-end: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; color: var(--pos-text-3); pointer-events: none; }
.qcc-cell.is-followed { animation: qcc-followed 900ms ease-out 1; }
@keyframes qcc-followed { 0%, 35% { background-color: var(--pos-accent-soft); box-shadow: inset 0 0 0 1.5px var(--pos-accent-line); } 100% { } }
@media (prefers-reduced-motion: reduce) { .qcc-cell.is-followed { animation: none; } }
/* refusal on the cash row: the locked cell keeps its place, reads empty, carries the danger underline + the engine's sentence */
td.qcc-cell--invalid .qcc-cell--locked { box-shadow: inset 0 -2px 0 0 var(--pos-danger); color: var(--pos-text-3); }
.qcc-cell-msg .qcc-linkbtn { font-size: 11.5px; margin-inline-start: 6px; }

/* ---- 74 · Cash Accounts list (ادارة → Cash Accounts). The §10 table + §30 empty state; rows open the edit form.
        Inactive rows stay in the list (a cash account with postings is never deleted), quiet. -------------- */
.qcc-table tr.qcc-tr--inactive td { color: var(--pos-text-3); }
.qcc-table tr.qcc-tr--inactive .qcc-code { color: var(--pos-text-3); }
.qcc-table .qcc-td--acts { text-align: end; white-space: nowrap; width: 1%; }
.qcc-rowacts { display: inline-flex; align-items: center; gap: 6px; }
.qcc-table td.qcc-td--cur { font-family: var(--pos-mono); font-size: 12.5px; color: var(--pos-text-2); }

/* ---- 75 · Cash account form — one card, formgrid, the Active tick. GL Account select lists ONLY the 181x leaves;
        181 is the <optgroup label>, never an <option>. -------------------------------------------------- */
.qcc-formcard { max-width: 820px; }
.qcc-check { display: inline-flex; align-items: center; gap: 9px; min-height: 38px; font-size: 13.5px; color: var(--pos-text); cursor: pointer; }
.qcc-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--pos-accent); }
.qcc-formcard-foot { display: flex; align-items: center; gap: 10px; padding-block-start: 14px; margin-block-start: 16px; border-top: 1px solid var(--pos-line); }
.qcc-formcard-foot .qcc-spacer { flex: 1; }


/* ============================================================================
   v0.12 ADDITIONS (2026-09-27) — BANK ACCOUNTS JOIN THE CASH ROW
   Brief 2026-09-27-DESIGN_BRIEF_bank-accounts-in-the-cash-row.md · drop-009. One declared change (§18, DQ-177/203); rest additive.
   ============================================================================ */

/* ---- 76 · Left-to-right data inside any direction — account numbers, IBAN, SWIFT/BIC. Mono, isolated, never mirrored.
        In a table: <td><span class="qcc-ltr">0012-448190</span></td>. In a form: <input class="qcc-input qcc-input--ltr" dir="ltr">.
        The §73 cash select needs nothing new: <optgroup label="Cash Accounts"> then <optgroup label="Bank Accounts">. ---------- */
.qcc-ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--pos-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.qcc-input--ltr { direction: ltr; font-family: var(--pos-mono); font-size: 13px; letter-spacing: .02em; }
[dir="rtl"] .qcc-input--ltr { text-align: right; }
