/* workspace.css - v4.1: panel layout engine, Review workspace, accessibility.
 *
 * Everything here is built on the SAME six design tokens index.html already
 * defines (--blue, --surface, --white, --border, --dark, --grey), so all four
 * themes work without a single theme-specific rule in this file. The one
 * addition is the project swatch set, which needs its own hues.
 *
 * Loaded AFTER the inline <style> block, so where a selector ties with an
 * existing one, this file wins - which is how the Professional theme retunes
 * the hardcoded dark colours without touching index.html.
 */

:root {
  /* Project swatches. Every one carries WHITE text on a 10.5px badge, so each
     is tuned to clear 4.5:1 against white (measured: 5.3, 5.3, 7.3, 5.3, 6.4).
     Lighter, prettier hues were tried first and failed at 4.1:1 - if you retune
     these, re-measure rather than eyeballing them. */
  --proj-blue:   #2F6BC4;
  --proj-teal:   #16786A;
  --proj-violet: #61479E;
  --proj-amber:  #96610C;
  --proj-slate:  #55606F;
  --red:         #C0392B;
  --panel-gap:   20px;

  /* Ink that sits on a saturated accent fill (the blue header, primary buttons,
     toasts). It is ALWAYS white, in every theme. */
  --on-accent:   #FFFFFF;

  /* Accent used as TEXT on a page surface. --blue is a FILL colour: at #0052CC
     it is dark enough to disappear against a dark background (measured 1.66:1
     on the dark theme's own --blue-light). index.html already worked around
     this ad hoc with `[data-theme="dark"] h2 { color: #4DA6FF }`; this token
     makes the distinction explicit so new components get it right by default.
     Use --blue to fill a shape, --accent-ink to write on one. */
  --accent-ink:  #0052CC;

  /* Same fill-versus-ink split for the danger colour: --red fills a button,
     --danger-ink writes the overdue count on a card. */
  --danger-ink:  #C0392B;

  /* And for success. index.html's --green (#008A4B) is a FILL: as text it
     measures 4.43:1 on white and 3.24:1 on the dark surface, both under AA.
     NOTE: that affects pre-existing rules too (.status-pass, .stage-final,
     #toast.success read --green as text). Not retuned here - out of scope for
     v5 - but worth a pass of its own. New v5 text uses this token. */
  --success-ink: #00663C;

  /* v6 P7 closes the pass the note above asked for. --green as text was not the
     only offender and was not even the worst: --orange measured 3.21:1 on white
     and 2.95:1 on .badge-recent's own tint, and it was never written down
     because only the green case had been noticed.

     Measured for this token: 6.79:1 on white, 6.25:1 on #FFF4E5, 5.98:1 on
     #E6F4EA. Use --orange to fill a shape, --warn-ink to write on one. */
  --warn-ink:    #8A4B08;

  /* ── Scale (v6 P7) ────────────────────────────────────────────────────────
     Spacing and type as tokens so density and rhythm are tuned in one place.
     Introduced alongside the existing hardcoded values rather than replacing
     all ~200 of them at once: there is no frontend test runner, so a blanket
     sweep of every padding in the app would be an unverifiable diff. New and
     retuned rules use these. */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px;
  --fs-lg: 16px; --fs-xl: 20px;   --fs-2xl: 26px;

  --lh-tight: 1.25; --lh-normal: 1.5;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
}

[data-theme="dark"] {
  --accent-ink: #7FB4FF;
  --danger-ink: #FF9A90;
  --success-ink: #6BD79B;
  /* 6.66:1 on the #2A2A2A panel, 8.89:1 on the #0F0F0F surface. */
  --warn-ink:   #E8A33D;
}

/* .rev-badge is declared in index.html, so it is retuned here. Components
   defined in THIS file use --accent-ink directly at their declaration - putting
   them in an override block here would lose to their own later definition. */
.rev-badge { color: var(--accent-ink); }

/* ── Contrast fix: white ink on accent fills ──────────────────────────────
 * index.html uses var(--white) for two different jobs: "the colour white" (ink
 * on the blue header) and "the panel surface" (which becomes #2A2A2A in dark
 * themes). The second meaning wins in dark mode, so the header title rendered
 * #2A2A2A on #0052CC - a contrast ratio of 2.1:1, well under the 4.5:1 WCAG AA
 * minimum, and effectively unreadable.
 *
 * Rather than retype a token used in a hundred places, the four spots that mean
 * "white ink" are pinned here. Each sits on a saturated fill in every theme, so
 * white is always the correct answer. */
header,
header h1,
header p,
.theme-toggle,
.btn-primary,
#toast { color: var(--on-accent); }

/* The notification count sat at 4.45:1 on #E11 - just under AA at 11px. */
.bell-badge { background: #C62828; }

/* ══ Accessibility utilities ══════════════════════════════════════════════ */

/* Visible only to screen readers. Used to say "done" / "current step" in words,
   so workflow state is never conveyed by colour alone (WCAG 1.4.1). */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: the first thing a keyboard user reaches, so they can jump past the
   header and sidebar straight into the content. */
.skip-link {
  position: absolute;
  left: 8px; top: -60px;
  z-index: 400;
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

/* One consistent, high-contrast focus ring everywhere. :focus-visible keeps it
   off mouse clicks, so it helps keyboard users without nagging everyone else. */
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}
[data-theme="dark"] :focus-visible { outline-color: #7FB4FF; }
/* Measured on Professional: the ring around a primary button came out
   rgb(11,15,22) - near-black, on a blue button, on a dark page, i.e. invisible.
   `outline` with no colour inherits the element's own `color`, and Professional
   deliberately flips white-on-blue controls to dark ink for contrast, so the
   two rules met and the keyboard ring disappeared exactly where the fill is
   strongest. Naming the colour on the button itself is the fix; the ring is a
   property of the page, not of the text inside the control. */
.btn-primary:focus-visible,
.btn-danger:focus-visible { outline-color: var(--dark); }
[data-theme="dark"] .btn-primary:focus-visible,
[data-theme="dark"] .btn-danger:focus-visible { outline-color: #FFFFFF; }

/* Respect the OS "reduce motion" setting: no spinners, slides or transitions. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══ Panel layout engine ══════════════════════════════════════════════════ */

.panel-cols {
  display: grid;
  gap: var(--panel-gap);
  align-items: start;
  grid-template-columns: 1fr;
}
.panel-cols[data-columns="2"] { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); }

.panel-col { min-width: 0; display: flex; flex-direction: column; gap: var(--panel-gap); }
.panel { min-width: 0; }
.panel-hidden { display: none !important; }

/* Layout width variants. The sidebar is handled by the existing
   .sidebar-collapsed class, which the engine toggles. */
/* v6.17 (Task 1): no preset caps the content any more - the page fills the
   width beside the sidebar. Kept as rules so a stored preset still parses. */
.app-container[data-width="narrow"] .main-content { max-width: none; }
.app-container[data-width="normal"] .main-content { max-width: none; }
.app-container[data-width="wide"]   .main-content { max-width: none; }


/* The nav items became real <button>s in v4.1 so the keyboard can reach them.
   Strip the default button chrome so they look exactly as they did as <a>.
 *
 * The selector is deliberately `.nav-item` (0,1,0) and NOT `.sidebar .nav-item`
 * (0,2,0). At (0,2,0) this rule ties with `.nav-item.active` and
 * `.nav-item:hover` in index.html and, loading later, WINS - so `background:
 * none` silently erased the active and hover highlight in every theme. Keeping
 * it a single class lets those state rules outrank it, as they must. */
.nav-item {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
}

/* ══ Header select chrome (.scope-wrap) ════════════════════════════════════
   Built for the v6 P4 project filter, which v6.18 (item 13, Erfan 2026-09-16)
   removed from the header; the language wrap (#lang-select, styled with the
   dock below) still wears it. Styled to match .identity-wrap so the header
   reads as one row of controls. */

.scope-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 10px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 12px;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.scope-wrap:hover { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.5); }
.scope-wrap:focus-within { box-shadow: 0 0 0 3px rgba(255,255,255,.22); }
.scope-wrap[hidden] { display: none; }
.scope-wrap .scope-icon { color: #fff; opacity: .8; font-size: 13px; }

/* ══ Layout menu ══════════════════════════════════════════════════════════ */

/* The Layout control is a line-manager / COO / CQM feature. Engineers and
   seniors get the one standard arrangement, so the button is not merely
   disabled for them - it is not there. Hidden by DEFAULT and revealed by the
   role class, never shown-then-hidden: the capability-driven UI rule this
   edition already follows for .sp-pick, because the other order makes the
   control appear, then vanish, on every load. index.html sets .role-layout from
   canCustomiseLayout() in index.html, the single owner of the policy.

   ONLY `display` is carried on the role selector. Moving the whole block there
   would make it (0,2,1) and outrank `.layout-btn:hover` at (0,2,0), silently
   killing the hover state - the specificity trap this stylesheet has already
   been bitten by once, on .nav-item. */
.layout-btn {
  display: none; align-items: center; gap: 6px;
  height: 42px; padding: 0 12px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.30);
  color: #fff;
  border-radius: 12px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
body.role-layout .layout-btn { display: flex; }
.layout-btn:hover { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.5); }

/* v6.18 (item 2): fixed, not absolute - the header is sticky, so an absolute
   menu stayed where the page was when it opened and scrolled away with it.
   Same fix as .notif-dropdown in index.html. */
.layout-menu {
  position: fixed;
  top: 60px; right: 16px;
  width: 340px; max-width: calc(100vw - 32px);
  max-height: 74vh; overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  z-index: 210;
  display: none;
  padding: 6px;
}
.layout-menu.open { display: block; }

.layout-menu .lm-head {
  padding: 9px 10px 5px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--grey);
}
.layout-menu .lm-subhead {
  padding: 8px 10px 3px;
  font-size: 11px; font-weight: 700;
  color: var(--accent-ink);
}
.layout-menu .lm-sep { height: 1px; background: var(--border); margin: 6px 4px; }

.layout-menu .lm-row,
.layout-menu .lm-check {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none; border: none;
  border-radius: 8px;
  text-align: left;
  font-size: 13px; color: var(--dark);
  cursor: pointer;
  font-family: inherit;
}
.layout-menu .lm-row:hover,
.layout-menu .lm-check:hover { background: var(--blue-light); }
.layout-menu .lm-row.on { background: var(--blue-light); }
/* The tick and the glyph belong to the row's TITLE, so they align to the first
   text line rather than to the middle of a block whose height depends on how
   many lines the hint wrapped onto. Centred, "Workspace" put its three boxes
   beside the second line of its own description. flex-start plus a shared line
   height is what keeps every row's left edge on one axis. */
.layout-menu .lm-row,
.layout-menu .lm-check { align-items: flex-start; }
.layout-menu .lm-tick,
.layout-menu .lm-shape,
.layout-menu .lm-box { line-height: 18px; flex: none; }
.layout-menu .lm-tick { width: 14px; color: var(--accent-ink); font-weight: 900; }
.layout-menu .lm-shape { width: 34px; color: var(--grey); letter-spacing: -1px; font-size: 15px; }
/* An icon is a block; without this it sits on the text baseline and rides 3px
   low against the label it belongs to. */
.layout-menu .lm-shape svg { display: block; margin-top: 1px; }
.layout-menu .lm-text { display: flex; flex-direction: column; line-height: 18px; }
.layout-menu .lm-text small { color: var(--grey); font-size: 11px; margin-top: 1px; }
.layout-menu .lm-box { width: 16px; font-size: 14px; color: var(--accent-ink); }

/* ══ Review workspace ═════════════════════════════════════════════════════ */

.review-head {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap; margin-bottom: 12px;
}
/* v6.18 (item 19): the workspace uses the app's font like every other tab.
   The monospace on the project codes, the queue titles and the detail heading
   is gone - it read as a different product inside the same window. */
.review-head h2 { font-size: 18px; color: var(--accent-ink); }
.review-head .rh-hint { font-size: 12px; color: var(--grey); }
.review-head .rh-spacer { margin-left: auto; }

/* ── Portfolio cards ─────────────────────────────────────────────────── */

.pf-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.pf-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pf-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.pf-card.on {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-light) inset, 0 4px 14px rgba(0,0,0,.08);
}

.pf-head { display: flex; align-items: center; gap: 7px; }
.pf-swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--proj-slate); flex-shrink: 0; }
.pf-card[data-colour="blue"]   .pf-swatch { background: var(--proj-blue); }
.pf-card[data-colour="teal"]   .pf-swatch { background: var(--proj-teal); }
.pf-card[data-colour="violet"] .pf-swatch { background: var(--proj-violet); }
.pf-card[data-colour="amber"]  .pf-swatch { background: var(--proj-amber); }
.pf-card[data-colour="slate"]  .pf-swatch { background: var(--proj-slate); }

