/* Chumbok app shell and components (docs/web-redesign-plan.md §4.1, §4.4). Built on tokens.css + Bootstrap 5.3.
   Desktop: sidebar + top bar. Below 760px: app bar + bottom tab bar, tables become cards. */

html, body { background: var(--c-bg); color: var(--c-ink); }
body { font-family: var(--f-body); font-size: var(--t-body); line-height: 1.5; -webkit-font-smoothing: antialiased; margin: 0; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
h1, h2, h3, h4, .f-display { font-family: var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.text-muted, .muted { color: var(--c-muted) !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* icons (one SVG sprite: /app/icons.svg#name) */
.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.app-side { background: var(--c-side); color: var(--c-side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.app-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px; font: 800 19px var(--f-display); letter-spacing: .04em; color: var(--c-side-ink); text-decoration: none; }
.app-brand:hover { color: var(--c-side-ink); }
.app-brand img { height: 30px; width: auto; }
.app-brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--c-accent-btn); display: grid; place-items: center; flex: none; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--c-side-muted); padding: 0 10px 6px; }
.app-side a.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--c-side-ink); text-decoration: none; font-size: 14.5px; }
.app-side a.nav-item .i { color: var(--c-side-muted); }
.app-side a.nav-item:hover { background: var(--c-side-active); }
.app-side a.nav-item[aria-current="page"] { background: var(--c-side-active); }
.app-side a.nav-item[aria-current="page"] .i { color: var(--c-side-accent); }
/* 8.5at: a sub-menu in the sidebar (details/summary) */
.app-side .nav-sub > summary.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--c-side-ink); font-size: 14.5px; cursor: pointer; list-style: none; }
.app-side .nav-sub > summary.nav-item::-webkit-details-marker { display: none; }
.app-side .nav-sub > summary.nav-item .i { color: var(--c-side-muted); }
.app-side .nav-sub > summary.nav-item:hover { background: var(--c-side-active); }
.app-side .nav-sub > summary .nav-sub-arrow { margin-left: auto; width: 14px; height: 14px; transition: transform .15s; }
.app-side .nav-sub[open] > summary .nav-sub-arrow { transform: rotate(90deg); }
.app-side a.nav-item.nav-child { padding-left: 42px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .app-side .nav-sub > summary .nav-sub-arrow { transition: none; } }
.nav-badge { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--c-accent-btn); color: #fff; border-radius: 99px; padding: 0 8px; line-height: 20px; }
.app-side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--c-side-active); font-size: 12px; color: var(--c-side-muted); }
.app-side-foot b { color: var(--c-side-ink); font-weight: 600; display: block; }

.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; min-height: var(--top-h); border-bottom: 1px solid var(--c-line); background: var(--c-surface); position: sticky; top: 0; z-index: 20; }
.app-top .spacer { flex: 1; }
.icon-btn { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; color: var(--c-muted); border: 1px solid var(--c-line); background: var(--c-surface); padding: 0; }
.icon-btn:hover { color: var(--c-ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; background: var(--c-accent-btn); border-radius: 50%; border: 2px solid var(--c-surface); }
.theme-switch { display: inline-flex; border: 1px solid var(--c-line); border-radius: 10px; padding: 3px; gap: 2px; background: var(--c-bg); margin: 0; }
.theme-switch button { width: 32px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--c-muted); border: 0; background: transparent; padding: 0; }
.theme-switch button[aria-pressed="true"] { background: var(--c-surface); color: var(--c-ink); box-shadow: var(--c-shadow); }
.me { display: flex; align-items: center; gap: 10px; padding-left: 6px; color: var(--c-ink); text-decoration: none; background: none; border: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me .who { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.me .who small { color: var(--c-muted); font-size: 12px; }

.app-content { padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.app-mbar, .app-tabbar { display: none; }

/* ---------------------------------------------------------------- page parts */
.page-header { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-header .crumb { font-size: 13px; color: var(--c-muted); }
.page-header h1 { font-size: var(--t-title); font-weight: 800; margin: 2px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-header .sub { font-size: 13.5px; color: var(--c-muted); margin-top: 4px; }
.page-header .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--c-shadow); --bs-card-bg: var(--c-surface); --bs-card-border-color: var(--c-line); }
.card-pad { padding: 18px; }
.section-title { font: 700 15.5px var(--f-display); margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title a { margin-left: auto; font: 600 13.5px var(--f-body); }

.btn { font-weight: 600; border-radius: 10px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-sm { min-height: 34px; }
.btn-primary { --bs-btn-bg: var(--c-accent-btn); --bs-btn-border-color: var(--c-accent-btn); --bs-btn-hover-bg: var(--c-accent-btn); --bs-btn-hover-border-color: var(--c-accent-btn);
  --bs-btn-active-bg: var(--c-accent-btn); --bs-btn-color: var(--c-on-accent); --bs-btn-hover-color: var(--c-on-accent); filter: none; }
.btn-primary:hover { filter: brightness(.94); }
.btn-success { --bs-btn-bg: var(--c-ok-btn); --bs-btn-border-color: var(--c-ok-btn); --bs-btn-hover-bg: var(--c-ok-btn); --bs-btn-hover-border-color: var(--c-ok-btn); }
.btn-secondary-soft { background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-ink); }
.btn-secondary-soft:hover { background: var(--c-sunk); color: var(--c-ink); }
.btn-danger-outline { background: var(--c-surface); border: 1px solid var(--c-bad-line); color: var(--c-bad); }
.btn-danger-outline:hover { background: var(--c-bad-soft); color: var(--c-bad); }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
/* a busy button's spinner (app.js busy(): api calls and the page loader) */
.btn[aria-busy="true"]::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: .45em; vertical-align: -.125em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* page loader (app.js): a bar at the top while the next page loads; a band slides along it (still when motion is reduced);
   the page's content fades and the pointer shows "loading" (html[aria-busy], set with the bar), so it is hard to miss */
.page-loader { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 2000; overflow: hidden; background: var(--c-accent-soft); pointer-events: none; }
.page-loader[hidden] { display: none; }
.page-loader::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--c-accent); animation: page-loader 1.1s ease-in-out infinite; }
@keyframes page-loader { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
html[aria-busy="true"], html[aria-busy="true"] * { cursor: progress !important; }

/* numbers that arrive after the page (_LoadingNumbers, deferred.js): a banner with a spinner over skeleton cards shaped
   like the page; the skeletons shimmer (still when motion is reduced) */
.loading-panel { display: flex; flex-direction: column; gap: 12px; }
.loading-banner { display: flex; flex-direction: row; align-items: center; gap: 14px; background: var(--c-accent-soft); border-color: var(--c-accent-line); }
.spinner { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; border: 3px solid var(--c-accent-line); border-top-color: var(--c-accent); animation: btn-spin .8s linear infinite; }
.skel { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--c-sunk) 25%, var(--c-line) 50%, var(--c-sunk) 75%); background-size: 200% 100%; animation: skel-shimmer 1.4s ease-in-out infinite; }
.skel-sm { height: 12px; width: 55%; }
.skel-short { width: 35%; }
.skel-lg { height: 28px; width: 45%; margin: 10px 0; }
.skel-title { height: 16px; width: 40%; margin-bottom: 16px; }
.skel-chart { height: 180px; width: 100%; }
.skel-line { height: 12px; width: 100%; margin: 12px 0; }
.skel-line:nth-child(odd) { width: 80%; }
@keyframes skel-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
html[aria-busy="true"] .app-content { opacity: .55; transition: opacity .2s ease; }

/* status pill: one look for every state (StatusPill partial) */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--c-ok); background: var(--c-ok-soft); }
.pill-warn { color: var(--c-warn); background: var(--c-warn-soft); }
.pill-bad { color: var(--c-bad); background: var(--c-bad-soft); }
.pill-info { color: var(--c-info); background: var(--c-info-soft); }
.pill-mute { color: var(--c-muted); background: var(--c-sunk); }

.chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip { border: 1px solid var(--c-line); background: var(--c-surface); border-radius: 99px; padding: 6px 13px; font-size: 13px; white-space: nowrap; color: var(--c-ink); text-decoration: none; }
.chip b { font-weight: 600; }
.chip-add { border-style: dashed; color: var(--c-muted); background: transparent; }
.seg { display: inline-flex; border: 1px solid var(--c-line); border-radius: 10px; overflow: hidden; background: var(--c-surface); flex: none; }
.seg a, .seg button { padding: 8px 14px; font-weight: 500; border: 0; border-right: 1px solid var(--c-line); background: transparent; color: var(--c-ink); text-decoration: none; white-space: nowrap; }
.seg > :last-child { border-right: 0; }
.seg [aria-current="true"], .seg [aria-pressed="true"] { background: var(--c-ink); color: var(--c-bg); }
.seg em { font-style: normal; margin-left: 6px; opacity: .6; }

.table-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--c-shadow); overflow: hidden; }
.table-card table { width: 100%; border-collapse: collapse; margin: 0; }
.table-card th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--c-muted); font-weight: 600; text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--c-line); }
.table-card td { padding: 14px 18px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table-card tr:last-child td { border-bottom: 0; }

/* audit log (step 2.1) */
.nowrap { white-space: nowrap; }
.audit-table td { vertical-align: top; }
.audit-id { font-family: var(--bs-font-monospace); font-size: 12.5px; word-break: break-all; }
.audit-changes { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 0; font-size: 13px; }
.audit-changes dt { font-weight: 500; color: var(--c-muted); }
.audit-changes dd { margin: 0; overflow-wrap: anywhere; }
.audit-changes .was { color: var(--c-muted); text-decoration: line-through; }
.audit-changes .arrow { color: var(--c-muted); }
.audit-reason { font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--c-muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state .i { width: 32px; height: 32px; }
.empty-state b { color: var(--c-ink); font-family: var(--f-display); font-size: 16px; }

/* toasts (app.js ui.toast) */
.toasts { position: fixed; left: calc(var(--side-w) + 28px); bottom: 22px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; }
.app-toast { background: var(--c-ink); color: var(--c-bg); border-radius: 12px; padding: 11px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45); font-size: 14px; max-width: 520px; }
.app-toast.bad { background: var(--c-bad); color: #fff; }
.app-toast button { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; white-space: nowrap; }

/* ---------------------------------------------------------------- phone (< 760px) */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  .app { display: block; }
  .app-side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); height: 100%; z-index: 1050; transform: translateX(-105%); transition: transform .2s ease; }
  .app-side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .app-top { display: none; }
  .app-mbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; background: var(--c-surface); border-bottom: 1px solid var(--c-line); position: sticky; top: 0; z-index: 20; }
  .app-mbar .title { font: 800 18px var(--f-display); margin-left: 4px; }
  .app-mbar .spacer { flex: 1; }
  .app-mbar .icon-btn { border: 0; width: 40px; height: 40px; }
  .app-mbar .avatar { width: 34px; height: 34px; font-size: 12px; }
  .app-tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--c-surface); border-top: 1px solid var(--c-line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 30; }
  .app-tabbar a, .app-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--c-muted); padding: 4px 0; position: relative; min-height: 48px; text-decoration: none; border: 0; background: none; }
  .app-tabbar .i { width: 22px; height: 22px; }
  .app-tabbar [aria-current="page"] { color: var(--c-accent); }
  .app-tabbar [aria-current="page"]::before { content: ""; position: absolute; top: -7px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--c-accent); }
  .app-tabbar .nav-badge { position: absolute; top: 0; left: calc(50% + 6px); margin: 0; font-size: 10.5px; line-height: 17px; padding: 0 6px; }
  .app-content { padding: 16px 16px calc(var(--tab-h) + 32px); gap: 14px; }
  /* the app bar shows the title; keep the h1 for screen readers only */
  .page-header h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .page-header .actions { margin-left: 0; width: 100%; }
  .page-header .actions .btn-primary { flex: 1; min-height: 46px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--tab-h) + 16px); }
  .app-toast { max-width: none; }

  /* tables become cards: <table class="cards-on-phone">, cells with data-label */
  .table-card:has(table.cards-on-phone) { background: transparent; border: 0; box-shadow: none; }
  table.cards-on-phone, table.cards-on-phone tbody, table.cards-on-phone tr, table.cards-on-phone td { display: block; }
  table.cards-on-phone thead { display: none; }
  table.cards-on-phone tr { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--c-shadow); }
  table.cards-on-phone td { border: 0; padding: 4px 0; display: flex; gap: 12px; justify-content: space-between; }
  table.cards-on-phone td[data-label]::before { content: attr(data-label); color: var(--c-muted); font-size: 13px; }
  table.cards-on-phone td.cell-main { display: block; font-weight: 600; }
  table.cards-on-phone td.audit-details { display: block; padding-top: 8px; }
  table.cards-on-phone td.cell-actions { justify-content: stretch; gap: 8px; padding-top: 10px; }
  table.cards-on-phone td.cell-actions .btn { flex: 1; min-height: 44px; }
}

