/* THZ Custom Workshop: the staff review board. Light, square and quiet like the platform's other staff pages (hairlines,
   Inter, no rounding), with THZ's violet for actions. The customer's page (style.css) is the dark, branded one. */
/* Inter (SIL Open Font License 1.1: docs/licenses/inter-OFL.txt), its Latin letters, served from here */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(assets/inter.woff2) format('woff2'); }

:root {
  --bg: #f4f3f6;
  --surface: #ffffff;
  --surface-2: #faf9fb;
  --line: #e4e1ea;
  --line-strong: #cfcad8;
  --ink: #1c1724;
  --ink-2: #3d3648;
  --muted: #6e6779;
  --violet: #7a35f0;
  --violet-dark: #5f22c9;
  --violet-bg: #f3ecff;
  --ok: #17865a;
  --ok-bg: #e8f6ef;
  --warn: #a86400;
  --warn-bg: #fff4e0;
  --bad: #c0283c;
  --bad-bg: #fdecee;
  --awaiting: #9a94a6;
  --ai_failed: #c0283c;
  --submitted: #7a35f0;
  --in_review: #2f6fde;
  --resubmit: #d98a00;
  --approved: #17865a;
  --cancelled: #6e6779;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; border-radius: 0; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 13.5px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--violet-dark); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }
.ic { display: inline-flex; width: 15px; height: 15px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* The loading spinner: a plain thin ring, the one round thing on the board (owner, 2026-10-12: "simple, conventional").
   It fades in after a moment, so a quick load shows nothing at all. Kept at its own size inside the pages, whose other
   blocks stretch to the full width. */
.boot, .page-body > .boot { flex: none; align-self: center; width: 24px; height: 24px; max-width: none; margin: 64px auto; border: 2px solid var(--line); border-top-color: var(--violet); border-radius: 50%; animation: spin .7s linear infinite, boot-in .2s ease .25s both; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes boot-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 13px/1 var(--sans);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.primary:hover { background: var(--violet-dark); border-color: var(--violet-dark); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; min-height: 40px; }
.btn.approve { border-color: var(--ok); color: var(--ok); }
.btn.approve:hover { background: var(--ok-bg); }
.btn.reject { border-color: var(--bad); color: var(--bad); }
.btn.reject:hover { background: var(--bad-bg); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
input[type=email], input[type=password], input[type=search], input[type=text], textarea, select {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 13.5px/1.4 var(--sans); padding: 7px 9px;
}
textarea { resize: vertical; }
select { width: auto; padding: 5px 8px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; white-space: nowrap; }
.toggle input { accent-color: var(--violet); margin: 0; }
.form-error { color: var(--bad); margin: 6px 0 0; }
.tag { display: inline-block; padding: 1px 5px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: 1px; }
.reg { display: inline-block; padding: 1px 6px; background: #ffd400; border: 1px solid #c9a800; color: #111; font: 700 11.5px/1.5 var(--sans); letter-spacing: .04em; }

/* ---------- sign-in ---------- */
.signin-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.signin { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--line); padding: 28px 24px; display: grid; gap: 6px; }
.signin-brand { background: #16121c; margin: -28px -24px 14px; padding: 22px 0; display: grid; place-items: center; }
.signin-logo { width: 170px; height: auto; }
.signin h1 { font-size: 18px; text-align: center; }
.signin > p { text-align: center; margin: 0 0 10px; }
.signin label { font-weight: 600; font-size: 12.5px; margin-top: 6px; }
.signin .btn { margin-top: 14px; }

/* ---------- the board ---------- */
/* ---------- the frame: an icon menu on the left that opens on hover, the page beside it ---------- */
.app-shell { height: 100%; }
.rail { position: fixed; left: 0; top: 0; bottom: 0; width: 56px; z-index: 30; display: flex; flex-direction: column; background: #16121c; color: #cfc9d8; overflow: hidden; transition: width .14s ease, box-shadow .14s ease; }
.rail:hover, .rail:focus-within { width: 212px; box-shadow: 8px 0 24px rgba(0, 0, 0, .18); }
.rail-brand { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 12px; border-bottom: 1px solid #2c2535; color: #fff; text-decoration: none; font-weight: 650; white-space: nowrap; }
.rail-brand img { width: 32px; height: 32px; flex: none; object-fit: contain; }
.rail-items { display: flex; flex-direction: column; padding: 8px 0; gap: 2px; }
.rail-item { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 18px; color: #cfc9d8; text-decoration: none; background: none; border: 0; border-left: 3px solid transparent; font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap; width: 100%; text-align: left; }
.rail-item .ic { width: 18px; height: 18px; }
.rail-item:hover { background: #241e2c; color: #fff; }
.rail-item.on { color: #fff; background: #2a2233; border-left-color: var(--violet); }
.rail-label { opacity: 0; transition: opacity .1s; overflow: hidden; text-overflow: ellipsis; }
.rail:hover .rail-label, .rail:focus-within .rail-label { opacity: 1; }
.rail-foot { margin-top: auto; border-top: 1px solid #2c2535; padding: 8px 0; }
.rail-user { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 13px; white-space: nowrap; color: #a59db1; font-size: 12.5px; }
.avatar { width: 28px; height: 28px; flex: none; display: grid; place-items: center; background: var(--violet); color: #fff; font-weight: 700; font-size: 13px; }
.view { margin-left: 56px; height: 100%; min-width: 0; }
.view-board { display: grid; grid-template-rows: auto auto 1fr; }
.view-texts, .view-settings { display: flex; flex-direction: column; }
.page-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.page-body > * { max-width: 1180px; width: 100%; }
.test-bar { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 7px 16px; background: var(--warn-bg); border-bottom: 1px solid #f0d199; color: #5c3a00; font-size: 13px; }
.test-bar[hidden] { display: block; padding: 0; border: 0; } /* keeps its grid row, at no height */
.topbar { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar { min-height: 56px; }
.topbar h1 { font-size: 16px; }
.search { position: relative; flex: 1 1 200px; max-width: 340px; }
.search .ic { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 30px; }
.tools { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: 12px var(--sans); cursor: pointer; }
.pill.spinning .ic { animation: spin .8s linear infinite; }

.board { display: flex; gap: 10px; padding: 12px 16px 16px; overflow-x: auto; min-height: 0; }
.col { flex: 1 1 0; min-width: 240px; display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-top: 3px solid var(--awaiting); min-height: 0; }
.col-ai_failed { border-top-color: var(--ai_failed); }
.col-submitted { border-top-color: var(--submitted); }
.col-in_review { border-top-color: var(--in_review); }
.col-resubmit { border-top-color: var(--resubmit); }
.col-approved { border-top-color: var(--approved); }
.dot { display: inline-block; width: 9px; height: 9px; flex: none; background: var(--awaiting); }
.dot-ai_failed { background: var(--ai_failed); }
.dot-submitted { background: var(--submitted); }
.dot-in_review { background: var(--in_review); }
.dot-resubmit { background: var(--resubmit); }
.dot-approved { background: var(--approved); }
.dot-cancelled { background: var(--cancelled); }
.col.over { background: var(--violet-bg); outline: 2px dashed var(--violet); outline-offset: -4px; }
.col > header { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 9px 10px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
.col > header b { font-size: 13px; }
.col > header .count { font-weight: 650; color: var(--muted); }
.col > header small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 60px; flex: 1; }
.empty { color: var(--muted); text-align: center; margin: 14px 0; font-size: 12.5px; }

.card { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; cursor: pointer; color: inherit; font: inherit; }
.card:hover { border-color: var(--line-strong); }
.card.active { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); }
.card.dragging { opacity: .45; }
.card[draggable=true] { cursor: grab; }
.card-top { display: flex; align-items: center; gap: 2px; }
.card-top b { font-size: 13.5px; }
.card-name { color: var(--ink-2); margin: 1px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.regs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.card-meta .bad { color: var(--bad); font-weight: 600; }
.flag { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; }
.flag .ic { width: 13px; height: 13px; }
.flag.tick { background: var(--ok-bg); color: var(--ok); border: 1px solid #b9e3cf; }
.flag.question { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0d199; }
/* AI Check Failed: which documents, and why, on the card. */
.card-warn { list-style: none; margin: 6px 0 0; padding: 6px 8px; background: var(--bad-bg); border: 1px solid #f3c2c9; color: var(--bad); display: flex; flex-direction: column; gap: 3px; font-size: 12px; line-height: 1.35; }
.card-warn li { display: flex; gap: 6px; align-items: flex-start; }
.card-warn .ic { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.card-warn b { font-weight: 600; }

/* ---------- one order ---------- */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -12px 0 32px rgba(28, 23, 36, .1); display: flex; flex-direction: column; z-index: 35; }
.panel-body { overflow-y: auto; padding: 16px 18px 24px; flex: 1; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.facts > * { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.facts > *:nth-child(odd) { border-right: 1px solid var(--line); }
.facts > label { font-size: 12px; color: var(--muted); }
.stage-field { font-size: 12px; }

/* ---------- our dropdown ---------- */
.dd { position: relative; margin-top: 2px; }
.dd-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 13.5px var(--sans); cursor: pointer; text-align: left; }
.dd-btn:hover:not(:disabled) { border-color: var(--ink-2); }
.dd-btn[aria-expanded=true] { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.dd-btn:disabled { cursor: default; background: var(--surface-2); color: var(--muted); }
.dd-value { flex: 1; }
.dd-btn .ic { width: 14px; height: 14px; color: var(--muted); }
.dd-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; margin: 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 10px 28px rgba(28, 23, 36, .16); outline: none; min-width: 240px; }
.dd-opt { display: flex; align-items: center; gap: 9px; padding: 8px 11px; cursor: pointer; }
.dd-opt span { display: flex; flex-direction: column; flex: 1; }
.dd-opt b { font-weight: 600; font-size: 13.5px; }
.dd-opt small { color: var(--muted); font-size: 11.5px; }
.dd-opt .ic { width: 14px; height: 14px; color: var(--violet); }
.dd-opt:hover, .dd-opt.focus { background: var(--violet-bg); }
.dd-opt.on b { color: var(--violet-dark); }
.dd-opt.off { cursor: default; opacity: .55; }
.dd-opt.off:hover { background: none; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.customer-link { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 0; }
.customer-link p { margin: 0; }
.link-text { width: 100%; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink-2); background: var(--surface-2); }
.note-state { margin: 0 0 10px; padding: 6px 9px; border: 1px solid var(--line); font-size: 12.5px; }
.note-state.ok { color: var(--ok); }
.note-state.warn { color: var(--warn); background: var(--warn-bg); border-color: #f0d199; }
.note-state.bad { color: var(--bad); background: var(--bad-bg); border-color: #f2bcc4; }
.banner { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; margin: 0 0 10px; background: var(--warn-bg); border: 1px solid #f0d199; color: #5c3a00; }
.plates { display: grid; gap: 6px; margin: 4px 0 6px; }
.plates > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.slot { border-top: 1px solid var(--line); padding: 14px 0 6px; margin-top: 12px; }
.slot h3 { font-size: 14px; margin: 0; }
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.add-doc { display: inline-flex; }
.adding { margin: 0; font-size: 13px; color: var(--violet-dark); }
.hint { margin: 0 0 10px; padding: 9px 11px; background: var(--violet-bg); border: 1px solid #ddcdfb; color: var(--ink-2); font-size: 13px; }
.reg-form { display: grid; gap: 4px; margin: 0 0 10px; }
.reg-row { display: flex; gap: 6px; flex-wrap: wrap; }
.reg-input { width: 140px; text-transform: uppercase; font-family: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line-strong); }
.col-cancelled { border-top-color: var(--cancelled); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.doc { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.preview { display: block; border: 1px solid var(--line); background: var(--surface-2); height: 200px; }
.preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview.file { display: grid; place-items: center; text-decoration: none; color: var(--ink-2); }
.file-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; }
.file-tile .ic { width: 40px; height: 40px; color: var(--violet); }
.doc-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.doc-file { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; width: fit-content; }
.check { padding: 8px 10px; border: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.check .check-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.check.ok { background: var(--ok-bg); border-color: #b9e3cf; color: var(--ok); }
.check.warn { background: var(--warn-bg); border-color: #f0d199; color: var(--warn); display: block; }
.check.none { background: var(--surface-2); color: var(--ink-2); }
.check span { color: var(--ink-2); }
.check ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink); }
.review { display: flex; flex-direction: column; gap: 8px; }
.decision { display: flex; gap: 6px; align-items: flex-start; }
.decision.ok { color: var(--ok); }
.decision.bad { color: var(--bad); }
.decision span { color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions.end { justify-content: flex-end; }
.reject-form { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #f2bcc4; background: #fffafa; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reason { padding: 5px 9px; border: 1px solid var(--line-strong); background: var(--surface); font: 12.5px var(--sans); cursor: pointer; color: var(--ink); }
.reason.on { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.earlier { margin-top: 10px; font-size: 12.5px; }
.earlier summary { cursor: pointer; color: var(--muted); }
.earlier ul { margin: 6px 0 0; padding-left: 18px; }
.history { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.history h3 { font-size: 14px; margin-bottom: 8px; }
.history ul { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.history time { color: var(--muted); white-space: nowrap; font-size: 12px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* ---------- dialogs and messages ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(28, 23, 36, .38); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { font-size: 16px; }
.modal p { margin: 0; }
.rerequest { display: flex; flex-direction: column; gap: 8px; }
.message { margin: 0 0 6px; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--line); font: 12.5px/1.5 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
/* ---------- Order Texts and Settings ---------- */
.island { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.island-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.island-head h2 { font-size: 15px; }
.island p { margin: 0; }
.island-intro { color: var(--ink-2); max-width: 820px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip .ic { width: 12px; height: 12px; }
.chip.ok { color: var(--ok); background: var(--ok-bg); border-color: #b9e3cf; }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: #f2bcc4; }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: #f0d199; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.stats > div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { font-size: 22px; font-weight: 650; }
.stats span { color: var(--muted); font-size: 12px; }
.stats .bad b { color: var(--bad); }
.wording { display: flex; flex-direction: column; gap: 4px; }
.table-island { padding: 0; }
.table-wrap { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.grid th:last-child, .grid td:last-child { border-right: 0; }
.grid tr.problem td { background: #fffafa; }
.grid .nowrap { white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.field-help { font-size: 12px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.row2.top { align-items: start; }
.row2.top > div { display: flex; flex-direction: column; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); width: fit-content; }
.seg-btn { min-height: 32px; padding: 0 16px; border: 0; background: var(--surface); color: var(--ink-2); font: 600 13px var(--sans); cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.on { background: var(--violet); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips code, .copy-cell code { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; overflow-wrap: anywhere; }
.copy-cell { display: flex; align-items: center; gap: 6px; }
.icon-btn.small { width: 26px; height: 26px; flex: none; }
.icon-btn.small .ic { width: 13px; height: 13px; }
.domain-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
textarea.code { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); color: var(--ink-2); white-space: pre; overflow: auto; }
.test-bar a { margin-left: auto; color: #5c3a00; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; background: var(--ink); color: #fff; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.good { background: #10563b; }
.toast.bad { background: #8d1b2b; }

@media (max-width: 720px) {
  .rail, .rail:hover, .rail:focus-within { top: auto; right: 0; width: auto; height: 58px; flex-direction: row; box-shadow: 0 -1px 0 #2c2535; }
  .rail-brand, .rail-user { display: none; }
  .rail-items { flex-direction: row; flex: 1; padding: 0; }
  .rail-foot { margin: 0; border: 0; padding: 0; }
  .rail-item { flex-direction: column; justify-content: center; gap: 3px; height: 58px; padding: 0 6px; border-left: 0; border-top: 3px solid transparent; font-size: 11px; flex: 1; text-align: center; }
  .rail-item.on { border-top-color: var(--violet); }
  .rail-label { opacity: 1; }
  .view { margin-left: 0; height: calc(100% - 58px); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .stats b { font-size: 18px; }
  .topbar { gap: 8px 10px; padding: 8px 12px; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .tools { gap: 10px; margin-left: 0; }
  .pill .txt { display: none; }
  .board { padding: 10px 12px; scroll-snap-type: x mandatory; }
  .col { min-width: 84vw; scroll-snap-align: start; }
  .panel-body { padding: 14px 14px 20px; }
  .doc { grid-template-columns: 1fr; }
  .preview { height: 220px; }
  .facts { grid-template-columns: 1fr; }
  .facts > *:nth-child(odd) { border-right: 0; }
  .panel-foot { padding: 10px 14px; }
}

/* The document viewer: the picture or PDF over the page. */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(28, 23, 36, .82); display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line-strong); }
.viewer-name { min-width: 0; flex: 1 1 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; cursor: zoom-in; display: block; }
.viewer-stage.zoomed { align-items: flex-start; justify-content: flex-start; }
.viewer-stage.zoomed img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-stage iframe { width: 100%; max-width: 1000px; height: 100%; border: 0; background: #fff; }
@media (max-width: 640px) {
  .viewer-bar { padding: 8px 16px; }
  .viewer-stage { padding: 8px; }
}
