/* =========================================================
   FS Orders — design system
   Palette: kelp green (actions), safety-tape yellow (needs a person),
   concrete grey (canvas), slate ink (text). One family: Archivo, variable
   weight + width. Two radii: 4px controls, 10px cards.
   ========================================================= */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/Archivo-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: italic; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url("fonts/Archivo-italic.woff2") format("woff2"); }

:root {
    --ink: #1B2430; --ink-2: #3B4655; --muted: #6B7684; --faint: #98A2B0;
    --line: #DCE1E7; --line-strong: #B9C1CB;
    --bg: #EEF1F4; --surface: #FFFFFF; --surface-2: #F6F8FA; --surface-3: #E9EDF1;
    --green: #0B6B5D; --green-2: #085A4E; --green-soft: #DCEFE9; --green-ink: #0B6B5D;
    --yellow: #F2B705; --yellow-2: #D9A300; --yellow-soft: #FCF1C7; --yellow-ink: #6E5100;
    --blue: #2456A6; --blue-soft: #DEE7F6;
    --teal: #0E7C86; --teal-soft: #D6EEF0;
    --red: #B3261E; --red-soft: #F8DEDC;
    --rail: #1B2430; --rail-2: #243040; --rail-text: #C9D2DE; --rail-active: #0F8A77;
    --r-ctl: 4px; --r-card: 10px;
    --tap: 48px;
    --shadow-1: 0 1px 2px rgba(27,36,48,.06);
    --shadow-2: 0 8px 24px rgba(27,36,48,.12);
    --font: "Archivo", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --rail-w: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; font-feature-settings: "tnum" 1, "cv11" 1; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
h1:focus { outline: none; }
p { margin: 0 0 .75rem; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: var(--r-ctl); }
::selection { background: var(--yellow-soft); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: .85rem; } .tiny { font-size: .78rem; }
.num { font-variant-numeric: tabular-nums; }
.code { font-stretch: 85%; font-weight: 600; letter-spacing: .02em; }
.narrow { font-stretch: 88%; }
.wide { font-stretch: 112%; }
.nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 1rem; } .mt-s { margin-top: .5rem; } .mb { margin-bottom: 1rem; } .mb-s { margin-bottom: .5rem; }
.grow { flex: 1; min-width: 0; }
.icon { flex: none; vertical-align: -0.2em; }

/* ---------- app shell ---------- */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-x: clip; }
.shell > div { min-width: 0; }
html, body { overflow-x: hidden; max-width: 100%; }
.rail { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; padding-top: env(safe-area-inset-top); display: flex; align-items: center; gap: .75rem; padding-inline: .9rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .logo-text { color: var(--ink); }
.content { width: 100%; max-width: 1180px; min-width: 0; margin: 0 auto; padding: 1.1rem 1rem calc(76px + env(safe-area-inset-bottom)); }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; color: var(--muted); font-size: .72rem; font-weight: 600; background: none; border: 0; cursor: pointer; text-decoration: none; }
.bottomnav a.active { color: var(--green); }

