/* ===========================================================================
   BLUE OPS INTRANET — site-specific styles on top of blueops.css.

   Load order matters: blueops.css FIRST (it owns the tokens, the reset and the
   chrome), this file second. Everything here is what is unique to the intranet
   — the card pipeline, WebCrawl, the dashboard charts — and every colour is a
   --color-* token from blueops.css so both themes come for free. The vellum
   palette that began on the front page now lives in those tokens (JKG, 22 Nov
   2026: whole site). Literal hex lives in one documented place only: the white
   plate behind a QR code.
   =========================================================================== */

/* --- sticky footer, on a phone ---------------------------------------------- */
/* blueops.css already pins the footer on a short page: body is a flex column with
   min-height:100vh and main takes flex:1 0 auto. That is correct on a desktop and
   WRONG on a phone, which is where this site is actually used - 100vh on iOS and
   Android means the viewport with the browser's address bar HIDDEN, so every page
   is taller than what you can see, a short page scrolls when it has no business
   scrolling, and the footer sits just under the fold until the bar collapses.
   100dvh is that same height measured against the chrome as it is right now.

   Declared here rather than in blueops.css because that file is the shared design
   system and the portal renders from its own copy of it; this is a one-line
   correction the intranet can carry on its own. Older engines that never learned
   dvh ignore the whole declaration and keep the 100vh above it, which is the old
   behaviour and not a regression. The footer also gets a hairline-safe top border
   already, so nothing else is needed to make it read as the bottom of the page. */
body { min-height: 100dvh; }

/* --- front page: the console ------------------------------------------------- */
/* The front page reads as a control console (JKG, 22 Nov 2026): a strip with what
   needs the person now, a status line, then one station per workstream. Its
   vellum look is the site theme now, so this block is written in the shared
   --color-* tokens like everything else. Mobile first: one column until there
   is room. */
.mc { --mc-grid: color-mix(in srgb, var(--color-muted) 9%, transparent); }
.mc-num { font-variant-numeric: tabular-nums lining-nums; }

.mc-head { margin-bottom: 1.1rem; }
.mc-head h1 { font-size: 2rem; line-height: 1.15; margin: .15rem 0 .3rem; }
.mc-asof { color: var(--color-muted); font-size: .82rem; margin: 0; }
.mc-asof .mc-num { color: var(--color-accent); font-weight: 600; }

/* Pencil sketches: drones and boats, drawn in the muted ink at a few percent, in
   corners where no text sits. The strip at the foot carries drones only: the
   site's own vessel watermark (below) already sails across the bottom of the page. They never take a click and are hidden from
   assistive tech in the markup. */
.mc-sketch { position: absolute; pointer-events: none; fill: none; stroke: var(--color-muted);
             stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
             opacity: var(--sketch-alpha); }
.mc-sketch.sk-hero { right: 8px; bottom: 10px; width: 150px; transform: rotate(-8deg); }
.mc-sketch.sk-stn { right: 4px; top: -30px; width: 190px; }
.mc-chartfoot { position: relative; height: 96px; margin-top: 1.4rem; overflow: hidden;
                border-top: 1px dashed var(--color-border); }
.mc-chartfoot .sk-a { left: 6%; top: 14px; width: 96px; transform: rotate(6deg); }
.mc-chartfoot .sk-c { right: 5%; top: 30px; width: 70px; transform: rotate(-10deg); }

/* The lamp: a round status light. The state word is always printed next to it.
   State classes are s-* because blueops.css already owns .ok and .warn as bold
   coloured TEXT; reusing them would repaint a whole station. */
.mc .lamp { display: inline-block; width: 9px; height: 9px; flex: none;
            border-radius: 50%; background: var(--color-muted); }
.mc .lamp.s-ok,   .mc .s-ok   > .lamp { background: var(--color-ok); }
.mc .lamp.s-attn, .mc .s-attn > .lamp { background: var(--color-wait); animation: mc-pulse 1.8s ease-in-out infinite; }
.mc .lamp.s-work, .mc .s-work > .lamp { background: var(--color-ok); animation: mc-pulse 1s ease-in-out infinite; }
.mc .lamp.s-idle, .mc .s-idle > .lamp { background: transparent; box-shadow: inset 0 0 0 2px var(--color-muted); }
.mc .lamp.s-none, .mc .s-none > .lamp { background: transparent; outline: 1.5px dashed var(--color-muted); outline-offset: -1.5px; }

/* Hero: count | queue | next step, one sheet of paper with ruled divisions. */
.mc-hero {
  position: relative; display: grid; grid-template-columns: 1fr; overflow: hidden;
  background: var(--color-panel); border: 1px solid var(--color-border); border-left: 4px solid var(--color-ok);
  border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft), 0 8px 24px -18px var(--shadow-soft);
}
.mc-hero.s-attn { border-left-color: var(--color-accent); }
.mc-hero > div { position: relative; padding: 1.1rem 1.2rem 1.2rem; min-width: 0;
                 border-top: 1px solid var(--color-border); }
.mc-hero > div:first-child { border-top: 0; }
.mc-hero .eyebrow { margin: 0 0 .6rem; }
/* The count sits on chart paper: a faint ruled grid, with a drone sketched in the corner. */
.mc-count {
  background-color: var(--color-panel-2);
  background-image: linear-gradient(var(--mc-grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--mc-grid) 1px, transparent 1px);
  background-size: 100% 24px, 24px 100%; overflow: hidden;
}
.mc-count > :not(.mc-sketch) { position: relative; }
.mc-big { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin: 0 0 .7rem; }
.mc-big .mc-num { font: 600 4.2rem/.9 var(--font-serif); color: var(--color-accent); }
.mc-big-word { font: italic 600 1.05rem/1.2 var(--font-serif); color: var(--color-accent); }
.mc-hero.s-ok .mc-big .mc-num, .mc-hero.s-ok .mc-big-word { color: var(--color-ok); }
ul.mc-tally { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem;
              max-width: 15rem; }
