/* =============================================================================
   Masonsbridge Operations: concept console. Builds on the tokens in styles.css.
   ============================================================================= */
.ops { background: var(--paper); font-size: 1rem; }
.ops .muted { color: var(--ink-soft); }
.ops .small { font-size: .8125rem; }
.ops .center { text-align: center; }
.mono { font-family: var(--f-mono); letter-spacing: .02em; }
.ops a.mono { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule-soft); }
.ops a.mono:hover { color: var(--accent); border-color: var(--accent); }
.arrow { color: var(--accent); }

/* Demo bar: layout comes from styles.css; the console uses the accent so it reads as a different space */
.ops .demo-bar { background: var(--accent); color: var(--accent-ink); }
.ops .demo-bar a { color: var(--accent-ink); text-decoration-color: currentColor; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - var(--demo-h)); }
.side {
  background: var(--ink); color: var(--paper-on-dark);
  display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
  position: sticky; top: var(--demo-h); height: calc(100vh - var(--demo-h)); overflow-y: auto;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--rule-on-dark); }
.side__brand img { filter: invert(1) brightness(1.4); }
.side__brand span { display: flex; flex-direction: column; line-height: 1.15; }
.side__brand b { font-family: var(--f-display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -.02em; }
.side__brand small { font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute-on-dark); }
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__nav a, .mnav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: var(--radius-sm);
  color: var(--paper-on-dark); text-decoration: none; font-size: .9375rem; font-weight: 500;
}
.side__nav a:hover { background: rgba(243,237,224,.07); }
.side__nav a.is-on { background: var(--paper); color: var(--ink); }
.side__nav .icon { width: 18px; height: 18px; }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--f-mono); font-size: .75rem; text-align: center; }
.badge--warn { background: #e8b23a; color: var(--ink); }
.side__foot { margin-top: auto; }
.side__reset { display: flex; gap: 8px; align-items: center; color: var(--mute-on-dark); font-size: .8125rem; padding: 8px 10px; border-radius: var(--radius-sm); width: 100%; }
.side__reset:hover { color: var(--paper); background: rgba(243,237,224,.07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: var(--demo-h); z-index: 30;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px clamp(16px, 3vw, 36px); border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--paper) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.topbar__role { display: flex; align-items: center; gap: 10px; }
.topbar__role label { white-space: nowrap; }
@media (max-width: 1500px) { .topbar__role label { display: none; } }
.topbar__role select, .ops select, .ops input:not([type=radio]):not([type=checkbox]) {
  min-height: 42px; padding: 8px 12px; border: 1px solid var(--rule-soft); border-radius: var(--radius-sm); background: var(--field); font-size: .9375rem;
}
.topbar__role select { font-weight: 600; max-width: 300px; }
.topbar__search { flex: 1; min-width: 160px; position: relative; }
.topbar__search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }
.topbar__search input { width: 100%; padding-left: 38px !important; }
.mnav { display: none; }

#view { padding: clamp(18px, 3vw, 36px); max-width: 1320px; width: 100%; outline: none; }
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.vhead h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 600; }
.vhead p { margin-top: 8px; color: var(--ink-soft); max-width: 70ch; }
.vhead p b { color: var(--ink); }