/* notices and forms (step 2.2) */
.notice { border-radius: var(--r-lg); padding: 12px 16px; border: 1px solid var(--c-line); background: var(--c-surface); }
.notice-ok { color: var(--c-ok); background: var(--c-ok-soft); border-color: transparent; }
.notice-bad { color: var(--c-bad); background: var(--c-bad-soft); border-color: var(--c-bad-line); }
.notice-info { color: var(--c-info); background: var(--c-info-soft); border-color: transparent; }

/* step-by-step guidance (posting content, §8.5ah): numbered steps, a setup checklist, the next step */
.step-no { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; margin-right: 6px; border-radius: 50%;
  background: var(--c-accent); color: var(--c-on-accent); font-size: .8em; font-weight: 700; vertical-align: .1em; }
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--c-accent-soft); color: var(--c-accent); font-weight: 700; }
.steps > li > span { color: var(--c-muted); font-size: 14px; }
.checklist { list-style: none; padding: 0; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.checklist > li { position: relative; padding-left: 32px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.checklist > li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-line); }
.checklist > li.done::before { content: "✓"; border-color: var(--c-ok); background: var(--c-ok); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.checklist > li.now::before { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.checklist > li > span { color: var(--c-muted); font-size: 14px; }
.next-step { padding: 10px 14px; border-radius: var(--r-lg); background: var(--c-accent-soft); }
.hint-list { padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.add-version { border-style: dashed; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.field-error { display: block; color: var(--c-bad); font-size: 13px; margin-top: 6px; }
.field-error:empty { display: none; }
.input-validation-error { border-color: var(--c-bad) !important; }
.setting-meta { font-size: 12.5px; color: var(--c-muted); margin-top: 6px; }
.reasons-input { font-size: 14px; line-height: 1.5; resize: vertical; }
.undo-input { width: 110px; }
@media (max-width: 760px) {
  .form-actions .btn { flex: 1; min-height: 46px; }
}

/* lists with a toolbar, row details (step 2.3: Phones) */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .seg button { display: inline-flex; align-items: center; }
.toolbar-search { flex: 1 1 240px; min-width: 0; max-width: 420px; }
.toolbar-select { width: auto; flex: none; }
/* a labelled date and time in a toolbar (Activity links: Added from / to) */
.toolbar-field { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.toolbar-field .form-control { width: 13.5rem; min-width: 0; }
.bulk-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--c-line); border-radius: var(--r-lg); background: var(--c-accent-soft); }
.bulk-bar[hidden] { display: none; }
.cell-sub { display: block; font-size: 13px; color: var(--c-muted); }
.cell-pick { width: 44px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.table-card td .pill + .pill { margin-left: 4px; }
.phones-table td { vertical-align: top; }
.phones-table tr.sel td { background: var(--c-sunk); }
.phones-table tr.pdetail td { background: var(--c-sunk); padding-top: 4px; }
.pd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pd-title { font: 600 11.5px var(--f-body); text-transform: uppercase; letter-spacing: .07em; color: var(--c-muted); margin: 0 0 6px; }
.pd-item + .pd-item { margin-top: 8px; }
.pd-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.pd-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-line); }
.pd-policy { color: var(--c-muted); font-size: 13.5px; flex: 1 1 260px; }
.quick-reasons { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-reasons[hidden] { display: none; }
.quick-reasons .chip { cursor: pointer; white-space: normal; text-align: left; }
.decided-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.decided-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.decided-text { color: var(--c-ink); overflow-wrap: anywhere; }
.btn-link { min-height: 0; padding: 0; font-weight: 600; }
@media (max-width: 760px) {
  .toolbar .seg { overflow-x: auto; max-width: 100%; }
  .toolbar-search { max-width: none; flex-basis: 100%; }
  .toolbar-select { flex: 1; }
  .toolbar-field { flex: 1 1 100%; }
  .toolbar-field .form-control { width: auto; flex: 1; }
  .pd-grid { grid-template-columns: 1fr; }
  table.cards-on-phone td.cell-pick { justify-content: flex-start; }
  table.cards-on-phone td.cell-pick:empty, table.cards-on-phone td.cell-pick[hidden] { display: none; }
  table.cards-on-phone tr.pdetail { margin-top: -12px; border-top: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--c-sunk); }
  table.cards-on-phone tr.pdetail td { display: block; }
  table.cards-on-phone tr.sel { background: var(--c-sunk); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .phones-table.cards-on-phone tr.sel td { background: transparent; }
  .row-actions { justify-content: stretch; width: 100%; }
  .row-actions .btn { flex: 1; min-height: 44px; }
}

/* Users page: clickable rows, side panel (step 2.4) */
.users-table tr.clickable { cursor: pointer; }
.users-table tr.clickable:hover td { background: var(--c-sunk); }
.users-table td .pill + .pill { margin-left: 4px; }
.min-w-0 { min-width: 0; }
.user-panel { --bs-offcanvas-width: 480px; --bs-offcanvas-bg: var(--c-surface); --bs-offcanvas-color: var(--c-ink); border-left: 1px solid var(--c-line); }
.user-panel .offcanvas-header { align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--c-line); }
.panel-tabs { margin: 12px 16px 0; align-self: flex-start; max-width: calc(100% - 32px); overflow-x: auto; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--c-line); }
.panel-actions .btn { flex: 1 1 auto; }
.detail-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 16px 0 0; font-size: 14px; }
.detail-list dt { font-weight: 500; color: var(--c-muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { border: 1px solid var(--c-line); border-radius: 10px; padding: 10px 12px; background: var(--c-bg); }
.stat small { display: block; color: var(--c-muted); font-size: 12px; }
.stat b { font-size: 15px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.role-change { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--c-sunk); font-size: 14px; }
@media (max-width: 760px) {
  .user-panel { --bs-offcanvas-width: 100vw; }
}

/* public account pages (forgot / reset password, confirm email) */
.public-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--c-bg); }
.public-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; }
.public-card h1 { font: 800 22px var(--f-display); margin: 4px 0 0; }
.public-brand { display: inline-flex; align-items: center; gap: 10px; font: 800 18px var(--f-display); letter-spacing: .04em; color: var(--c-ink); text-decoration: none; }
.public-brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--c-accent-btn); color: #fff; display: grid; place-items: center; }
.public-card .validation-summary-valid { display: none; }