ul.mc-tally a, ul.mc-tally span { display: flex; align-items: baseline; gap: .5rem;
  color: var(--color-text); text-decoration: none; font-size: .9rem; padding: .28rem .6rem;
  background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
ul.mc-tally a:hover, ul.mc-tally a:focus-visible { border-color: var(--color-accent); text-decoration: underline; }
ul.mc-tally b { min-width: 1.6ch; text-align: right; font: 600 1.1rem/1 var(--font-serif); color: var(--color-accent); }
.mc-clear { margin: 0 0 .6rem; font: 600 1.05rem/1.35 var(--font-serif); color: var(--color-ok); }
.mc-queue .hint { margin: .7rem 0 0; font-size: .78rem; }
.mc-next { display: flex; flex-direction: column; }

.btn.mc-go { display: flex; flex-direction: column; gap: .15rem; text-align: left;
             padding: .8rem 1rem; min-height: 4.2rem; justify-content: center; }
.btn.mc-go span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.btn.mc-go b { font: 600 1.1rem/1.3 var(--font-serif); overflow-wrap: anywhere; }
.btn.mc-go b::after { content: " \2192"; }
.home-actions { display: flex; flex-direction: column; gap: .45rem; margin: .6rem 0 0; }
.home-actions:empty { display: none; }
.home-actions .btn { min-height: 2.8rem; display: flex; align-items: center; justify-content: center; }

ul.home-list { list-style: none; margin: 0; padding: 0; }
ul.home-list li { padding: .5rem 0; border-bottom: 1px solid var(--color-hairline);
  font-size: 1rem; overflow-wrap: anywhere; }
ul.home-list li:last-child { border-bottom: 0; }
ul.home-list li .dim { font-size: .78rem; font-variant-numeric: tabular-nums; }
.mc ul.home-list a { font-weight: 600; text-decoration-color: color-mix(in srgb, var(--color-accent) 45%, transparent); }
.mc ul.home-list a:hover { text-decoration-color: var(--color-accent); }

/* Status line: one row of lamps under the hero. */
ul.home-status { list-style: none; margin: .6rem 0 1.9rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: .4rem .5rem; font-size: .78rem; color: var(--color-muted);
  font-variant-numeric: tabular-nums; }
ul.home-status li { display: flex; align-items: center; gap: .5rem; padding: .22rem .7rem;
  background: var(--color-panel-2); border: 1px solid var(--color-border); border-radius: var(--radius-pill); }
ul.home-status a { color: var(--color-text); text-decoration: none; }
ul.home-status a:hover, ul.home-status a:focus-visible { color: var(--color-accent); text-decoration: underline; }

/* Stations: one card per workstream. The name is the real link and its ::after
   covers the whole card, so the card is one big target while each figure stays
   its own link above it. */
.mc-stations { position: relative; }
.mc-stations h2 { display: block; margin: 0 0 .7rem; padding-bottom: .3rem; border-bottom: 1px solid var(--color-border);
                  font: 700 .75rem/1.3 var(--font-sans); letter-spacing: .09em; text-transform: uppercase;
                  color: var(--color-muted); }
.stations { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.station { position: relative; background: var(--color-panel); padding: .9rem 1.05rem 1rem;
           display: flex; flex-direction: column; min-width: 0;
           border: 1px solid var(--color-border); border-left: 4px solid var(--color-border);
           border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
           transition: box-shadow .15s ease, transform .15s ease; }
.station.s-ok, .station.s-work { border-left-color: var(--color-ok); }
.station.s-attn { border-left-color: var(--color-wait); }
.station:hover, .station:focus-within { box-shadow: 0 2px 4px var(--shadow-soft), 0 12px 24px -14px var(--shadow-soft);
                                         transform: translateY(-1px); }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem .6rem; flex-wrap: wrap; }
.st-code { font-size: .68rem; font-weight: 600; letter-spacing: .08em; color: var(--color-muted); }
.st-head h3 { margin: .1rem 0 0; flex: 1 1 100%; font-size: 1.3rem; }
.st-open { color: var(--color-text); text-decoration: none; }
.st-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.st-open:hover { color: var(--color-accent); }
.st-open:focus-visible { outline: none; }
.st-open:focus-visible::after { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.st-light { display: inline-flex; align-items: center; gap: .4rem; font-size: .7rem; font-weight: 600;
  letter-spacing: .04em; color: var(--color-muted); white-space: nowrap;
  border: 1px solid var(--color-border); background: var(--color-panel-2); border-radius: var(--radius-pill); padding: .05rem .55rem; }
.st-light.s-ok, .st-light.s-work { color: var(--color-ok); }
.st-light.s-attn { color: var(--color-warn); }
.st-sub { color: var(--color-muted); font-size: .82rem; margin: .2rem 0 .75rem; }
.st-figs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.st-fig { position: relative; z-index: 1; flex: 1 1 5.4rem; min-width: 0;
  display: flex; flex-direction: column; gap: .2rem; padding: .55rem .7rem .5rem;
  text-decoration: none; color: var(--color-text);
  background: var(--color-panel-2); border: 1px solid var(--color-border); border-radius: var(--radius); }
.st-fig b { font: 600 1.75rem/1.05 var(--font-serif); color: var(--color-accent); }
.st-fig span { font-size: .78rem; line-height: 1.25; color: var(--color-text); }
.st-fig small { font-size: .7rem; color: var(--color-muted); line-height: 1.2; margin-top: auto; }
.st-fig:hover, .st-fig:focus-visible { border-color: var(--color-accent); background: var(--color-panel); }
.st-fig:hover span, .st-fig:focus-visible span { text-decoration: underline; }
.st-state { font-size: .82rem; color: var(--color-muted); margin: auto 0 0; }
.st-acts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: .3rem 1rem;
           margin: .55rem 0 0; font-size: .82rem; font-weight: 600; }
.st-figs + .st-acts { margin-top: auto; }

/* Logs: what I touched, what is in the library, what changed in Otto. */
.mc-logs { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-top: 1.9rem; }
.mc .cpanel { min-width: 0; }
.mc-logs .cpanel { margin-top: 0; }
.cpanel.mc-log .hint { font-size: .76rem; margin: .7rem 0 0; }
.cpanel.mc-log ul.home-list li { font-size: .92rem; }
.cpanel.mc-other { background: transparent; box-shadow: none; border-style: dashed; margin-top: .75rem; }

@media (min-width: 640px) {
  .stations { grid-template-columns: repeat(2, 1fr); }
  .home-actions { flex-direction: row; }
  .home-actions .btn { flex: 1; }
}
@media (min-width: 900px) {
  .mc-hero { grid-template-columns: minmax(15rem, 1fr) minmax(0, 1.7fr) minmax(15rem, 1fr); }
  .mc-hero > div { border-top: 0; border-left: 1px solid var(--color-border); }
  .mc-hero > div:first-child { border-left: 0; }
  .stations { grid-template-columns: repeat(3, 1fr); }
  .mc-logs { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
  .home-actions { flex-direction: column; }
  .mc-next .home-actions { margin-top: auto; padding-top: .6rem; }
}
@media (max-width: 639px) { .mc-sketch.sk-stn { width: 130px; top: -22px; } }
@keyframes mc-pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .mc .lamp { animation: none !important; }
  .station { transition: none; } .station:hover, .station:focus-within { transform: none; }
}
@media print { .mc-sketch { display: none; } .mc-count { background-image: none; } }

/* --- USV watermark ---------------------------------------------------------- */
/* Kept from the first design on purpose - the one thing worth carrying over. A
   line-art unmanned surface vessel just above the threshold of visibility: you
   notice it on the second look, never on the first. Drawn in the chart ink, not
   the accent - an accent-coloured watermark would read as a warning. Fixed so it stays put while
   content scrolls over it; pointer-events:none so it can never catch a click. */
:root { --usv-alpha: .08; }
@media (prefers-color-scheme: dark) { :root { --usv-alpha: .13; } }
:root[data-theme="light"] { --usv-alpha: .08; }
:root[data-theme="dark"]  { --usv-alpha: .13; }

body::before {
  content: ""; position: fixed; inset: auto 0 0 0; height: min(46vh, 420px);
  z-index: 0; pointer-events: none;
  background: url("/static/usv.svg") no-repeat right -6% bottom 6%;
  background-size: min(1150px, 116%) auto;
  opacity: var(--usv-alpha);
  color: var(--color-data);            /* the SVG strokes use currentColor */
  /* the mask only shapes alpha, it never renders as a colour on screen */
  -webkit-mask-image: linear-gradient(to top, #000 40%, transparent 100%);
  mask-image: linear-gradient(to top, #000 40%, transparent 100%);
}
/* Lift the chrome and content above the watermark. */
.statusbar, .site-header, main, .site-footer { position: relative; z-index: 1; }
@media (max-width: 680px) { body::before { opacity: calc(var(--usv-alpha) * .7); background-size: 150% auto; } }
@media print { body::before { display: none !important; } }

/* --- login ------------------------------------------------------------------ */
/* The front door: one centred console card on the page ground. margin:auto in
   the body's flex column centres it both ways whatever chrome sits above. */
main.loginbox {
  margin: auto; flex: 0 0 auto;
  width: min(400px, 92vw); max-width: none; padding: 1.8rem 2rem 1.6rem;
  background: var(--color-panel); border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent); border-radius: var(--radius);
  box-shadow: 0 1px 2px var(--shadow-soft), 0 24px 60px -30px var(--shadow);
}
/* blueops.css styles .brand for the dark header; on a paper card the same cream
   text would vanish, so the login card recolours it in page ink. */
.loginbox .brand { color: var(--color-text); margin-bottom: 1.1rem; }
.loginbox .brand .sub { color: var(--color-muted); }
.loginbox form { display: flex; flex-direction: column; gap: 1rem; }
.loginbox .dim { font-size: .8rem; margin-top: 1.2rem; }

/* --- shared bits ------------------------------------------------------------ */
.hint.warn { color: var(--color-warn); }

/* --- CardAI status strip ----------------------------------------------------- */
/* Plan §5: queue first, machine state second. One row in the panel voice; the
   queue sentence is the widest, most readable thing in it because the queue IS
   the information. Start/Stop keep the small paper-button voice - the page's one
   filled primary stays the Upload button, and a filled Stop would read as
   an alarm on a strip that is usually reporting "all quiet". */
.cardai {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
  padding: .65rem .85rem; margin-top: 1rem;
}
.cardai .cname { font-family: var(--font-serif); font-size: 1.02rem; font-weight: 600; }
.cardai .cqueue { flex: 1 1 auto; font-size: .9rem; min-width: 0; }
.cardai form { display: inline; margin: 0; }
.cardai form button {
  background: var(--color-panel); color: var(--color-btn-text); border-color: var(--color-border);
  box-shadow: none; padding: .28rem .8rem; font-size: .8rem;
}
.cardai form button:hover { background: var(--color-panel-2); border-color: var(--color-accent);
                            color: var(--color-btn-text); filter: none; }
/* The upload form follows the strip as a card of its own. */
.cardai + form.upload, form.upload + .hint { margin-top: .75rem; }
/* The power note and any button answer sit under the strip, full width, quiet. */
.cardai .hint { flex-basis: 100%; margin: 0; font-size: .8rem; }

/* --- business-card queue ---------------------------------------------------- */
ul.clist { list-style: none; margin: 1rem 0 0; padding: 0; }
.crow {
  display: flex; align-items: center; gap: 1rem;
  background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
  padding: .7rem .85rem; margin-bottom: .6rem;
}
.crow img { width: 104px; height: 64px; object-fit: cover; border: 1px solid var(--color-hairline);
            border-radius: var(--radius-xs); }
.cmeta { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.cmeta span { color: var(--color-muted); font-size: .85rem; }
.crow .rstat { margin-left: auto; }
/* Review is the row's action, but eight rows of full-size buttons would shout. */
.crow .btn { padding: .35rem .9rem; font-size: .85rem; }
@media (max-width: 680px) {
  .crow { flex-wrap: wrap; }
  .crow .cmeta { flex: 1 1 0; min-width: 9.5rem; }   /* the name keeps its width; the buttons wrap under */
  .crow .rstat { margin-left: 0; order: 3; }
}

/* Research status — the pill shape from blueops.css, semantic colour as ink.
   The ok/warn tokens are AA as text on the tile ground in both themes. */
.rstat {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  border-radius: var(--radius-pill); background: var(--color-panel-2); padding: .08rem .6rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .04em; line-height: 1.5; white-space: nowrap;
}
.rstat.working { color: var(--color-muted); }
.rstat.ok      { color: var(--color-ok); }
.rstat.warn    { color: var(--color-warn); }
/* Pulsing dot, same as blueops chips. */
.rstat .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
              animation: bo-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .rstat .dot { animation: none; opacity: .85; } }

/* --- card review ------------------------------------------------------------
   Two columns: the scanned details (and, once filed, the Lead delivery) on the left,
   Marcus's company check on the right, sticky so it stays in view while the fields are
   edited. Sections are cards with a header bar. */
.rv { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
      gap: 1.6rem; align-items: start; margin-top: 1rem; }
.rv.solo { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
.rv-side { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto;
           scrollbar-width: thin; }
.rv-side .rpanel, .rv-main .rpanel { margin-top: 0; }
.rv-main > * + *, .rv-main > * + .rpanel { margin-top: 1.4rem; }
.review, .rv .rpanel {
  background: var(--color-panel); border: 1px solid var(--color-border); padding: 0;
  border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft); overflow: hidden;
}
.rhead, .rv .rpanel > h2 {
  margin: 0; padding: .85rem 1.3rem; border-bottom: 1px solid var(--color-hairline);
  background: var(--color-panel-2, transparent);
}
/* The verdict or badge sits at the far end of its header bar, where the eye looks for
   a status, instead of trailing the title wherever the title happens to end. */
.rv .rpanel > h2 { justify-content: space-between; }
.rhead h2 { margin: 0; }
.rhead .hint { margin: .3rem 0 0; }
/* Which reader produced the numbers: provenance, so it is quiet - but it is also where
   a degraded read shows, so it keeps a line of its own and full-strength ink. */
.rhead .reader { margin: .15rem 0 0; font-size: .78rem; color: var(--color-muted); }
.rhead .reader b { color: var(--color-text); font-weight: 600; }
.rv .rpanel > :not(h2) { margin-left: 1.3rem; margin-right: 1.3rem; }
.rv .rpanel > h2 + * { margin-top: 1rem; }
.rv .rpanel > :last-child { margin-bottom: 1.2rem; }
.rv .rpanel form { margin-bottom: 0; display: flex; flex-direction: column; gap: 1rem; }
.rbody { padding: 1.3rem; }
.shot { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.3rem;
        padding-bottom: 1.3rem; border-bottom: 1px solid var(--color-hairline); }
.shot-btn { position: relative; flex: none; padding: 0; border: 1px solid var(--color-edge);
            border-radius: var(--radius-sm); overflow: hidden;
            background: none; cursor: zoom-in; width: 180px; line-height: 0; }
.shot-btn:hover { background: none; border-color: var(--color-accent); }
.shot-btn:focus-visible { border-color: var(--color-accent); }
.shot-btn img { width: 100%; max-height: 130px; object-fit: cover; border: 0; display: block; }
.shot-zoom { position: absolute; right: 0; bottom: 0; padding: .1rem .5rem;
             border-top-left-radius: var(--radius-sm);
             background: var(--color-text); color: var(--color-bg); line-height: 1.5;
             font-size: .68rem; font-weight: 600; letter-spacing: .03em; }
.shot-btn:hover .shot-zoom, .shot-btn:focus-visible .shot-zoom {
  background: var(--color-accent); color: var(--color-accent-contrast); }
.shot-side { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.shot-side .hint { margin: 0; }
.shotlink { font-size: .8rem; }
.shotlink[hidden] { display: none; }
.shot .cropnote { margin: 0; font-size: .8rem; }
/* The full-size picture. Native <dialog>: Escape, the focus trap and the backdrop come
   for free. A title bar carries the close button so it never sits on top of the card. */
.shotdlg { padding: 0; border: 1px solid var(--color-border); background: var(--color-panel);
           border-radius: var(--radius); overflow: hidden;
           color: var(--color-text); max-width: min(94vw, 1100px); max-height: 92vh;
           box-shadow: 0 24px 60px -20px var(--shadow); }
.shotdlg[open] { display: flex; flex-direction: column; }
.shotdlg::backdrop { background: rgba(26, 24, 20, .72); }
.shotdlg-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
               padding: .55rem .6rem .55rem 1rem; border-bottom: 1px solid var(--color-hairline);
               background: var(--color-panel-2, transparent); flex: none; }
.shotdlg img { display: block; max-width: 100%; max-height: calc(92vh - 3.2rem);
               min-height: 0; object-fit: contain; margin: 0 auto; }
.review form { display: flex; flex-direction: column; gap: 1rem; }
/* Confidence rides in the field label, so it stays mono and tiny. */
.conf { font-size: .72rem; font-variant-numeric: tabular-nums lining-nums;
        font-weight: 700; letter-spacing: .02em; color: var(--color-ok); margin-left: .5rem; }
.conf.low { color: var(--color-warn); }
.review .actions { margin-top: .9rem; padding-top: 1.2rem; gap: .8rem;
                   border-top: 1px solid var(--color-hairline); }
.actions button.primary { padding: .8rem 2rem; font-size: 1rem; }
.review .actions .btn.ghost { padding: .8rem 1.2rem; font-size: 1rem; }
/* Dismissing is the way out, not the invitation: small, at the far end, on its own line. */
.review form.discard { display: block; margin-top: .9rem; text-align: right; }
@media (max-width: 900px) {
  .rv { grid-template-columns: minmax(0, 1fr); }
  .rv.solo { max-width: none; }
  .rv-side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 680px) {
  .rhead, .rv .rpanel > h2 { padding: .8rem 1rem; }
  .rbody { padding: 1rem; }
  .rv .rpanel > :not(h2) { margin-left: 1rem; margin-right: 1rem; }
  .shot { gap: .9rem; }
  .shot-btn { width: 132px; }
  /* One-handed: the two ways forward share the row and are both easy to hit. */
  .review .actions > * { flex: 1 1 auto; }
  .shotdlg { max-width: 100vw; width: 100vw; border-left: 0; border-right: 0; border-radius: 0; }
}

/* --- what the reader did to each field -------------------------------------
   Four states, four different next actions for the reviewer, so four different
   looks - and never colour alone: every one of them carries its own WORD, which
   is what survives a monochrome screen, a screen reader and colour blindness.

     repaired   amber, solid rail. We changed the value; check we were right.
     check      danger red, solid rail. We refused; read it off the card. This is
                the one loud thing on the form.
     unseen     muted, DASHED rail. Nothing is wrong with it - it simply has one
                engine behind it instead of two. Dashed reads as provisional
                without reading as broken, which is the whole distinction.
     empty      hairline only, muted. A legitimate answer, and deliberately the
                quietest thing on the form: nothing was printed, and nobody
                should feel invited to fill it in.
   --------------------------------------------------------------------------- */
/* blueops.css makes every <label> a COLUMN flex, which would put the percentage and
   the mark on lines of their own under the caption. A three-column grid puts the
   caption left and the two badges right, on one line, with the input and the reason
   spanning underneath - and the rail down the left edge is what carries the state. */
.fld {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: baseline; gap: .3rem .5rem;
  border-left: 3px solid transparent; padding-left: .7rem; margin-left: -.7rem;
}
.fld > .fname { grid-column: 1; }
.fld > .conf  { grid-column: 2; margin-left: 0; }
.fld > .vflag { grid-column: 3; margin-left: 0; }
/* text-transform and letter-spacing are INHERITED INTO FORM CONTROLS, so the label's
   uppercase micro-type voice was being applied to the values themselves - a review
   screen whose entire job is comparing a string against a photograph was drawing
   anne.kracht@… as ANNE.KRACHT@…, letter-spaced. The caption keeps the voice; the
   value is shown exactly as it will be filed. */
.fld > input  { grid-column: 1 / -1; text-transform: none; letter-spacing: normal; }
.fld > .why   { grid-column: 1 / -1; }
/* Wide screens: caption | value | confidence on one line, every value box the same
   width so the column reads as a form and not as a ragged list. The mark (when there is
   one) drops under the value and leads into its reason - it is the start of that
   sentence, and keeping it out of the first line is what lets the boxes line up. */
@media (min-width: 681px) {
  .review .fld { grid-template-columns: 8.5rem minmax(0, 1fr) 2.9rem; align-items: center;
                 gap: .4rem .7rem; }
  .review .fld > .fname { grid-column: 1; grid-row: 1; }
  .review .fld > input  { grid-column: 2; grid-row: 1; }
  .review .fld > .conf  { grid-column: 3; grid-row: 1; justify-self: start; }
  .review .fld > .vflag { grid-column: 2 / -1; grid-row: 2; justify-self: start; }
  .review .fld > .why   { grid-column: 2 / -1; grid-row: 3; margin-top: 0; }
}
/* The value is what gets compared against the picture: regular weight, not the label's
   bold, which made every box shout and long addresses hard to scan. */
.fld > input, .fld > select { font-weight: 400; }
.conf { padding: .05rem .45rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
        background: var(--color-panel-2); text-align: center; }
.conf:empty { display: none; }
.fld.f-repaired { border-left-color: var(--color-wait); }
.fld.f-check,
.fld.f-invalid  { border-left-color: var(--color-danger); }
.fld.f-unseen   { border-left: 3px dashed var(--color-edge); }
.fld.f-low      { border-left-color: var(--color-hairline); }
.fld.f-empty    { border-left-color: var(--color-hairline); }

.vflag {
  display: inline-block; margin-left: .45rem; padding: .05rem .4rem;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: var(--radius-pill);
  background: var(--color-panel-2);
  font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: none; white-space: nowrap;
  vertical-align: 1px;
}
.vflag.v-repaired { color: var(--color-warn); }
.vflag.v-check,
.vflag.v-invalid  { color: var(--color-danger); }
.vflag.v-unseen   { color: var(--color-muted); border-style: dashed; }
.vflag.v-empty    { color: var(--color-muted); border-color: var(--color-hairline); }
.vflag.v-low      { color: var(--color-muted); }

/* The reason, under the input. A sentence, not a label - so the uppercase micro-type
   voice blueops.css gives everything inside a <label> is undone here. */
.why {
  display: block; margin-top: .35rem; font-size: .78rem; line-height: 1.45;
  color: var(--color-muted); text-transform: none; letter-spacing: normal;
  font-weight: 400;
}
.why .was, .why .sugg {
  font-family: ui-monospace, Consolas, monospace; font-size: .95em;
  padding: 0 .25rem; background: var(--color-panel-2, transparent);
  border: 1px solid var(--color-hairline); border-radius: var(--radius-xs); color: var(--color-text);
}

/* The key to the marks. Only rendered on a card that actually carries verdicts -
   a legend for symbols that never appear is worse than no legend. */
.vkey { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .6rem 0 1rem;
        font-size: .78rem; }
.vpair { display: inline-flex; align-items: baseline; gap: .45rem; }
.vpair .vflag { margin-left: 0; }
.novalidation { margin: .6rem 0 1rem; }

/* --- research findings panel ------------------------------------------------ */
.rpanel { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
          padding: 1rem 1.15rem; margin-top: 1rem; }
.rpanel h2 { margin: 0 0 .6rem; }
.rrow2 {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .7rem;
  padding: .45rem 0; border-bottom: 1px solid var(--color-hairline); font-size: .9rem;
}
.rrow2:last-child { border-bottom: 0; }
/* The row label reads as a form label: uppercase micro-type, muted. */
.rrow2 b { min-width: 132px; font-size: .7rem; font-weight: 700;
           text-transform: uppercase; letter-spacing: .07em; color: var(--color-muted); }
.rpanel.future { opacity: .92; }
/* .futurerow is a <label>, so undo blueops.css's uppercase label voice - these
   are sentences describing future switches, not field captions. */
.futurerow {
  flex-direction: row; align-items: flex-start; gap: .7rem; padding: .55rem 0;
  border-bottom: 1px solid var(--color-hairline); cursor: not-allowed; min-width: 0;
  text-transform: none; letter-spacing: normal; font-size: .9rem; font-weight: 400;
  color: var(--color-text);
}
.futurerow:last-child { border-bottom: 0; }
.futurerow input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.futurerow span { display: flex; flex-direction: column; gap: 2px; }
.futurerow .dim { font-size: .85rem; }
@media (max-width: 680px) { .rrow2 b { min-width: 0; width: 100%; } }
/* In the review page's side column a row is a small stack - caption, value, remark -
   rather than a wrapped line, so every finding starts at the same left edge. */
.rv-side .rrow2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem;
                  padding: .7rem 0; justify-items: start; }
.rv-side .rrow2 b { min-width: 0; }
.rv-side .rrow2 > .dim { font-size: .82rem; line-height: 1.45; }
.rv-side .rrow2 > .dim:empty { display: none; }
.rv-side .rrow2.dim { font-size: .82rem; }
/* A long listing or address must wrap inside the panel, never push out of it. */
.rv-side .chip.pick { white-space: normal; overflow-wrap: anywhere; text-align: left;
                      max-width: 100%; }
.rv-side .rurl { margin-left: .35rem; white-space: nowrap; }

/* --- "what are we looking for" wells ---------------------------------------- */
/* The one thing a person actually types on these pages. The accent's left rule
   says "start here" - a full accent wash would say "warning". */
.askfield {
  background: var(--color-panel-2); border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent); border-radius: var(--radius);
  padding: .7rem .85rem .8rem; gap: .45rem; flex: 1 1 100%; min-width: 0;
}
.askfield > input[type=text] {
  background: var(--color-field); border-color: var(--color-edge);
  font-size: 1rem; padding: .7rem .85rem; width: 100%;
}
form.searchbar { align-items: flex-end; gap: .8rem; }
form.searchbar .askfield { flex: 1 1 420px; }
form.searchbar button { padding: .75rem 1.4rem; }