@media (min-width: 960px) {
    .shell { grid-template-columns: var(--rail-w) 1fr; grid-template-rows: 1fr; }
    .topbar, .bottomnav { display: none; }
    .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; background: var(--rail); color: var(--rail-text); padding: 1.1rem .9rem 1rem; }
    .content { padding: 1.75rem 2.25rem 3rem; }
}
.rail .logo { padding: .2rem .5rem 1.2rem; }
.rail .logo-text { color: #fff; }
.rail-group { margin-top: .9rem; }
.rail-group-title { font-size: .72rem; font-weight: 600; color: #7E8BA0; padding: 0 .6rem .35rem; letter-spacing: .01em; }
.rail a.rail-item, .rail button.rail-item { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .55rem .65rem; border-radius: 6px; color: var(--rail-text); font-weight: 500; font-size: .93rem; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.rail a.rail-item:hover { background: var(--rail-2); color: #fff; }
.rail a.rail-item.active { background: var(--rail-active); color: #fff; }
.rail-spacer { flex: 1; }
.rail-account { border-top: 1px solid rgba(255,255,255,.1); padding-top: .8rem; }
.rail-account .who { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem; border-radius: 6px; width: 100%; background: none; border: 0; color: inherit; cursor: pointer; text-align: left; }
.rail-account .who:hover { background: var(--rail-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; }
.who .name { color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.15; }
.who .tenant { font-size: .78rem; color: #9AA7B8; }

/* account menu (popover) */
.popover-backdrop { position: fixed; inset: 0; z-index: 40; }
.popover { position: fixed; z-index: 41; width: min(92vw, 300px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-2); overflow: hidden; }
.popover.from-rail { left: .9rem; bottom: 4.6rem; }
.popover.from-top { right: .9rem; top: 60px; }
.popover-head { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.popover-section { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.popover-title { font-size: .78rem; color: var(--muted); padding: .3rem 1rem .2rem; }
.popover form { margin: 0; }
.popover-item { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; background: none; border: 0; font: inherit; color: var(--ink); padding: .6rem 1rem; cursor: pointer; min-height: 44px; text-decoration: none; }
.popover-item:hover { background: var(--surface-2); text-decoration: none; }
.popover-item.active { font-weight: 600; color: var(--green); }

/* ---------- page furniture ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.55rem; font-weight: 650; letter-spacing: -0.015em; }
.page-subtitle { color: var(--muted); margin-top: .2rem; }
.page-back { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.page-back:hover { color: var(--green); text-decoration: none; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.row.gap { gap: .5rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr 1fr; } }
.grid-side { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-side { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); align-items: start; } }

.card { min-width: 0; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow-1); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .8rem; }
.card-flush { padding: 0; overflow: hidden; }

/* summary strip: quiet figures, no uppercase labels */
.figures { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.figure { display: flex; flex-direction: column; min-width: 90px; }
.figure b { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.figure span { color: var(--muted); font-size: .82rem; }
.figure.warn b { color: var(--yellow-ink); }
.figure.ok b { color: var(--green); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .9rem 0; }
.toolbar > * { max-width: 100%; }
.list-item.wrap { flex-wrap: wrap; }
@media (max-width: 560px) { .list-item.wrap .grow { flex-basis: 100%; } .btn { white-space: normal; } }
.search { position: relative; flex: 1; min-width: 200px; }
.search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 2.2rem; }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; gap: .5rem; }
.list-item { display: flex; align-items: center; gap: .9rem; min-width: 0; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .8rem 1rem; color: inherit; min-height: var(--tap); text-decoration: none; transition: border-color .12s ease, background .12s ease; }
a.list-item:hover { text-decoration: none; border-color: var(--line-strong); background: #FBFCFD; }
.list-item .title { font-weight: 600; overflow-wrap: anywhere; }
.list-item .sub { color: var(--muted); font-size: .85rem; margin-top: .1rem; overflow-wrap: anywhere; }
.list-item .chev { color: var(--faint); }
.list-item .lead { width: 44px; height: 44px; border-radius: 8px; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); font-weight: 700; font-stretch: 90%; flex: none; }
.list-item .lead.done { background: var(--green-soft); color: var(--green); }
.list-item .lead.warn { background: var(--yellow-soft); color: var(--yellow-ink); }
.meta { display: inline-flex; flex-wrap: wrap; gap: .15rem 1rem; }
.day-progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: .5rem; }
.day-progress > div { height: 100%; background: var(--green); transition: width .3s ease; }

table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); }
.tbl th, .tbl td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FBFCFD; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl .dim { opacity: .55; }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .6rem .18rem .45rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-New { background: var(--surface-3); color: var(--ink-2); }
.status-Packing { background: var(--yellow-soft); color: var(--yellow-ink); }
.status-Ready { background: var(--blue-soft); color: var(--blue); }
.status-Sent { background: var(--teal-soft); color: var(--teal); }
.status-Printed { background: var(--green-soft); color: var(--green); }
.status-Cancelled, .status-Failed { background: var(--red-soft); color: var(--red); }
.status-NotSent { background: var(--surface-3); color: var(--ink-2); }
.status-Pending { background: var(--yellow-soft); color: var(--yellow-ink); }
.status-Superseded { background: var(--surface-3); color: var(--muted); }
.pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }

/* ---------- forms ---------- */
.lbl { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.field { margin-bottom: 1rem; }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: .5rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--r-ctl); font: inherit; background: var(--surface); color: var(--ink); transition: border-color .12s ease, box-shadow .12s ease; }
.input:hover { border-color: #97A2B0; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,107,93,.18); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input-lg { min-height: 50px; font-size: 1.05rem; }
.input-num { text-align: right; font-variant-numeric: tabular-nums; }
.input.invalid { border-color: var(--yellow-2); background: #FFFDF3; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7684' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; padding-right: 2rem; }
.check { display: inline-flex; align-items: center; gap: .55rem; min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.validation-message { color: var(--red); font-size: .82rem; margin-top: .3rem; display: block; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 42px; padding: .5rem 1rem; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s ease, border-color .12s ease, transform .05s ease; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-accent { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-accent:hover { background: var(--yellow-2); }
.btn-danger { color: var(--red); border-color: #E3B4B0; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .85rem; }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding-inline: 1.4rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; min-width: 34px; }

.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--r-ctl); margin-bottom: 1rem; border: 1px solid; font-size: .92rem; }
.alert .icon { margin-top: .1rem; }
.alert-info { background: var(--blue-soft); border-color: #C4D3EE; color: #1B3F7A; }
.alert-warn { background: var(--yellow-soft); border-color: #EBD48C; color: var(--yellow-ink); }
.alert-bad { background: var(--red-soft); border-color: #EBB8B4; color: var(--red); }
.alert-ok { background: var(--green-soft); border-color: #B7DCD1; color: var(--green); }
.alert ul { margin: .2rem 0 0 1.1rem; padding: 0; }
.alert a { color: inherit; text-decoration: underline; }

.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--r-card); padding: 1.4rem; text-align: center; background: var(--surface-2); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.dropzone input[type=file] { width: 100%; font-size: .9rem; }
.dropzone .icon { color: var(--muted); margin-bottom: .4rem; }

.empty { text-align: center; padding: 2.5rem 1rem; }
.empty-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-3); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .8rem; }
.empty-title { font-size: 1.1rem; margin-bottom: .3rem; }
.empty-text { color: var(--muted); max-width: 42ch; margin: 0 auto .9rem; }
.empty-actions { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- pack screen: the carton label ---------- */
.label { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-card); margin-bottom: 1.1rem; overflow: hidden; box-shadow: var(--shadow-1); }
.label-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .9rem; padding: .8rem 1rem .8rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.label-no { font-size: 2.1rem; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1; }
.label-no small { display: block; font-size: .78rem; font-weight: 600; font-stretch: 100%; color: var(--muted); letter-spacing: 0; margin-top: .15rem; }
.label-store { font-size: .85rem; color: var(--muted); }
.label-store b { color: var(--ink); font-weight: 600; }
.readout { display: inline-flex; align-items: baseline; gap: .3rem; background: var(--ink); color: #fff; border-radius: 6px; padding: .35rem .8rem .3rem; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.45rem; letter-spacing: .01em; min-width: 7.5ch; justify-content: flex-end; }
.readout small { font-size: .8rem; font-weight: 600; color: #B8C4D4; }
.readout.zero { background: var(--surface-3); color: var(--muted); }
.readout.zero small { color: var(--faint); }
.label-lines { padding: .2rem 1.1rem; }
.pline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center; padding: .75rem 0; border-bottom: 1px dashed var(--line); }
.pline:last-child { border-bottom: 0; }
.pline .pname { font-weight: 600; }
.pline .pmeta { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.pline .inputs { display: grid; grid-template-columns: 96px 128px auto auto; gap: .5rem; align-items: end; }
.pline .inputs .lbl { margin-bottom: .2rem; font-weight: 500; color: var(--muted); font-size: .78rem; }
.pline .inputs .input { min-height: 46px; font-size: 1.15rem; font-weight: 600; }
@media (max-width: 560px) { .pline { grid-template-columns: 1fr; } .pline .inputs { grid-template-columns: 1fr 1fr auto auto; } }
.move-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; margin-top: .25rem; background: var(--yellow-soft); border-radius: var(--r-ctl); }
.move-row .input { min-height: 40px; }
.label-foot { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .75rem 1.1rem .9rem; background: var(--surface-2); position: relative; }
.label-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 0; border-top: 2px dashed var(--line-strong); }
.label-foot .lbl { margin: 0; color: var(--muted); font-weight: 500; }
.label-foot .input { width: 120px; }
.label-foot select.input { flex: 1; min-width: 220px; }
.label.locked .label-head { background: var(--surface-3); }

.ordered { padding: 0; }
.ordered-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem 1rem; align-items: center; padding: .65rem 1.2rem; border-bottom: 1px solid var(--line); }
.ordered-row:last-child { border-bottom: 0; }
.ordered-row .code { color: var(--muted); margin-left: .4rem; }
.ordered-row .qty { font-variant-numeric: tabular-nums; text-align: right; color: var(--ink-2); }
.ordered-row.ok .qty { color: var(--green); font-weight: 600; }
.ordered-row.over .qty { color: var(--red); font-weight: 600; }
.ordered-row .bar { grid-column: 1 / -1; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.ordered-row .bar > div { height: 100%; background: var(--green); }
.ordered-row.over .bar > div { background: var(--red); }

.actionbar { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 10; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .7rem .8rem; box-shadow: var(--shadow-2); }
@media (min-width: 960px) { .actionbar { bottom: 1rem; } }
.actionbar .note { color: var(--muted); font-size: .88rem; }

/* ---------- toasts, modals ---------- */
.toasts { position: fixed; z-index: 60; left: 1rem; right: 1rem; bottom: calc(74px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
@media (min-width: 960px) { .toasts { left: auto; right: 1.5rem; bottom: 1.5rem; width: 380px; } }
.toast { pointer-events: auto; display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 8px; background: var(--ink); color: #fff; box-shadow: var(--shadow-2); font-size: .92rem; cursor: pointer; border-left: 4px solid var(--green); animation: toast-in .18s ease-out; }
.toast-danger { border-left-color: #E5534B; } .toast-warning { border-left-color: var(--yellow); } .toast-info { border-left-color: #7FA6E8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(27,36,48,.5); z-index: 50; }
.modal { position: fixed; z-index: 51; left: 50%; top: 8vh; transform: translateX(-50%); width: min(94vw, 500px); max-height: 84vh; overflow: auto; background: var(--surface); border-radius: 12px; padding: 1.4rem 1.4rem 1.2rem; box-shadow: var(--shadow-2); }
.modal h3 { font-size: 1.15rem; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.2rem; }

/* ---------- auth ---------- */
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--bg); }
.auth-hero { display: none; }
.auth-form { display: flex; flex-direction: column; padding: 2rem 1.25rem 1rem; max-width: 440px; width: 100%; margin: 0 auto; min-height: 100dvh; }
.auth-form-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--muted); padding-top: 1.5rem; }
.auth-foot a { color: var(--ink-2); font-weight: 600; }
.auth-form h1 { font-size: 1.6rem; margin: 1.4rem 0 .3rem; }
.auth-form .lede { color: var(--muted); margin-bottom: 1.4rem; }
@media (min-width: 900px) {
    .auth-shell { grid-template-columns: 1.1fr 1fr; }
    .auth-hero { display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--rail); color: #fff; padding: 3rem; position: relative; overflow: hidden; }
    .auth-form { padding: 3rem 4rem 1.5rem; max-width: 560px; }
}
.auth-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 30% 20%, rgba(15,138,119,.35), transparent 70%); }
.hero-label { position: relative; width: min(100%, 380px); background: #fff; color: var(--ink); border-radius: 10px; padding: 1.1rem 1.2rem 1rem; box-shadow: 0 30px 60px rgba(0,0,0,.45); transform: rotate(-2deg); }
.hero-label .hl-top { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); padding-bottom: .5rem; margin-bottom: .6rem; }
.hero-label .hl-store { font-size: 1.25rem; font-weight: 700; font-stretch: 95%; }
.hero-label .hl-box { font-weight: 800; font-stretch: 112%; font-size: 1.1rem; }
.hero-label .hl-row { display: flex; justify-content: space-between; font-size: .85rem; padding: .2rem 0; border-bottom: 1px dashed var(--line); }
.hero-label .hl-row span:first-child { color: var(--muted); }
.hero-label .hl-weight { display: flex; justify-content: space-between; align-items: baseline; margin-top: .7rem; }
.hero-label .hl-weight b { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hero-label .hl-bar { margin-top: .6rem; height: 34px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 9px, var(--ink) 9px 12px, transparent 12px 14px); border-radius: 2px; }
.hero-copy { position: relative; margin-top: 2.6rem; max-width: 40ch; text-align: center; color: #C9D2DE; }
.hero-copy strong { color: #fff; }
.hero-tape { position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(1deg); width: 110px; height: 26px; background: var(--yellow); opacity: .9; border-radius: 2px; }

/* ---------- misc ---------- */
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-stretch: 112%; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.logo:hover { text-decoration: none; }
.kbd-note { font-size: .8rem; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 1rem 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { background: var(--surface-3); color: var(--ink-2); border-radius: 4px; padding: .15rem .45rem; font-size: .8rem; font-weight: 600; font-stretch: 90%; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, #F2F4F7 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.1s infinite; border-radius: 6px; height: 56px; margin-bottom: .5rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

#blazor-error-ui { color-scheme: light only; background: var(--yellow-soft); border-top: 1px solid var(--yellow-2); bottom: 0; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