.pf-code {
  font-size: 12.5px; font-weight: 800; color: var(--dark);
  letter-spacing: -.2px;
}
.pf-name {
  font-size: 12px; color: var(--grey);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pf-stats { display: flex; gap: 14px; margin-top: 2px; }
.pf-stat { display: flex; flex-direction: column; }
.pf-stat strong { font-size: 17px; font-weight: 800; color: var(--dark); line-height: 1.1; }
.pf-stat small { font-size: 10.5px; color: var(--grey); margin-top: 2px; }
.pf-stat.s-await strong { color: var(--accent-ink); }
.pf-stat.s-over strong  { color: var(--danger-ink); }

.sc-good { background: #E6F4EA; color: #1B7F4D; }
.sc-warn { background: #FFF4E0; color: #A6631A; }
.sc-poor { background: #FFEDE0; color: #B4530F; }
.sc-bad  { background: #FDE7E4; color: #A32A1D; }
.sc-none { background: var(--surface); color: var(--grey); }
[data-theme="dark"] .sc-good { background: #123523; color: #57C98A; }
[data-theme="dark"] .sc-warn { background: #37290F; color: #E3B255; }
[data-theme="dark"] .sc-poor { background: #3A250F; color: #E39355; }
[data-theme="dark"] .sc-bad  { background: #3B1A16; color: #E8776A; }

/* ── Queue ───────────────────────────────────────────────────────────── */

.queue-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.queue-top {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.queue-top h3 { font-size: 14.5px; color: var(--dark); font-weight: 700; }
.queue-top .qt-hint { font-size: 12px; color: var(--grey); }
.queue-badge {
  margin-left: auto;
  background: var(--blue-light); color: var(--accent-ink);
  font-size: 12px; font-weight: 800;
  padding: 3px 11px; border-radius: 11px;
}
.queue-controls {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.queue-controls input[type="search"] {
  flex: 1; min-width: 180px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--dark);
  font-size: 13px; font-family: inherit;
}
.queue-controls label { font-size: 12px; color: var(--grey); font-weight: 600; }
.queue-controls select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--dark);
  font-size: 13px; font-family: inherit;
  cursor: pointer;
}

/* v6.24.2 (item 11): the period row and, when rows awaiting the viewer fall
   outside it, the line that says how many, with Show All. The line's words
   are --dark; its warning is the left rule in --warn-ink, so no new contrast
   pair is introduced in any theme. */
.queue-period, .queue-range { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-period { padding: 10px 16px 0; }
.queue-period label { font-size: 12px; color: var(--grey); font-weight: 600; }
.queue-range[hidden], .queue-outside[hidden] { display: none; }
.queue-range .date-wrap { width: 140px; }
.queue-outside {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 16px 0; padding: 8px 12px;
  border-left: 3px solid var(--warn-ink); border-radius: 6px;
  background: var(--surface); color: var(--dark);
  font-size: 13px; font-weight: 600;
}

/* The Admin panel's From and To fields (v6.24.2, item 6). */
.admin-tool .date-wrap { width: 140px; }

.queue-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; }
.chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--white);
  color: var(--grey);
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.queue-list { max-height: 620px; overflow-y: auto; }
.queue-empty { padding: 34px 16px; text-align: center; color: var(--grey); font-size: 13px; }
.queue-empty.error { color: var(--danger-ink); }

.queue-group {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--grey);
  position: sticky; top: 0; z-index: 1;
}
.queue-group .qg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grey); }
.queue-group.u-overdue .qg-dot { background: var(--red); }
.queue-group.u-week    .qg-dot { background: var(--orange); }
.queue-group.u-later   .qg-dot { background: var(--green); }
.queue-group .qg-count { margin-left: auto; color: var(--grey); }

.q-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-left: 3px solid transparent;
}
.q-row:hover { background: var(--blue-light); }
.q-row.on { background: var(--blue-light); border-left-color: var(--blue); }

.q-left { display: flex; flex-direction: column; gap: 3px; width: 96px; flex-shrink: 0; }
.q-proj {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 800;
  padding: 2px 7px; border-radius: 6px;
  background: var(--proj-slate); color: #fff;
  white-space: nowrap;
}
[data-colour="blue"].q-proj   { background: var(--proj-blue); }
[data-colour="teal"].q-proj   { background: var(--proj-teal); }
[data-colour="violet"].q-proj { background: var(--proj-violet); }
[data-colour="amber"].q-proj  { background: var(--proj-amber); }
[data-colour="slate"].q-proj  { background: var(--proj-slate); }
.q-disc { font-size: 10.5px; font-weight: 700; color: var(--grey); letter-spacing: .4px; }

.q-mid { flex: 1; min-width: 0; }
.q-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.q-title strong {
  font-size: 13px; color: var(--dark); font-weight: 700;
}
.q-stale, .q-nocheck {
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 6px;
  white-space: nowrap;
}
.q-stale   { background: #FFF1DC; color: #A6631A; }
.q-nocheck { background: var(--surface); color: var(--grey); border: 1px dashed var(--border); }
[data-theme="dark"] .q-stale { background: #3A2A0F; color: #E3B255; }
.q-sub {
  font-size: 11px; color: var(--grey); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.q-right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.q-due {
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 9px;
  white-space: nowrap;
}
.q-due.due-overdue { background: #FDE7E4; color: #A32A1D; }
.q-due.due-soon    { background: #FFF4E0; color: #A6631A; }
.q-due.due-ok      { background: var(--surface); color: var(--grey); }
.q-due.due-none    { background: var(--surface); color: var(--grey); }
[data-theme="dark"] .q-due.due-overdue { background: #3B1A16; color: #E8776A; }
[data-theme="dark"] .q-due.due-soon    { background: #37290F; color: #E3B255; }
.q-score { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 7px; min-width: 32px; text-align: center; }

/* ── Detail panel ────────────────────────────────────────────────────── */

.review-detail {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  position: sticky; top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.rd-empty { padding: 40px 10px; text-align: center; color: var(--grey); font-size: 13px; }

.rd-crumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.rd-projname { font-size: 12px; color: var(--grey); }

.rd-head { display: flex; gap: 13px; align-items: flex-start; }
.rd-ring {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
  border: 2px solid currentColor;
}
.rd-head h3 {
  font-size: 15px; color: var(--dark); font-weight: 800;
  word-break: break-all;
}
.rd-sub { font-size: 11.5px; color: var(--grey); margin-top: 4px; word-break: break-all; }
.rd-meta { font-size: 11px; color: var(--grey); margin-top: 4px; }

.rd-warn {
  margin-top: 14px;
  padding: 11px 13px;
  background: #FFF4E0;
  border: 1px solid #E8C27A;
  border-radius: 10px;
  font-size: 12.5px; color: #7A4B12;
  line-height: 1.5;
}
[data-theme="dark"] .rd-warn { background: #33260E; border-color: #6B5322; color: #E8C98A; }

.rd-deadline {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
}
.rd-dl-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--grey);
}
.rd-dl-date { font-size: 15px; font-weight: 700; color: var(--dark); margin-top: 4px; }
.rd-dl-chip {
  position: absolute; top: 12px; right: 14px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 9px;
}
.rd-dl-chip.due-overdue { background: #FDE7E4; color: #A32A1D; }
.rd-dl-chip.due-soon    { background: #FFF4E0; color: #A6631A; }
.rd-dl-chip.due-ok, .rd-dl-chip.due-none { background: var(--white); color: var(--grey); }

.rd-stepper-wrap { margin-top: 18px; }
.rd-steps-title {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--grey); margin-bottom: 12px;
}
.rd-steps { list-style: none; display: flex; margin: 0; padding: 0; }
.rd-step {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.rd-step:not(:last-child)::after {
  content: ""; position: absolute;
  top: 13px; left: 50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.rd-step.done:not(:last-child)::after { background: var(--blue); }
/* A not-started step used to be white-on-border (1.34:1 - the step number was
   invisible). It is now an outlined dot with secondary-text ink, which reads in
   all four themes and also distinguishes "not started" by SHAPE, not only by
   colour. */
.rd-dot {
  width: 27px; height: 27px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--grey);
  position: relative; z-index: 1;
}
.rd-step.done .rd-dot { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.rd-step.current .rd-dot {
  background: var(--white); color: var(--accent-ink);
  border: 2px solid var(--accent-ink);
  box-shadow: 0 0 0 4px var(--blue-light);
}
.rd-step-label { font-size: 9.5px; font-weight: 700; color: var(--grey); line-height: 1.25; }
.rd-step.done .rd-step-label, .rd-step.current .rd-step-label { color: var(--dark); }
/* The viewer's own rung. Underlined rather than recoloured, so it is
   distinguished by SHAPE as well - and the note beneath the ladder says it in
   words, which is the part a screen reader reads. */
.rd-step.is-mine .rd-step-label { text-decoration: underline; text-underline-offset: 2px; }

.rd-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-rd {
  flex: 1;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s;
}
.btn-rd.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-rd.primary:hover:not(:disabled) { background: #0041A8; }
.btn-rd.secondary { background: var(--white); color: var(--dark); }
.btn-rd.secondary:hover:not(:disabled) { border-color: var(--accent-ink); color: var(--accent-ink); }
.btn-rd:disabled { opacity: .6; cursor: default; }

.rd-note { font-size: 11px; color: var(--grey); margin-top: 10px; line-height: 1.55; }
.rd-link {
  display: block; width: 100%;
  margin-top: 14px; padding-top: 12px;
  border: none; border-top: 1px solid var(--border);
  background: none;
  color: var(--accent-ink);
  font-size: 12.5px; font-weight: 700;
  text-align: left; cursor: pointer; font-family: inherit;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .panel-cols[data-columns="2"] { grid-template-columns: 1fr; }
  .review-detail { position: static; max-height: none; }
}
@media (max-width: 680px) {
  .q-left { width: auto; }
  .q-sub { display: none; }
  .layout-btn span:not(.lb-icon) { display: none; }
  .layout-menu { right: 8px; top: 54px; }
}

/* ── v5: SharePoint picker ────────────────────────────────────────────
   Uses the ink tokens rather than the fill tokens for text: --blue as text on a
   dark surface measured 1.66-2.64:1. See the fill-versus-ink note in CLAUDE.md. */

/* The call to action that replaced the upload zone. Base rules only - keep them
   less specific than any :hover/.active state defined in index.html. */
/* .sp-pick sets display:flex, which outranks the UA rule for [hidden], so the
   attribute needs saying explicitly or a hidden panel still renders. */
.sp-pick[hidden], .sp-notice[hidden] { display: none !important; }

.sp-pick {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; margin-bottom: 32px;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--white);
  color: var(--accent-ink);
  transition: border-color .2s, background .2s;
}
.sp-pick:hover { border-color: var(--blue); background: var(--blue-light); }
.sp-pick svg { flex: none; }
.sp-pick-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sp-pick-text strong { font-size: 14px; color: var(--dark); }
.sp-pick-text span { font-size: 12px; color: var(--grey); line-height: 1.45; }
.sp-pick .btn { flex: none; }

@media (max-width: 680px) {
  .sp-pick { flex-wrap: wrap; }
  .sp-pick .btn { width: 100%; }
}

/* Picker dialog (reuses .modal-overlay from index.html) */
.picker-dialog {
  background: var(--white); border-radius: 16px;
  width: 720px; max-width: calc(100vw - 32px);
  height: 78vh; max-height: 78vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.picker-head h2 { margin: 0; font-size: 17px; color: var(--dark); flex: 1 1 auto; }
/* v6.17 (Task 5): the Back control on the registration form shares the corner
   closer's chrome and sits before the title. */
.reg-back { font-size: 30px; margin-right: 6px; }
.picker-close {
  border: none; background: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--grey);
  padding: 0 4px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.picker-close:hover { color: var(--dark); }
/* v6.18 (item 16): one close icon everywhere. The picker, the register form,
   the analysis panel and the journey modal all draw AventaIcons' "close" - the
   static markup carries <span data-icon="close"> for paint() to fill at boot,
   the modal builds its own at open. pointer-events: none so a click lands on
   the BUTTON: register.js matches e.target.id ("reg-close"), and an SVG path
   has no id. */
.picker-close [data-icon], .panel-close-btn [data-icon] { display: flex; pointer-events: none; }
.picker-close .ic, .panel-close-btn .ic { width: 18px; height: 18px; }

/* --bg was never a defined token anywhere, so every `background: var(--bg)`
   below rendered TRANSPARENT and the recessed surface each of them describes
   was never drawn. #reg-revision is the clearest case: its own comment says the
   parsed revision "has to LOOK unavailable, or the first thing an author does
   is try to correct it" - and it looked exactly like the editable fields next
   to it. --surface is the page base and --white the panel, so --surface on a
   panel is the inset the authors meant, in all three themes. */
.picker-crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  font-size: 12px; background: var(--surface);
}
.crumb {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 12px; color: var(--accent-ink); padding: 3px 6px; border-radius: 6px;
}
.crumb:hover { background: var(--blue-light); }
.crumb.current { color: var(--grey); font-weight: 700; cursor: default; }
.crumb.current:hover { background: none; }
.crumb-sep { color: var(--border); padding: 0 1px; }

/* Filter + sort for the open folder. --white is the panel surface token, so the
   inputs stay readable in every theme rather than being literally white. */
.picker-tools {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
}
.picker-filter, .picker-sort {
  font-family: inherit; font-size: 12px; color: var(--dark);
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
}
.picker-filter { flex: 1; min-width: 0; }
.picker-sort { flex: none; cursor: pointer; }
.picker-filter:focus-visible, .picker-sort:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 1px;
}

/* The list scrolls; the dialog never does, so the breadcrumb stays reachable. */
.picker-list { flex: 1; overflow-y: auto; padding: 6px 0; }
.picker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 20px; font-size: 13px; color: var(--dark);
  border-bottom: 1px solid transparent;
}
.picker-row.is-folder, .picker-row[tabindex] { cursor: pointer; }
.picker-row.is-folder:hover, .picker-row[tabindex]:hover { background: var(--blue-light); }
.picker-row:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.picker-row.disabled { color: var(--grey); opacity: .6; }
.picker-row.done .picker-meta { color: var(--success-ink); font-weight: 600; }
/* v6.24.2 (decision 20): sent for senior review, so locked to its registrant. */
.picker-row.locked .picker-meta { color: var(--danger-ink); font-weight: 600; }
.picker-icon { flex: none; width: 20px; height: 20px; color: var(--accent-ink); }
.picker-icon svg { width: 20px; height: 20px; display: block; }
.picker-row.disabled .picker-icon { color: var(--grey); }
.picker-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.picker-size { color: var(--grey); font-size: 11px; margin-left: 8px; }
.picker-meta { flex: none; font-size: 11.5px; color: var(--grey); }
.picker-row.is-folder .picker-meta { font-size: 18px; }

.picker-empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px 20px; color: var(--grey); font-size: 13px; text-align: center;
}

.picker-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--grey);
}

/* Library search results inside the picker (decision D9: navigate-only). */
.picker-search-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.picker-search-count { color: var(--grey); font-size: 12px; min-width: 0; }
.picker-search-note {
  color: var(--grey); font-size: 11.5px; padding: 10px 12px 4px;
}
/* v6.12: a registered document whose FILE changed after its review. */
.picker-updated-tag {
  color: var(--warn-ink); font-size: 11px; font-weight: 600;
  margin-right: 8px; white-space: nowrap;
}

/* Where a registered document lives, under its name in both tables. */
.row-path {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; margin-top: 3px; min-width: 0;
}
.row-path-text {
  color: var(--grey); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
  /* Was a fixed 420px, which is what pushed the File Name column to 518px and
     the whole table into a horizontal scroll - so the Analyze buttons, the one
     thing every row is there for, sat off-screen. It fills whatever the bounded
     cell below leaves it instead. The full path is still on the title tooltip
     and on the SharePoint link beside it. */
  max-width: 100%;
}

/* The name cell is bounded so the table fits its container. It is the only
   column whose content has no natural limit - a SharePoint path is as long as
   the project's folder tree happens to be.

   Addressed by CLASS, not by position: the Dashboard table opens with a
   checkbox column and All Documents does not, so `td:first-child` capped the
   name in one table and the checkbox in the other, and the Dashboard stayed
   423px too wide while looking fixed. */
.col-name { max-width: 320px; }
.col-name > div { min-width: 0; max-width: 320px; }
.col-name strong,
.col-name > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The actions are why the row exists, so they are pinned to the right edge of
   the scroller and are reachable WITHOUT scrolling at any width, in any of the
   three languages. Capping the name column is what usually makes the table fit;
   this is what makes "usually" not matter. Italian headers run ~25% longer than
   English ones, which is enough on its own to push a table that fits in English
   over the edge. */
.col-actions {
  position: sticky; right: 0;
  white-space: nowrap;
  background: var(--white);
}
thead .col-actions { background: var(--surface); z-index: 2; }
/* A left edge, so a row scrolling underneath does not appear to merge with the
   buttons floating over it. */
.col-actions::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}
/* 16px tall was a 16px click target. The padding costs no layout - the row is
   already three lines high - and takes it to a size a hand can hit. */
.row-path-link {
  color: var(--accent-ink); text-decoration: none; font-weight: 600; flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 2px; min-height: 22px;
}
.row-path-link:hover { text-decoration: underline; }

/* Shown in place of the picker when the backend has no library to browse - local
   or Blob development, or SharePoint not configured yet. */
.sp-notice {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px; margin-bottom: 32px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent-ink);
  border-radius: 12px; background: var(--white);
}
.sp-notice strong { font-size: 13px; color: var(--dark); }
.sp-notice span { font-size: 12px; color: var(--grey); line-height: 1.5; }
.sp-notice code {
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  padding: 0 4px; font-size: 11.5px; color: var(--accent-ink);
}

/* ── Registration form (v6 P3) ─────────────────────────────────────────────
   Step 2 of sending a document for review. Reuses .modal-overlay, .picker-head
   and .picker-foot from the picker rather than restating them - it is the same
   dialog shape, one step later. Height is content-driven, unlike .picker-dialog:
   a fixed 78vh made a form of eight fields float in a mostly empty box. */
.reg-dialog {
  background: var(--white); border-radius: 16px;
  width: 720px; max-width: calc(100vw - 32px);
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.reg-body { padding: 18px 20px; overflow-y: auto; }

/* The document the form is about, stated once at the top: the picker has closed
   by now, so this is the only confirmation of what is being registered. */
.reg-file {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; margin-bottom: 16px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
}
.reg-file strong { font-size: 13px; color: var(--dark); word-break: break-all; }
.reg-file span { font-size: 11px; color: var(--grey); word-break: break-all; }

/* align-items: end, not the default stretch. The three fields on the identity
   row have labels of different heights - "Document Number (from Project Document
   Hub)" wraps to two lines while "Revision" does not - so stretching them to
   equal height left their INPUTS at three different offsets. Aligning the
   bottom edge lines the inputs up, which is the thing the eye actually reads. */
.reg-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
/* The per-field explanation under each people control. Tighter than the
   standalone .reg-hint below, which separates whole sections. */
.reg-body .fld > .reg-hint { margin: 6px 0 0; }
/* align-items: end alone was not enough, and only a browser could show why: a
   native <input type="date"> has a TALLER intrinsic content box than a text
   input at the same font size and padding - measured 19px against 17px, so
   39px against 37px overall - and aligning the bottoms then left its top 2px
   proud of the Document Number beside it. Pinned to one height rather than
   chasing ::-webkit-datetime-edit's metrics, which are engine-specific.
   Scoped to .reg-row, so the selects below (39px, each alone on its own row,
   where the difference cannot show) are deliberately left as they are. */
.reg-body .reg-row input[type="text"],
.reg-body .reg-row input[type="number"],
.reg-body .reg-row input[type="date"] { height: 37px; }
.reg-body .fld { flex: 1; min-width: 200px; margin-bottom: 14px; }
.reg-body .fld-narrow { flex: 0 0 110px; min-width: 110px; }
/* v6.19: the revision is two controls - the stage menu and the number - so its
   slot is wider than the one select was, and the pair shares the row's height. */
.reg-body .fld-revision { flex: 0 0 220px; min-width: 220px; }
.rev-pair { display: flex; gap: 6px; align-items: stretch; }
.rev-pair .am-trigger { flex: 1 1 auto; min-width: 0; }
.rev-pair input[type="number"] { flex: 0 0 64px; width: 64px; }
.rev-pair.field-missing .am-trigger, .rev-pair.field-missing input {
  border-color: #C00 !important; box-shadow: 0 0 0 3px rgba(204,0,0,.12);
}
.reg-body label {
  display: block; font-size: 12px; font-weight: 600; color: var(--grey);
  margin-bottom: 4px;
}
.reg-body .fld-hint { color: var(--grey); font-weight: 400; }
.reg-body input[type="text"], .reg-body input[type="number"], .reg-body input[type="date"], .reg-body select {
  width: 100%; padding: 9px 11px; font-family: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--dark);
}
.reg-body input:focus, .reg-body select:focus { outline: none; border-color: var(--blue); }
.reg-body input.field-missing {
  border-color: #C00 !important; box-shadow: 0 0 0 3px rgba(204,0,0,.12);
}
.reg-hint { font-size: 12px; color: var(--grey); margin: -6px 0 16px; line-height: 1.5; }
/* The legend, radio and chip-strip rules went with the "Who is involved" legend
   and the PM viewer/approver pair (v6.14); nothing has rendered them since, and
   the people picker draws its own chips (.pp-chips). Removed in the v6.18 cleanup. */
.reg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--dark);
}
.reg-chip-x {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 15px; line-height: 1; color: var(--grey); padding: 0 5px;
}
.reg-chip-x:hover { color: var(--danger-ink); }

/* v6.17 (Task 6): the shared people picker (js/peoplepicker.js). The list is
   INLINE on purpose - the registration dialog scrolls inside a fixed height,
   and a floating list would be clipped at its bottom edge exactly where the
   long lists are. `.pp-field > input.pp-input` matches the specificity of the
   .reg-body input rule above and is later in the file, so it wins the padding
   the clear button needs. */
.pp { position: relative; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pp-chips[hidden] { display: none; }
.pp-field { position: relative; display: flex; align-items: center; }
.pp-field > input.pp-input {
  width: 100%; padding: 9px 34px 9px 11px; font-family: inherit; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--dark);
}
.pp-field > input.pp-input:focus { outline: none; border-color: var(--blue); }
.pp-clear {
  position: absolute; right: 6px; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 18px; line-height: 1; color: var(--grey); padding: 2px 6px;
}
.pp-clear:hover { color: var(--danger-ink); }
.pp-list {
  list-style: none; margin: 4px 0 0; padding: 4px; max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; background: var(--white);
}
.pp-list[hidden] { display: none; }
.pp-list li[role="option"] { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--dark); }
.pp-list li[role="option"]:hover, .pp-list li.active { background: var(--surface); }
.pp-empty { padding: 7px 10px; font-size: 12px; color: var(--grey); font-style: italic; }

/* One heading per revision inside the family journey. Deliberately quieter than
   .rd-steps-title, which titles the whole panel: the revision codes are
   sub-headings under it, not five competing panel titles.
   v6.18 (item 17): each revision is a native <details class="rh-rev-block">,
   closed by default, and the heading is its <summary>. The UA marker is
   replaced by a chevron that turns when the block opens, so it matches the
   rest of the app; the summary keeps its disclosure semantics for AT. The
   divider moved from the heading to the block, because :first-of-type on a
   summary matches every summary (each is the first in its own details). */
.rh-rev-block { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.rh-rev-block:first-of-type { border-top: none; padding-top: 0; margin-top: 6px; }
.rh-rev {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 4px; padding: 3px 4px; border-radius: 6px;
  cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none;
}
.rh-rev::-webkit-details-marker { display: none; }
/* v6.24.12: the arrow sits on the first line, beside the revision code: centred
   in the row it dropped to the middle once a phone wrapped the date and the
   file name over three lines. An empty box's baseline is its bottom edge, so
   its middle sits about half an x-height above the text's baseline. */
.rh-rev::before {
  content: ""; flex: none; align-self: baseline;
  width: 7px; height: 7px; margin-right: 2px;
  border-right: 2px solid var(--grey); border-bottom: 2px solid var(--grey);
  transform: rotate(-45deg); transition: transform .15s;
}
.rh-rev-block[open] > .rh-rev::before { transform: rotate(45deg); }
.rh-rev:hover { background: var(--surface); }
.rh-rev:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.rh-rev strong { font-size: 13px; color: var(--dark); }
.rh-rev-step { font-size: 11px; color: var(--grey); font-variant-numeric: tabular-nums; }

.reg-actions { display: flex; gap: 8px; flex: none; }
/* v6.24.1: the reason dialog register.js asks with (window.prompt does not work
   in the Teams tab). Above every .modal-overlay (2000) and the confirmation
   dialog (2050), under the toast (2100), which still says a reason is too short. */
#reason-modal { z-index: 2060; }
/* v6.26: the same question dialog asks before the ADC mailbox sends; a Send
   is no deletion, so it loses the warning sign and the red button. */
#confirm-modal.is-send .modal-header .icon { display: none; }
#confirm-modal.is-send .btn-confirm { background: var(--blue); color: var(--on-accent); }
#confirm-modal.is-send .btn-confirm:hover { background: #0041A8; }
#reason-modal .reason-message { margin: 0 0 14px; color: var(--dark); }
/* The file the reason is recorded on, above the sentence: a long name with no
   space breaks where it must rather than widening the dialog. */
#reason-modal .reason-file { margin: 0 0 6px; font-weight: 700; color: var(--dark); overflow-wrap: anywhere; }

/* ── The 85 submit gate (P3) ─────────────────────────────────────────────── */
/* The gate state is stated BEFORE the button is pressed, so a refusal is never
   a surprise. .is-blocked uses --danger-ink, the semantic INK token: --red is a
   fill colour and measured 1.66-2.64:1 as text on a dark surface. */
.rd-submit { margin-top: 16px; }
.rd-gate-state { font-size: 12px; color: var(--grey); margin: 0 0 10px; }
.rd-gate-state.is-blocked { color: var(--danger-ink); font-weight: 600; }
.rd-gate-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--dark); margin-bottom: 6px;
}
/* v6.26: every textarea grows downwards only, never wider than its column
   and never taller than 40% of the window: the Aventa Sign message could be
   dragged sideways out of its column and the window (Erfan). One rule for
   all of them; a textarea's own rule sets its look, never its resize. */
textarea { resize: vertical; max-width: 100%; min-height: 2.6em; max-height: 40vh; }
.rd-gate-reason {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--dark);
  font: inherit; font-size: 13px;
}
/* v6.24.1: whose place the COO signs in, above the plain Sign button. */
.rd-in-place select {
  width: 100%; box-sizing: border-box; margin-bottom: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--dark);
  font: inherit; font-size: 13px;
}
.rd-gate-hint { font-size: 11px; color: var(--grey); margin: 6px 0 10px; }
/* v6.27.3: the mark beside a name the send must carry (the senior reviewer
   and the Discipline Leader). Ink, not the fill red: it is text. */