/* Verification: identity documents (step 2.5) */
.doc-row { display: flex; gap: 12px; flex-wrap: wrap; }
.doc { margin: 0; width: 150px; }
.doc a, .doc-missing { display: grid; place-items: center; width: 150px; height: 110px; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-surface); overflow: hidden; font-size: 12.5px; color: var(--c-muted); text-align: center; padding: 0; }
.doc-missing { padding: 8px; }
.doc img { width: 100%; height: 100%; object-fit: cover; }
.doc figcaption { font-size: 12.5px; color: var(--c-muted); margin-top: 4px; }
.doc-nopreview { padding: 8px; text-decoration: underline; }

/* Overview (step 2.6): queue cards, KPI tiles, the chart */
.queue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.queue-card { display: flex; flex-direction: column; gap: 4px; color: var(--c-ink); text-decoration: none; }
a.queue-card:hover { border-color: var(--c-accent-line); color: var(--c-ink); }
.queue-title { font-size: 13.5px; color: var(--c-muted); }
.queue-count { font: 800 30px var(--f-display); line-height: 1.15; }
.queue-count small { font: 500 14px var(--f-body); color: var(--c-muted); }
.queue-link { margin-top: 6px; font-weight: 600; font-size: 13.5px; color: var(--c-accent); }
.queue-quiet { justify-content: center; background: transparent; box-shadow: none; border-style: dashed; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi small { font-size: 12.5px; color: var(--c-muted); }
.kpi b { font: 800 24px var(--f-display); line-height: 1.2; }
.kpi span { font-size: 12.5px; color: var(--c-muted); }
.chart { position: relative; min-height: 220px; }
.chart .grid { stroke: var(--c-line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis { stroke: var(--c-line); stroke-width: 1; }
.chart .tick { fill: var(--c-muted); font: 11.5px var(--f-body); font-variant-numeric: tabular-nums; }
.chart .col { fill: var(--c-chart); }
.chart .col-today { fill: url(#ov-hatch); stroke: var(--c-chart); stroke-width: 1; }
.chart .hatch-bg { fill: var(--c-surface); }
.chart .hatch-ink { fill: var(--c-chart); }
.chart .hit { fill: transparent; outline: none; cursor: default; }
.chart .hit:hover, .chart .hit:focus-visible { fill: var(--c-ink); fill-opacity: .06; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--c-ink); color: var(--c-bg); border-radius: 8px; padding: 6px 10px; font-size: 13px; white-space: nowrap; pointer-events: none; z-index: 5; }
.chart-tip[hidden] { display: none; }
.chart-tip span { display: block; font-size: 12px; opacity: .75; }
.chart-table summary { font-size: 13px; color: var(--c-muted); cursor: pointer; }
.chart-table table { max-width: 360px; margin-top: 8px; --bs-table-bg: transparent; --bs-table-color: var(--c-ink); --bs-table-border-color: var(--c-line); }
.attention-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.attention-list li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.attention-text { flex: 1 1 240px; }
.app-line { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; font-size: 13.5px; color: var(--c-muted); margin: 0; }
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header .actions { justify-content: space-between; }
}

/* Overview sections (docs/overview-plan.md §4.3): each loads and updates on its own; the wrapper keeps the page's
   spacing; a skeleton has the height of the section it stands for, so nothing moves when the numbers arrive; while new
   numbers are counted the old ones stay and a small spinner turns in the corner; a swapped section glows once */
.ov-sections { display: contents; }
.ov-section { position: relative; display: flex; flex-direction: column; gap: 18px; min-width: 0; border-radius: 12px; }
.ov-age { margin: 0; font-size: 12.5px; color: var(--c-warn); }
.ov-spinner { display: none; position: absolute; top: -7px; right: -7px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--c-accent-line); border-top-color: var(--c-accent); background: var(--c-surface); animation: btn-spin .8s linear infinite; }
.ov-section.is-refreshing > .ov-spinner { display: block; }
.ov-section[aria-busy="true"] > .ov-spinner { display: none; }   /* a skeleton already says it is loading */
.ov-section.ov-updated { animation: ov-glow 1.6s ease-out; }
@keyframes ov-glow { from { box-shadow: 0 0 0 3px var(--c-accent-line); } to { box-shadow: 0 0 0 3px transparent; } }
.ov-status { display: inline-flex; align-items: center; gap: 6px; }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-line); flex: 0 0 8px; }
.ov-status.is-live .ov-dot { background: var(--c-ok); }
.ov-status.is-error .ov-dot { background: var(--c-warn); }
.ov-skel-queue { min-height: 132px; }
.ov-skel-trend .kpi-grid { margin-top: 16px; }
.ov-skel-chart { height: 220px; margin: 16px 0 22px; }
.ov-skel-attention { min-height: 92px; }
.ov-skel-brands { min-height: 320px; }
.ov-skel-line { width: 60%; margin: 2px 0; }
.ov-error { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .ov-section { gap: 14px; } }

