/*
    One screen, read from a few feet away at a booth. Sized in rem off a root that scales with the
    viewport, so the same layout holds on the 23.8" rack monitor, a laptop, or a projector.
    Colors are the handset's (Resources/Styles/Colors.xaml) so this reads as the same rack.
*/
:root {
    --navy: #00396D;
    --blue: #00529C;
    --green: #78A818;
    --violet: #7C3AED;
    --amber: #F2A63B;
    --amber-ink: #8A5A00;
    --red: #B3261E;
    --ink: #212121;
    --ink-2: #404040;
    --ink-3: #6E6E6E;
    --line: #E1E6EC;
    --canvas: #05233F;
    --card: #FFFFFF;
}

* { box-sizing: border-box; }

html { font-size: clamp(11px, 0.84vw, 22px); }
/* Projector mode (B, or ?big=1): everything ~15% larger for a big room. */
html.big { font-size: clamp(12.5px, 0.97vw, 25px); }

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr auto;
    /* minmax(0, …): without it the one column grows to fit its widest child — a long rail of
       tags — and the whole page becomes wider than the screen. */
    grid-template-columns: minmax(0, 1fr);
    background: radial-gradient(120% 90% at 20% 0%, #0B3A66 0%, var(--canvas) 60%);
    color: #fff;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

.muted { opacity: .65; }
[hidden] { display: none !important; }

/* ── Header ───────────────────────────────────────────────────────────────── */

.bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: .5rem 1.6rem;
    margin-bottom: .9rem;
    background: #000;    /* the logos' own dark-background color, so they sit straight on it */
}

.brand { display: flex; align-items: center; gap: .8rem; }
.brand-sub { font-size: 1.1rem; opacity: .7; }

/* The transparent logos, straight on the black bar. */
.plate { display: inline-flex; align-items: center; flex: none; }
.plate img { height: 4.8rem; width: auto; display: block; }
.plate-company img { height: 3.3rem; }