.rd-req { color: var(--danger-ink); font-weight: 700; }
.rd-submit .btn-rd { width: 100%; }
/* The postponed date field and the reason label beneath it (browser review:
   the label touched the field). */
.rd-submit .date-wrap { margin-bottom: 12px; }

/* ── A reviewer's return (P3) ────────────────────────────────────────────── */
/* The author has to be able to read WHY, so it is a block of prose and not a
   badge. --danger-ink again, never --red as text. */
.rd-returned {
  margin-top: 12px; padding: 8px 10px;
  border-left: 3px solid var(--danger-ink); border-radius: 0 8px 8px 0;
  background: var(--surface); color: var(--danger-ink);
  font-size: 12px; line-height: 1.55;
}

/* A mail control. An <a> wearing the button style, so it needs the box
   model a button has by default. */
.rd-mail { display: inline-block; margin-top: 12px; text-decoration: none; }
/* Several mail actions can be offered at once (explain a return, then the
   chase), so they sit side by side rather than stacking. */
.rd-mail + .rd-mail { margin-left: 8px; }
/* v6.26 (Erfan): Send over Preview, two real buttons wherever the app
   offers a reminder it can send itself: the filled Send and a quieter
   Preview centred beneath it. They wear the pair's own classes on every
   surface (the tracker, the bell, Team details), never the surface's link
   style, which made them read as two stacked links. */
/* Never wider than what holds it: in a narrow table cell (Team details
   below 1100px) the words wrap inside the button, they do not leave it. */
.mail-pair { display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  vertical-align: top; max-width: 100%; }
.rd-stepper-wrap .mail-pair { margin-top: 12px; }
.rd-mail + .mail-pair, .mail-pair + .rd-mail { margin-left: 8px; }
.notif-item .mail-pair { margin-top: 8px; }
.mail-btn {
  box-sizing: border-box; display: inline-block; margin: 0; border-radius: 8px;
  font-family: inherit; font-weight: 600; line-height: 1.3; text-align: center;
  text-decoration: none; max-width: 100%; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.mail-btn.mail-send {
  padding: 7px 14px; font-size: 13px;
  background: var(--blue); border: 1px solid var(--blue); color: var(--on-accent);
}
.mail-btn.mail-send:hover:not(:disabled) { background: #0041A8; border-color: #0041A8; }
/* Team details' Follow-up column is about 119px of room at 1280px: a size
   down, so the words stay on one line there (measured). */
.td-table .mail-btn.mail-send { padding: 6px 8px; font-size: 12px; }
.mail-btn.mail-preview {
  padding: 4px 12px; font-size: 12px;
  background: var(--white); border: 1px solid var(--border); color: var(--accent-ink);
}
.mail-btn.mail-preview:hover { border-color: var(--accent-ink); }
/* v6.27: the pair that says where each goes ("from the ADC mailbox", "from my
   own Outlook"): side by side, one height, wrapping only where the line is
   too narrow (a phone, the bell's list). */
.mail-pair.mail-pair-row { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.mail-btn.mail-own {
  padding: 7px 14px; font-size: 13px;
  background: var(--white); border: 1px solid var(--border); color: var(--accent-ink);
}
.mail-btn.mail-own:hover { border-color: var(--accent-ink); }
.mail-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.mail-send:disabled { opacity: .7; cursor: progress; }
/* v6.24: the e-mail to the client is prepared in a native <dialog>, opened
   modal on document.body (the top layer, above the family modal), listing the
   copy as removable chips before the person's own mail opens. */
.rd-dialog {
  /* margin: auto is the UA's own centring, restated: the page's reset
     removes it and the dialog sat in the top-left corner (browser check). */
  margin: auto; width: min(480px, calc(100vw - 32px)); box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  background: var(--white); color: var(--dark);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
}
.rd-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.rd-dialog-title { margin: 0 0 6px; font-size: 15px; }
.rd-dialog-actions { display: flex; justify-content: flex-end; align-items: flex-start; gap: 8px; margin-top: 16px; }
.rd-dialog-actions .btn-rd { flex: 0 0 auto; text-decoration: none; }
.cl-mail { display: inline-block; margin-top: 12px; text-decoration: none; }


/* ── The history timeline (P5) ───────────────────────────────────────────── */
/* A vertical rail with a dot per event. The rail is drawn on the LIST, not on
   each item, so the last dot has no tail hanging below it - which is what a
   per-item ::after border-left does and why it is not used here.
   Every entry states what happened in words; the dot carries no meaning of its
   own and is aria-hidden, so nothing here is readable by colour alone. */
.rh-wrap { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.rh-list {
  list-style: none; margin: 0; padding: 0 0 0 18px;
  border-left: 2px solid var(--border);
  /* Scrolls in its own box: a document under review for months must not push
     the modal's Close button off the screen. */
  max-height: 260px; overflow-y: auto;
}
.rh-item { position: relative; padding: 0 0 14px 0; }
.rh-item:last-child { padding-bottom: 0; }
.rh-dot {
  position: absolute; left: -25px; top: 4px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--border);
}
/* The three events a reader scans for. --danger-ink and --accent-ink are the
   INK tokens: --red and --blue are fills and measure 1.66-2.64:1 as text. */
.rh-returned .rh-dot { border-color: var(--danger-ink); }
.rh-idc_done .rh-dot, .rh-signed .rh-dot { background: var(--accent-ink); border-color: var(--accent-ink); }
.rh-line { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--dark); }
.rh-detail { margin: 3px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--grey); }
.rh-returned .rh-detail { color: var(--danger-ink); }

/* ── The client-comment checklist (P5) ───────────────────────────────────── */
/* Every state is stated in WORDS: the progress line reads "4 of 11 done", a
   ticked item names who ticked it and when, and the bar below the words is
   aria-hidden decoration. Nothing here is readable by colour or shape alone. */
.cl-wrap { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.cl-progress { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--dark); }
.cl-bar {
  height: 5px; border-radius: 3px; background: var(--border); overflow: hidden;
}
.cl-bar-fill { height: 100%; background: var(--accent-ink); transition: width .25s; }
.cl-source { margin: 8px 0 0; font-size: 11px; color: var(--grey); }
/* v6.19: the one-act "Remove all comments" (checklist.js clearBlock), right-
   aligned under the source line so it reads as a tool of the list, not an item.
   Danger ink on hover only: the confirmation is what protects the list. */
.cl-tools { display: flex; justify-content: flex-end; margin: 8px 0 0; }
/* .btn-rd is flex: 1 for the tracker's action pair; here it would stretch the
   one button across the whole list. */
.btn-rd.cl-clear { flex: 0 0 auto; }
.btn-rd.cl-clear:hover:not(:disabled) { border-color: var(--danger-ink); color: var(--danger-ink); }
.cl-list {
  list-style: none; margin: 10px 0 0; padding: 0;
  /* Its own scroll box: a sheet with forty comments must not push the modal's
     Close button off the screen. Same reason .rh-list has one. */
  max-height: 260px; overflow-y: auto;
}
.cl-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.cl-item:last-child { border-bottom: 0; }
.cl-box { margin-top: 2px; width: 15px; height: 15px; flex: 0 0 auto; cursor: pointer; }
.cl-box:disabled { cursor: default; }
.cl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-ref { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--grey); text-transform: uppercase; }
/* The client's own words, which can be a paragraph and can contain anything.
   Wrapped rather than clipped, so nothing is hidden from the engineer. */
.cl-text { font-size: 12.5px; line-height: 1.5; color: var(--dark); overflow-wrap: anywhere; }
.cl-item.done .cl-text { color: var(--grey); text-decoration: line-through; }
.cl-meta { font-size: 11px; color: var(--grey); }
.cl-verified { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--success-ink); }
.cl-attach { margin-top: 12px; }
/* The native file input is replaced by its own <label>, which is a real control
   for the keyboard and for a screen reader - unlike a div with a click handler.
   Hidden with clip rather than display:none, which would take it out of the tab
   order and off the accessibility tree along with it. */
.cl-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cl-attach label { display: inline-block; cursor: pointer; }
.cl-file:focus-visible + label { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* ── Icons (v6 P7) ──────────────────────────────────────────────────────────
   One set, stroked, inheriting currentColor, so an icon takes the colour of the
   text beside it in every theme. Sized in px by icons.js rather than in em: the
   glyphs are drawn on a 24x24 grid and a font-size they were not drawn for
   makes the stroke weight drift against the nav rail.

   Kept deliberately LOW specificity (0,1,0). workspace.css loads after the
   inline <style>, so a heavier selector here would outrank the :hover and
   .active rules defined there - which is exactly how a base rule once erased
   the nav highlight in every theme. */
.ic { flex: none; vertical-align: -0.18em; }

/* Gap only when the icon actually leads words. An icon-only button must not
   carry a trailing margin that pushes it off centre. */
.ic:first-child:not(:only-child) { margin-right: 6px; }

.ic-lead { display: inline-flex; align-items: center; margin-right: 6px; vertical-align: -0.18em; }
.ic-wrap { display: inline-flex; align-items: center; }

/* ── Avatars (v6 P7) ────────────────────────────────────────────────────────
   Initials on a fill hashed from the e-mail. Every fill in avatar.js carries
   white ink at 6.17:1 or better, so the ink is fixed white here rather than
   inherited - inheriting would let a theme's text colour land on a saturated
   background it was never measured against. */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; flex: none;
  color: #fff; font-weight: 700; line-height: 1;
  /* Prefixed for WebKit: Teams on macOS and iOS is Safari, not the Edge
     WebView2 that Windows uses. */
  letter-spacing: .02em; -webkit-user-select: none; user-select: none;
  margin-right: 8px; vertical-align: middle;
}

/* No name to show. Neutral rather than a random colour, because a colour here
   would imply an identity the record does not actually have. */