/* Overview, SuperAdmin page (docs/overview-plan.md §9.3): rows of two, inbox, tiles, the stacked chart, the hours grid,
   the age bar, lists. Text always in text tokens; colour only on the marks. */
.ov-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ov-row-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.ov-row > .ov-section, .ov-row > .card { height: 100%; }
.ov-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; height: 100%; }
.ov-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ov-head .section-title { margin: 0; }
.ov-more { margin-left: auto; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.ov-asof { margin-left: auto; font-size: 12.5px; color: var(--c-muted); }
.ov-asof + .ov-more { margin-left: 14px; }
.ov-ctl { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ov-ctl .seg button { padding: 6px 11px; font-size: 13px; }
.ov-sub { font-size: 12.5px; color: var(--c-muted); margin-bottom: 8px; }
.ov-inbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ov-inq-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; color: var(--c-ink); }
.ov-qi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.ov-qi .i { width: 16px; height: 16px; }
.ov-qi-r { background: var(--c-accent-soft); color: var(--c-accent); }
.ov-qi-w { background: var(--c-warn-soft); color: var(--c-warn); }
.ov-qi-b { background: var(--c-info-soft); color: var(--c-info); }
.ov-quiet { margin: 10px 0 0; font-size: 13px; color: var(--c-muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ov-quiet .i { width: 15px; height: 15px; color: var(--c-ok); }
.ov-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ov-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ov-tile small { font-size: 12.5px; color: var(--c-muted); }
.ov-tile b { font: 800 24px var(--f-display); line-height: 1.2; }
.ov-tile > span { font-size: 12.5px; color: var(--c-muted); }
.ov-tile > span.ov-up { color: var(--c-ok); }
.ov-spark { width: 100%; height: 30px; margin-top: 6px; display: block; }
.ov-spark polyline { fill: none; stroke: var(--c-muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ov-spark rect { fill: var(--c-muted); opacity: .35; }
.ov-spark rect.now { fill: var(--c-chart); opacity: 1; }
.ov-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-ink); }
.ov-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ov-legend .sw-line { width: 14px; height: 2px; border-radius: 1px; vertical-align: 3px; background: var(--c-ink); }
.ov-legend .sw-today { background: repeating-linear-gradient(45deg, var(--c-ty1) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--c-ty1); }
.sw.ty1, .chart .ty1 { background: var(--c-ty1); fill: var(--c-ty1); } .sw.ty2, .chart .ty2 { background: var(--c-ty2); fill: var(--c-ty2); }
.sw.ty3, .chart .ty3 { background: var(--c-ty3); fill: var(--c-ty3); } .sw.ty4, .chart .ty4 { background: var(--c-ty4); fill: var(--c-ty4); }
.sw.ty5, .chart .ty5 { background: var(--c-ty5); fill: var(--c-ty5); }
.chart .decided { fill: none; stroke: var(--c-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .decided-dot { fill: var(--c-ink); stroke: var(--c-surface); stroke-width: 2; }
.ov-heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 11px; color: var(--c-muted); align-items: center; }
.ov-heat span { height: 18px; border-radius: 3px; background: var(--c-sunk); }
.ov-heat em { font-style: normal; }
.ov-heat .hx { background: none; height: auto; font-size: 10.5px; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.ov-heat .h1, .ov-scale .h1 { background: var(--c-h1); } .ov-heat .h2 { background: var(--c-h2); } .ov-heat .h3, .ov-scale .h3 { background: var(--c-h3); }
.ov-heat .h4 { background: var(--c-h4); } .ov-heat .h5, .ov-scale .h5 { background: var(--c-h5); } .ov-heat .h6 { background: var(--c-h6); }
.ov-heat .h7, .ov-scale .h7 { background: var(--c-h7); }
.ov-scale { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--c-muted); }
.ov-scale span { width: 18px; height: 10px; border-radius: 2px; }
.ov-note { margin: 0; display: flex; gap: 10px; align-items: flex-start; background: var(--c-sunk); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--c-ink); }
.ov-note .i { width: 16px; height: 16px; color: var(--c-muted); flex: none; margin-top: 2px; }
.ov-figs, .ov-nums { display: grid; gap: 10px; }
.ov-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ov-nums { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.ov-figs > div, .ov-nums > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ov-nums > div { border: 1px solid var(--c-line); border-radius: 10px; padding: 10px 12px; }
.ov-figs b, .ov-nums b { font: 800 20px var(--f-display); }
.ov-figs span, .ov-nums span { font-size: 12.5px; color: var(--c-muted); }
.ov-agebar { width: 100%; height: 28px; display: block; }
.ov-agebar .a1, .sw.a1 { fill: var(--c-age1); background: var(--c-age1); } .ov-agebar .a2, .sw.a2 { fill: var(--c-age2); background: var(--c-age2); }
.ov-agebar .a3, .sw.a3 { fill: var(--c-age3); background: var(--c-age3); } .ov-agebar .a4, .sw.a4 { fill: var(--c-age4); background: var(--c-age4); }
.ov-agebar + .ov-legend { margin-top: 8px; }
.ov-tlist, .ov-jlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ov-tlist li, .ov-jlist li { display: grid; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--c-line); font-size: 13.5px; }
.ov-tlist li { grid-template-columns: minmax(0, 1fr) auto 90px; }
.ov-tlist li > a { text-align: right; font-weight: 600; font-size: 13px; }
.ov-jlist li { grid-template-columns: minmax(0, 1fr) 150px 112px; }
.ov-tlist li:last-child, .ov-jlist li:last-child { border-bottom: 0; }
.ov-tlist small { color: var(--c-muted); font-size: 12.5px; }
.ov-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ov-chips span { font-size: 11.5px; border: 1px solid var(--c-line); border-radius: 99px; padding: 1px 8px; color: var(--c-ink); }
.ov-prog { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.ov-prog progress { flex: 1; height: 8px; min-width: 60px; }
.ov-prog > span { font-size: 12.5px; width: 38px; text-align: right; }
.ov-tag { font-size: 11px; padding: 0 7px; margin-left: 6px; }
.ov-tag::before { display: none; }
/* skeleton heights from the sections' measured heights (rehearsal data, 1440 px), so a cold start barely shifts */
.ov-inbox .ov-skel-queue { min-height: 189px; }
.ov-skel-tile { min-height: 165px; }
.ov-row-wide .ov-skel-trend, .ov-skel-side { min-height: 494px; }
.ov-skel-block { display: block; height: 200px; border-radius: 6px; }
.ov-skel-card { min-height: 300px; }
.ov-skel-review, .ov-skel-trust { min-height: 620px; }
.ov-skel-jobs, .ov-skel-tasks { min-height: 400px; }
.ov-skel-app { min-height: 214px; }
.ov-skel-brands-sa { min-height: 700px; }
@media (max-width: 1100px) { .ov-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .ov-row, .ov-row-wide { grid-template-columns: minmax(0, 1fr); }
  .ov-inbox { display: flex; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .ov-inbox > * { flex: 0 0 160px; }
  .ov-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-tiles > :first-child { grid-column: 1 / -1; }
  .ov-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-heat { grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 1px; }
  .ov-heat span { height: 14px; border-radius: 2px; }
  .ov-jlist li { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-jlist li .ov-prog { grid-column: 1 / -1; order: 3; }
  .ov-tlist li { grid-template-columns: minmax(0, 1fr) auto; }
  .ov-tlist li > a, .ov-tlist li > span:last-child:empty { grid-column: 2; }
}

/* Jobs (phase 3): list, workspace tabs, bars */
.jobs-table .job-title { font-weight: 600; color: var(--c-ink); text-decoration: none; }
.jobs-table .job-title:hover { color: var(--c-accent); text-decoration: underline; }
.seg a[aria-current="true"] { background: var(--c-ink); color: var(--c-bg); }
progress { appearance: none; -webkit-appearance: none; height: 6px; border: 0; border-radius: 99px; background: var(--c-sunk); overflow: hidden; vertical-align: middle; }
progress::-webkit-progress-bar { background: var(--c-sunk); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--c-chart); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--c-chart); border-radius: 99px; }
.job-progress { display: block; width: 120px; margin-top: 6px; }
.job-heading { align-items: center; }
.job-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--c-line); scrollbar-width: thin; }
.job-tabs a { padding: 10px 14px; white-space: nowrap; color: var(--c-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.job-tabs a:hover { color: var(--c-ink); }
.job-tabs a[aria-current="page"] { color: var(--c-ink); border-bottom-color: var(--c-accent); }
.job-tabs em { font-style: normal; margin-left: 6px; font-size: 12px; background: var(--c-accent-soft); color: var(--c-accent); border-radius: 99px; padding: 1px 7px; }
.bar-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bar-list li { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) max-content; gap: 12px; align-items: center; font-size: 14px; }
.bar-list progress { width: 100%; height: 8px; }
.job-description { white-space: pre-line; }
@media (max-width: 760px) {
  .job-tabs { margin-inline: -16px; padding-inline: 16px; }
  .bar-list li { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) max-content; }
}
.danger-zone { border-color: var(--c-bad-line); }

/* Review queue (phase 4) */
.review-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.review-list { display: flex; flex-direction: column; overflow: hidden; }
.review-list-head { padding: 12px 14px; border-bottom: 1px solid var(--c-line); }
.review-items { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.review-item { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--c-line); cursor: pointer; outline: none; }
.review-item:hover { background: var(--c-sunk); }
.review-item[aria-selected="true"] { background: var(--c-accent-soft); box-shadow: inset 3px 0 0 var(--c-accent); }
.review-item:focus-visible { box-shadow: inset 0 0 0 2px var(--c-accent); }
.review-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.review-pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; }
.review-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); overflow: hidden; }
.review-detail[hidden] { display: none; }
.review-shot { background: var(--c-sunk); display: grid; place-items: center; min-height: 420px; max-height: 78vh; overflow: auto; }
.review-shot img { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; }
.review-shot-missing { color: var(--c-muted); padding: 24px; }
.review-info { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--c-line); }
.review-decide { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--c-line); display: flex; flex-direction: column; gap: 10px; }
.review-buttons { display: flex; gap: 10px; }
.review-buttons .btn { flex: 1; min-height: 46px; }
kbd { font: 600 11px var(--f-body); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .7; }
.more-filters { position: relative; }
.more-filters summary { list-style: none; cursor: pointer; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 240px; padding: 12px; display: flex; flex-direction: column; gap: 6px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); box-shadow: var(--c-shadow); }
@media (max-width: 1100px) {
  .review-detail { grid-template-columns: 1fr; }
  .review-info { border-left: 0; border-top: 1px solid var(--c-line); }
}
@media (max-width: 760px) {
  /* one screenshot at a time; the decision buttons stay above the tab bar */
  .review-layout { grid-template-columns: 1fr; }
  .review-items { max-height: 30vh; }
  .review-shot { min-height: 260px; max-height: 60vh; }
  /* the decision stays on screen, just above the tab bar */
  .review-decide { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); z-index: 25;
    margin: 0; padding: 10px 16px; background: var(--c-surface); border-top: 1px solid var(--c-line); box-shadow: 0 -8px 20px -14px rgba(0, 0, 0, .5); }
  .review-info { padding-bottom: 96px; }
  .review-layout.show-list .review-decide { display: none; }
  .review-keys, kbd { display: none; }
  .more-filters-box { right: auto; left: 0; }
}
.review-list-toggle { display: none; }
@media (max-width: 760px) {
  .review-list-toggle { display: inline-flex; align-self: flex-start; }
  .review-layout:not(.show-list) .review-list { display: none; }
  .review-layout.show-list .review-detail { display: none; }
  .review-layout.show-list .review-items { max-height: none; }
}