/* The search page has two forms; the comment box at the bottom must not compete
   with Search, the page's real primary, so its submit falls back to the paper button. */
form[action="/webcrawl/comment"] button[type=submit] {
  background: var(--color-panel); color: var(--color-btn-text); border-color: var(--color-border); box-shadow: none;
}
form[action="/webcrawl/comment"] button[type=submit]:hover {
  background: var(--color-panel-2); border-color: var(--color-accent); color: var(--color-btn-text); filter: none;
}

/* --- business-card tabs ----------------------------------------------------- */
/* Same language as the site nav: a rust underline on the current one. Plain links, so every tab is its own page. */
nav.tabs { display: flex; gap: 1.6rem; flex-wrap: wrap; margin: .2rem 0 1rem;
           border-bottom: 1px solid var(--color-border); }
nav.tabs a {
  color: var(--color-muted); text-decoration: none;
  letter-spacing: .01em; font-size: .95rem; font-weight: 600;
  padding: .55rem 0; margin-bottom: -1px; border-bottom: 2px solid transparent;
}
nav.tabs a:hover { color: var(--color-text); border-bottom-color: var(--color-edge); }
nav.tabs a.on { color: var(--color-text); border-bottom-color: var(--color-accent); }
nav.tabs .count { margin-left: .25rem; }
/* Status filter inside Scanned cards: quieter than the tabs, pills. */
nav.stages { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 .4rem; }
nav.stages a {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--color-muted); text-decoration: none; font-size: .85rem; font-weight: 600;
  background: var(--color-panel); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: .28rem .5rem .28rem .85rem;
}
nav.stages a:hover { color: var(--color-text); border-color: var(--color-edge); }
nav.stages a.on { color: var(--color-link); border-color: var(--color-accent); background: var(--color-panel-2); }
nav.stages a.on .count { background: var(--color-panel); }
.cpanel.denied { border-left: 4px solid var(--color-wait); }
.cpanel .actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }

/* --- upload pickers --------------------------------------------------------- */
/* Big tap targets - these are used one-handed on a phone. Dashed border says
   "drop zone"; the accent arrives on hover only. */
label.pick {
  border: 1px dashed var(--color-edge); border-radius: var(--radius); padding: .75rem .85rem; gap: 3px;
  background: var(--color-panel-2); cursor: pointer;
}
label.pick:hover { border-color: var(--color-accent); }
label.pick .sub { font-size: .78rem; color: var(--color-muted);
                  text-transform: none; letter-spacing: normal; font-weight: 400; }
label.pick input[type=file] { margin-top: 5px; background: var(--color-field); }
@media (max-width: 680px) {
  form.upload { flex-direction: column; align-items: stretch; }
  label.pick { min-height: 64px; justify-content: center; }
  form.upload button { width: 100%; padding: .9rem; }
}

/* --- phone onboarding (QR) -------------------------------------------------- */
.phonebox {
  display: flex; gap: 1.1rem; align-items: center;
  background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
  padding: .9rem 1rem; margin-top: .8rem;
}
/* THE one literal hex outside blueops.css, on purpose: a QR code must stay
   ink-on-white in BOTH themes - a phone camera reads black-on-white, and a
   token that goes dark in dark mode would break scanning. */
.phonebox img { background: #FFFFFF; padding: 6px; flex: none;
                border: 1px solid var(--color-hairline); border-radius: var(--radius-xs); }