.avatar-empty {
  background: var(--border, #D8DEE8);
  color: var(--text-muted, #6B7280);
}

/* ── Teammates (P7b) ─────────────────────────────────────────────────────── */
/* The author's collaborators. Shaped like .reg-chip because it is the same
   thing on a different surface - the registration form names them, this edits
   the list afterwards - and a teammate should not look like a new kind of
   object halfway through a document's life. Separated from the ladder by a
   rule, because it answers a different question: who is on this, not where
   it is. */
.rd-mates { margin-top: var(--sp-4, 16px); padding-top: var(--sp-3, 12px);
            border-top: 1px solid var(--border); }
.rd-mate-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.rd-mate {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 3px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--dark);
}
.rd-mate-name { padding-left: 2px; }
.rd-mate-x {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 15px; line-height: 1; color: var(--grey); padding: 0 5px;
}
.rd-mate-x:hover { color: var(--danger-ink); }
/* v6.24 (Erfan, D20): the undo of a wrong sign-off pick, an icon button at
   the end of a matrix line or an "Also signs" chip. Its name is in words on
   aria-label and title; the icon inherits the text colour like every icon. */
.rd-undo {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; color: var(--grey);
  padding: 2px 5px; margin-left: auto; border-radius: 6px;
}
.rd-mate .rd-undo { margin-left: 0; }
.rd-undo:hover { color: var(--accent-ink); background: var(--surface); }
.rd-undo:disabled { cursor: default; opacity: .5; }
/* Changing the approvers after sending (D6): folded away until asked for, so
   the signing step reads as the matrix first. */
.rd-update { margin-top: 12px; }
/* list-item keeps the disclosure triangle, which .rd-gate-label's block
   display would otherwise remove: the control must look openable. */
.rd-update > summary { display: list-item; cursor: pointer; margin-bottom: 6px; }

/* v6.17: the journey panel's per-person lists (seniors, Discipline Leaders,
   the signature matrix) with each person's state in WORDS, and the people
   pickers mounted inside the panel. */
.rd-people { margin-top: 14px; }
.rd-person-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rd-person { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dark); }
.rd-person-state { color: var(--grey); font-size: 11px; }
/* v6.27: the place a person holds in the sign-off (Prepared by, ...). */
.rd-person-place { color: var(--grey); font-size: 12px; }
/* v6.27: step 7's two buttons, one size, one above the other. */
.rd-dispatch .btn-rd { display: block; margin-top: 12px; }
.rd-dispatch .rd-gate-hint { margin: 8px 0 0; }
.rd-person.ok .rd-person-state { color: var(--success-ink); font-weight: 600; }
.rd-pick { margin: 6px 0 4px; }
.rd-approvers { display: grid; grid-template-columns: 1fr; gap: 2px; }
.rh-rev-file { display: block; font-size: 11px; color: var(--grey); }

/* ── Comments typed by the team (2026-08-13) ─────────────────────────────── */
/* A hand-written comment sits in the same list as a parsed one, so the row
   keeps its shape and only gains a remove control on the right. The × is the
   same weight as the teammate chip's, because it is the same act. */
.cl-item { position: relative; }
.cl-remove {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 15px; line-height: 1; color: var(--grey);
  padding: 0 4px; align-self: flex-start; flex: none;
}
.cl-remove:hover { color: var(--danger-ink); }
.cl-add { margin-top: var(--sp-3, 12px); }
.cl-add-row { display: flex; gap: 8px; align-items: stretch; }
.cl-add-input {
  flex: 1 1 auto; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--dark); font: inherit; font-size: 13px;
}
.cl-add-input:focus { outline: none; border-color: var(--blue); }
/* flex: none so the button keeps its label at every width - the input is what
   gives way, which is the one of the two that can. */
.cl-add-btn { flex: none; }

/* ── Queue views: awaiting me / signed by me (2026-08-13) ────────────────── */
.queue-views { display: flex; gap: 4px; margin: 0 0 10px; }
.queue-views .qv {
  flex: 1 1 auto;
  padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: none; color: var(--grey);
  font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.queue-views .qv:hover { color: var(--dark); }
.queue-views .qv.on {
  background: var(--blue); border-color: var(--blue); color: var(--on-accent);
}

/* ── Header at narrow widths (2026-08-13) ────────────────────────────────── */
/* Measured at 820px - a realistic width for a Teams side panel - the header
   overflowed by 49px and pushed the theme toggle clean off the right edge, on
   every section. It is one nowrap flex row holding five controls whose widths
   are fixed, so the last one simply left the page.

   Wrapping rather than hiding: every control up there is reachable nowhere else
   (the project scope, the Layout menu, the bell, the theme). A second line is
   an inch of height; a control that does not exist is a feature that does not
   exist at that width. */
header { flex-wrap: wrap; row-gap: 10px; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }

@media (max-width: 900px) {
  /* The title gives way first - it names the app the user already opened, and
     it is the only thing up there that is not a control. */
  header h1 { font-size: 16px; }
  /* The identity pill is the widest control and the only one that can lose
     width without losing meaning: the avatar and the role chip stay, the name
     truncates. */
  .identity-wrap { min-width: 0; }
}

/* ── Admin panel ──────────────────────────────────────────────────────────
   The banner is the mode indicator: its presence means company-wide data.
   It carries WORDS as well as colour, per the rule the lifecycle stepper
   follows - status is never signalled by colour alone.

   It reuses --warn-ink rather than defining an admin colour of its own. That
   token is already #8A4B08 light and #E8A33D dark, and P7 already MEASURED it
   at 6.25:1 against #FFF4E5 - which is the very tint this banner wanted. A new
   token would be the same two values re-typed, unmeasured, in a third place.
   --admin-ink is an ALIAS to --warn-ink (not a second colour) so the tab and
   count rules below can name what they are for without retyping the value.
   Only the tint is new, and it is defined for all three themes rather than
   inside a media block alone, because a colour defined once in a media block
   renders wrong in the other two. */
:root { --admin-bg: #FFF4E5; --admin-ink: var(--warn-ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --admin-bg: #2A2118; }
}
:root[data-theme="dark"] { --admin-bg: #2A2118; }
[data-palette="professional"] { --admin-bg: #26211A; }

.admin-banner {
  display: flex; gap: .5rem; align-items: baseline;
  padding: .6rem .9rem; margin-bottom: 1rem;
  border-left: 4px solid var(--warn-ink);
  background: var(--admin-bg); color: var(--warn-ink);
  border-radius: var(--radius-md, 6px); font-size: var(--fs-sm, .9rem);
}
/* .main-content is the app's <main> wrapper - there is no .content, and a
   selector matching nothing is how --bg shipped invisible for months. */
body.admin-mode .main-content { border-left: 4px solid var(--warn-ink); }

/* The header chip: the mode signal that is visible from every section, not
   only from inside the Admin one. Reuses the same measured tint and ink as the
   banner rather than introducing a third pair. */
.admin-chip {
  padding: .2rem .55rem; border-radius: 999px; cursor: pointer;
  background: var(--admin-bg); color: var(--admin-ink);
  border: 1px solid var(--admin-ink);
  font-size: var(--fs-xs, .72rem); font-weight: 700; letter-spacing: .05em;
  line-height: 1.4;
}

.admin-tabs { display: flex; gap: .25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.admin-filters { display: flex; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.admin-filters input {
  padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: inherit; min-width: 12rem;
}
.admin-tab {
  padding: .45rem .9rem; border: 1px solid var(--border);
  background: none; color: inherit; border-radius: 6px; cursor: pointer;
}
.admin-tab.active { background: var(--admin-bg); color: var(--admin-ink);
                    border-color: var(--admin-ink); font-weight: 600; }

.admin-row { border: 1px solid var(--border); border-radius: 6px;
             padding: .6rem .8rem; margin-bottom: .5rem; }
.admin-row .count { font-weight: 700; color: var(--admin-ink);
                    font-variant-numeric: tabular-nums; }
.admin-row pre { overflow-x: auto; font-size: .8rem; white-space: pre-wrap; }
.muted { color: var(--grey); }

.uptime-bars { display: flex; gap: 2px; align-items: flex-end; }
.uptime-bars i { width: 6px; height: 26px; border-radius: 2px; display: block; }
.uptime-bars i.operational { background: var(--green); }
.uptime-bars i.degraded    { background: var(--orange); }
.uptime-bars i.down        { background: var(--red); }
.uptime-bars i.nodata      { background: var(--border); }

/* ══ v6.17 Task 18: navigation modes - the dock ═══════════════════════════ */

/* The language select moved into the header (Settings is the admin's only
   now). Since v6.18 it is hidden behind its menu trigger (.scope-wrap
   .am-trigger below) and is only the value holder, so it has no chrome here. */
#nav-mode-btn svg { width: 18px; height: 18px; }

/* Hidden until the preference says dock. .dock sets display, so the UA
   [hidden] rule has to be restated - the .sp-pick lesson.
   v6.18 (item 20): glassier - 30% white over a stronger blur, which is the
   glass Erfan asked for; the dark themes drop proportionally. The
   reduced-transparency and high-contrast answers below stay solid. */
.dock {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 8px;
  max-width: calc(100vw - 24px); overflow-x: auto;
  border-radius: 22px;
  background: rgba(255, 255, 255, .30);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .6);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  z-index: 900;
}
.dock[hidden] { display: none; }
[data-theme="dark"] .dock {
  background: rgba(18, 28, 58, .40);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.dock-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 64px; padding: 8px 10px 6px;
  border: 0; border-radius: 14px; background: transparent;
  color: var(--accent-ink); font: inherit; font-size: 11px; line-height: 1.2;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background .18s, transform .18s;
}
.dock-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; opacity: .8; stroke-linecap: round; stroke-linejoin: round; }
.dock-item:hover { background: rgba(0, 82, 204, .10); transform: translateY(-2px); }
.dock-item.active { background: rgba(0, 82, 204, .16); font-weight: 600; }
.dock-item.active svg { opacity: 1; }
/* The active item is marked by its tint, its weight and aria-current, which
   says it in words. v6.18 (item 20): the dot beneath it is gone. */
.dock-item:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
[data-theme="dark"] .dock-item:hover { background: rgba(160, 212, 255, .14); }
[data-theme="dark"] .dock-item.active { background: rgba(160, 212, 255, .22); }
/* Same gates as the sidebar, same attribute. */
.dock-item[data-role="manager"] { display: none; }
body.role-manager .dock-item[data-role="manager"] { display: flex; }
.dock-item[data-role="admin"] { display: none; }
body.role-admin .dock-item[data-role="admin"] { display: flex; }
.dock-item[data-role="stats"] { display: none; }
body.role-stats .dock-item[data-role="stats"] { display: flex; }

body.nav-dock .sidebar { display: none; }
/* Room for the dock, so the last table row is never under it. */
body.nav-dock .main-content { padding-bottom: 112px; }

/* The date filter, moved here from the sidebar while the dock is on. The
   sidebar's Show All button carries inline width/margin for its column
   layout, which only !important can override in the row. */
.dock-filter-slot { display: flex; margin-bottom: 14px; }
.dock-filter-slot[hidden] { display: none; }
.dock-filter-slot .filter-box {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  margin-top: 0; padding: 10px 14px; width: 100%;
}
.dock-filter-slot .filter-box h3 { margin: 0; }
.dock-filter-slot .filter-box .date-wrap { width: 170px; }
.dock-filter-slot .filter-box .btn { margin-top: 0 !important; width: auto !important; }

/* v6.27.2: the Dashboard's period menu, in the sidebar's box (a column) and in
   the dock's slot (a row that wraps). A display rule outranks the UA [hidden]
   rule (the .sp-pick trap), so each hidden state is stated. */
.dash-period { margin-bottom: 10px; }
.dash-period .am-trigger { width: 100%; }
.dash-range { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.dash-range label { font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.dash-day[hidden], .dash-range[hidden] { display: none; }
.dock-filter-slot .filter-box .dash-period { margin: 0; }
.dock-filter-slot .filter-box .dash-period .am-trigger { width: auto; min-width: 170px; }
.dock-filter-slot .filter-box .dash-range { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.dock-filter-slot .filter-box .dash-range[hidden] { display: none; }

@media (prefers-reduced-transparency: reduce) {
  .dock { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--white); }
}
@media (prefers-contrast: more) {
  .dock { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--white); border-color: var(--dark); }
}
/* prefers-reduced-motion is zeroed globally above (every transition). */

/* ══ v6.17 Task 18: the calendar popover ═════════════════════════════════ */

/* The browser's own picker is never shown: no indicator, and nothing calls
   showPicker(). The field keeps its ISO value and the YYYY/MM/DD overlay. */
.date-input::-webkit-calendar-picker-indicator { display: none; }
/* v6.24.1: and its own text is transparent. Playwright's WebKit (Windows) has
   no date fields and draws the value as the field's text, under the overlay;
   iOS's value inherits the fill. The overlay is an element of its own. */
.date-input.has-overlay { cursor: pointer; -webkit-text-fill-color: transparent; }
/* v6.24.1: iOS draws a date field's value in ::-webkit-date-and-time-value,
   which the ::-webkit-datetime-edit rule in index.html never reaches, so the
   native "19 Oct 2026" sat under the overlay ("2026/19/0ct 2026" on Erfan's
   iPhone). A rule of its own: an engine that does not know a pseudo-element
   drops the whole selector list it sits in, the desktop's rule with it. */
.date-input.has-overlay::-webkit-date-and-time-value { opacity: 0; }

.cal-pop {
  position: fixed; z-index: 2300;      /* above the register modal and the toast */
  width: 296px; padding: 12px;
  background: var(--white); color: var(--dark);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
  font-size: 13px;
}
.cal-pop[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; text-transform: capitalize; }
/* v6.24.3 (item 20): the title opens the month grid, the month grid's title
   the year grid. */
.cal-zoom { border: 0; background: none; font: inherit; font-weight: 600; color: var(--dark);
  padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.cal-zoom:hover { background: rgba(0, 82, 204, .10); }
.cal-zoom:focus-visible, .cal-pick:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.cal-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.cal-pick { height: 44px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--dark);
  cursor: pointer; text-transform: capitalize; }
.cal-pick:hover { background: rgba(0, 82, 204, .10); }
.cal-pick.is-today { box-shadow: inset 0 0 0 1px var(--accent-ink); font-weight: 600; }
.cal-pick.is-selected { background: var(--blue); color: var(--on-accent); font-weight: 600; }
[data-theme="dark"] .cal-zoom:hover, [data-theme="dark"] .cal-pick:hover { background: rgba(160, 212, 255, .14); }
[data-palette="professional"] .cal-pick.is-selected { color: #0B0F16; }
.cal-nav {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--accent-ink); cursor: pointer;
}
.cal-nav svg { width: 18px; height: 18px; }
.cal-nav:hover { background: rgba(0, 82, 204, .10); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-weekdays span {
  text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--grey); padding: 4px 0;
}
.cal-day {
  height: 34px; border: 0; border-radius: 8px; background: transparent;
  color: var(--dark); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer;
}
.cal-day:hover { background: rgba(0, 82, 204, .10); }
.cal-day.is-outside { color: var(--grey); opacity: .7; }
/* v6.27: a day, month or year the field does not allow (its min or max). */
.cal-day.is-off, .cal-pick.is-off { color: var(--grey); opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.cal-day.is-off:hover, .cal-pick.is-off:hover { background: none; }
/* v6.27: the notice a person sees when their access is switched off. */
.access-off { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--danger-ink);
  border-left-width: 4px; border-radius: 10px; background: var(--white); color: var(--danger-ink);
  font-size: 14px; font-weight: 600; }
/* v6.27: the admin Users tab's access controls. */
.admin-access { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--accent-ink); font-weight: 600; }
.cal-day.is-selected { background: var(--blue); color: var(--on-accent); font-weight: 600; }
.cal-day:focus-visible, .cal-nav:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 1px; }
.cal-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.cal-foot .btn { background: var(--border); color: var(--dark); }
[data-theme="dark"] .cal-nav:hover, [data-theme="dark"] .cal-day:hover { background: rgba(160, 212, 255, .14); }

/* ══ v6.17 Task 19: the Admin panel an operator can read ══════════════════ */

.admin-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.admin-tool { display: flex; align-items: center; gap: .4rem; font-size: var(--fs-sm, .9rem); }
.admin-tool input[type="search"], .admin-tool select {
  padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: inherit; font: inherit; min-width: 15rem;
}
.admin-tool select { min-width: 0; }

.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm, .9rem); margin-bottom: 1rem; }
/* v6.24.1: whole words in every cell, and a table wider than the panel scrolls
   sideways in a box of its own (admin.js wraps every table in it), never the
   page; on a phone and on the desktop alike. break-word let every table fit by
   splitting its words: the Errors table's Where and Who read "tracker.j / s"
   and an address a letter or two a line. */