/* Worker home (phase 5) */
.app-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-color: var(--c-accent-line); background: var(--c-accent-soft); }
.today-job { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.today-count { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.today-count progress { width: 120px; }
.today-job { flex-wrap: wrap; }
.today-job > .min-w-0 { flex: 1 1 180px; }
.today-count .pill { white-space: normal; }

/* a cell with a number and a line under it (brand overview): one block, right-aligned on phone cards */
.cell-stack { min-width: 0; }
@media (max-width: 760px) { table.cards-on-phone td .cell-stack { text-align: right; } table.cards-on-phone td .cell-stack .job-progress { margin-left: auto; } }

/* Find jobs (step 5.2): job cards, two columns on wide screens; descriptions keep the brand's line breaks */
.job-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.feed-job { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feed-job-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.feed-job-title { font-weight: 600; font-size: 16px; color: var(--c-ink); text-decoration: none; min-width: 0; flex: 1 1 200px; }
.feed-job-title:hover { text-decoration: underline; }
.feed-job-text { margin: 4px 0 0; color: var(--c-muted); white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-job-foot { margin-top: auto; padding-top: 8px; }
.job-text { white-space: pre-line; overflow-wrap: anywhere; }
/* the period filter's optional time beside each date (the job's Analytics tab) */
.period-time { flex: 0 0 7.5rem; min-width: 0; }
/* an activity link's description on the job's Activity links tab: line breaks kept, three lines at most (all of it on hover) */
.link-description { white-space: pre-line; overflow-wrap: anywhere; max-width: 48ch; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) { .job-feed { grid-template-columns: 1fr; } .feed-job-foot .btn { width: 100%; min-height: 44px; } }

/* My jobs (step 5.2): a post link with the worker's count on the right; stacked on phones */
.link-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.link-row > .min-w-0 { flex: 1 1 auto; }
@media (max-width: 760px) { .link-row { flex-direction: column; gap: 2px; } }

/* Feedback (step 5.2): the screenshot beside the message; unread ones marked on the left edge */
.feedback-item { display: flex; flex-direction: row; gap: 16px; align-items: flex-start; }
.feedback-item.is-new { box-shadow: inset 3px 0 0 var(--c-warn); }
.feedback-shot { flex: 0 0 88px; display: block; border-radius: var(--r-md, 8px); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-sunk); }
.feedback-shot img { display: block; width: 88px; height: 120px; object-fit: cover; object-position: top; }
.feedback-body { flex: 1 1 auto; }
.feedback-message { margin: 8px 0 4px; white-space: pre-line; overflow-wrap: anywhere; font-size: 15px; }
@media (max-width: 760px) { .feedback-shot { flex-basis: 64px; } .feedback-shot img { width: 64px; height: 88px; } .feedback-item { gap: 12px; } }

/* Team pages (step 5.2): tabs as a segmented nav (aria-current="page"), forms of a readable width */
.seg [aria-current="page"] { background: var(--c-ink); color: var(--c-bg); }
.seg-tabs { align-self: flex-start; max-width: 100%; overflow-x: auto; }
.seg-tabs .pill { font-size: 11.5px; padding: 1px 8px; }
.team-form { max-width: 560px; }
.member-names { columns: 2 160px; display: block; }
.member-names li { break-inside: avoid; margin-bottom: 6px; }

/* Profile and Facebook profiles (step 5.2) */
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; }
.profile-facts dt { color: var(--c-muted); font-weight: 500; }
.profile-facts dd { margin: 0; }
.fb-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 12px; align-items: end; }
.fb-item.is-hidden { opacity: .7; }
.fb-edit { flex: 1 1 100%; }
.fb-edit > summary { list-style: none; display: inline-block; }
.fb-edit > summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) { .fb-add { grid-template-columns: 1fr; } .fb-edit { flex-basis: auto; } }