/* Panels, KPIs */
.panel { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel h2, .lane h2, .scan__list h2, .subhead { font-size: 1.125rem; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.panel--attn { border-color: #e8b23a; background: #fffaf0; }
.panel--attn h2 .icon { color: #b07a0a; }
.panel--next { border: 1px solid var(--ink); }
.count { font-family: var(--f-mono); font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-soft); font-weight: 400; }
.attn li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.attn li:first-child { border-top: 0; padding-top: 0; }
.attn small { display: block; color: var(--ink-soft); margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: .8125rem; color: var(--ink-soft); }
.kpi__val { font-family: var(--f-display); font-size: clamp(1.25rem, 2vw, 1.75rem); overflow-wrap: anywhere; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi__sub { font-size: .75rem; color: var(--ink-soft); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > *, .sgrid > *, .scan > *, .kpis > *, .cards > *, .pcards > * { min-width: 0; }
.cols > .panel { margin-bottom: 18px; }

.stagebar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin-bottom: 16px; }
.seg--booked { background: #e8b23a; } .seg--accepted { background: #d98a4a; } .seg--collected { background: var(--accent); }
.seg--transit { background: #2f4a7a; } .seg--arrived { background: #1a2437; } .seg--delivered { background: var(--ok); } .seg--closed { background: #9aa3b5; }
.stagelist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: .9375rem; }
.stagelist li { display: flex; align-items: center; gap: 8px; }
.stagelist b { margin-left: auto; font-variant-numeric: tabular-nums; }
.stagelist .pct { width: 3.2em; text-align: right; color: var(--ink-soft); font-size: .8125rem; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* Tables */
.tablewrap { position: relative; overflow-x: auto; border: 1px solid var(--rule-soft); border-radius: var(--radius); background: var(--field); }
.panel .tablewrap { border: 0; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.tbl th { font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 400; white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono, .tbl td:first-child { white-space: nowrap; }
.tbl .clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl--click tbody tr { cursor: pointer; }
.tbl--click tbody tr:hover { background: var(--paper); }
.tbl--matrix td.center, .tbl--matrix th { text-align: center; }
.tbl--matrix td:first-child, .tbl--matrix th:first-child { text-align: left; }
.yes { color: var(--ok); display: inline-grid; } .no { color: var(--rule-soft); }
.tbl tfoot th, .tbl tfoot td { border-bottom: 0; font-size: 1rem; }
.empty { color: var(--ink-soft); padding: 18px; text-align: center; border: 1px dashed var(--rule-soft); border-radius: var(--radius); }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--rule-soft); }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--paper-2); color: var(--ink); }
.chip .icon { width: 12px; height: 12px; }
.chip--booked, .chip--warn { background: #fbecc5; color: #6b4a00; }
.chip--accepted { background: #f6dcc6; color: #7a3b0d; }
.chip--collected { background: #f3d1b8; color: #7a3b0d; }
.chip--transit { background: #dbe3f2; color: #1d3360; }
.chip--arrived { background: var(--ink); color: var(--paper); }
.chip--delivered, .chip--paid { background: #d6ecdf; color: #0b4f2b; }
.chip--closed { background: #e4e7ee; color: #3d4659; }
.chip--rejected { background: #f5d6d2; color: var(--danger); }
.chip--muted { background: transparent; border: 1px solid var(--rule-soft); color: var(--ink-soft); font-weight: 500; }
.chip--sms { background: #d6ecdf; color: #0b4f2b; } .chip--email { background: #dbe3f2; color: #1d3360; }

/* Queue */
.lane { margin-bottom: 28px; }
.lane__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 14px; }
.lane__head h2 { margin: 0; }
.lane__head p { color: var(--ink-soft); font-size: .875rem; max-width: 60ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.qcard, .rjob { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.qcard.is-new { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.qcard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qcard h3, .rjob h3 { font-size: 1.0625rem; font-weight: 600; font-family: var(--f-body); letter-spacing: 0; }
.qcard__route { font-weight: 500; }
.qcard__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.qcard__meta dt { font-size: .6875rem; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.qcard__meta dd { margin: 0; font-weight: 600; font-size: .9375rem; }
.qcard__sub { font-size: .8125rem; color: var(--ink-soft); }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wait { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: .9375rem; }

/* Shipment detail */
.back { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--ink-soft); font-size: .875rem; margin-bottom: 12px; }
.back .icon { transform: rotate(180deg); width: 14px; }
.shead { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.shead h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 500; letter-spacing: 0; }
.shead p { color: var(--ink-soft); margin-top: 4px; }
.shead__chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pstep { display: grid; grid-template-columns: repeat(6, 1fr); margin-bottom: 20px; }
.pstep li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: .8125rem; padding: 0 4px; }
.pstep li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--rule-soft); z-index: 0; }
.pstep li:first-child::before { display: none; }
.pstep li.is-done::before, .pstep li.is-cur::before { background: var(--ink); }
.pdot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--rule-soft); }
.pdot .icon { width: 14px; height: 14px; }
.is-done .pdot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.is-cur .pdot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 20%, transparent); }
.pstep small { color: var(--ink-soft); font-size: .6875rem; min-height: 1em; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: #fbecc5; color: #4f3600; margin-bottom: 16px; }
.alert small { display: block; }
.alert .icon { margin-top: 3px; }
.sgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.kv--tight { grid-template-columns: 1fr; gap: 0; margin-bottom: 14px; }
.kv--tight div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); }
.kv--tight dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.person { display: flex; flex-direction: column; gap: 4px; font-size: .9375rem; }
.person span:not(.meta) { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-soft); overflow-wrap: anywhere; }
.person .icon { margin-top: 4px; width: 14px; height: 14px; }
.hist li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule-soft); font-size: .9375rem; }
.hist li:first-child { border-top: 0; }
.hist time { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-soft); padding-top: 3px; }
.hist small { display: block; color: var(--ink-soft); font-size: .8125rem; }
.qr { width: 150px; margin: 0 auto 10px; }
.qr svg, .label__qr svg { width: 100%; height: auto; display: block; }
.label-mini .mono.center { font-size: 1.0625rem; margin-bottom: 6px; }
.label-mini .muted { font-size: .8125rem; margin-bottom: 12px; }
.pays { margin: -6px 0 14px; font-size: .875rem; }
.pays li { padding: 6px 0; border-bottom: 1px solid var(--rule-soft); }
.pays small { display: block; color: var(--ink-soft); font-size: .75rem; }
.msgs li.msg { padding: 12px 0; border-top: 1px solid var(--rule-soft); font-size: .9rem; }
.msgs li.msg:first-child { border-top: 0; padding-top: 0; }
.msg__head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.msg__head time { margin-left: auto; font-size: .75rem; color: var(--ink-soft); }
.msg__head .muted { font-size: .8125rem; }
.msg__subj { font-weight: 600; }
.msg p { color: var(--ink-2); }
.msgs--wide { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 16px 20px; }
.msgs--wide li.msg { display: block; }
.msgs--wide .msg--sms p { background: var(--paper); border-radius: 14px 14px 14px 4px; padding: 9px 13px; max-width: 62ch; margin: 6px 0; }

/* Scan */
.scan { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 24px; align-items: start; }
.viewfinder { position: relative; aspect-ratio: 3 / 4; border-radius: 22px; background: radial-gradient(120% 90% at 50% 40%, #2a3550, #0a1322); overflow: hidden; border: 8px solid #0a1322; box-shadow: var(--shadow); }
.viewfinder::before { content: ""; position: absolute; inset: 22% 18%; border-radius: 8px; background:
  repeating-linear-gradient(90deg, rgba(243,237,224,.08) 0 8px, transparent 8px 16px),
  repeating-linear-gradient(0deg, rgba(243,237,224,.08) 0 8px, transparent 8px 16px); }
.corner { position: absolute; width: 38px; height: 38px; border: 3px solid var(--paper); }
.corner.tl { top: 20%; left: 16%; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.corner.tr { top: 20%; right: 16%; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.corner.bl { bottom: 20%; left: 16%; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.corner.br { bottom: 20%; right: 16%; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scanline { position: absolute; left: 16%; right: 16%; top: 22%; height: 2px; background: var(--accent); box-shadow: 0 0 14px 2px var(--accent); opacity: 0; }
.viewfinder.is-scanning .scanline { opacity: 1; animation: scan 1.1s ease-in-out; }
.viewfinder.is-ok .corner { border-color: #3ad17e; }
@keyframes scan { 0% { top: 22%; } 50% { top: 76%; } 100% { top: 22%; } }
.vf__msg { position: absolute; left: 0; right: 0; bottom: 7%; text-align: center; color: var(--paper); font-family: var(--f-mono); font-size: .8125rem; letter-spacing: .04em; padding: 0 12px; }
.scan__manual { margin-top: 14px; }
.scan__manual .quick-track__row { display: flex; gap: 6px; margin-top: 6px; }
.scan__manual input { flex: 1; min-width: 0; }
.scan__manual button { display: inline-flex; gap: 6px; align-items: center; padding: 0 16px; background: var(--ink); color: var(--paper); border-radius: var(--radius-sm); font-weight: 600; }
.scan__manual .err { color: var(--danger); font-size: .875rem; margin-top: 6px; min-height: 1.2em; }
.explist { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); }
.explist li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--rule-soft); }
.explist li:first-child { border-top: 0; }
.explist li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.explist small { color: var(--ink-soft); }
.scanok { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius); background: #d6ecdf; color: #0b4f2b; }
.scanok > .icon { width: 22px; height: 22px; margin-top: 2px; }
.scanok--info { background: var(--paper-2); color: var(--ink); }
.phone { margin-top: 16px; max-width: 320px; border: 8px solid var(--ink); border-radius: 26px; background: #f7f7f7; overflow: hidden; box-shadow: var(--shadow); }
.phone__bar { display: flex; flex-direction: column; align-items: center; padding: 10px; background: #ececec; font-size: .75rem; color: #666; }
.phone__bar b { color: #111; font-size: .875rem; }
.phone__body { padding: 16px 12px 20px; }
.bubble { background: #e5e5ea; color: #111; border-radius: 16px 16px 16px 4px; padding: 10px 12px; font-size: .875rem; line-height: 1.4; animation: pop .35s ease-out; }
.phone__body small { display: block; margin-top: 6px; color: #888; font-size: .6875rem; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* Rider */
.rider { display: grid; gap: 12px; max-width: 460px; margin-bottom: 24px; }
.rjob p { display: flex; gap: 8px; align-items: flex-start; color: var(--ink-soft); }
.rjob p .icon { margin-top: 4px; }
.subhead { margin-top: 8px; }

/* Partners */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.pcard { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.pcard h3 { font-size: 1.125rem; }
.pcard__terms { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9375rem; }
.tip { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding: 12px 14px; background: var(--paper-2); border-radius: var(--radius-sm); }

/* Audit, rules */
.audit li { display: grid; grid-template-columns: 150px 200px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--rule-soft); font-size: .9rem; }
.audit li:first-child { border-top: 0; }
.audit time { font-family: var(--f-mono); font-size: .75rem; color: var(--ink-soft); padding-top: 2px; }
.audit__who small { display: block; color: var(--ink-soft); font-size: .75rem; }
.rules li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
.rules li:first-child { border-top: 0; padding-top: 0; }
.rules span { color: var(--ink-soft); font-size: .9375rem; }

/* Walkthrough */
.guide {
  position: fixed; top: var(--demo-h); right: 0; bottom: 0; z-index: 60; width: min(400px, 100vw);
  background: var(--paper); border-left: 1px solid var(--rule); box-shadow: -24px 0 60px -30px rgba(10,19,34,.35);
  display: flex; flex-direction: column;
}
.guide[hidden] { display: none; }
.guide__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--rule); }
.guide__head h2 { font-size: 1.25rem; margin-top: 4px; }
.guide__body { overflow-y: auto; padding: 16px 20px 28px; }
.gsteps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 0; }
.gsteps li.is-todo { opacity: .55; }
.gnum { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-mono); font-size: .8125rem; border: 1.5px solid var(--rule-soft); }
.gnum .icon { width: 14px; height: 14px; }
.is-done .gnum { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.is-cur .gnum { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.gsteps p { font-size: .875rem; color: var(--ink-soft); margin: 2px 0 8px; }
.gsteps li.is-cur { background: var(--field); margin: 4px -10px; padding: 12px 10px; border-radius: var(--radius); border: 1px solid var(--accent); }
@media (min-width: 1200px) { body.guide-open .main, body.guide-open .demo-bar { margin-right: 400px; } }

/* Modal */
.omodal { border: 0; padding: 0; background: transparent; max-width: min(620px, calc(100vw - 24px)); width: 100%; }
.omodal::backdrop { background: rgba(10,19,34,.55); }
.omodal__panel { background: var(--paper); border-radius: var(--radius-lg); border: 1px solid var(--rule); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.omodal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule-soft); }
.omodal__head h2 { font-size: 1.25rem; }
.omodal__body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.omodal .field { display: flex; flex-direction: column; gap: 6px; }
.omodal .field label { font-weight: 600; font-size: .9375rem; }
.omodal .row--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Checkout */
.checkout { display: flex; flex-direction: column; gap: 14px; }
.checkout__head { display: flex; gap: 10px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.checkout__head small { display: block; color: var(--ink-soft); }
.checkout__amt { margin-left: auto; font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; }
.paymeth { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paymeth label { position: relative; }
.paymeth input { position: absolute; opacity: 0; }
.paymeth span { display: block; text-align: center; padding: 12px 6px; border: 1px solid var(--rule-soft); border-radius: var(--radius-sm); background: var(--field); font-weight: 600; cursor: pointer; }
.paymeth input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.paymeth input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Label + invoice documents */
.label { background: #fff; color: #000; border: 2px solid #000; border-radius: 6px; padding: 14px; max-width: 440px; margin: 0 auto; font-family: var(--f-body); }
.label__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.label__logo { height: 44px; width: auto; }
.label__top .mono { font-size: .8125rem; font-weight: 600; text-align: right; }
.label__mid { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 12px 0; border-bottom: 2px solid #000; }
.label__k { display: block; font-family: var(--f-mono); font-size: .625rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
.label__id { font-size: 1.25rem; font-weight: 600; }
.label__v { font-weight: 600; font-size: .9375rem; }
.label__foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; font-size: .8125rem; }
.invoice { background: #fff; border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.invoice__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.invoice__head img { height: 54px; width: auto; }
.invoice__title { text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: .875rem; }
.invoice__title h3 { font-size: 1.5rem; }
.invoice__parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: .875rem; }
.invoice__parties div { display: flex; flex-direction: column; }
.invoice__lines { border: 1px solid var(--rule-soft); }
.invoice__lines small { color: var(--ink-soft); }
.invoice__pay { font-size: .875rem; padding: 10px 12px; background: var(--paper); border-radius: var(--radius-sm); }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; animation: pop .25s ease-out; transition: opacity .35s, transform .35s; }
.toast small { color: var(--mute-on-dark); display: flex; gap: 6px; align-items: center; font-size: .8125rem; }
.toast small .icon { width: 13px; height: 13px; color: #3ad17e; }
.toast.is-out { opacity: 0; transform: translateY(8px); }

#printArea { display: none; }
@media print {
  body.is-printing > *:not(#printArea) { display: none !important; }
  body.is-printing #printArea { display: block; padding: 10mm; }
  body.is-printing .invoice { border: 0; }
}

/* Responsive */
@media (max-width: 1100px) {
  .cols, .sgrid, .scan { grid-template-columns: 1fr; }
  .scan__cam { max-width: 380px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mnav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; background: var(--ink); scrollbar-width: none; position: sticky; top: var(--demo-h); z-index: 30; }
  .mnav::-webkit-scrollbar { display: none; }
  .mnav a { flex: none; padding: 8px 12px; font-size: .875rem; }
  .mnav a.is-on { background: var(--paper); color: var(--ink); }
  .mnav .icon { width: 16px; height: 16px; }
  .topbar { position: static; padding: 10px 16px; gap: 8px; }
  .topbar__role { flex: 1 1 100%; }
  .topbar__role select { max-width: none; width: 100%; }
  .topbar__search { order: 2; min-width: 0; }
  #guideBtn { order: 3; padding-inline: 14px; }
  #view { padding: 18px 16px 48px; }
  .guide { width: 100vw; border-left: 0; }
  .vhead { margin-bottom: 18px; }
  .vhead__right { width: 100%; }
}
@media (max-width: 640px) {
  .ops { font-size: .9375rem; }
  #guideBtn .gb-long { display: none; }
  #guideBtn .gb-short { display: inline; }
  .kpis, .kpis--4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi__sub { display: none; }
  .panel { padding: 16px; }
  .stagelist, .people, .kv, .invoice__parties { grid-template-columns: 1fr; }
  .pstep { grid-template-columns: repeat(6, 1fr); }
  .pstep b { font-size: .625rem; font-weight: 600; }
  .pstep small { display: none; }
  .pdot { width: 22px; height: 22px; }
  .pstep li::before { top: 10px; }
  .hist li, .audit li { grid-template-columns: 1fr; gap: 2px; }
  .attn li { flex-direction: column; align-items: stretch; }
  .explist li { flex-wrap: wrap; }
  .label__mid { grid-template-columns: 110px 1fr; }
  .cards { grid-template-columns: 1fr; }
  .viewfinder { aspect-ratio: 16 / 10; border-width: 6px; }
  .viewfinder::before { inset: 16% 30%; }
  .corner.tl, .corner.bl { left: 28%; } .corner.tr, .corner.br { right: 28%; }
  .corner.tl, .corner.tr { top: 12%; } .corner.bl, .corner.br { bottom: 12%; }
  .scanline { left: 28%; right: 28%; }
  .scan__cam { max-width: none; }
  .omodal { max-width: 100vw; margin: auto 0 0; }
  .omodal__panel { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; }
  .omodal .row--2 { grid-template-columns: 1fr; }
  .acts .btn { flex: 1 1 auto; }
  .shead h1 { font-size: 1.6rem; }
  .invoice { padding: 14px; }
  .invoice__head img { height: 40px; }
  .toasts { bottom: 12px; }
  /* Tables become stacked cards on phones */
  .tablewrap:has(.tbl--stack) { border: 0; background: transparent; overflow: visible; }
  .tbl--stack thead { display: none; }
  .tbl--stack, .tbl--stack tbody, .tbl--stack tr, .tbl--stack td { display: block; width: 100%; }
  .tbl--stack tr { background: var(--field); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
  .tbl--stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
  .tbl--stack td.num { text-align: right; }
  .tbl--stack td::before { content: attr(data-label); font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); text-align: left; flex: none; }
  .tbl--stack td:first-child { font-weight: 600; border-bottom: 1px solid var(--rule-soft); padding-bottom: 8px; margin-bottom: 4px; }
  .tbl--stack td.clip { max-width: none; white-space: normal; }
  .tbl--stack td[colspan] { justify-content: center; }
  .tbl--stack td[colspan]::before { display: none; }
  .panel .tbl--stack tr { border-color: var(--rule-soft); }
  .tbl--stack tfoot { display: block; }
}
.walk-cta { display: none; }
.gb-short { display: none; }
@media (max-width: 1199px) {
  .walk-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 18px; padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: var(--paper); text-align: left; }
  .walk-cta b { display: block; font-family: var(--f-display); font-size: 1.0625rem; }
  .walk-cta small { color: var(--mute-on-dark); }
  .walk-cta .icon { width: 22px; height: 22px; color: var(--accent); flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .viewfinder.is-scanning .scanline { animation: none; top: 49%; }
  .bubble, .toast { animation: none; }
}