.admin-scroll { overflow-x: auto; }
.admin-table th, .admin-table td {
  padding: .45rem .6rem; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top;
}
.admin-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--grey); white-space: nowrap; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The header cell IS a button, so the keyboard can sort. */
.admin-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.admin-sort:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 3px; }
.admin-table th[aria-sort="ascending"] .admin-sort::after { content: " \25B4"; }
.admin-table th[aria-sort="descending"] .admin-sort::after { content: " \25BE"; }
.admin-table th[aria-sort="ascending"] .admin-sort,
.admin-table th[aria-sort="descending"] .admin-sort { color: var(--dark); }
.admin-table tbody tr:hover td { background: var(--surface); }
/* v6.24.1: a button in a cell keeps its word whole, on one line. The cells
   broke long words then, which split the narrow Sample column's "Show" into
   "Sho / w"; the Sample button is as wide for "Hide" as for "Show", so the
   toggle never moves the column ("Show" measured 56px in Chromium). */
.admin-table td button { white-space: nowrap; word-break: normal; }
.admin-sample-btn { min-width: 5em; justify-content: center; }
.admin-detail td { background: var(--surface); }
.admin-sample {
  display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0;
  font-size: .8rem; font-family: ui-monospace, Consolas, "Courier New", monospace;
}
.admin-sample dt { color: var(--grey); }
.admin-sample dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

.status-overall { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.status-overall h2 { margin: 0; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin: .75rem 0 1.25rem; }
.status-card {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: 8px;
  padding: .7rem .9rem; background: var(--white);
}
.status-card.operational { border-left-color: var(--green); }
.status-card.degraded    { border-left-color: var(--orange); }
.status-card.down        { border-left-color: var(--red); }
.status-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.status-ms { font-variant-numeric: tabular-nums; color: var(--grey); font-size: .8rem; margin-top: .3rem; }
/* State in words, ink tokens for text (never --green/--orange/--red as ink). */
.state-pill {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .1rem .5rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap;
}
.state-pill.operational { color: var(--success-ink); }
.state-pill.degraded    { color: var(--warn-ink); }
.state-pill.down        { color: var(--danger-ink); }
.state-pill.nodata      { color: var(--grey); }

.uptime-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: .5rem 0; font-size: .8rem; color: var(--grey); }
.uptime-key { display: inline-flex; align-items: center; gap: .35rem; }
.uptime-key i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.uptime-key i.operational { background: var(--green); }
.uptime-key i.degraded    { background: var(--orange); }
.uptime-key i.down        { background: var(--red); }
.uptime-key i.nodata      { background: var(--border); }

.admin-log {
  border: 1px solid var(--border); border-radius: 6px; padding: .6rem .8rem;
  background: var(--surface); color: var(--dark);
  font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .78rem; line-height: 1.45;
  max-height: 60vh; overflow: auto; white-space: pre;
}
/* Professional lifts --blue to #4A90E2, which reaches only 3.29:1 against white (measured), so the selected day takes the same dark ink its primary buttons do. */
[data-palette="professional"] .cal-day.is-selected { color: #0B0F16; }

/* ══ v6.18 (item 14): popover menus for every select[data-menu] ═══════════ */
/* menu.js hides the native <select> and draws a button in its place; the list
   is a fixed popover appended to <body>, so it escapes the overflow of any
   dialog it opens from (the register form scrolls inside a fixed height). The
   trigger takes its chrome from where it sits: transparent white in the blue
   header, an input-shaped box beside the inputs of the queue controls, the
   picker tools and the register form. */
.am-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--dark);
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; text-align: left; max-width: 100%;
  line-height: 1.2;
}
.am-trigger:hover { border-color: var(--accent-ink); }
.am-trigger:disabled { opacity: .6; cursor: default; }
.am-trigger .am-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-trigger .am-chev { display: inline-flex; flex: none; opacity: .75; }
/* In the header the trigger wears the transparent chrome the selects had. */
.identity-wrap .am-trigger, .scope-wrap .am-trigger {
  background: transparent; border: none; color: #fff; padding: 3px 0; border-radius: 6px;
}
.identity-wrap .am-trigger { font-size: 14.5px; max-width: 240px; }
.scope-wrap .am-trigger { font-size: 13px; }
.identity-wrap .am-trigger:hover, .scope-wrap .am-trigger:hover { border: none; }
.identity-wrap .am-trigger:focus-visible, .scope-wrap .am-trigger:focus-visible { outline-color: #fff; }
/* Beside the picker tools, the same quiet box as the filter field. */
.picker-tools .am-trigger { font-size: 12px; font-weight: 400; padding: 6px 10px; }
/* On the register form: the full width of its field, the inputs' height. A
   locked field (the name carries the code) looks unavailable, as the read-only
   box did, or the first thing an author does is try to correct it. */
.reg-body .am-trigger { width: 100%; font-weight: 400; padding: 9px 11px; }
.reg-body .reg-row .am-trigger { height: 37px; }
.reg-body .am-trigger:disabled { background: var(--surface); color: var(--grey); opacity: 1; }

.am-pop {
  position: fixed; z-index: 2300;
  max-height: min(60vh, 420px); overflow-y: auto;
  padding: 6px; border-radius: 12px;
  background: var(--white); color: var(--dark);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}
.am-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--dark); white-space: nowrap;
}
.am-opt .am-label { flex: 1 1 auto; min-width: 0; }
.am-opt.active, .am-opt:hover { background: var(--blue-light); }
.am-opt[aria-selected="true"] { font-weight: 700; }
.am-opt[aria-disabled="true"] { opacity: .5; cursor: default; }
.am-tick { display: inline-flex; color: var(--accent-ink); flex: none; }
/* The identity rows: the avatar, the name, the position beneath it. */
.am-person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.am-person .avatar { margin-right: 0; }
.am-person-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.am-person-name { font-weight: 600; }
.am-person-pos { font-size: 11px; font-weight: 400; color: var(--grey); }
@media (max-width: 900px) { .identity-wrap .am-trigger { max-width: 130px; } }
@media (max-width: 680px) { .identity-wrap .am-trigger { max-width: 120px; font-size: 12px; } }

/* ══ v6.23: the Help Center (replaces the v6.18 tutorial grid) ════════════ */
.help-hero { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.help-hero .section-header { margin-bottom: 0; }
.help-hero .section-header h2 { font-size: 24px; }
.help-lead { color: var(--grey); font-size: 14px; max-width: 760px; }
.help-search { position: relative; max-width: 560px; }
.help-search input { width: 100%; padding: 11px 14px 11px 40px; font-size: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--dark); }
.help-search input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.help-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--grey); }
.help-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; border-bottom: 1px solid var(--border); }
.help-tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 9px 12px; font-size: 14px; font-weight: 600; color: var(--grey); cursor: pointer; }
.help-tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--blue); }
.help-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.help-h3 { font-size: 16px; margin: 22px 0 10px; color: var(--dark); }
.help-h4 { font-size: 13px; margin: 16px 0 6px; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.help-card { display: flex; flex-direction: column; text-align: left; gap: 8px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--white); color: var(--dark); cursor: pointer; overflow: hidden; text-decoration: none; font: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.help-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .12); }
.help-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.help-card-feature { flex-direction: row; align-items: stretch; margin-bottom: 6px; width: 100%; }
.help-card-feature .help-thumb { flex: 0 0 min(46%, 520px); }
.help-card-feature .help-card-text { justify-content: center; padding: 18px 22px; }
.help-card-feature .help-card-title { font-size: 20px; }
.help-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #0e1452, #03051a); }
.help-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* v6.24: a third larger, the circle in proportion (56 to 75px, the triangle 16
   to 21px, Erfan). The triangle keeps its optical shift to the right, scaled
   with it: its box sits 3.6px right of the circle's centre, 2.7px at 56. */
.help-play { position: absolute; left: 50%; top: 50%; width: 75px; height: 75px; margin: -37.5px 0 0 -37.5px; border-radius: 50%; background: rgba(255, 255, 255, .94); color: #0e1452; display: flex; align-items: center; justify-content: center; padding: 0 0 0 5.4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.help-play svg { width: 21px; height: 21px; }
.help-len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .72); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.help-len:empty { display: none; }
/* v6.24: the tick centred exactly (measured 3.5px low): a flex box, not an icon
   sitting inline on the text baseline, and the check path's own box is centred
   half a grid unit high (y 11.5 of 24), which 1/48 of the icon takes back. */
.help-seen { position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: #0f7a3d; color: #fff; display: flex; align-items: center; justify-content: center; }
.help-seen svg { width: 16px; height: 16px; transform: translateY(calc(100% / 48)); }
.help-card-text { display: flex; flex-direction: column; gap: 4px; padding: 0 14px 14px; }
.help-eyebrow { font-size: 12px; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .05em; }
.help-card-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.help-card-desc { font-size: 13px; color: var(--grey); line-height: 1.45; }
.help-q { border: 1px solid var(--border); border-radius: 10px; background: var(--white); margin-bottom: 8px; }
.help-q summary { cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--dark); }
.help-q summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.help-a { padding: 0 14px 14px; color: var(--dark); font-size: 14px; line-height: 1.55; }
.help-watch { margin-top: 8px; background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; font: inherit; font-weight: 600; }
.help-empty { padding: 24px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.help-contact { margin-top: 26px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.help-contact h3 { margin-bottom: 6px; }
.help-contact p { margin-bottom: 12px; color: var(--grey); }
/* v6.24.1: Contact support is a link drawn by mailto.js, wearing the button. */
.help-contact a.btn { text-decoration: none; }
.help-player-dialog { width: min(1100px, 94vw); max-width: none; max-height: 94vh; overflow: auto; padding: 18px 20px; }
.help-player-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.help-player-head h2 { flex: 1; font-size: 18px; color: var(--dark); }
.help-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--surface); color: var(--dark); cursor: pointer; padding: 8px; }
.help-x:focus-visible { outline: 2px solid var(--blue); }
#help-player-video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; display: block; }
.help-player-desc { margin: 10px 0; color: var(--grey); }
.help-player-nav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
/* v6.24: Previous and Next are one button (.btn .btn-primary), one width in
   every language (the widest label measured 107.5px, Italian "Successivo"); at
   either end of the list one is disabled, which .btn alone does not show. */
.help-player-nav .btn { min-width: 112px; justify-content: center; }
.help-player-nav .btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.help-upnext h3 { font-size: 13px; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
#help-player-upnext { display: flex; flex-wrap: wrap; gap: 8px; }
.help-upnext-item { border: 1px solid var(--border); background: var(--white); color: var(--dark); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
@media (max-width: 820px) { .help-card-feature { flex-direction: column; } .help-card-feature .help-thumb { flex: none; } }
@media (prefers-reduced-motion: reduce) { .help-card { transition: none; } .help-card:hover { transform: none; } }

/* ══ v6.23: the offline and cannot-load screen, and the reconnect bar ═══════ */
.conn-screen { position: fixed; inset: 0; z-index: 3001; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(120% 90% at 50% 40%, #070b2e 0%, #03051a 70%); color: #fff; }
.conn-screen[hidden] { display: none; }
html:has(.conn-screen:not([hidden])) { background: #03051a; }
.conn-card { max-width: 520px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.conn-art { width: min(360px, 80vw); height: auto; margin-bottom: 8px; overflow: visible; }
.conn-left { animation: conn-l 2.6s ease-in-out infinite; }
.conn-right { animation: conn-r 2.6s ease-in-out infinite; }
.conn-spark { transform-origin: 120px 54px; transform-box: view-box; animation: conn-spark 2.6s ease-in-out infinite; }
.conn-card h1 { font-size: 26px; font-weight: 700; color: #fff !important; }
.conn-card p { color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.5; }
.conn-retry { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.conn-retry span[data-icon] { width: 18px; height: 18px; display: inline-flex; }
.conn-status { min-height: 1.5em; font-size: 13px; }
.conn-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 2500; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 16px; background: #8A4B08; color: #fff; font-size: 14px; }
.conn-bar[hidden] { display: none; }
.conn-bar button { border: 1px solid rgba(255, 255, 255, .7); background: transparent; color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
@keyframes conn-l { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }
@keyframes conn-r { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
@keyframes conn-spark { 0%, 40%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.1); } 60% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .conn-left, .conn-right, .conn-spark { animation: none; } }
/* ══ v6.23: the Statistics section ═══════════════════════════════════════
   Colour follows the MEASURE, in fixed order whatever the Team filter:
   Created is blue, Issued to client is orange. The journey is one hue,
   step 2 lightest to step 6 darkest in Light and flipped in the dark
   schemes, so a later step always stands out more. Validated with the
   dataviz skill's script (2026-10-12) against the surfaces the charts sit
   on: #FFFFFF Light; #1A1A2E for the cards in Dark AND Professional (the
   .settings-section override in index.html, which Professional reaches
   through its data-theme="dark", measured in the browser); and
   var(--white), #2A2A2A Dark and #171C26 Professional, under the tiles and
   the tooltip. Series pair: worst adjacent CVD Delta E 24.7 Light
   and 26.8 Dark and Professional, normal vision 33.6 and 31.8, mark
   contrast 4.42 and 3.20:1 on white, 4.69 and 4.39:1 on #1A1A2E and on
   #171C26, 3.94 and 3.70:1 on #2A2A2A. Ramp: monotone, adjacent OKLCH L at
   least 0.06 apart, one hue; its light end sits at 2.11:1 Light and 3.16:1
   on the dark cards (2.66:1 on #2A2A2A), so the bar totals, the tooltips
   and the table view carry every value.
   Professional carries data-theme="dark" and inherits the dark steps. One
   --st-oN per journey step with acts: test_every_acting_step_has_a_ramp_colour. */
:root {
  --st-s1: #2a78d6;   /* Created */
  --st-s2: #eb6834;   /* Issued to client */
  --st-o1: #86b6ef;   /* step 2, ADC check */
  --st-o2: #5598e7;   /* step 3, Senior review */
  --st-o3: #2a78d6;   /* step 4, IDC review */
  --st-o4: #1c5cab;   /* step 5, ADC check of the issue PDF */
  --st-o5: #104281;   /* step 6, Approval and sign-off */
  --st-o6: #0a2c57;   /* step 7, signed and not yet sent (D30, v6.24) */
}
[data-theme="dark"] {
  --st-s1: #3987e5;
  --st-s2: #d95926;
  --st-o1: #256abf;   /* one step lighter than the reference ramp: #184f95 is 1.77:1 on #2A2A2A */
  --st-o2: #3987e5;
  --st-o3: #6da7ec;
  --st-o4: #9ec5f4;
  --st-o5: #cde2fb;
  --st-o6: #eef5fe;
}
/* fill for SVG marks, background for the HTML swatches and in-cell bars.
   Text never wears these: values and labels stay in the ink tokens. */
.st-s1 { fill: var(--st-s1); background: var(--st-s1); }
.st-s2 { fill: var(--st-s2); background: var(--st-s2); }
.st-o1 { fill: var(--st-o1); background: var(--st-o1); }
.st-o2 { fill: var(--st-o2); background: var(--st-o2); }
.st-o3 { fill: var(--st-o3); background: var(--st-o3); }
.st-o4 { fill: var(--st-o4); background: var(--st-o4); }
.st-o5 { fill: var(--st-o5); background: var(--st-o5); }
.st-o6 { fill: var(--st-o6); background: var(--st-o6); }

.st-intro, .st-note { color: var(--grey); font-size: var(--fs-sm); line-height: 1.5; max-width: 90ch; }
.st-intro { margin: 0 0 var(--sp-4); }
.st-note { margin: var(--sp-4) 0 0; }
/* The tile definitions as text, beside the footnote: the tiles' title
   attribute reaches neither the keyboard, nor a touch screen, nor most
   screen readers. A native <details> opens with Enter, Space or a tap. */
.st-defs { margin: var(--sp-3) 0 0; max-width: 90ch; font-size: var(--fs-sm); color: var(--grey); }
.st-defs summary { cursor: pointer; width: fit-content; color: var(--accent-ink); font-weight: 600; }
.st-defs summary:hover { text-decoration: underline; }
.st-defs dl { margin: var(--sp-2) 0 0; }
.st-defs dt { color: var(--dark); font-weight: 600; margin-top: var(--sp-2); }
.st-defs dd { margin: 2px 0 0; line-height: 1.5; }
.st-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-4); }
.st-filters label { font-size: var(--fs-sm); font-weight: 600; color: var(--grey); }
/* v6.24.3 (item 6): the export sits at the end of the toolbar. */
.st-export { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.st-export[disabled] { opacity: .7; cursor: progress; }
/* A plain .btn takes the browser's own button fill, which WebKit draws light
   grey under white dark-theme ink (1.82:1): these carry the theme's surface. */
.st-toggle, .st-export, .td-all, .td-more { background: var(--surface); color: var(--dark); border: 1px solid var(--border); }
.st-busy { opacity: .6; }
.st-empty { color: var(--grey); font-size: var(--fs-md); padding: var(--sp-3) 0; }

.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); margin-bottom: var(--panel-gap); }
.st-tile { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 14px; min-width: 0; }
.st-tile-label { font-size: var(--fs-sm); color: var(--grey); }
/* Proportional figures on purpose: a big standalone number set in
   tabular-nums reads gappy (dataviz anti-patterns). */
.st-tile-value { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.25; color: var(--dark); margin: 4px 0 2px; }
.st-tile-cap { font-size: var(--fs-xs); color: var(--grey); }
.st-tile.is-alert .st-tile-value, .st-alert { color: var(--danger-ink); }
.st-alert { display: inline-flex; align-items: center; gap: 6px; }

.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--panel-gap); margin-bottom: var(--panel-gap); }
.st-grid > .st-card { margin-bottom: 0; }
@media (max-width: 1100px) { .st-grid { grid-template-columns: minmax(0, 1fr); } }
.st-card { min-width: 0; }
.st-card-head { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.st-card-titles { flex: 1; min-width: 0; }
.st-card .st-card-titles h3 { color: var(--accent-ink); margin: 0; padding: 0; border: 0; }
.st-sub { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--grey); }
.st-hint { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--grey); }
.st-toggle { flex: none; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: var(--sp-2); font-size: 12px; color: var(--dark); }
.st-legend[hidden] { display: none; }
.st-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.st-swatch { flex: none; }

.st-plot { position: relative; }
.st-plot:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; border-radius: 4px; }
.st-svg { display: block; overflow: visible; }
.st-grid-line { stroke: var(--border); stroke-width: 1; }
.st-base { stroke: var(--grey); stroke-width: 1; opacity: .6; }
.st-tick { fill: var(--grey); font-size: 11px; font-variant-numeric: tabular-nums; }
.st-row-label { fill: var(--dark); }
.is-focus .st-row-label { font-weight: 700; }
.st-row-on { fill: var(--surface); }
.st-val { fill: var(--dark); font-size: 11px; font-variant-numeric: tabular-nums; }
.st-hit { fill: transparent; }
.st-group { transition: opacity .15s; }
.is-reading .st-group:not(.on) { opacity: .45; }
.st-tip { position: absolute; z-index: 5; min-width: 150px; max-width: 280px; padding: 8px 10px;
  background: var(--white); color: var(--dark); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); pointer-events: none; }