.phonebox h3 { margin: 0 0 .3rem; }
.phonebox p { margin: 0 0 .4rem; color: var(--color-muted); font-size: .875rem; }
.phonebox p:last-child { margin-bottom: 0; font-size: .8rem; }
.handoffbox { border-left: 4px solid var(--color-accent); }
.handoffbox form { margin-top: .6rem; }
code.handoffurl { display: block; word-break: break-all; padding: .5rem;
                  background: var(--color-panel-2); border: 1px solid var(--color-hairline);
                  border-radius: var(--radius-sm);
                  font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
@media (max-width: 680px) { .phonebox { display: none; } }  /* pointless on the phone itself */

/* --- the handed-off phone ---------------------------------------------------
   Its own screen, not the app shell: no nav, no sign-out, nothing it cannot
   open. Used one-handed, outdoors, in a hurry - so every control is a target
   you can hit without looking, and nothing on it needs a script. */
.phonewrap { max-width: 34rem; margin: 0 auto; padding: 1rem 1rem 3rem; }
.phonebrand { margin: 0 0 1rem; padding-bottom: .6rem; border-bottom: 3px solid var(--color-accent);
              font-size: .8rem; letter-spacing: .08em;
              text-transform: uppercase; color: var(--color-muted); }
.phonebrand b { font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; letter-spacing: 0;
                text-transform: none; color: var(--color-text); margin-right: .3rem; }
.phonewrap h1 { font-size: 1.5rem; margin: 0 0 .4rem; }
.phonewrap h2 { font-size: 1rem; margin: 1.6rem 0 .5rem; }
.phoneform { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
label.bigpick {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 5.5rem; padding: 1rem; text-align: center; cursor: pointer;
  background: var(--color-panel); border: 2px dashed var(--color-edge); border-radius: var(--radius);
  font-size: 1.15rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--color-text);
}
label.bigpick .sub { font-size: .85rem; font-weight: 400; color: var(--color-muted);
                     margin-top: .2rem; }
label.bigpick input[type=file] { margin-top: .7rem; font-size: 1rem; }
.bigbtn {
  display: block; width: 100%; box-sizing: border-box; min-height: 3.4rem;
  padding: .9rem 1rem; font-size: 1.15rem; font-weight: 600; text-align: center;
  border: 1px solid var(--color-accent); border-radius: var(--radius); cursor: pointer;
  background: var(--color-accent); color: var(--color-accent-contrast); text-decoration: none;
}
.bigbtn.ghost { background: var(--color-panel); color: var(--color-text);
                border-color: var(--color-edge); font-weight: 500; }
ul.phonelist { list-style: none; margin: 0; padding: 0; }
ul.phonelist li { display: flex; justify-content: space-between; gap: .6rem;
                  align-items: baseline; padding: .7rem .8rem; font-size: 1rem;
                  background: var(--color-panel);
                  border-bottom: 1px solid var(--color-hairline); }
ul.phonelist { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
ul.phonelist li:last-child { border-bottom: 0; }
ul.phonelist li .dim { font-size: .8rem; white-space: nowrap; }
.phonefoot { margin-top: 2rem; padding-top: 1rem;
             border-top: 1px solid var(--color-hairline); }
.phonefoot p { font-size: .875rem; color: var(--color-muted); margin: 0 0 .5rem; }
.phonefoot form { margin-top: 1rem; }

/* --- WebCrawl search results ------------------------------------------------ */
ul.rlist { list-style: none; margin: .9rem 0 0; padding: 0; }
.rrow {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
  padding: .75rem .85rem; margin-bottom: .6rem;
}
.rrow input[type=checkbox] { margin-top: 4px; width: 16px; height: 16px; }
.rmeta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rmeta b { font-size: .95rem; }
/* Addresses and "open" links stay in the link voice - underlined, never
   colour alone - just smaller, because a URL is provenance rather than prose. */
.rurl { color: var(--color-link); font-size: .8rem; word-break: break-all; }
.rsnip { color: var(--color-muted); font-size: .875rem; }

/* captured page text */
pre.pagetext {
  background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 1rem; white-space: pre-wrap; word-break: break-word;
  font-size: .82rem; line-height: 1.6; max-height: 70vh; overflow-y: auto;
}

/* comment list */
ul.notes { list-style: none; margin: .8rem 0 0; padding: 0; }
ul.notes li { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
              padding: .55rem .8rem; margin-bottom: .45rem; font-size: .9rem; }
ul.notes li .dim { margin-right: .55rem; font-size: .8rem; }

/* --- watch configuration ---------------------------------------------------- */
/* One block per selected result, grouped fields inside, so a five-site batch
   does not turn into a wall of labels. */
.cfgblock { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
            padding: .9rem 1rem; margin-bottom: .75rem; }
.cfgblock h3 { margin: 0 0 .2rem; }
.cfgblock .curl { color: var(--color-muted); font-size: .8rem;
                  word-break: break-all; margin: 0 0 .7rem; }
.cfgblock .cfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
                     gap: .75rem; }

/* --- result states ---------------------------------------------------------- */
/* One chip shape, four meanings, and only the reason the watch exists gets to
   shout: a keyword hit fills with the accent, everything else keeps a quiet
   border. "changed" is notable-but-calm (page ink), "failed" is attention
   (warn) - the accent would promote a network hiccup to an alarm. */
.pill {
  display: inline-flex; align-items: center;
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  border-radius: var(--radius-pill); background: var(--color-panel-2);
  padding: .08rem .6rem; font-size: .7rem; font-weight: 600; line-height: 1.5;
  letter-spacing: .04em; white-space: nowrap;
}
.pill.quiet   { color: var(--color-muted); border-color: var(--color-border); background: transparent; }
.pill.changed { color: var(--color-text); border-color: var(--color-edge); }
.pill.hit     { background: var(--color-accent); color: var(--color-accent-contrast);
                border-color: var(--color-accent); }
.pill.failed  { color: var(--color-warn); border-color: var(--color-warn); }
/* Keyword highlight in excerpts: a warn-tinted wash, not red - the pill already
   said "hit"; the mark's job is only to show WHERE. Full-strength page ink, not
   inherit: excerpts are muted, and muted-over-the-amber-wash slips under AA in
   dark - the very word being highlighted must be the most readable one. */
mark { background: color-mix(in srgb, var(--color-wait) 32%, transparent);
       color: var(--color-text); padding: 0 2px; border-radius: 2px; }

/* --- daily review ----------------------------------------------------------- */
.daygroup { margin-top: 1.5rem; }
.dayhead { font-size: .72rem; color: var(--color-muted); letter-spacing: .14em;
           margin: 0 0 .5rem; padding-bottom: .4rem;
           border-bottom: 1px solid var(--color-border); }
.resrow { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
          padding: .8rem .95rem; margin-bottom: .6rem; }
.resrow .rtop { display: flex; align-items: flex-start; justify-content: space-between;
                gap: .75rem; flex-wrap: wrap; }
.resrow .rtitle { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resrow .rtitle b { font-size: .95rem; }
.resrow .rside { display: flex; align-items: center; gap: .55rem; flex: none; }
.resrow .rexcerpt { margin: .55rem 0 0; font-size: .875rem;
                    color: var(--color-muted); line-height: 1.55; }
/* A failed fetch prints its error as the excerpt; without this the generic
   muted rule above out-cascades .hint.warn and the failure reads as calm. */
.resrow .rexcerpt.warn { color: var(--color-warn); }

/* --- watch management table ------------------------------------------------- */
.rowactions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.rowactions form { display: inline; margin: 0; }
/* Eight rows each with a filled "Run now" would be eight competing primaries;
   in the table every action drops to the small paper-button voice. The page keeps
   exactly one filled button: "Run all due". */
.rowactions button, .rowactions .btn {
  background: var(--color-panel); color: var(--color-btn-text); border-color: var(--color-border);
  box-shadow: none; padding: .28rem .7rem; font-size: .8rem;
}
.rowactions button:hover, .rowactions .btn:hover {
  background: var(--color-panel-2); border-color: var(--color-accent);
  color: var(--color-btn-text); filter: none;
}
.rowactions button.ghost, .rowactions .btn.ghost { color: var(--color-muted);
  background: transparent; }
.rowactions button.ghost:hover, .rowactions .btn.ghost:hover {
  background: transparent; color: var(--color-text); border-color: var(--color-edge);
}

/* --- dashboard -------------------------------------------------------------- */
/* A panel's heading is a small ruled label, as on the front page: the panel's
   content is the thing to read, the heading only says which panel this is. */
.cpanel { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 1px 2px var(--shadow-soft);
          padding: 1rem 1.15rem; margin-top: .9rem; }
.cpanel h2 { margin: 0 0 .5rem; padding-bottom: .35rem; border-bottom: 1px solid var(--color-border);
             font: 700 .75rem/1.3 var(--font-sans); letter-spacing: .09em; text-transform: uppercase;
             color: var(--color-muted); }
.cpanel h2 .count { text-transform: none; letter-spacing: .04em; }
.cpanel > summary { cursor: pointer; font-weight: 600; }
.cpanel .hint { margin-bottom: .6rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 680px) { .duo { grid-template-columns: 1fr; } }

/* The capture chart - server-rendered SVG, coloured by the same tokens as the
   page so dark mode needs no second copy. Bars are the warm chart ink; the
   accent is kept for the figures and actions around them. */
svg.cbars { width: 100%; height: auto; display: block; margin-top: .4rem; }
.cbars .axis { stroke: var(--color-border); stroke-width: 1; }
.cbars .bar { fill: var(--color-data); opacity: .85; rx: 3px; }
.cbars .bar:hover { opacity: 1; }
.cbars .nil { fill: var(--color-hairline); }
.cbars .glab { fill: var(--color-muted); font-size: 11px; }
.cbars .vlab { fill: var(--color-text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Label / bar / count rows - the bar compares, the printed number is the truth. */
.brow { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto;
        gap: .7rem; align-items: center; padding: .32rem 0; font-size: .875rem; }
.blab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btrack { background: var(--color-panel-2); height: 10px; overflow: hidden; border-radius: var(--radius-pill); }
.bfill { display: block; height: 100%; background: var(--color-data); opacity: .85; border-radius: var(--radius-pill); }
.brow:hover .bfill { opacity: 1; }
.bnum { font-variant-numeric: tabular-nums lining-nums; font-size: .82rem;
        font-weight: 700; color: var(--color-muted); min-width: 20px; text-align: right; }

/* --- signed-in chrome ------------------------------------------------------- */
/* Sign-out rides in the nav rather than the status strip: it is an action on
   this site, not an environment fact, and it has to be a POST (it revokes the
   session server-side) so it is a real form and a real button. Styled to read
   as a nav item, not as a call to action - nobody should be drawn to it. */
.site-nav .signout { display: inline; margin: 0; }
.site-nav .signout button {
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0 0 3px;
  color: var(--color-header-muted);
  font: inherit; font-size: .85rem; font-weight: 600; letter-spacing: .01em; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.site-nav .signout button:hover {
  background: none; color: var(--color-header-text); filter: none;
  border-bottom-color: var(--color-header-edge);
}

/* --- auth pages ------------------------------------------------------------- */
/* The QR keeps a white plate in BOTH themes: inverted, no camera reads it. */
.qrplate { text-align: center; margin: 1rem 0; }
.qrplate img { background: #FFFFFF; padding: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-xs); }
ul.plainlist { list-style: none; margin: .6rem 0 1rem; padding: 0;
               font-size: .875rem; color: var(--color-muted); }
ul.plainlist li { padding: .2rem 0; }
ul.plainlist code { font-family: ui-monospace, Consolas, monospace;
                    color: var(--color-text); }
ul.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; }
ul.codes li { background: var(--color-panel-2); border: 1px solid var(--color-hairline); border-radius: var(--radius-sm);
              padding: .4rem .6rem; text-align: center; }
@media (max-width: 480px) { ul.codes { grid-template-columns: 1fr; } }

/* --- /admin/apps grid (§4.3) ------------------------------------------------ */
/* The checkbox is the one place the accent colour is allowed to carry meaning
   here, and accent-color gives it that in both themes without a custom
   control that would lose the keyboard behaviour. */
table.grid th[scope="row"] { font-weight: 600; text-transform: none;
                             letter-spacing: 0; font-size: .875rem; }
table.grid th[scope="row"] .dim { display: block; font-size: .78rem; }
table.grid td { text-align: center; vertical-align: middle; }
table.grid input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--color-accent); cursor: pointer;
}
table.grid input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .45; }
table.grid tr.pending { opacity: .62; }
/* A row's own buttons are paper buttons with air between them: a filled button on
   every row would be a column of competing primaries. */
table.grid td form.inline { display: inline-flex; align-items: center; gap: .6rem; flex-wrap: wrap;
                            vertical-align: middle; }
table.grid td > button + form.inline { margin-left: .4rem; }
table.grid td button[type="submit"] { background: var(--color-panel); color: var(--color-btn-text);
                                      border-color: var(--color-border); box-shadow: none; }
table.grid td button[type="submit"]:hover { background: var(--color-panel-2); border-color: var(--color-accent);
                                            filter: none; }
table.grid td button.quiet { background: transparent; color: var(--color-muted); }
table.grid td button.quiet:hover { background: transparent; color: var(--color-text); border-color: var(--color-edge); }
table.grid td input:not([type]) { width: auto; max-width: 100%; padding: .35rem .55rem; font-size: .85rem;
                                  font-family: ui-monospace, Consolas, monospace; }
/* Invite: two fields and the action on one line, wrapping on a phone. */
form.invite { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin: 0 0 .9rem; }
form.invite label { flex: 1 1 14rem; }
table.grid .chip { margin-left: .4rem; }
/* Visually hidden but read aloud - the Save column's header has no visible
   text, and an unlabelled column header is a hole for a screen reader. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* --- admin tabs + /admin/domains (M6b) --------------------------------------- */
.admintabs { display: flex; gap: 1.4rem; margin: 0 0 .9rem;
             border-bottom: 1px solid var(--color-border); }
.admintabs a { padding: .4rem 0; font-size: .95rem; font-weight: 600;
               letter-spacing: .01em; text-decoration: none;
               color: var(--color-muted); border-bottom: 2px solid transparent;
               margin-bottom: -1px; }
.admintabs a:hover { color: var(--color-text); }
.admintabs a[aria-current="page"] { color: var(--color-text);
                                    border-bottom-color: var(--color-accent); }
h1 .count { vertical-align: middle; margin-left: .5rem; }
form.domadd { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
              margin: 0 0 .9rem; }
form.domadd input[type="text"] { width: auto; flex: 1 1 14rem; padding: .35rem .55rem;
                                 font-size: .875rem; }
form.domadd input[name="note"] { flex-basis: 18rem; }
table.domreg th, table.domreg td { padding: .35rem .7rem; vertical-align: middle; }
table.domreg th[scope="row"] { text-transform: none; letter-spacing: 0;
                               font-size: .875rem; font-weight: 600; }
table.domreg th[scope="row"] { cursor: help; }
table.domreg tr.pending th, table.domreg tr.pending code { color: var(--color-muted); }
table.domreg td.rowactions { justify-content: flex-end; flex-wrap: nowrap; }
table.domreg details summary { cursor: pointer; list-style: none; }
table.domreg details summary::-webkit-details-marker { display: none; }
.dinfo summary { font-size: .72rem; color: var(--color-muted); text-decoration: underline dotted; }
.dinfo[open] > div { font-size: .78rem; margin-top: .3rem; max-width: 38rem; }
.dinfo p { margin: 0 0 .2rem; }
.dinfo ul { margin: .2rem 0 0; padding-left: 1rem; color: var(--color-muted); }
details.confirm { display: inline-flex; gap: .4rem; align-items: center; }
details.confirm summary.btn { padding: .28rem .7rem; font-size: .8rem; }
details.confirm[open] summary.btn::after { content: " ✕"; }
details.history summary { cursor: pointer; font-size: .9rem; font-weight: 600; }
details.history[open] summary { margin-bottom: .5rem; }

/* --- pencil sketches on empty states ------------------------------------------ */
/* The front page's drone and boat sketches, reused sparingly where a page has
   nothing else to show: an empty review queue, the no-access page, under the
   sign-in page's two buttons. Same drawings as home_page.py, held here as masks so they take
   the theme's muted ink and need no markup. Always in space of their own -
   under or beside the text, never behind it - and never clickable. */
:root {
  --sk-drone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 104' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='30' cy='30' rx='27' ry='5'/%3E%3Cellipse cx='170' cy='30' rx='27' ry='5'/%3E%3Cellipse cx='64' cy='18' rx='20' ry='4'/%3E%3Cellipse cx='136' cy='18' rx='20' ry='4'/%3E%3Cpath d='M30 30v9M170 30v9M64 18v8M136 18v8M26 39h8M166 39h8'/%3E%3Cpath d='M78 56 30 39M122 56 170 39M88 50 64 26M112 50 136 26'/%3E%3Cpath d='M80 50h40a8 8 0 0 1 8 8v6a8 8 0 0 1-8 8H80a8 8 0 0 1-8-8v-6a8 8 0 0 1 8-8z'/%3E%3Cpath d='M86 58h28M84 72 76 92M116 72l8 20M62 92h30M108 92h30'/%3E%3Ccircle cx='100' cy='80' r='6'/%3E%3Ccircle cx='100' cy='80' r='2'/%3E%3C/svg%3E");
  --sk-boat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 264 92' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 48 250 40 228 66H34Q16 66 8 48z'/%3E%3Cpath d='M22 57h214'/%3E%3Cpath d='M92 45l8-15h50l12 13M106 36h38'/%3E%3Cpath d='M124 30V8M112 12h24M144 30l6-18M66 46a9 9 0 0 1 18 0M196 42v-8h10v8'/%3E%3Cpath d='M0 80q8-6 16 0t16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0 16 0'/%3E%3Cpath d='M30 88q8-5 16 0t16 0 16 0M150 88q8-5 16 0t16 0 16 0'/%3E%3C/svg%3E");
}
ul.clist > li.dim:only-child { padding: 1.1rem 1.2rem; border: 1px dashed var(--color-border);
                               border-radius: var(--radius); }
ul.clist > li.dim:only-child::after, .noaccess::after, .signin::after {
  content: ""; display: block; pointer-events: none;
  background: var(--color-muted); opacity: calc(var(--sketch-alpha) * 2);
  -webkit-mask: var(--sk-drone) center / contain no-repeat; mask: var(--sk-drone) center / contain no-repeat;
}
ul.clist > li.dim:only-child::after { width: 150px; height: 78px; margin: .9rem 0 .2rem; transform: rotate(-6deg); }
.noaccess::after { width: 230px; height: 80px; margin: 2.2rem 0 0;
                   -webkit-mask-image: var(--sk-boat); mask-image: var(--sk-boat); }
.signin::after { width: 170px; height: 88px; margin: 2.4rem 0 0 .4rem; transform: rotate(-6deg); }
/* The sign-in page's one invitation is the Microsoft button. */
.signin .btn:not(.quiet) { background: var(--color-accent); border-color: var(--color-accent);
                           color: var(--color-accent-contrast); margin-right: .4rem; }
.signin .btn:not(.quiet):hover { filter: brightness(1.1); }
@media print { ul.clist > li.dim:only-child::after, .noaccess::after, .signin::after { display: none; } }

/* --- Product Studio (SKU DI prototype) ----------------------------------------- */
.sd { display: grid; gap: 1.1rem; }
.sd-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.sd-head h1 { margin: .1rem 0 0; }
.sd-eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent); font-weight: 700; }
.sd-tabs { display: flex; gap: .2rem; flex-wrap: wrap; border-bottom: 1px solid var(--color-border); }
.sd-tabs a { padding: .55rem .85rem; color: var(--color-muted); text-decoration: none; font-weight: 600;
             border-bottom: 2px solid transparent; }