/* Verification (step 5.2) */
.verify-state p { max-width: 70ch; }
.verify-state > .pill { align-self: flex-start; }
.verify-form { max-width: 920px; }
.verify-files { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.verify-file { display: flex; flex-direction: column; gap: 4px; text-decoration: none; width: 140px; }
.verify-file img, .verify-pdf { width: 140px; height: 100px; object-fit: cover; border-radius: var(--r-md, 8px); border: 1px solid var(--c-line); background: var(--c-sunk); }
.verify-pdf { display: grid; place-items: center; font-weight: 600; color: var(--c-muted); }

/* Register (step 5.3): brand fields only for a brand, worker fields otherwise, without a script (CSP) */
.register-form .register-brand { display: none !important; }
.register-form:has(input[name="Input.RegisterAs"][value="Brand"]:checked) .register-brand { display: flex !important; }
.register-form:has(input[name="Input.RegisterAs"][value="Brand"]:checked) .register-worker { display: none !important; }
.register-as { display: flex; width: 100%; }
.register-as label { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 12px; cursor: pointer; border-right: 1px solid var(--c-line); }
.register-as label:last-child { border-right: 0; }
.register-as label:has(input:checked) { background: var(--c-ink); color: var(--c-bg); }
.public-card fieldset { border: 0; margin: 0; padding: 0; }

/* Public site of chumbok.co (step 5.3): landing, About, Terms, Privacy, Refund */
.site-page { background: var(--c-bg); color: var(--c-ink); min-height: 100vh; display: flex; flex-direction: column; }
.site-page main { flex: 1; }
.site-wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 16px; }
.site-header { border-bottom: 1px solid var(--c-line); background: var(--c-surface); position: sticky; top: 0; z-index: 10; }
.site-header .site-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; }
.site-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-nav > a:not(.btn) { color: var(--c-ink); text-decoration: none; font-weight: 500; }
.site-nav > a:not(.btn):hover { text-decoration: underline; }
.site-hero { padding: 72px 0 56px; }
.site-hero h1 { font: 800 clamp(32px, 5vw, 52px)/1.1 var(--f-display); max-width: 16ch; margin: 0 0 16px; }
.site-hero p { font-size: 18px; color: var(--c-muted); max-width: 60ch; margin: 0 0 24px; }
.site-section { padding: 40px 0; }
.site-section h2 { font: 800 26px var(--f-display); margin: 0 0 6px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.site-grid li { display: flex; flex-direction: column; gap: 6px; }
.site-faq { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; max-width: 820px; }
.site-faq summary { font-weight: 600; cursor: pointer; }
.site-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; align-items: start; }
.site-footer { border-top: 1px solid var(--c-line); padding: 20px 0; margin-top: 32px; color: var(--c-muted); font-size: 14px; }
.site-footer .site-wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-doc { width: min(820px, 100%); margin: 0 auto; padding: 40px 16px; line-height: 1.65; }
.site-doc h1 { font: 800 32px var(--f-display); margin-bottom: 20px; }
.site-doc h2 { font: 700 18px var(--f-display); margin: 28px 0 8px; }
.site-doc li { margin-bottom: 6px; }
@media (max-width: 760px) {
  .site-hero { padding: 40px 0 32px; }
  .site-contact { grid-template-columns: 1fr; gap: 16px; }
  .site-nav { gap: 10px; }
  .site-nav > a:not(.btn) { display: none; }
}