.st-tip-head { font-weight: 600; margin-bottom: 4px; }
.st-tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.st-tip-row strong { font-variant-numeric: tabular-nums; }
.st-key { display: inline-block; flex: none; width: 12px; height: 2px; border-radius: 1px; }
.st-key-none { background: transparent; }

.st-table-wrap { margin-top: var(--sp-2); }
.st-table { font-size: 13px; }
.st-table th, .st-table td { padding: 8px 12px; }
/* apple-polish.css fades the last 24px of every .table-scroll to say there is
   more, and these tables end in a right-aligned figure: at 12px its digits sat
   half under the fade (Overdue now measured 2.5:1). The last column carries
   the fade's width on top of its padding, so it is clear of the fade whether
   the table fits or is scrolled to its end, and the hint stays. On the cell,
   not the wrapper: a scroll container's own end padding is not scrollable
   overflow in every engine. Pinned by
   test_the_last_column_of_a_statistics_table_clears_the_scroll_fade. */
.st-table th:last-child, .st-table td:last-child { padding-right: 36px; }
/* The figures stay on one line, the headers may wrap: nowrap on a long
   uppercase header made both trend tables wider than their card at 1280. */
.st-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.st-table td.num { white-space: nowrap; }
/* Row headers read as data, not as the uppercase column-header style. */
.st-table tbody th, .st-table tfoot th { color: var(--dark); font-size: 13px; font-weight: 500;
  text-transform: none; letter-spacing: 0; border-bottom: 0; border-top: 1px solid var(--border); }
.st-table tfoot th, .st-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.st-table tr.on th, .st-table tr.on td { background: var(--surface); }
.st-incell { display: inline-flex; align-items: center; gap: 8px; }
.st-inbar { display: inline-block; height: 6px; border-radius: 3px; }
.st-team-btn { font: inherit; color: var(--dark); background: none; border: 0; padding: 0;
  cursor: pointer; text-align: left; }
.st-team-btn:hover, .st-team-btn:focus-visible { text-decoration: underline; }
.st-team-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 3px; }
.st-team-btn[aria-pressed="true"] { font-weight: 700; color: var(--accent-ink); }

/* v6.24.2: the custom range beside the period, and the Details controls that
   open the Team details window (js/teamdetails.js). */
.st-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.st-range[hidden] { display: none; }
.st-range .date-wrap { width: 150px; }
.st-more { font: inherit; font-size: var(--fs-sm); color: var(--accent-ink); background: none; border: 0;
  padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.st-tile .st-more { margin-top: 6px; }
.st-more:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 3px; }
/* Hidden-then-shown, like every role gate: only `display` on the role rule. */
.td-open { display: none; }
body.role-teamdetails .td-open { display: inline-flex; }
.td-dialog { width: min(1440px, 96vw); max-width: none; max-height: 90vh; display: flex; flex-direction: column; }
.td-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.td-head h2 { flex: 1; margin: 0; font-size: 18px; color: var(--dark); }
.td-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--surface); color: var(--dark);
  cursor: pointer; padding: 8px; display: inline-flex; align-items: center; justify-content: center; }
.td-x:focus-visible { outline: 2px solid var(--accent-ink); }
.td-body { overflow: auto; color: var(--dark); }
.td-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.td-field { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; max-width: 100%; }
.td-field label { font-size: var(--fs-sm); font-weight: 600; color: var(--grey); }
.td-select { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--white); color: var(--dark); min-width: 0; max-width: 100%; }
.td-scope { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); color: var(--grey); }
.td-sec { margin-top: var(--sp-4); }
.td-sec h3 { margin: 0 0 var(--sp-2); font-size: 15px; color: var(--accent-ink); }
.td-sec h3:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.td-table td, .td-table tbody th { white-space: nowrap; }
/* v6.24.9: every group's table on the same columns; a narrow window
   scrolls the table inside its box rather than squeezing it. */
.td-table.td-fixed { table-layout: fixed; width: 100%; min-width: 880px; }
/* v6.24.13: the whole text, never "..." (Erfan): a long value wraps inside
   its column, and every figure starts at the left like the other columns. */
.td-table.td-fixed th, .td-table.td-fixed td, .td-table.td-fixed tbody th {
  white-space: normal; overflow-wrap: break-word; overflow: visible; }
.td-table.td-fixed .num, .td-table.td-fixed td.num { text-align: left; }
.td-postponed { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
.td-mail { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* v6.24.3 (item 7): one section per tab, each document list grouped by
   project (the number first, the name smaller), searched, sorted and paged.
   The tabs scroll sideways on a narrow window rather than wrap. */
.td-tabs { display: flex; gap: 4px; margin-top: var(--sp-3); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: thin; }
.td-tab { flex: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--grey); background: none; border: 0;
  border-bottom: 3px solid transparent; padding: 8px 12px; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; }
.td-tab:hover { color: var(--dark); }
.td-tab.is-on { color: var(--accent-ink); border-bottom-color: var(--accent-ink); }
.td-tab:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; border-radius: 4px; }
.td-count { font-size: 12px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--surface); color: var(--dark); text-align: center; font-variant-numeric: tabular-nums; }
.td-panel { padding-top: var(--sp-3); }
.td-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.td-search input { width: 260px; max-width: 100%; }
.td-groups { display: flex; flex-direction: column; gap: var(--sp-2); }
.td-group { border: 1px solid var(--border); border-radius: 8px; background: var(--white); }
.td-group-head { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; cursor: pointer;
  list-style-position: inside; }
