/* The whole look. Build screens from these classes; add nothing inline.

   House rules:
   - one typeface (Manrope); weight and colour do the work, not decoration
   - panels with a hairline border, no shadows, no gradients
   - status is a coloured word with a small dot, never a filled badge
   - one accent colour (the brand's), used for "this is live": the current
     menu item, a piece that is ready, an unread row
   - thin line icons only; no emoji
   --ink and --accent come from the brand file and are set by app.js. */
@font-face { font-family: "Manrope"; src: url(/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations"); font-weight: 200 800; font-display: swap; }
:root {
  --ink: #14293E; --accent: #c08a22;
  --bg: #f4f5f6; --panel: #ffffff; --panel-2: #f6f7f8; --line: rgba(16, 24, 32, .10); --line-2: rgba(16, 24, 32, .20);
  --hi: #10181f; --text: #2a343c; --soft: #5f6b74; --faint: #8b959c;
  --ok: #1c7a53; --warn: #9a6200; --bad: #c0362c; --info: #2c63a8;
  --bad-bg: #fbeceb; --warn-bg: #fbf3e2;
  --solid: var(--ink); --on-solid: #fff;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1518; --panel: #151c20; --panel-2: #1a2327; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .17);
  --hi: #fbfcfd; --text: #d3d9dc; --soft: #98a3a8; --faint: #6a767b;
  --ok: #86cfae; --warn: #f0b54f; --bad: #ff8273; --info: #8ab8f0;
  --bad-bg: rgba(255, 130, 115, .10); --warn-bg: rgba(240, 181, 79, .10);
  --solid: #fbfcfd; --on-solid: #0f1518;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 450 15.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--hi); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2 { color: var(--hi); margin: 0; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(24px, 3vw, 31px); line-height: 1.25; }
h2 { font-size: 13px; font-weight: 650; letter-spacing: .01em; color: var(--soft); margin-bottom: 10px; }
p { margin: 0 0 8px; }
strong, b { color: var(--hi); font-weight: 650; }
.muted, .ago, .hint { color: var(--soft); } .ago, .hint { font-size: 13px; font-weight: 450; }
.num, .ago, .prog { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; } .pad { padding: 0 2px 6px; max-width: 46em; }
.boot, .empty { color: var(--faint); padding: 10px 0; margin: 0; font-size: 14.5px; }
[hidden] { display: none !important; }
svg.i { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* The page heading: the point in full colour, the rest in grey. */
.say { color: var(--soft); font-weight: 600; max-width: 26em; } .say b { color: var(--hi); font-weight: 700; }

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; height: 58px; padding: 0 22px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--hi); text-decoration: none; font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; white-space: nowrap; flex: none; }
.mark { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800; letter-spacing: 0; box-shadow: inset 0 -2px 0 var(--accent); }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.nav a { color: var(--soft); font-size: 14.5px; font-weight: 550; padding: 0 10px; white-space: nowrap; text-decoration: none; display: flex; align-items: center; position: relative; }
.nav a:hover { color: var(--hi); }
.nav a.on { color: var(--hi); } .nav a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.top-right { display: flex; align-items: center; gap: 6px; flex: none; }
.iconbtn { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px; border: 1px solid transparent; border-radius: 9px; background: none; color: var(--soft); font: 550 14.5px var(--font); cursor: pointer; text-decoration: none; }
.iconbtn:hover { color: var(--hi); border-color: var(--line); }
.badge { position: absolute; top: 1px; right: 0; background: var(--accent); color: #fff; border-radius: 9px; font-size: 10.5px; font-weight: 800; line-height: 16px; padding: 0 4.5px; min-width: 16px; text-align: center; }

main { max-width: 1120px; margin: 0 auto; padding: 30px 22px 96px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--soft); font-size: 16px; margin: 4px 0 0; } .contact { margin: 6px 0 0; font-size: 14.5px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.foot-link { text-align: center; margin-top: 4px; }

/* ---- panels and rows ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
details.card summary { cursor: pointer; font-size: 13px; font-weight: 650; color: var(--soft); }
details.card[open] summary { margin-bottom: 8px; }
.row { display: flex; gap: 14px; align-items: center; padding: 11px 0; border: 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; width: 100%; text-align: left; background: none; font: inherit; }
.card > .row:first-of-type, h2 + .row { border-top: 0; padding-top: 4px; }
.card > .row:last-child { padding-bottom: 2px; }
a.row:hover strong, .row.as-button:hover strong { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.row.as-button { cursor: pointer; }
.row-main { flex: 1; min-width: 0; } .row-side { flex: none; text-align: right; display: flex; flex-direction: column; gap: 1px; align-items: flex-end; }
.row-side.actions { gap: 6px; }
.row-top { display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; }
.row-sub { color: var(--soft); font-size: 14px; overflow-wrap: anywhere; }
.row-with { font-size: 14px; color: var(--text); margin-top: 1px; } .row-with::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 2px; }
.row.unread .row-main { color: var(--hi); font-weight: 600; } .row.unread .row-main::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 9px; vertical-align: 1px; }
.row.faded { opacity: .5; }
.prog { font-size: 13px; font-weight: 650; color: var(--soft); }
.alert-line { color: var(--bad); font-weight: 600; font-size: 14px; margin-top: 4px; }
.note-line { font-size: 14px; color: var(--soft); margin-top: 3px; }

/* Status: a word and a dot. Kinds: a quiet label. */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip[class*=" k-"] { color: var(--faint); font-weight: 600; min-width: 4.2em; } .chip[class*=" k-"]::before { display: none; }
.chip.ok, .chip.s-done, .chip.a-accepted, .chip.p-received, .chip.e-customer_note { color: var(--ok); }
.chip.open, .chip.s-ready, .chip.p-needed, .chip.a-pending, .chip.e-office_note { color: var(--warn); }
.chip.s-doing, .chip.p-ordered { color: var(--info); }
.chip.a-declined, .chip.a-call { color: var(--bad); }
.chip.mute::before, .chip.s-waiting::before, .chip.s-skipped::before { background: none; border: 1.5px solid currentColor; }

/* ---- buttons and inputs ---- */
.btn { font: 600 14.5px var(--font); height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); color: var(--hi); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn:hover { border-color: var(--soft); }
.btn.primary { background: var(--solid); border-color: var(--solid); color: var(--on-solid); } .btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--bad); } .btn.ghost { border-color: transparent; background: none; color: var(--soft); } .btn.ghost:hover { color: var(--hi); }
.btn.big { height: 44px; padding: 0 20px; font-size: 15.5px; border-radius: 11px; } .btn.small { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: default; }
.link { background: none; border: 0; padding: 0 2px; color: var(--soft); font: inherit; font-weight: 550; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; } .link:hover { color: var(--hi); } .link.small { font-size: 13px; }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  font: 450 15.5px var(--font); padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel); color: var(--hi); width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; line-height: 1.5; }
.field { display: block; margin-bottom: 13px; } .lbl { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; color: var(--text); } .hint { display: block; margin-top: 4px; }
.checks { display: flex; gap: 8px 20px; flex-wrap: wrap; margin: 6px 0 13px; } .checks label, .inline { display: inline-flex; gap: 8px; align-items: center; font-size: 14.5px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ink); flex: none; margin: 0; }
[data-theme="dark"] input[type=checkbox] { accent-color: var(--accent); }
.grid2, .grid3, .grid4 { display: grid; gap: 0 12px; } .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 2fr 1.3fr 1.7fr; } .grid4 { grid-template-columns: 1fr 2.4fr 1fr 1fr; }
.big-search { font-size: 17px !important; padding: 13px 16px !important; border-radius: 12px !important; margin-bottom: 16px; }
.lookup { display: flex; gap: 8px; } .lookup input { width: 220px; }
.filters { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; } .filters input { max-width: 280px; }
/* Tabs are words; the live one is underlined in the accent. */
.tabs { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { font: 600 14.5px var(--font); padding: 0 0 10px; border: 0; background: none; color: var(--soft); cursor: pointer; position: relative; }
.tab:hover { color: var(--hi); } .tab.on { color: var(--hi); } .tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.filters .tabs { margin: 0; border: 0; gap: 16px; } .filters .tab { padding-bottom: 4px; font-size: 13.5px; } .filters .tab.on::after { bottom: 0; }
.card .tabs { margin-bottom: 12px; }

/* ---- requests and overview ---- */
.nav .count { margin-left: 7px; min-width: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; line-height: 17px; text-align: center; }
.req-text { color: var(--hi); margin: 6px 0 4px; font-size: 16px; }
.fact { margin: 0 0 9px; color: var(--soft); } .fact b { color: var(--hi); font-size: 17px; font-variant-numeric: tabular-nums; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.player { width: 100%; margin: 2px 0 12px; height: 40px; }
.transcript { color: var(--hi); line-height: 1.75; margin: 0; }

.lookup-box { margin-bottom: 18px; } .lookup-box .big-search { margin-bottom: 10px; }
.alt { padding: 8px 0 4px; border-top: 1px solid var(--line); } h2 + .alt { border-top: 0; padding-top: 0; } .alt .row { padding: 7px 0; border-top: 0; }
.part-no.small { font-size: 17px; } .lookup-tools { display: flex; gap: 6px 16px; flex-wrap: wrap; margin: 2px 0 14px; } .checks.tight { margin: 0; }
.row > .btn { flex: none; }
.part-head { margin-bottom: 4px; } .part-no { font-size: 22px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; } .hist { margin: 10px 0 0; }

/* ---- my work ---- */
.work { border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; margin-bottom: 10px; background: var(--panel); }
.work.doing { border-color: var(--line-2); }
.work-head { display: block; text-decoration: none; color: inherit; }
.work-step { font-size: 18.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; color: var(--hi); margin: 3px 0 1px; }
.work-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; } .work-actions .ago { margin-right: auto; }
.handoff { margin: 10px 0 0; padding: 2px 0 2px 13px; border-left: 2px solid var(--accent); font-size: 14.5px; color: var(--hi); }
.handoff cite { color: var(--soft); font-size: 13px; font-style: normal; }
.next-line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font-weight: 600; color: var(--hi); background: var(--panel-2); margin-bottom: 14px; }
section.group { margin-bottom: 26px; } section.group > h2 { margin-bottom: 10px; }