/* system pages (step 6.1) */
.bug-shot, .shot-thumb { display: block; overflow: hidden; font-size: 0; color: transparent; width: 56px; height: 76px; object-fit: cover; object-position: top; border-radius: var(--r-md, 8px); border: 1px solid var(--c-line); background: var(--c-sunk); }
/* Suspicious screenshots (security plan §12): a flagged screenshot next to the one it looks like */
.suspect-shot { display: block; width: 220px; max-width: 100%; height: auto; border-radius: var(--r-md, 8px); border: 1px solid var(--c-line); background: var(--c-sunk); }
/* a screenshot as a thumbnail beside its details (Team › Screenshots): its top part; the popup shows all of it */
.shot-row { display: flex; gap: 14px; align-items: flex-start; }
.shot-thumb { flex: none; display: block; }
.shot-thumb img { display: block; width: 150px; height: auto; max-height: 260px; object-fit: cover; object-position: top;
  border-radius: var(--r-md, 8px); border: 1px solid var(--c-line); background: var(--c-sunk); }
@media (max-width: 760px) {
  .shot-row { gap: 10px; }
  .shot-thumb img { width: 92px; max-height: 170px; }
}
.table-card td details > summary { list-style: none; cursor: pointer; display: inline-flex; }
.table-card td details > summary::-webkit-details-marker { display: none; }
.table-card td details[open] { min-width: 240px; }
details.card > summary { cursor: pointer; }
.code-wrap { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; word-break: break-all; }
@media (max-width: 760px) { table.cards-on-phone td.cell-main .cell-stack { text-align: left; } }
fieldset > legend.form-label { float: none; font-size: inherit; font-weight: 500; margin-bottom: 6px; }
table.cards-on-phone td.cell-main .cell-sub, .table-card td.cell-main .cell-sub { font-weight: 400; }
.note-text { white-space: pre-line; }
.posting-media { width: 140px; }
.posting-media img, .posting-media video { display: block; width: 140px; height: 140px; object-fit: cover; border-radius: var(--r-md, 8px); border: 1px solid var(--c-line); background: var(--c-sunk); }
/* account settings (step 6.5a): the scaffolded Identity pages inside the new layout */
.account-page h3, .account-page h4 { font-size: 1.05rem; font-weight: 600; margin-bottom: .75rem; }
.account-page .form-group { margin-bottom: .75rem; }
.account-page .col-md-6 { max-width: 560px; }

/* step 6.5b: profiles, member limits */
.profile-picture { border-radius: 50%; object-fit: cover; }
.limit-input { width: 7.5rem; }
/* step 6.5c: payment */
.table-card tfoot th { border-bottom: 0; border-top: 1px solid var(--c-line); text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--c-ink); }
.table-card tfoot td { border-top: 1px solid var(--c-line); }
.inline-edit > summary { list-style: none; display: inline-block; }
.inline-edit > summary::-webkit-details-marker { display: none; }
.public-card.public-wide { width: min(780px, 100%); }
.pay-icons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* step 6.5d: the Screenshots list's grid view (the old Gallery) */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.shot-card { margin: 0; overflow: hidden; display: flex; flex-direction: column; }
.shot-card img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; object-position: top; background: var(--c-line); }
.shot-card figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
details.card > summary.section-title { list-style: revert; }
/* step 6.5d-2: a seeding post's picture or video */
.seed-media { display: block; width: 100%; max-height: 480px; object-fit: contain; border-radius: var(--r-md, 8px); border: 1px solid var(--c-line); background: var(--c-sunk); }

/* 8.5av: the picture viewer (app/lightbox.js): screenshots open in a popup on the page */
/* fixed to the screen's edges (100vw would include the page's scrollbar and push the buttons out of sight) */
dialog.lightbox { position: fixed; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden; }
dialog.lightbox[open] { display: flex; flex-direction: column; }
dialog.lightbox::backdrop { background: rgba(8, 10, 14, .88); }
.lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; }
.lightbox-count { font-size: 14px; opacity: .8; min-width: 3.5em; }
.lightbox-caption { flex: 1; min-width: 0; font-size: 14px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-open { color: #fff; font-size: 14px; font-weight: 600; text-decoration: underline; white-space: nowrap; }
.lightbox-open:hover, .lightbox-open:focus-visible { color: #fff; opacity: .85; }
.lightbox-close, .lightbox-nav { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; flex: none; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible, .lightbox-open:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox-close .i, .lightbox-nav .i { width: 22px; height: 22px; }
.lightbox-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px 16px; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 8px 40px rgba(0, 0, 0, .5); }
.lightbox-nav[hidden] { display: none; }
@media (max-width: 600px) {
  .lightbox-stage { padding: 0 8px 8px; gap: 0; position: relative; }
  .lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-open { display: none; }
}