.td-group-head:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; border-radius: 8px; }
/* The number never breaks at its hyphens; the name beside it gives way. */
.td-proj { font-weight: 700; color: var(--dark); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.td-pname { font-size: 12.5px; color: var(--grey); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-gcount { margin-left: auto; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px;
  background: var(--surface); color: var(--dark); font-variant-numeric: tabular-nums; }
.td-group > .st-table-wrap { margin: 0 12px 8px; }
.td-more { margin: 0 12px 10px; }

/* Under forced colours the series colours are gone, so the tables replace
   the plots, whatever the toggle says. */
@media (forced-colors: active) {
  .st-plot, .st-legend { display: none !important; }
  .st-card .st-table-wrap[hidden] { display: block; }
}

/* ══ v6.24: the small Aventa mark (js/loader.js) ═════════════════════════════
   The drop-shaped "A" (assets/aventa-icon-white.png as a mask) inked in the
   theme's --accent-ink, on a panel-coloured tile, bobbing like a drop with a
   ripple under it; the still mark under reduced motion. Between sections it
   sits mid-window over the content area: #section-loader is sticky and
   zero-height at the top of <main>, so it moves nothing, and its top is the
   middle of the window below the header. */
.section-loader { position: sticky; top: calc(50vh + var(--header-h, 74px) / 2); height: 0; z-index: 50; pointer-events: none; }
.section-loader .al-mark { display: none; }
.section-loader.on .al-mark { display: block; position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); }
.al-mark { position: relative; display: block; width: 64px; height: 64px; border-radius: 16px; background: var(--white); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.al-mark::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 37px; margin: -21px 0 0 -11px; background: var(--accent-ink);
  -webkit-mask: url(../assets/aventa-icon-white.png) center / contain no-repeat; mask: url(../assets/aventa-icon-white.png) center / contain no-repeat;
  animation: al-drop 1.1s ease-in-out infinite; }
.al-mark::after { content: ""; position: absolute; left: 50%; bottom: 9px; width: 30px; height: 8px; margin-left: -15px; border-radius: 50%;
  border: 1.5px solid var(--accent-ink); opacity: 0; animation: al-ripple 1.1s ease-out infinite; }
@keyframes al-drop { 0%, 100% { transform: translateY(-3px); opacity: .75; } 50% { transform: translateY(2px); opacity: 1; } }
@keyframes al-ripple { 0%, 40% { transform: scale(.3); opacity: 0; } 50% { opacity: .8; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .al-mark::before { animation: none; }
  .al-mark::after { animation: none; display: none; }
}
/* ══ v6.24 (D32): Sign out ═══════════════════════════════════════════════════
   A nav item at the foot of the sidebar (margin-top: auto in its flex column)
   and its own item at the end of the dock, set apart by a thin rule. Both are
   hidden-then-shown by body.can-sign-out, never shown-then-hidden: only
   behind the platform's sign-in and outside a Microsoft 365 host. */
.nav-item.nav-signout { display: none; margin-top: auto; }
body.can-sign-out .nav-item.nav-signout { display: flex; }
.dock-item.dock-signout { display: none; position: relative; margin-left: 9px; }
body.can-sign-out .dock-item.dock-signout { display: flex; }
.dock-item.dock-signout::before { content: ""; position: absolute; left: -7px; top: 12px; bottom: 12px; width: 1px; background: currentColor; opacity: .25; }
/* The moment before the browser leaves: the mark fades on the opening's navy
   stage with "Signing out" under it; the still mark under reduced motion. */
.signout-screen { position: fixed; inset: 0; z-index: 3002; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px;
  background: radial-gradient(120% 90% at 50% 40%, #070b2e 0%, #03051a 70%); animation: so-in .2s ease-out both; }
.signout-screen[hidden] { display: none; }
html:has(.signout-screen:not([hidden])) { background: #03051a; }
.so-mark { height: 96px; width: auto; animation: so-fade .6s ease-in .1s forwards; }
.so-text { margin: 0; font: 600 18px/1.3 "Segoe UI", system-ui, sans-serif; color: #fff !important; text-align: center; }
@keyframes so-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes so-fade { to { opacity: 0; transform: scale(.86) translateY(6px); filter: blur(4px); } }
@media (prefers-reduced-motion: reduce) {
  .signout-screen, .so-mark { animation: none; }
}

/* v6.24.1: My signature's pen is drawn only on a phone (the block below); a
   desktop reads the words, as before. */
.sign-mine-ic { display: none; }

/* ── v6.24.3: the Aventa Sign tab (js/signreq.js) ─────────────────────────
   Wraps instead of folding at a breakpoint, so a phone needs no rule of its
   own here; the phone block below still lifts its controls to 44px. Every
   text here is 12px or more. Signer colours mark boxes and dots, never text. */
.dock-item[data-role="aventasign"] { display: none; }
body.role-aventasign .dock-item[data-role="aventasign"] { display: flex; }
.asg-new { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.asg-new[hidden] { display: none; }
/* v6.25: the sender's own e-mail to the signers while the app sends none. */
.asg-mail { display: grid; gap: 6px; margin: 12px 0; }
.asg-mail .asg-hint { margin: 0; }
.asg-mail-btns { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.asg-mail-btns a { text-decoration: none; }
.asg-mail-btns .btn[disabled] { opacity: .55; cursor: not-allowed; }
.asg-intro { color: var(--grey); font-size: var(--fs-sm); margin: 0 0 var(--sp-4); max-width: 90ch; }
.asg-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.asg-tab { border: 1px solid var(--border); background: var(--white); color: var(--dark); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.asg-tab.is-on { background: var(--blue); border-color: var(--blue); color: var(--on-accent, #fff); font-weight: 600; }
.asg-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.asg-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2) var(--sp-4); width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--white); color: var(--dark); cursor: pointer; font: inherit; }
.asg-row:hover { border-color: var(--accent-ink); }
/* v6.26: several requests at once. The tick box beside each of the person's own rows, and the line above the list. */
.asg-row-wrap { display: flex; align-items: center; gap: var(--sp-2); }
.asg-row-wrap .asg-row { flex: 1 1 auto; width: auto; min-width: 0; }
.asg-pick-cell { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; min-height: 44px; cursor: pointer; }
span.asg-pick-cell { cursor: default; }
.asg-pick, .asg-pick-all input { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: var(--blue); }
.asg-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-2); min-height: 36px; }
.asg-pick-all { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; padding: 0 7px; margin-right: auto; font-size: 13px; color: var(--dark); cursor: pointer; }
@media (max-width: 600px) { .asg-pick-cell { width: 44px; } .asg-pick-all { min-height: 44px; } }
.asg-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.asg-row-title { font-weight: 600; overflow-wrap: anywhere; }
.asg-row-meta, .asg-meta, .asg-when { color: var(--grey); font-size: 12px; }
.asg-row-side { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.asg-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; color: var(--accent-ink); }
.asg-st-completed { color: var(--success-ink); }
.asg-st-declined, .asg-st-cancelled, .asg-st-expired { color: var(--danger-ink); }
.asg-st-draft, .asg-st-deleted { color: var(--grey); }
.asg-empty { color: var(--grey); padding: var(--sp-4) 0; }
.asg-subhead { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-md); }
.asg-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.asg-title { margin: 0; font-size: var(--fs-lg); overflow-wrap: anywhere; }
.asg-meta { margin: 0; }
#section-aventasign.asg-open .asg-intro { display: none; }
/* v6.24.5 (Erfan): the title goes back to the lists; it keeps the heading's
   look and shows it is a control on hover and focus. */
.asg-home { display: inline-flex; align-items: center; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-sm); }
.asg-home:hover { text-decoration: underline; text-underline-offset: 4px; }
.asg-home:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
/* "All requests": an outline button with its arrow, plainly a way back.
   Four classes, so it outranks the tab's plain-button rule below. */
#section-aventasign .btn.asg-back:not(.btn-primary):not(.btn-danger) { border: 1.5px solid var(--accent-ink); color: var(--accent-ink); font-weight: 600; gap: 6px; display: inline-flex; align-items: center; }
#section-aventasign .btn.asg-back:hover { background: color-mix(in srgb, var(--accent-ink) 10%, var(--surface)); }
/* The period over the lists (v6.24.5); gone while a request is open. */
.asg-period, .asg-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
/* display: flex outranks the UA [hidden] rule (the .sp-pick trap): the From/To
   fields showed under every period, not only Custom (v6.24.5 review). */
.asg-range[hidden] { display: none; }
.asg-period { margin: 0 0 var(--sp-3); }
.asg-period label { font-size: 12px; font-weight: 600; color: var(--grey); }
#section-aventasign.asg-open .asg-period { display: none; }
.asg-form { display: flex; flex-direction: column; gap: var(--sp-3); }
/* A field takes its own height. Its old flex-basis (220px) was meant for the
   deadline row, but in the form's column it set every field's HEIGHT, which
   was the empty band under Title, Signers and Message (v6.24.4, Erfan). */
.asg-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.asg-row2 { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.asg-row2 > .asg-field { flex: 1 1 150px; }
.asg-label { font-weight: 600; font-size: 13px; color: var(--dark); }
.asg-hint { color: var(--grey); font-size: 12px; margin: 0; }
.asg-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); color: var(--dark); font: inherit; font-size: 14px; }
.asg-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
/* A plain .btn in the tab (back, delete the draft, add a place, a reason's
   own button) carries the theme's surface, as the Statistics buttons do:
   WebKit drew the browser's light grey under white dark-theme ink (1.82:1,
   v6.24.3 browser sweep). */
#section-aventasign .btn:not(.btn-primary):not(.btn-danger) { background: var(--surface); color: var(--dark); border: 1px solid var(--border); }
.asg-place { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.asg-place .asg-subhead { margin: 0; }
.asg-place .btn { align-self: flex-start; }
.asg-signers { margin: var(--sp-3) 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.asg-signer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.asg-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--asg-c); flex: none; }
.asg-signer-name { font-weight: 600; }
.asg-signer-state { color: var(--grey); font-size: 13px; }
.asg-signer-reason { flex-basis: 100%; font-size: 13px; color: var(--dark); padding-left: 22px; }
.asg-signers li::marker { color: var(--grey); }
ol.asg-signers { counter-reset: asg; }
ol.asg-signers > li::before { counter-increment: asg; content: counter(asg) "."; color: var(--grey); font-size: 13px; }
.asg-c0 { --asg-c: #0052CC; } .asg-c1 { --asg-c: #B4530A; } .asg-c2 { --asg-c: #00804A; }
.asg-c3 { --asg-c: #7B2CBF; } .asg-c4 { --asg-c: #C0392B; } .asg-c5 { --asg-c: #0E7490; }
[data-theme="dark"] .asg-c0 { --asg-c: #7FB4FF; } [data-theme="dark"] .asg-c1 { --asg-c: #F0A35E; }
[data-theme="dark"] .asg-c2 { --asg-c: #6BD79B; } [data-theme="dark"] .asg-c3 { --asg-c: #C9A2F2; }
[data-theme="dark"] .asg-c4 { --asg-c: #FF9A90; } [data-theme="dark"] .asg-c5 { --asg-c: #67D3E8; }
/* v6.24.4 (Erfan, 2026-11-01): step 6's layout. The page on the left, one at
   a time under its Previous / Next and zoom bar, the request's controls on
   the right with Send under them, and the page held in view (sticky) while
   the controls scroll. One column on a phone and wherever the two do not fit
   (below 1100px with the sidebar, 860px with the dock): the controls, the
   page, then Send. */
.asg-work { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "doc" "actions"; gap: var(--sp-4); align-items: start; }
.asg-side { grid-area: side; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.asg-doc { grid-area: doc; min-width: 0; --asg-fit-h: 64vh; }
.asg-work > .asg-actions { grid-area: actions; margin: 0; }
@media (min-width: 1100px) {
  .asg-work { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); grid-template-areas: "doc side" "doc actions"; grid-template-rows: auto 1fr; gap: var(--sp-3) var(--sp-5); }
  .asg-doc { position: sticky; top: calc(var(--header-h, 74px) + 12px); --asg-fit-h: max(240px, calc(100vh - var(--header-h, 74px) - 182px)); }
}
/* With the dock: the same from 860px (never a phone turned sideways, which
   the phone query keeps stacked), and the page clear of the dock (112px). */
@media (min-width: 860px) and (min-height: 501px), (min-width: 1024px) {
  body.nav-dock .asg-work { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); grid-template-areas: "doc side" "doc actions"; grid-template-rows: auto 1fr; gap: var(--sp-3) var(--sp-5); }
  body.nav-dock .asg-doc { position: sticky; top: calc(var(--header-h, 74px) + 12px); --asg-fit-h: max(240px, calc(100vh - var(--header-h, 74px) - 294px)); }
}
.asg-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.asg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.asg-page-label { font-size: 13px; color: var(--dark); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Zoomed in, the page scrolls inside this box, both ways, as in step 6. */
.asg-viewport { overflow: auto; max-height: calc(var(--asg-fit-h) + 26px); padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overscroll-behavior: contain; }
.asg-page { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); touch-action: pan-x pan-y pinch-zoom; user-select: none; }
.asg-page.can-place { cursor: crosshair; }
.asg-page-img { display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.asg-box { position: absolute; box-sizing: border-box; border: 2px dashed var(--asg-c); background: color-mix(in srgb, var(--asg-c) 12%, transparent); border-radius: 4px; }
.asg-box.is-mine { border-style: solid; background: color-mix(in srgb, var(--asg-c) 20%, transparent); }
.asg-box.is-edit { cursor: move; touch-action: none; }
.asg-box:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; }
.asg-box-label { position: absolute; left: 0; bottom: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: #1A1A1A; background: #fff; border: 1px solid var(--asg-c); border-radius: 3px; padding: 0 4px; }
.asg-box-del { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--dark); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
/* The corner that resizes a box, as step 6's grip; its hit area is wider than
   the square, for a finger. */
.asg-grip { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; box-sizing: border-box; background: var(--asg-c); border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; touch-action: none; }
.asg-grip::before { content: ""; position: absolute; inset: -10px; }
/* The confirm step's real stamp (v6.24.4): sign.css draws its inside; here it
   loses the box's fill and border, keeping a thin outline to grab. */
.asg-box.asg-stamp { border: none; background: transparent; outline: 1px dashed var(--asg-c); }
.asg-box.asg-stamp:focus-visible { outline: 3px solid var(--accent-ink); }
.asg-preview-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); flex-basis: 100%; }
.asg-summary { margin: 0; }
.asg-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; margin: 0; }
/* v6.27: Delete (and Remove for good) end the row at the right, whatever
   stands before them; where the row wraps they keep their order. */
.asg-actions .asg-delete { margin-left: auto; }
.asg-actions .asg-open-sp { text-decoration: none; }
.asg-reason { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; background: var(--white); min-width: 260px; flex: 1 1 300px; max-width: 520px; }
.asg-reason summary { cursor: pointer; font-weight: 600; }
.asg-reason .asg-input { margin: 6px 0 8px; }
.asg-signbar { border: 1px solid var(--accent-ink); border-radius: var(--radius-md); padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); background: var(--white); }
.asg-signbar .asg-subhead { flex-basis: 100%; margin: 0; }
.asg-signbar > .asg-field { flex: 1 1 100%; }
.asg-mark-preview { height: 44px; max-width: 180px; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.asg-signbar .btn.is-on { outline: 2px solid var(--accent-ink); }
/* Add a place, how many were added and Sign: one line, centred together
   (v6.24.5, Erfan). */
.asg-sign-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); flex-basis: 100%; }
.asg-sign-actions .asg-hint { margin: 0; }
.asg-quote { margin: 0 0 var(--sp-3); padding: 8px 12px; border-left: 3px solid var(--border); color: var(--dark); white-space: pre-wrap; max-width: 820px; }
.asg-note { color: var(--dark); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 12px; max-width: 820px; }
/* v6.24.8: a deleted request's notice: what it is, and the days left. */
.asg-deleted-note p { margin: 0; }
.asg-deleted-note .asg-hint { margin-top: 4px; }
.asg-events { max-width: 820px; }
.asg-event-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.asg-event-list .asg-when { margin-left: 8px; }

/* ══ v6.24: phones (Erfan, 2026-10-12: "a proper and adaptive version for
   mobile phones ... horizontally and vertically") ═══════════════════════════
   ONE query for a phone, word for word the one js/dock.js asks
   (test_v624_mobile.py pins the two): portrait phones and small tablets by
   their width, a phone turned sideways by its height and its coarse pointer.
   A window 1024px wide or more is never a phone, so the desktop is exactly as
   it was, and neither is a mouse-driven desktop zoomed to 200%, which is as
   short as a sideways phone (Erfan's sidebar at zoom 200). Measured with
   Playwright device emulation at 360 to 430px wide and turned sideways, in
   four languages and three themes. Everything for a phone lives in this block
   and the two after it (the narrow portrait and the dashboard's cards). */
/* v6.24.3 (item 19): the dashboard's families under their project. The
   heading is one full-width cell holding one button (the number first, the
   name smaller, the count); a folded project's rows stay in the table,
   hidden, so nothing else about the table changes. The [hidden] rule is
   explicit because the phone's card rule sets display on every row. */
#document-body > tr[hidden] { display: none !important; }
#document-body > tr.proj-head > td, #document-body > tr.proj-head:hover > td {
  padding: 14px 8px 4px; border-bottom: 2px solid var(--border); background: var(--surface) !important;
}
.proj-toggle {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; width: 100%;
  border: 0; background: none; padding: 4px 0; font: inherit; color: var(--dark);
  cursor: pointer; text-align: left;
}
.proj-caret { width: 12px; flex: none; color: var(--grey); }
.proj-code { font-size: 15px; letter-spacing: .2px; }
.proj-name { font-size: 13px; color: var(--grey); overflow-wrap: anywhere; }
.proj-count { margin-left: auto; font-size: 12px; color: var(--grey); white-space: nowrap; }

@media (max-width: 768px), (max-width: 1023px) and (max-height: 500px) and (pointer: coarse) {
  /* Navigation is the dock. dock.js forces the mode on a phone and moves the
     date filter to the top of the Dashboard; the sidebar is hidden here too,
     so it never shows for a frame before dock.js runs. */
  .sidebar { display: none; }
  #nav-mode-btn { display: none; }
  /* v6.24.2: no Layout menu either. Every preset is one column here and the
     sidebar is hidden, so a preset changes nothing, and the phone header was
     measured to fit without it. The same specificity as the rule that
     reveals it, later in the file. */
  body.role-layout .layout-btn { display: none; }
  .dock {
    left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
    bottom: calc(8px + env(safe-area-inset-bottom));
    transform: none; max-width: none; padding: 6px 4px; gap: 2px; border-radius: 20px;
  }
  /* The items share the width; a label wraps at its spaces, and an item
     never shrinks below its longest word nor below 44px (v6.24.1,
     supervisor review: the operator's eight items were 32 to 43px wide
     at 390px), so only a crowded dock scrolls inside itself, under the
     pinned Sign out. */
  .dock-item { flex: 1 0 44px; min-width: min-content; min-height: 52px; padding: 6px 3px 5px; font-size: 12px; justify-content: center; white-space: normal; text-align: center; line-height: 1.15; }
  .dock-item:hover { transform: none; }
  /* Sign out stays in view however crowded the dock: pinned to its end on a
     surface of its own, its divider margin given back, while the sections
     scroll beneath it. Measured with it shown: an administrator's seven items
     need 348 to 390px of the 342 a 360px phone gives the dock, in all four
     languages, and Sign out was the item scrolled out of view. */
  .dock-item.dock-signout { position: sticky; right: 0; margin-left: 0; background: var(--white); }
  .dock-item.dock-signout::before { display: none; }
  /* The content clears the dock and, sideways, the notch. */
  .main-content, body.nav-dock .main-content {
    padding: 12px max(12px, env(safe-area-inset-right)) calc(108px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  /* The header is one line: the identity is the one control that shrinks (the
     name ellipsises), the language keeps its icon and its menu, and every
     control is 44px tall. Measured before: 162px and three rows at 360px. */
  header {
    flex-wrap: nowrap; gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  }
  header .logo-img { height: 30px; flex: none; }
  header h1 { font-size: 15px; white-space: nowrap; }
  /* The controls keep the right edge whatever the name leaves: an identity
     drawn as initials, or as its control alone, is narrower than its room. */
  .header-actions { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
  /* v6.24.1: and it clips what does not fit inside itself, so nothing in it
     (the pen, an expired session's Sign in again) is drawn over a neighbour.
     Its padding and gap are 6px: the room is the name's (index.html's
     _fitWho draws its initials, or nothing, when the name has none). */
  .identity-wrap { min-width: 0; height: 44px; padding: 0 6px; gap: 6px; overflow-x: clip; }
  .identity-wrap .am-trigger, .identity-wrap .who-name { max-width: none; min-width: 0; }
  .identity-wrap .am-trigger { min-height: 44px; }
  .role-pill { display: none; }
  .header-actions .theme-toggle { width: 44px; height: 44px; flex: none; }
  .bell-btn { width: 44px; height: 44px; flex: none; }
  .admin-chip { flex: none; }
  /* v6.24.1: the language is a 44px square, like the theme and the bell: its
     glyph, the whole square its menu's trigger. Its icon beside an empty 44px
     trigger took 86px, and with the bell and the ADMIN chip the identity was
     left 44px (measured, 360px). The trigger covers the square's border box,
     so it is 44 by 44 like every button here (inside the border, 42 wide). */
  .lang-wrap { position: relative; width: 44px; height: 44px; padding: 0; flex: none; justify-content: center; }
  .lang-wrap .am-trigger { position: absolute; inset: -1px; width: auto; max-width: none; min-width: 0; min-height: 0; padding: 0; border-radius: 12px; }
  .lang-wrap .am-trigger .am-chev { display: none; }
  .lang-wrap .scope-icon svg, .sign-mine-ic svg { width: 20px; height: 20px; }
  .lang-wrap .am-trigger .am-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .identity-wrap .sign-out:not([hidden]) { display: inline-flex; align-items: center; min-height: 44px; }
  /* v6.24.1: My signature is its pen, a 44px target, its words kept for
     assistive technology. In words it took 50 to 80px of a header with none to
     spare, and the 44px floor every button has here let it shrink below its
     words, which ran out over the language control (measured, 360px). */
  #my-signature-btn { flex: none; width: 44px; justify-content: center; }
  /* While the session is expired Sign in again is the one control here that
     works, so the pen gives way to it: the clip above cut the link (46 of its
     71px at 360px with the ADMIN chip, measured in WebKit). */
  .identity-wrap:has(#sign-in:not([hidden])) #my-signature-btn { display: none; }
  /* And the ADMIN chip goes too: the admin key reaches nothing once the
     session has expired, and with the bell the chip left the link "Sign in
     aga" at 360px in all four languages (measured, WebKit and Chromium). */
  header:has(#sign-in:not([hidden])) .admin-chip { display: none; }
  .sign-mine-ic { display: inline-flex; }
  .sign-mine-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* v6.24.1: on iOS any sideways overflow widens the layout viewport itself,
     so every full-width box grows past the screen (Erfan's iPhone: the date
     filter, Select from SharePoint and Refresh cut at the right); Chromium
     scrolls instead. Nothing may push the document wider: clip, not hidden,
     so neither box becomes a scroll container and the header still sticks. */
  header, .app-container { overflow-x: clip; }
  /* The bell's list spans the phone under the header. */
  .notif-dropdown {
    top: calc(var(--header-h, 60px) + 6px); left: 8px; right: 8px; width: auto; max-width: none;
    max-height: calc(100dvh - var(--header-h, 60px) - 110px);
  }
  /* The toast rises above the dock instead of sitting on it. */
  #toast { left: 12px; right: 12px; bottom: calc(104px + env(safe-area-inset-bottom)); text-align: center; }

  /* The dashboard: a card per family. Measured (600 to 1000px wide, four
     languages): even with its columns folded the table needs 950 to 1120px,
     so it fits no phone in either orientation, and every phone gets cards.
     Scoped to the dashboard's own table: no other table changes. A card has
     no header row, so the due date says what it is (data-label). */
  [data-panel="documents"] .card { overflow: visible; background: none; border: 0; border-radius: 0; box-shadow: none; }
  [data-panel="documents"] table, #document-body { display: block; }
  /* The header row goes, all but Select all, which stands above the cards
     with its own words (shown only here): without it a phone removed several
     registrations by ticking every card. Its id rule outranks the checkbox
     rule below, so its 44px target is restated; the themes paint the header
     row with !important, so its band is cleared by a more specific one. */
  [data-panel="documents"] thead, [data-panel="documents"] thead tr { display: block; }
  [data-panel="documents"] table thead tr { background: none !important; }
  [data-panel="documents"] thead th { display: none; }
  [data-panel="documents"] thead th.select-all-cell { display: flex; align-items: center; gap: 2px; width: auto; padding: 0 0 8px 9px; border: 0; }
  .select-all-label { display: inline; font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: normal; color: var(--dark); cursor: pointer; }
  #select-all-checkbox { width: 44px; height: 44px; }
  #document-body > tr {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; column-gap: 8px; row-gap: 8px;
    grid-template-areas: "check name name del" ". status score score" ". due due due" "act act act act";
    margin-bottom: 12px; padding: 8px 8px 12px;
    border: 1px solid var(--border); border-radius: 14px; background: var(--white);
  }
  #document-body > tr > td, #document-body > tr:hover > td { display: block; min-width: 0; padding: 0; border: 0; background: transparent !important; }
  #document-body > tr > td.col-hide-sm, #document-body > tr > td.col-hide-md, #document-body > tr.fam-rev > td:empty { display: none; }
  #document-body > tr > td[colspan] { grid-column: 1 / -1; }
  #document-body > tr > td.col-check { grid-area: check; width: auto; }
  #document-body > tr > td.col-name { grid-area: name; max-width: none; align-self: center; }
  #document-body > tr > td.col-name > div { max-width: none; }
  #document-body > tr > td.col-name strong, #document-body > tr > td.col-name > div > span { white-space: normal; overflow-wrap: anywhere; }
  #document-body > tr > td.col-del { grid-area: del; width: auto; }
  #document-body > tr > td.col-status { grid-area: status; text-align: left; align-self: center; }
  #document-body > tr > td.col-status .status-wrap { align-items: flex-start; }
  #document-body > tr > td.col-score { grid-area: score; width: auto; justify-self: end; align-self: center; }
  #document-body > tr > td.due-cell { grid-area: due; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
  #document-body > tr > td.due-cell::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--grey); }
  #document-body > tr > td.col-actions { grid-area: act; position: static; white-space: normal; }
  #document-body > tr > td.col-actions::before { display: none; }
  #document-body .action-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #document-body .action-group .btn-action { justify-content: center; min-height: 44px; font-size: 14px; }
  #document-body .btn-delete { width: 44px; height: 44px; }
  #document-body .score-mini { min-width: 44px; min-height: 44px; }
  /* The revisions stack inside their family's card: the family's card opens
     at its foot, each revision is a band of it indented under the name, and
     the last band closes the card. */
  #document-body > tr:not(.fam-rev):has(+ tr.fam-rev) { margin-bottom: 0; border-bottom: 0; border-radius: 14px 14px 0 0; }
  #document-body > tr.fam-rev {
    grid-template-columns: minmax(0, 1fr) auto 44px; grid-template-areas: "name score del" "act act act";
    margin: 0; padding: 10px 8px 10px 60px;
    border-top: 1px dashed var(--border); border-radius: 0; background: var(--surface);
  }
  #document-body > tr.fam-rev:not(:has(+ tr.fam-rev)) { margin-bottom: 12px; border-radius: 0 0 14px 14px; }
  #document-body > tr.fam-rev > td.col-name { padding-left: 0; }
  #document-body > tr.proj-head { display: block; margin: 14px 0 8px; padding: 0; border: 0; background: none; }
  #document-body > tr.proj-head > td, #document-body > tr.proj-head:hover > td { padding: 0 4px 4px; }

  /* Every modal is a full-height sheet: its title and close control at the
     top, its body scrolling on its own, the safe areas kept clear. The
     viewport's resizes-content shrinks it above the keyboard in Chromium;
     iOS scrolls the focused field into view inside it. */
  .modal-dialog, .family-dialog, .picker-dialog, .reg-dialog {
    width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0;
    display: flex; flex-direction: column;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .modal-dialog .modal-body, .family-dialog .fd-body, .reg-dialog .reg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .family-dialog { overflow: hidden; }
  .family-dialog .fd-head { flex: none; }
  .picker-list { overscroll-behavior: contain; }
  /* One scroller per sheet: the journey's history and the client's comments
     keep their own 260px boxes on a desktop, so the Close button stays on
     screen; on a phone the sheet's head keeps it there. */
  .rh-list, .cl-list { max-height: none; overflow: visible; }
  .review-detail { scroll-margin-top: calc(var(--header-h, 60px) + 8px); }
  /* The player scrolls as one sheet, its title row and close control pinned. */
  .help-player-dialog {
    display: block; overflow-y: auto; overscroll-behavior: contain;
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  .help-player-head { position: sticky; top: 0; z-index: 1; margin: 0 0 8px; padding: 10px 0; background: var(--white); }
  /* Sideways, the whole video and its controls fit under the title row; the
     picture letterboxes inside the box rather than running off the screen. */
  #help-player-video { max-height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  /* The result panel leaves the page for a sheet of its own. */
  #ai-panel {
    position: fixed; inset: 0; z-index: 1500; margin: 0; border-radius: 0; animation: none;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; overflow-wrap: anywhere;
    padding: 0 max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }
  #ai-panel h3 { position: sticky; top: 0; z-index: 1; margin: 0 0 12px; padding: calc(14px + env(safe-area-inset-top)) 52px 10px 0; background: var(--white); }
  #ai-panel h3 > * { min-width: 0; }
  #ai-panel .panel-close-btn { position: fixed; top: calc(8px + env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 2; width: 44px; height: 44px; }
  #ai-panel pre { white-space: pre-wrap; }
  /* No field makes iOS zoom on focus (it does under 16px, and stays zoomed).
     !important: the fields' own rules set 12 to 15px at every specificity. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
  .date-overlay { font-size: 16px; }

  /* Touch: every control is at least 44 by 44 (Apple's minimum, WCAG 2.5.5),
     nothing depends on hover, and no text is under 12px. A pill keeps its
     look and grows its height; an icon button grows to a 44px square. */
  button, summary, a[href], [role="button"], [role="tab"], [role="option"],
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 44px; }
  button, [role="button"] { min-width: 44px; }
  .btn, .btn-sm, .btn-action, .btn-rd, .status-step, .rev-chip, .fam-toggle, .crumb, .chip, .qv,
  .help-tab, .help-upnext-item, .picker-close, .help-x, .btn-delete, .modal-footer button {
    display: inline-flex; align-items: center; justify-content: center;
  }
  .fam-toggle { justify-content: flex-start; }
  /* The pills stay pills at 44px: round ends, the words inset. A revision
     chip is a tag beside the name, so it draws a 28px pill inside its 44px
     target: the transparent border is target, not paint. */
  .status-step { border-radius: 22px; padding: 0 14px; }
  .rev-chip { border: 8px solid transparent; border-radius: 22px; padding: 0 8px; }
  .rev-chip, .rev-chip.is-active { background-clip: padding-box; }
  .rev-chips { gap: 0; margin-left: -8px; }
  /* Their words in the ink token, not the fill: --blue as text on the Dark
     theme's --blue-light measured 1.66:1, --accent-ink 5.32:1. */
  .status-step, .rev-chip { color: var(--accent-ink); }
  /* A picker row wraps its action under a long name rather than squeezing
     the name to one letter a line. */
  .picker-row { flex-wrap: wrap; row-gap: 6px; }
  .picker-name { flex: 1 1 160px; }
  .picker-meta { margin-left: auto; flex: 0 1 auto; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; text-align: right; }
  .picker-updated-tag { white-space: normal; margin-right: 0; }
  /* v6.24.1: a revision of the journey is two lines: its code and its name,
     the name breaking where a name can (after a hyphen), then the score, Open
     in SharePoint and Rules under the name. In one row their 44px targets left
     the name a few pixels, one letter a line ("EN G- 24 -0..."). */
  .rev-row { flex-wrap: wrap; row-gap: 8px; }
  .rev-row .rev-left { flex: 1 1 100%; align-items: baseline; }
  .rev-row .rev-file { word-break: normal; overflow-wrap: anywhere; }
  .rev-row .rev-right { flex: 1 1 100%; padding-left: 52px; flex-wrap: wrap; }
  /* Open in SharePoint was 20px tall there: the journey's own min-height
     outranks the a[href] rule above. */
  .rev-row .row-path-link { min-height: 44px; }
  /* v6.24.4: Rules at the same place on every revision. The score takes a
     44px slot (a checked revision's ring is a 44px button, an unchecked one's
     dash a few pixels), and Rules ends the line whether or not the row has
     Open in SharePoint. */
  .rev-row .rev-right > [data-score-file] { flex: none; width: 44px; justify-content: center; text-align: center; }
  .rev-row .rev-right > .btn-action { margin-left: auto; }
  .reg-body .reg-row input[type="text"], .reg-body .reg-row input[type="number"], .reg-body .reg-row input[type="date"],
  .reg-body .reg-row .am-trigger { height: 44px; }
  /* A checkbox is a 44px target drawing a 22px box. */
  input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 44px; margin: 0; border-radius: 10px; cursor: pointer; }
  input[type="checkbox"]::before { content: ""; position: absolute; inset: 11px; border: 2px solid var(--grey); border-radius: 6px; background: var(--white); }
  input[type="checkbox"]:checked::before { border-color: var(--blue); background: var(--blue); }
  input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 18px; top: 14px; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
  input[type="checkbox"]:disabled { opacity: .55; cursor: default; }
  input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -4px; }
  /* Text: 12px at the least. Every rule that sets less, listed (the test
     recomputes the list from the stylesheets, so a new one is noticed), and
     inline styles, which only !important reaches. */
  th, .badge, .check-badge, .bell-badge, .status-step, .rev-chip, .rev-badge, .fam-toggle, .filter-box h3,
  .rev-row .btn-action, .rev-row .row-path-link, .row-path, .notif-item .meta, .settings-desc,
  #extracted-text-content, .batch-ts-opt-check, .batch-ts-opt-ext, .pf-stat small, .queue-group, .q-proj,
  .q-disc, .q-stale, .q-nocheck, .q-sub, .q-due, .rd-sub, .rd-meta, .rd-dl-label, .rd-dl-chip, .rd-steps-title,
  .rd-step-label, .rd-note, .rd-gate-hint, .rd-person-state, .rh-rev-step, .rh-rev-file, .rh-detail, .cl-source,
  .cl-ref, .cl-meta, .picker-size, .picker-meta, .picker-foot, .picker-search-note, .picker-updated-tag,
  .sp-notice code, .reg-file span, .cal-weekdays span, .admin-table th, .state-pill, .am-person-pos,
  .rev-superseded, .st-tick, .st-val, .st-tile-cap, .admin-chip { font-size: 12px; }
  [style*="font-size:10px"], [style*="font-size: 10px"], [style*="font-size:11px"], [style*="font-size: 11px"] { font-size: 12px !important; }
  .mini-num, #score-sub, .batch-sub { font-size: 12px; }
  /* avatar.js sizes the initials inline at four tenths of the circle, 8 to
     9px for the journey's 20 to 22px avatars (supervisor review): 12px in
     a circle that holds them. */
  .avatar { min-width: 30px; min-height: 30px; font-size: 12px !important; }
  /* The signing window's hints and labels: sign.css loads after this file
     and wins a tie in specificity, so only !important lifts them here. */
  .sign-hint, .sign-card .meta, .sign-badge { font-size: 12px !important; }
  /* "All signatures" or "only this one": each choice a 44px target, its
     words in the middle. Two classes, because sign.css loads after this
     file and its .sign-side label (flex-start) would win a tie. */
  .sign-side .sign-size-scope label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
  /* A checkbox and its words (a place found, "Also write the date and
     time"): one 44px row, the words beside the drawn box and centred on it.
     .sign-side label's flex-start put them above-right of the 44px target
     (Erfan, 2026-11-02). Two classes, for the same reason as above. */
  .sign-side .sign-check { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; }
  /* The Aventa Sign tab's date choice: the label is the target, 44px tall,
     the box inside it (v6.24.3 browser sweep: 19px). */
  .asg-check { min-height: 44px; }
  /* A box's remove button draws its 24px circle inside a 44px target, the
     way a revision chip draws its pill: the transparent border is target,
     not paint, and the inset shadow is the circle's edge (v6.24.5, Erfan). */
  .asg-box-del { width: 44px; height: 44px; top: -22px; right: -22px; border: 10px solid transparent; background-clip: padding-box; box-shadow: inset 0 0 0 1px var(--border); }
  /* A folded remedy (Postpone, Withdraw, Replace): its words in the middle
     of the 44px summary, not at the top of an empty band. */
  .rd-update > summary { padding-block: 12px; margin-bottom: 0; }
  /* A bell event's words beside its 44px dismiss (plus its 8px margin),
     not below it under an empty band (v6.24.3 browser sweep). */
  .notif-open { width: calc(100% - 52px); }
  /* v6.27: two 44px controls on a live row, the archive and the cross. */
  .notif-item.has-archive .notif-open { width: calc(100% - 104px); }
  /* A name is read in full where a tooltip cannot be hovered. */
  .picker-name, #document-body .row-path-text { white-space: normal; overflow-wrap: anywhere; }

  /* The Help Center: two videos a row (one in portrait, below). */
  .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The calendar spans the phone (seven 44px days) and scrolls inside itself
     when a sideways phone is shorter than it. */
  .cal-pop { width: 344px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; }
  .cal-day { height: 44px; }
  /* The admin panel stays a desktop tool, but never scrolls the phone
     sideways: its tables scroll in their own box (.admin-scroll, on every
     width since v6.24.1) and the uptime strip inside itself. */
  .uptime-bars { overflow-x: auto; }
  .status-card { min-width: 0; overflow-wrap: anywhere; }
  /* The offline screen: centred when it fits, scrolled from the top when a
     sideways phone is shorter than it, its picture never taller than a third. */
  .conn-screen { overflow-y: auto; align-items: flex-start; }
  .conn-card { margin: auto; }
  .conn-art { width: min(360px, 80vw, 64dvh); }
}
/* A phone turned sideways is 360 to 430px tall, and the header and the dock
   took 134px of it: the dock's icons sit beside their words and the header
   loses its padding. Wherever the phone layout meets a short window: a phone
   turned sideways, or a narrow window (768px or less) that is also short. */
@media (max-width: 768px) and (max-height: 500px), (max-width: 1023px) and (max-height: 500px) and (pointer: coarse) {
  header { padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); }
  .dock-item { flex-direction: row; gap: 6px; min-height: 44px; padding: 4px 8px; }
}
/* A portrait phone: the title gives way (the logo names the app), hidden on
   screen and kept for assistive technology; one video a row, two projects. */
@media (max-width: 599px) {
  /* v6.27.2: the Dashboard's custom range, each label beside its own field,
     never at the end of the other one's row. */
  .dock-filter-slot .filter-box .dash-range { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; }
  .dock-filter-slot .filter-box .dash-range[hidden] { display: none; }
  .dock-filter-slot .filter-box .dash-range .date-wrap { width: 100%; }
  /* v6.24.10: on a portrait phone the check's name needs the room more than
     the badges need one width. */
  .check-badge { min-width: 0; }
  .batch-card-link { padding-left: 20px; }
  header h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  /* v6.24.1: and its wrapper, empty on screen then, takes no slot in the
     header's row: it took its 8px gap from the identity's room. */
  .header-title { position: absolute; }
  .help-grid { grid-template-columns: 1fr; }
  /* Two projects a row, so the queue is not two screens down. */
  .pf-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-stats { flex-wrap: wrap; gap: 6px 12px; }
  /* The tracker's seven steps stand in a column: across 360px their 12px
     names ran off the edge in Croatian and into each other. The connector
     runs down from each dot's centre to the next. */
  .rd-steps { flex-direction: column; }
  .rd-step { flex-direction: row; align-items: center; gap: 12px; text-align: left; min-height: 40px; }
  .rd-step:not(:last-child)::after { top: 50%; left: 12.5px; width: 2px; height: 100%; }
  .rd-step-label { font-size: 13px; }
}
/* v6.24.1: the narrowest phones (320px) cannot hold the pen, the ADMIN chip,
   the bell, the language and the theme beside the logo: the pen showed a third
   of itself. With the bell and the chip, the logo gives way as the title has.
   v6.24.2: the bell is everyone's, so the chip alone decides. */
@media (max-width: 339px) {
  header:has(.admin-chip:not([hidden])) .logo-img { display: none; }
  /* A card's status chip and its score rings do not fit one row at 320px
     (Safari drew the chip over the first ring): the score goes under it. */
  #document-body > tr { grid-template-areas: "check name name del" ". status status status" ". score score score" ". due due due" "act act act act"; }
  #document-body > tr:not(.fam-rev) > td.col-score { justify-self: start; }
}