/* ---- job page ---- */
.alert-banner { border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-bg); color: var(--bad); font-weight: 650; border-radius: 12px; padding: 11px 15px; margin-bottom: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.alert-banner span, .alert-line { display: flex; gap: 8px; align-items: flex-start; } .alert-banner svg, .alert-line svg { margin-top: 3px; }
.stamp { font-size: 13px; font-weight: 750; letter-spacing: .04em; padding: 5px 10px; border-radius: 7px; margin: 10px 0 4px; display: inline-block; }
.stamp.blocked { background: var(--bad); color: #fff; } .stamp.hold { background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.pieces { list-style: none; margin: 0 0 12px; padding: 0; }
.piece { display: flex; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); align-items: flex-start; } .piece:first-child { border-top: 0; padding-top: 2px; }
.piece-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); color: var(--faint); font-size: 12px; font-weight: 700; line-height: 21px; text-align: center; flex: none; margin-top: 1px; display: grid; place-items: center; }
.piece-dot svg { width: 13px; height: 13px; stroke-width: 2.4; }
.piece.ready .piece-dot { border-color: var(--accent); color: var(--accent); } .piece.doing .piece-dot { background: var(--accent); border-color: var(--accent); color: #fff; } .piece.done .piece-dot { border-color: var(--ok); color: var(--ok); }
.piece.waiting .piece-title strong, .piece.skipped .piece-title strong, .piece.done .piece-title strong { color: var(--soft); font-weight: 550; } .piece.skipped .piece-title strong { text-decoration: line-through; }
.piece-main { flex: 1; min-width: 0; } .piece-title { display: flex; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; } .piece-who { color: var(--soft); font-size: 14px; }
.piece-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; } .piece-actions:empty { display: none; }
.pieces.edit .piece { align-items: center; } .pieces.edit select { width: 180px; flex: none; } .piece.off { opacity: .4; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 22px; margin: 4px 0 12px; font-size: 14.5px; } .facts dt { color: var(--soft); } .facts dd { margin: 0; color: var(--hi); }
.lines { list-style: none; margin: 0 0 10px; padding: 0; } .lines li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; } .lines li:first-child { border-top: 0; padding-top: 2px; }
.tick { display: flex; gap: 11px; align-items: center; flex: 1; min-width: 200px; color: var(--hi); } .ticked .tick > span:first-of-type { text-decoration: line-through; color: var(--soft); }
.line-side { display: flex; gap: 14px; align-items: center; } .line-side select { width: 150px; padding: 4px 8px; font-size: 13.5px; }
.price { font: 650 15px var(--font); font-variant-numeric: tabular-nums; background: none; border: 0; border-bottom: 1px dashed var(--line-2); color: var(--hi); cursor: pointer; padding: 1px 0; } .price.unpriced { color: var(--warn); }
.total { text-align: right; font-size: 14.5px; }
.entry-form { margin-bottom: 6px; } .entry-form textarea { margin-bottom: 8px; }
.entry-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; } .entry-row select { width: auto; flex: 1; min-width: 180px; }
.entry-row.time { justify-content: flex-start; color: var(--soft); } .entry-row.time input { width: 78px; font-size: 18px; font-weight: 650; text-align: center; }
.entry-row input[type=number] { width: 84px; flex: none; } .entry-row input[type=text] { flex: 1; }
.feed { margin-top: 12px; }
.entry { border-top: 1px solid var(--line); padding: 11px 0 9px; } .entry-head { display: flex; gap: 4px 12px; align-items: baseline; flex-wrap: wrap; } .entry p { margin: 3px 0 0; color: var(--hi); }
.event { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.plain { list-style: none; margin: 0 0 10px; padding: 0; } .plain li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 4px 10px; align-items: baseline; flex-wrap: wrap; } .plain li:first-child { border-top: 0; padding-top: 2px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; margin-bottom: 12px; }
.file { display: flex; flex-direction: column; gap: 5px; text-decoration: none; color: var(--soft); font-size: 12.5px; overflow-wrap: anywhere; }
.file img, .file-icon { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); } .file-icon { display: grid; place-items: center; background: var(--panel-2); font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--faint); }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; } .cols > div > .card:last-child { margin-bottom: 14px; }