.who { display: flex; align-items: center; gap: .8rem; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.who > span { overflow: hidden; text-overflow: ellipsis; }
.who > #operator, .who > .pill { flex: none; }
.brand, .stats { flex: none; }

.stats { display: flex; gap: 1.8rem; }
.stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.stat b { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; opacity: .65; }
.stat-work b { color: #9CC8F5; }
.stat-flag b { color: var(--amber); }
.stat.zero b { color: inherit; opacity: .35; }

.link { width: .8rem; height: .8rem; border-radius: 50%; background: #c33; flex: none; }

/* The build, small, in the corner: enough to check a booth PC against the latest. */
.version { position: fixed; right: .6rem; bottom: .3rem; font-size: .7rem; color: rgba(255,255,255,.45); font-variant-numeric: tabular-nums; z-index: 5; }

/* What key was just heard: bottom left, fades after a couple of seconds. */
.key-echo { position: fixed; left: .8rem; bottom: .6rem; z-index: 6; display: flex; align-items: center; gap: .6rem;
    padding: .35rem .7rem .35rem .4rem; border-radius: .6rem; background: rgba(0,0,0,.85); color: #fff; font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.4); animation: echo-fade 2.2s ease-in forwards; }
.key-echo kbd { font: 700 1.05rem/1 system-ui, sans-serif; min-width: 1.6rem; text-align: center; padding: .35rem .4rem;
    border-radius: .35rem; background: #fff; color: #000; }
@keyframes echo-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
body.has-prompter .key-echo { bottom: 5.2rem; }

/* The controller guide: the annotated button map over everything, H toggles. */
.guide { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; gap: .6rem;
    background: rgba(0,0,0,.88); color: #ddd; text-align: center; font-size: .9rem; }
.guide img { max-width: 92vw; max-height: 86vh; border-radius: .8rem; box-shadow: 0 8px 40px rgba(0,0,0,.6); }   /* above the ticker, not on top of its product name */
.link.on { background: var(--green); box-shadow: 0 0 0 .25rem rgba(120,168,24,.25); }

.pill { padding: .2rem .7rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.pill-demo { background: var(--amber); color: #3a2500; }

/* ── Source switcher: one tab per profile on a device ─────────────────────── */

body.has-sources { grid-template-rows: auto auto 1fr auto; }

.sources { display: flex; gap: .5rem; padding: 0 1.6rem .8rem; overflow-x: auto; scrollbar-width: none; }
.sources::-webkit-scrollbar { display: none; }

.src {
    flex: none; display: flex; align-items: center; gap: .55rem;
    padding: .35rem .5rem .35rem .45rem;
    border-radius: .6rem;
    background: rgba(255,255,255,.1);
    color: #fff; text-decoration: none;
    font-size: .95rem;
    border: 1px solid transparent;
}
.src:hover { background: rgba(255,255,255,.18); }
.src kbd { font-size: .7rem; padding: 0 .35rem; opacity: .7; }
.src-name { font-weight: 600; }
.src-detail { opacity: .7; font-size: .85rem; }
.src.on { background: #fff; color: var(--navy); }
.src.on kbd { background: rgba(0,57,109,.12); }
.src.showing { border-color: rgba(255,255,255,.6); }
.src.busy .src-name::before {
    content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .4rem;
    border-radius: 50%; background: var(--green); vertical-align: middle;
}
.src-x { border: 0; background: none; color: inherit; opacity: 0; cursor: pointer; font-size: 1rem; padding: 0 .2rem; line-height: 1; }
.src:hover .src-x { opacity: .6; }
.src-x:hover { opacity: 1 !important; }

/* ── The phone's screen, mirrored ─────────────────────────────────────────── */

/* A phone is tall and narrow: the panel takes the height and only the width that shape needs. */
body.has-mirror main { grid-template-columns: var(--mirror-width) minmax(0, .75fr) minmax(0, 1.25fr); }
.mirror { background: #0D1B2A; }
.mirror .panel-head { background: #000; }
.mirror-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: .6rem; }
.mirror-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: .6rem; background: #000; display: block; }
.mirror-body img.lost { opacity: .25; }
.mirror-note { position: absolute; inset: auto 1rem 1rem; text-align: center; color: #fff; font-size: .95rem; opacity: .8; }

@media (orientation: portrait) {
    body.has-mirror main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); }
}

/* ── Panels ───────────────────────────────────────────────────────────────── */

main {
    display: grid;
    /* The rack list is narrow — product, brand, price; the detail pane gets the room. */
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    --mirror-width: 0px;
    gap: 1.2rem;
    padding: 0 1.6rem;
    min-height: 0;
    min-width: 0;
}

.panel {
    min-width: 0;
    background: var(--card);
    color: var(--ink);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 .6rem 2rem rgba(0,0,0,.35);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1.2rem;
    background: var(--navy);
    color: #fff;
}

.panel-head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; min-width: 0; }
.panel-sub { font-size: .85rem; font-weight: 400; opacity: .75; margin-left: .7rem; white-space: nowrap; }
/* Three panels across leave no room for the caption on the rack panel. */
body.has-mirror .panel-sub { display: none; }
@media (max-width: 1100px) { .panel-sub { display: none; } }

.rack-status { font-size: 1rem; font-weight: 600; }
.rack-status.printing { color: #9CC8F5; }
.rack-status.submitted { color: #C9E88A; }

/* ── Rack rows — two lines each, as on the handset ────────────────────────── */

/* Scrolls by wheel or touch to reach older rows; no scrollbar, as on the handset. */
.rows { overflow-y: auto; scrollbar-width: none; flex: 1; }
.rows::-webkit-scrollbar { display: none; }

.row {
    display: grid;
    grid-template-columns: 3.2rem 1fr auto;
    align-items: center;
    column-gap: .6rem;
    padding: .55rem 1.2rem .55rem 1rem;
    border-bottom: 1px solid var(--line);
    border-left: .35rem solid transparent;
    animation: row-in .45s cubic-bezier(.2,.8,.2,1);
}

a.row, a.tag { text-decoration: none; }
a.row { color: inherit; }
a.row:focus-visible, a.tag:focus-visible { outline: .2rem solid var(--blue); outline-offset: -.2rem; }
.row { cursor: pointer; }
.row:hover { background: #F6F9FC; }
.row:hover .product { text-decoration: underline; }
.row.focus { background: #F1F6FC; }
.is-pinned .row.focus { background: #FFF4DF; }
.row.s-review { border-left-color: var(--amber); }
.row.s-incomplete { border-left-color: var(--red); }

.row .pos { font-size: 1.05rem; font-weight: 700; color: var(--ink-3); line-height: 1.15; }
.row .pos small { display: block; font-size: .85rem; font-weight: 400; color: #ACACAC; }

/* Where the product changes. */
.rows .sep {
    display: flex; align-items: center; justify-content: space-between;
    padding: .3rem 1.2rem .3rem 1.35rem;
    background: #E4EAF1; color: var(--navy);
    font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    border-bottom: 1px solid var(--line);
}
.rows .sep b { background: var(--navy); color: #fff; border-radius: .8rem; padding: 0 .55rem; font-size: .8rem; letter-spacing: 0; }

.row .l1 { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.row .product { font-size: 1.2rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .brand-name { font-size: 1.15rem; color: var(--blue); white-space: nowrap; }
.row .brand-name.unconfirmed { font-style: italic; opacity: .75; }

.row .l2 { display: flex; align-items: center; gap: .5rem; min-height: 1.6rem; font-size: 1rem; color: var(--ink-2); min-width: 0; }
.row .heard { color: var(--ink-3); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.row .price { font-size: 1.5rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; text-align: right; }
.row .price.unsettled { color: #ACACAC; font-weight: 400; }

.chip { padding: .1rem .55rem; border-radius: .8rem; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.chip-resolving, .chip-pricing { background: rgba(107,114,128,.12); color: var(--ink-2); }
.chip-review { background: rgba(242,166,59,.18); color: var(--amber-ink); }
.chip-incomplete { background: rgba(211,47,47,.15); color: var(--red); }
.chip-ai { background: rgba(139,92,246,.12); color: var(--violet); }

.via { width: 1.1rem; height: 1.1rem; flex: none; color: var(--ink-3); }

@keyframes row-in {
    from { opacity: 0; transform: translateY(-1.2rem); background: #DCEBFA; }
    to   { opacity: 1; transform: none; }
}

/* A value that just landed. */
.flash { animation: flash 1.1s ease-out; border-radius: .3rem; }
@keyframes flash {
    0%   { background: rgba(120,168,24,.55); box-shadow: 0 0 0 .3rem rgba(120,168,24,.25); }
    100% { background: transparent; box-shadow: none; }
}

/* A value still on its way. */
.skeleton {
    display: inline-block;
    min-width: 5rem;
    height: 1em;
    border-radius: .3rem;
    background: linear-gradient(90deg, #E6EBF1 25%, #F5F8FB 50%, #E6EBF1 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
    vertical-align: middle;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.dots::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ── Spotlight ────────────────────────────────────────────────────────────── */

.source { font-size: .95rem; opacity: .85; }
/* Auto / Stick: which item the detail pane shows. */
.mode { margin-left: auto; margin-right: 1rem; display: flex; padding: .15rem; border-radius: 1rem; background: rgba(255,255,255,.16); }
.mode button {
    border: 0; border-radius: 1rem; padding: .2rem .9rem;
    background: none; color: #fff;
    font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.mode button.on { background: #fff; color: var(--navy); }
.mode button[data-mode="stick"].on { background: var(--amber); color: #3a2500; }

.spot-body { padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; min-height: 0; overflow: hidden; }

.spot-top { display: flex; gap: 1.2rem; align-items: flex-start; }
/* Up to three pictures: the first large, any others stacked beside it at half its height. */
.spot-photos { display: grid; gap: .4rem; flex: none; height: 11rem; grid-template-rows: 1fr 1fr; grid-auto-flow: column; }
.spot-photos img { width: 100%; height: 100%; border-radius: .7rem; object-fit: cover; background: #EEF3F8; display: block; min-height: 0; }
.spot-photos img:first-child { grid-row: span 2; width: 11rem; }
.spot-photos.n2 img:nth-child(2) { grid-row: span 2; width: 11rem; }
.spot-photos.n3 img:nth-child(n+2) { width: 5.3rem; }
.spot-title { flex: 1; min-width: 0; }
.spot-pos { font-size: 1rem; font-weight: 700; color: var(--ink-3); }
.spot-product { font-size: 2.2rem; font-weight: 700; line-height: 1.15; margin: .1rem 0 .3rem; }
/* What the garment is: brand (and sub-brand), condition, size. */
.primary { margin: .35rem 0 .3rem; }
.primary-brand { font-size: 1.9rem; font-weight: 700; color: var(--blue); line-height: 1.2; display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .7rem; }
.primary-brand small { font-size: 1.15rem; font-weight: 400; color: var(--ink-2); }
.primary-row { display: flex; gap: 2.2rem; margin-top: .45rem; }
.primary-row > div { display: flex; align-items: baseline; gap: .5rem; }
.primary-row span:first-child { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.primary-row b { font-size: 1.5rem; font-weight: 600; }
.primary .from { font-size: .72rem; font-weight: 600; padding: .05rem .45rem; border-radius: .6rem; align-self: center; }
.primary .none { color: #ACACAC; font-weight: 400; }

/* Spoken tags: chips under condition and size, in the order they were said. */
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .5rem; }
.tags > span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-right: .25rem; }
.tag-word { font-style: normal; font-size: .95rem; font-weight: 600; padding: .12rem .6rem; border-radius: 1rem;
    background: rgba(0,82,156,.1); color: var(--blue); border: 1px solid rgba(0,82,156,.18); }
.tag-word.flash { animation: fact-in .5s cubic-bezier(.2,.8,.2,1) backwards; }
.chip-tags { background: rgba(0,82,156,.1); color: var(--blue); }

.spot-heard { font-size: 1.25rem; color: var(--ink-2); font-style: italic; }
.spot-heard::before { content: "heard "; font-style: normal; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

/* The attribute cards scroll; the heading above and the pricing panel below stay put. */
.facts-scroll { flex: 1; min-height: 6rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #C8D2DD transparent; padding-right: .3rem; }

/* ── Pricing panel ────────────────────────────────────────────────────────── */

.pricing {
    flex: none;
    /* A short band under the attributes: the price at the left, the value signals scrolling beside it. */
    max-height: 9.5rem; min-height: 0;
    display: grid; grid-template-columns: minmax(12rem, auto) 1fr; gap: 1.2rem;
    padding: .6rem 1rem;
    border-radius: .8rem;
    background: #F1F6FC;
    border: 1px solid #D5E2F0;
}
.pricing-main, .pricing-signals { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.pricing-head { flex: none; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--blue); margin-bottom: .2rem; }
.pricing .amount { font-size: 2.8rem; font-weight: 800; color: var(--navy); line-height: 1.05; font-variant-numeric: tabular-nums; }
.pricing .amount.routed { color: var(--violet); font-size: 2.4rem; }
.pricing .amount.unsettled { color: #ACACAC; font-weight: 400; font-size: 1.6rem; }
.pricing-how { font-size: .9rem; color: var(--ink-2); margin-top: .3rem; line-height: 1.35; }

.ladder { display: flex; align-items: center; gap: .5rem; margin-top: .55rem; font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ladder-bar { flex: 1; min-width: 6rem; height: .4rem; border-radius: .2rem; background: #D5E2F0; position: relative; }
.ladder-bar i { position: absolute; top: 50%; width: 1rem; height: 1rem; margin: -.5rem 0 0 -.5rem; border-radius: 50%; background: var(--green); border: .15rem solid #fff; box-shadow: 0 0 0 1px var(--green); }

.signals { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem .9rem; align-content: start;
    min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #C8D2DD transparent; padding-right: .3rem; }
.signal { min-width: 0; }

/* A signal today's price was looked up on. The legend sits in the panel heading. */
.signal.used b::before, .pricing-head em::before {
    content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .35rem;
    border-radius: 50%; background: var(--green); vertical-align: middle; position: relative; top: -.08em;
}
.pricing-head em { font-style: normal; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-3); margin-left: 1rem; }
.signal span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.signal b { font-size: 1.05rem; font-weight: 600; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.signal.wide { grid-column: 1 / -1; }
.signal.wide b { font-weight: 400; font-size: .95rem; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.steps { display: flex; gap: .4rem; }
.step {
    flex: 1;
    padding: .5rem .7rem;
    border-radius: .6rem;
    background: #EEF3F8;
    color: var(--ink-3);
    font-size: .95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    transition: background .4s, color .4s;
}
.step::before { content: "○"; }
.step.done { background: rgba(120,168,24,.16); color: #4C6B0C; }
.step.done::before { content: "✓"; }
.step.now { background: rgba(0,82,156,.12); color: var(--blue); }
.step.now::before { content: "◌"; animation: spin 1.4s linear infinite; }
.step.stop { background: rgba(211,47,47,.13); color: var(--red); }
.step.stop::before { content: "●"; }
.step.check { background: rgba(242,166,59,.2); color: var(--amber-ink); }
.step.check::before { content: "⚠"; }
@keyframes spin { to { transform: rotate(360deg); } }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; align-content: start; }

.fact {
    border: 1px solid var(--line);
    border-radius: .7rem;
    padding: .4rem .65rem .45rem;
    min-width: 0;
    border-left-width: 4px;    /* the edge color says where the attribute came from (tooltip has the words) */
    animation: fact-in .5s cubic-bezier(.2,.8,.2,1) backwards;
}
.fact.src-voice { border-left-color: var(--blue); }
.fact.src-ai { border-left-color: var(--violet); }
.fact.src-ocr { border-left-color: #0F766E; }
.fact.src-operator { border-left-color: var(--ink-2); }
.fact.src-catalog { border-left-color: var(--green); }
.fact .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.fact .value { font-size: 1.15rem; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fact .from { font-size: .75rem; font-weight: 600; margin-top: .25rem; display: inline-block; padding: .05rem .45rem; border-radius: .6rem; }
.fact.wide { grid-column: 1 / -1; }
.fact.wide .value { font-size: 1.05rem; font-weight: 400; font-family: Consolas, monospace; }
.fact.missing { border: 2px dashed var(--red); color: var(--red); }
.fact.pending .value { color: transparent; }

.from-voice { background: rgba(0,82,156,.12); color: var(--blue); }
.from-ai { background: rgba(139,92,246,.14); color: var(--violet); }
.from-ocr { background: rgba(13,148,136,.14); color: #0F766E; }
.from-operator { background: rgba(107,114,128,.14); color: var(--ink-2); }
.from-catalog { background: rgba(120,168,24,.18); color: #4C6B0C; }

@keyframes fact-in {
    from { opacity: 0; transform: scale(.92); background: rgba(120,168,24,.35); }
    to   { opacity: 1; transform: none; }
}

.calls { font-size: .9rem; color: var(--ink-3); font-family: Consolas, monospace; flex: none; }

.spot-idle { margin: auto; text-align: center; color: var(--ink-3); font-size: 1.2rem; }
.spot-idle h3 { margin: .8rem 0 .2rem; font-size: 1.8rem; color: var(--ink); }
.spot-idle p { margin: 0; }
.spot-idle .done {
    width: 5rem; height: 5rem; margin: 0 auto; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--green); color: #fff; font-size: 2.8rem; font-weight: 700;
}
.spot-idle .done.plain { background: #C8D2DD; }
.spot-idle .done.ready { background: var(--blue); font-size: 1.6rem; }

/* ── The rail — every garment as a hanging tag ────────────────────────────── */

.rail-wrap { position: relative; padding: 1rem 1.6rem 1rem; height: 7.4rem; }
.rail-bar { height: .35rem; border-radius: .2rem; background: linear-gradient(#D5DCE4, #8C99A8); }
.rail { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding: .1rem .3rem .3rem; }
.rail::-webkit-scrollbar { display: none; }

.tag {
    flex: none;
    width: 4.2rem;
    margin-top: .55rem;
    padding: .35rem .2rem .4rem;
    border-radius: .35rem;
    background: #fff;
    color: var(--navy);
    text-align: center;
    position: relative;
    animation: tag-in .5s cubic-bezier(.3,1.6,.5,1);
    transform-origin: top center;
}
.tag::before { content: ""; position: absolute; left: 50%; top: -.6rem; width: 2px; height: .6rem; background: #B8C2CE; }
.tag .n { font-size: .65rem; color: var(--ink-3); line-height: 1; }
.tag .p { font-size: 1rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tag.s-resolving, .tag.s-pricing { background: rgba(255,255,255,.28); color: #fff; }
.tag.s-resolving .n, .tag.s-pricing .n { color: rgba(255,255,255,.7); }
.tag.s-review { background: #FFE9C2; }
.tag.s-incomplete { background: #F9D2D0; color: var(--red); }
/* Where the product changes: a rack divider, hung like a tag, naming the run that follows. */
.rail .sep {
    flex: none;
    width: 4.4rem;
    margin: .55rem 0 0 .5rem;
    padding: .25rem .3rem;
    border-radius: .35rem;
    background: var(--blue);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    font-size: .62rem; font-weight: 700; line-height: 1.2; letter-spacing: .03em; text-transform: uppercase;
    text-align: center;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.rail .sep:first-child { margin-left: 0; }
.rail .sep::before { content: ""; position: absolute; left: 50%; top: -.6rem; width: 2px; height: .6rem; background: #B8C2CE; }
.rail .sep span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.tag { cursor: pointer; transition: transform .15s; }
.tag:hover { transform: translateY(.15rem) scale(1.06); }
.tag.focus { outline: .2rem solid var(--green); }
/* Held by the viewer rather than followed: a different color, and it hangs lower. */
.is-pinned .tag.focus { outline-color: var(--amber); transform: translateY(.3rem) scale(1.12); }

@keyframes tag-in {
    from { opacity: 0; transform: rotate(-14deg) translateY(-.6rem); }
    to   { opacity: 1; transform: none; }
}

/* ── Phrase clouds in the detail column (X) ─────────────────────────────── */
body.has-clouds .spot { display: none; }
.clouds { display: flex; flex-direction: column; }
.clouds iframe { flex: 1; min-height: 0; width: 100%; border: 0; background: #fff; }

/* ── The prompter: a ticker of phrases to say, five to eight per product ──────── */

body.has-prompter { grid-template-rows: auto 1fr auto auto; }
body.has-prompter.has-sources { grid-template-rows: auto auto 1fr auto auto; }

.prompter {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem;
    padding: .55rem 1.6rem .7rem;
    background: #000; color: #fff;
}
.prompter-product { font-size: 1rem; opacity: .8; white-space: nowrap; }
.prompter-product small { display: block; font-size: .75rem; opacity: .7; }
.prompter-phrase { font-size: 2.4rem; font-weight: 700; text-align: center; letter-spacing: -.01em; line-height: 1.1; }
.prompter-phrase .c { color: #C9E88A; } .prompter-phrase .b { color: #9CC8F5; } .prompter-phrase .s { color: #FFD28A; } .prompter-phrase .p { color: #aaa; font-weight: 400; }
.prompter-phrase.flash { animation: prompt-pop .4s ease-out; }
@keyframes prompt-pop { from { transform: scale(.94); opacity: .3; } to { transform: none; opacity: 1; } }
.prompter-side { text-align: right; }
.prompter-pace { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .85; }
.prompter-hint { font-size: .75rem; opacity: .5; white-space: nowrap; }
.prompter.paused .prompter-phrase { opacity: .45; }
.prompter.paused .prompter-pace { opacity: 1; color: #FFD28A; }

/* ── Empty ────────────────────────────────────────────────────────────────── */

.empty {
    position: fixed; inset: 0;
    display: none; align-items: center; justify-content: center;
    background: #000;
}
body.is-empty .empty { display: flex; }
.empty-card { text-align: center; }
.empty-logos { display: flex; justify-content: center; align-items: center; gap: 3rem; margin-bottom: 2.5rem; }
.empty-logos .plate img { height: 7rem; }
.empty-logos .plate-company img { height: 4.2rem; }
.empty-card h1 { font-size: 3rem; margin: 0 0 .6rem; }
.empty-card p { font-size: 1.3rem; margin: .4rem 0; }
.empty-card a { color: #9CC8F5; }
code, kbd { background: rgba(255,255,255,.14); padding: .1rem .5rem; border-radius: .3rem; font-family: Consolas, monospace; }

/* A monitor mounted on its side: stack the panels. */
@media (orientation: portrait) {
    html { font-size: clamp(11px, 1.5vw, 24px); }
    main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1.25fr); }
    .who { flex-basis: 100%; order: 5; }
    .signals { grid-template-columns: repeat(3, 1fr); }
    .sources { flex-wrap: wrap; }
    .bar { flex-wrap: wrap; gap: .8rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