.sd-tabs a[aria-current] { color: var(--color-text); border-color: var(--color-accent); }
.sd-flash { margin: 0; padding: .6rem .9rem; border-radius: var(--radius-sm); background: var(--color-panel-2);
            border-left: 3px solid var(--color-ok); }
.sd-panel { background: var(--color-panel); border: 1px solid var(--color-border); border-radius: var(--radius);
            padding: 1rem 1.2rem; }
.sd-panel h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.sd-panel h2 + h2, .sd-panel .table-wrap + p + h2 { margin-top: 1.2rem; }
.sd-err { border-left: 3px solid var(--color-danger); }
.sd-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1.1rem; align-items: start; }
.sd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.sd-kpi { display: block; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--color-border);
          background: var(--color-panel); text-decoration: none; color: inherit; }
.sd-kpi b { display: block; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sd-kpi span { color: var(--color-muted); font-size: .85rem; }
.sd-kpi.sd-new b { color: var(--color-ok); } .sd-kpi.sd-chg b { color: var(--color-wait); }
.sd-kpi.sd-prob b { color: var(--color-danger); }
.sd-bar { display: grid; grid-template-columns: 9rem 1fr 4rem; gap: .6rem; align-items: center; margin: .35rem 0; font-size: .9rem; }
.sd-bar i { display: block; height: .55rem; border-radius: 99px; background: var(--color-panel-2); position: relative; overflow: hidden; }
.sd-bar i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--color-accent); border-radius: 99px; }
.sd-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.sd-dl { display: grid; grid-template-columns: 10rem 1fr; gap: .35rem .8rem; margin: 0 0 .8rem; }
.sd-dl dt { color: var(--color-muted); } .sd-dl dd { margin: 0; }
.sd-ok { color: var(--color-ok); font-weight: 600; } .sd-warn { color: var(--color-warn); }
.sd-log { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; font-size: .9rem; }
.sd-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sd-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sd-table th, .sd-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--color-hairline); text-align: left; vertical-align: top; }
.sd-table thead th { color: var(--color-muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
.sd-table tr.sd-group th { background: var(--color-panel-2); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.sd-ready td.sd-yes { color: var(--color-ok); text-align: center; font-weight: 700; }
.sd-ready td.sd-no { color: var(--color-danger); text-align: center; font-weight: 700; }
.sd-chip { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--color-border);
           color: var(--color-muted); white-space: nowrap; margin: 0 .2rem .2rem 0; }
.sd-chip.sd-public { color: var(--color-ok); border-color: var(--color-ok); }
.sd-chip.sd-request_access { color: var(--color-wait); border-color: var(--color-wait); }
.sd-chip.sd-internal { color: var(--color-muted); }
.sd-chip.sd-miss { color: var(--color-danger); border-color: color-mix(in srgb, var(--color-danger) 50%, transparent); }
.sd-chip.sd-ai { color: #7c5cd6; border-color: #7c5cd6; }
.sd-form { display: grid; gap: .7rem; }
.sd-form label { display: grid; gap: .25rem; font-weight: 600; font-size: .9rem; }
.sd-form label .dim { font-weight: 400; }
.sd-form input:not([type=checkbox]), .sd-form select, .sd-form textarea { width: 100%; }
.sd-form .sd-check { display: flex; flex-direction: row; align-items: center; align-self: end; gap: .45rem;
  font-weight: 500; text-transform: none; letter-spacing: 0; padding-bottom: .6rem; }
.sd-form .sd-check input { width: auto; margin: 0; }
.sd-table td.mono { white-space: nowrap; }
.sd-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; align-items: end; }
.sd-inline { display: inline-flex; gap: .4rem; align-items: end; flex-wrap: wrap; margin: .2rem 0; }
.sd-form.sd-inline label { display: grid; }
.sd-crumb { margin: 0; color: var(--color-muted); }
.sd-danger { color: var(--color-danger); }
.sd-mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.sd-media { margin: 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; background: var(--color-field); }
.sd-media img, .sd-media video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #111; }
.sd-mph { aspect-ratio: 16 / 10; display: grid; place-items: center; font-weight: 700; color: var(--color-muted); background: var(--color-panel-2); }
.sd-media figcaption { padding: .55rem .65rem; display: grid; gap: .3rem; font-size: .85rem; }
.sd-media select { font-size: .8rem; }
.sd-lines { margin: 0; padding-left: 1rem; }

/* Studio live view */
.sd-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.sd-live-bar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: .7rem; }
.sd-live-dev .btn[aria-pressed="true"] { border-color: var(--color-accent); }
.sd-live-stage { display: flex; justify-content: center; background: var(--color-panel-2); border-radius: var(--radius-sm);
                 padding: .5rem; }
.sd-live iframe { width: 100%; height: 75vh; min-height: 480px; border: 0; background: #fff; border-radius: var(--radius-sm); }
.sd-live[data-device="phone"] iframe { width: 390px; max-width: 100%; }
.sd-live.sd-flash-on .sd-live-stage { outline: 3px solid var(--color-ok); }
#sd-live-status.flash { color: var(--color-ok); font-weight: 700; }
.sd-live-hint { margin: 0; }