/* ---- new job, boards, admin ---- */
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.kind { font: 650 15px var(--font); text-align: left; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel); color: var(--soft); cursor: pointer; } .kind:hover { color: var(--hi); }
.kind.on { color: var(--hi); border-color: var(--hi); box-shadow: inset 0 0 0 1px var(--hi); }
.picked { border: 1px solid var(--line); background: var(--panel-2); padding: 10px 13px; border-radius: 10px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.match { display: block; width: 100%; text-align: left; margin-top: 6px; padding: 9px 13px; border-radius: 10px; border: 1px dashed var(--accent); background: none; color: var(--text); font: inherit; cursor: pointer; }
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; } .lane { margin: 0; }
.tpl-row { display: grid; grid-template-columns: 62px 1fr 160px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.site-row { display: grid; grid-template-columns: 1.2fr 1fr 2fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.steps { margin: 0 0 4px; padding-left: 20px; } .steps li { margin-bottom: 8px; } details.card > .card { border: 0; padding: 0; margin: 0; }
.temp-pass { font-size: 16px; line-height: 1.9; border: 1px solid var(--line); background: var(--panel-2); padding: 10px 14px; border-radius: 10px; user-select: all; font-variant-numeric: tabular-nums; }

/* ---- sign in ---- */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.signin-box { width: 100%; max-width: 380px; }
.signin-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; } .signin-brand .mark { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; }
.signin-brand b { display: block; font-size: 18px; letter-spacing: -.015em; } .signin-brand span { color: var(--soft); font-size: 13.5px; }
.signin h1 { font-size: 25px; margin-bottom: 20px; }
.signin .btn.primary { width: 100%; justify-content: center; margin-top: 4px; } .form-error { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 1.4em; margin: 0 0 6px; }
.demo-list { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; margin-bottom: 14px; }
.demo-as { display: block; width: 100%; text-align: left; padding: 13px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; cursor: pointer; } .demo-as:first-child { border-top: 0; }
.demo-as:hover { background: var(--panel-2); } .demo-as b { display: block; } .demo-as span { color: var(--soft); font-size: 13.5px; }
.signin-foot { color: var(--faint); font-size: 13px; margin-top: 18px; }

/* ---- dialogs and toast ---- */
dialog.modal { border: 1px solid var(--line-2); border-radius: 16px; padding: 0; width: min(500px, calc(100vw - 24px)); max-height: calc(100vh - 24px); background: var(--panel); color: var(--text); box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
dialog.modal::backdrop { background: rgba(10, 16, 20, .5); }
dialog.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
dialog.modal header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px 0; } dialog.modal header h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--hi); letter-spacing: -.01em; }
.modal-body { padding: 14px 20px 6px; overflow-y: auto; } dialog.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
.x { background: none; border: 0; padding: 4px; color: var(--soft); cursor: pointer; display: grid; } .x:hover { color: var(--hi); }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--hi); color: var(--bg); padding: 10px 17px; border-radius: 11px; font-weight: 600; font-size: 14.5px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 100; max-width: calc(100vw - 30px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); } #toast.bad { background: var(--bad); color: #fff; }

/* ---- phones: the menu moves to the bottom, where a thumb is ---- */
@media (max-width: 860px) { .cols, .cols.even { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 760px) {
  /* A blurred bar would trap the fixed menu inside it, so on a phone the bar is solid. */
  .top { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .top-in { padding: 0 14px; height: 52px; }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(54px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); padding: 0 6px env(safe-area-inset-bottom); z-index: 20; }
  .nav a { flex: 1; justify-content: center; font-size: 13.5px; padding: 0 8px; } .nav a.on::after { bottom: auto; top: -1px; }
  .top-right { margin-left: auto; }
  main { padding: 20px 14px 110px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } .lookup { width: 100%; } .lookup input { width: auto; flex: 1; }
  .work-actions .btn.big { flex: 1; justify-content: center; } .tpl-row { grid-template-columns: 56px 1fr; } .site-row { grid-template-columns: 1fr; }
  .pieces.edit .piece { flex-wrap: wrap; } .pieces.edit select { width: 100%; }
  .row-side .ago { display: none; }
  #toast { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
@media print { .top, .nav, .btn, .tabs, .entry-form { display: none !important; } body { background: #fff; } .card { break-inside: avoid; } }
