/* Ledger (Halo). Mobile first; one column under 900px, two above. System fonts for reading,
   Space Grotesk for titles and Space Mono for codes (Halo design system). Tap targets are 44px.
   Colours are tokens. DARK IS THE DEFAULT: <html> always carries data-theme="dark" or "light"
   (web.render + the settings menu). Never use the OS colour-scheme media query: write light-only
   rules under [data-theme="light"] and dark-only ones under [data-theme="dark"]. The palettes are
   the design system's Graphite neutrals with the Dusk blue accent (dark; owner's choice 2026-11-01:
   "dark grey/black tones, keep the blue accent") and Daylight (light). */
@font-face { font-family: "Space Grotesk"; src: url("/static/fonts/SpaceGrotesk-Variable.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("/static/fonts/SpaceMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d10; --card: #17171c; --ink: #ececf0; --muted: #a8a8b0; --line: #2e2e35; --chip: #27272d;
  --accent: #84b6d8; --accent-ink: #0b1620; --ok: #6fd69a; --warn: #f2b25c; --err: #f6877f;
  --signal: #e3823d; --radius: 10px; --shadow: none;
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f4f6; --card: #ffffff; --ink: #102244; --muted: #465c82; --line: #d5dee6; --chip: #e5ebf0;
  --accent: #12658f; --accent-ink: #ffffff; --ok: #15803d; --warn: #b45309; --err: #b91c1c;
  --signal: #b85a1e; --shadow: 0 1px 2px rgba(16, 34, 68, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; padding-bottom: 64px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font: 500 1.55rem/1.2 var(--font-display); margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font: 500 1.1rem/1.3 var(--font-display); margin: 1.25rem 0 .5rem; color: var(--ink); }
h1 small, h2 .muted { font-weight: 400; font-size: .8em; }
p { margin: .4rem 0; } .lead { font-size: 1.05rem; margin: 0 0 .3rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.mono, code { font-family: var(--font-mono); font-size: .9em; }
code.block { display: block; padding: .6rem; background: var(--chip); border-radius: 6px; word-break: break-all; }
.ok { color: var(--ok); } .warnbox { background: #fff7ed; color: #7c2d12; padding: .6rem .8rem; border-radius: 8px; }
[data-theme="dark"] .warnbox { background: #3a2c17; color: #fcd29a; }

/* header: [menu] [logo Ledger] [search ............] [settings] */
header.top { display: flex; align-items: center; gap: .5rem .8rem; padding: .5rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; min-height: 40px; gap: .55rem; color: var(--ink); font: 500 1.25rem/1 var(--font-display); letter-spacing: .01em; flex: none; }
.brand:hover { text-decoration: none; } .brand img { height: 32px; width: auto; display: block; }
/* Halo logo: the white outline lockup on dark, the Dusk gradient square on light (BRAND.md "Logo") */
html[data-theme="dark"] img.logo-light, html[data-theme="light"] img.logo-dark { display: none; }
.topsearch { display: flex; flex: 1 1 260px; gap: .4rem; min-width: 0; max-width: 620px; } .topsearch input { flex: 1; min-width: 0; }
nav.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabbar a { flex: 1; text-align: center; padding: .7rem 0; font-size: .85rem; color: var(--ink); }
/* the current tab is marked (accent + bar); Scan is a button shape, not a colour, so it never reads as "current" */
nav.tabbar a.on { color: var(--accent); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
nav.tabbar a.scan { flex: 0 0 auto; align-self: center; margin: .3rem .4rem; padding: .5rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--chip); font-weight: 600; }
nav.tabbar a.scan.on { border-color: var(--accent); box-shadow: none; }
@media (min-width: 900px) { nav.tabbar { display: none; } body { padding-bottom: 2rem; } }

/* layout */
main { padding: 1rem; max-width: 1280px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; min-width: 0; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.row { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
@media (min-width: 900px) { .row { grid-template-columns: 3fr 2fr; } }
.titlerow { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.grid.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; color: var(--ink); display: flex; flex-direction: column; }
.tile b { font-size: 1.7rem; line-height: 1.1; } .tile span { color: var(--muted); font-size: .85rem; } .tile.warn b { color: var(--warn); }
.tile:hover { text-decoration: none; border-color: var(--accent); }
.qr { width: 72px; height: 72px; background: #fff; border-radius: 6px; padding: 2px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .6rem 0; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* tables */
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
td, th { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; letter-spacing: .02em; }
table.events td { font-size: .88rem; }
table.tree tr.me td { background: var(--chip); } table.tree tr.empty td { color: var(--muted); }
@media (max-width: 600px) { table.list th:nth-child(n+4), table.list td:nth-child(n+4) { display: none; } table.events td:nth-child(2) { display: none; } }

/* forms */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); min-height: 44px; }
textarea { min-height: 0; }
label { display: block; margin: .5rem 0; font-size: .92rem; } label > input, label > select, label > textarea { margin-top: .2rem; }
label.check { display: flex; align-items: center; gap: .5rem; } label.check input { width: 1.2rem; height: 1.2rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; } .two > * { min-width: 0; } @media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
form.inline { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .4rem 0; } form.inline input, form.inline select { width: auto; flex: 1 1 140px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.small { min-height: 34px; padding: .25rem .6rem; } .btn.tiny { min-height: 26px; padding: 0 .5rem; font-size: .8rem; }
.btn.chip { min-height: 38px; padding: .3rem .8rem; border-radius: 999px; }
.btnrow { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; } .chips a { color: var(--ink); }
.people { display: flex; flex-wrap: wrap; gap: .4rem; }
details.box { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
details.box summary { cursor: pointer; font-weight: 600; padding: .3rem 0; } details.box[open] summary { margin-bottom: .4rem; }
.actions { margin: .5rem 0 1rem; }
.box { border: 1px solid var(--line); border-radius: 8px; padding: .8rem; margin: .5rem 0; }
ul.plain { list-style: none; padding: 0; margin: .3rem 0; } ul.plain li { padding: .25rem 0; border-bottom: 1px solid var(--line); }

/* badges */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; background: var(--chip); color: var(--ink); white-space: nowrap; }
.st-received { background: #e0f2fe; color: #075985; } .st-inspected { background: #ede9fe; color: #5b21b6; } .st-accepted { background: #dcfce7; color: #166534; }
.st-hold { background: #fef3c7; color: #92400e; } .st-in_build { background: #fae8ff; color: #86198f; }
.st-scrapped, .st-retired { background: #fee2e2; color: #991b1b; }
.inin a { color: inherit; } td .inin { display: block; margin-top: .15rem; }   /* "In <parent> · slot" beside the condition badge: quiet, not a second badge; stacked under it in a table cell */
.ps-released { background: #dcfce7; color: #166534; } .ps-in_progress { background: #fef3c7; color: #92400e; } .ps-obsolete { background: #fee2e2; color: #991b1b; }
.bs-planned { background: #e0f2fe; color: #075985; } .bs-in_progress { background: #fae8ff; color: #86198f; } .bs-complete { background: #dcfce7; color: #166534; } .bs-cancelled { background: #fee2e2; color: #991b1b; }
.sev-major, .ncr-open { background: #fee2e2; color: #991b1b; } .sev-minor { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .badge { filter: saturate(.85) brightness(.95); }
.kind { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.bar { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; min-width: 80px; } .bar i { display: block; height: 100%; background: var(--accent); }

/* flash */
.flash { position: sticky; top: 56px; z-index: 4; margin: .5rem 1rem 0; padding: .6rem .9rem; border-radius: 8px; background: #dcfce7; color: #166534; transition: opacity .6s; }
.flash.err { background: #fee2e2; color: #991b1b; } .flash.fade { opacity: 0; }

/* scan page */
.viewport { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4/3; }
.cam { width: 100%; height: 100%; object-fit: cover; display: block; } .cam.scan-hit { outline: 6px solid #22c55e; outline-offset: -6px; }
.camhint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #ddd; font-size: .95rem; text-align: center; padding: 1rem; }
h1.serial { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0; word-break: break-all; }


/* scan session */
/* Phone: a short camera strip pinned at the top, the list gets the rest of the screen.
   Desktop: camera left, list right. */
.scanpage { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.scancam { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: .25rem 0 .1rem; margin-top: -.25rem; }
.scancam .viewport { aspect-ratio: auto; height: 26vh; min-height: 140px; max-height: 220px; }
.camtoggle { position: absolute; right: .5rem; bottom: .5rem; z-index: 1; } .camtoggle:not(.primary) { opacity: .85; }
@media (max-width: 899px) { .scanpage-body header.top { position: static; } .scanpage-body .topsearch { display: none; } }
@media (min-width: 900px) { .scanpage { grid-template-columns: 1fr 1fr; align-items: start; } .scancam { top: 4rem; }
  .scancam .viewport { height: auto; aspect-ratio: 4/3; max-height: none; } }
.scanhead { display: flex; align-items: center; gap: .75rem; } .scanhead h1 { flex: 1; font-size: 1.25rem; margin: 0; }
.wedgerow { display: flex; gap: .4rem; margin-top: .5rem; } .wedgerow input { flex: 1; min-width: 0; font-size: 1.05rem; }
ul.scanlist { list-style: none; padding: 0; margin: .4rem 0 0; } ul.scanlist li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
ul.scanlist li.k-none b { color: var(--warn); } ul.scanlist .btnrow { margin: 0; flex-wrap: nowrap; }
ul.scanlist li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
ul.scanlist li.again { animation: scanagain 1.2s ease-out; }
@keyframes scanagain { from { background: #fde68a; } to { background: transparent; } }
.batch .batchrow { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin: .4rem 0; align-items: center; }

.warnt { color: var(--err); font-weight: 600; }

/* weigh */
.massrow { display: flex; gap: .8rem; align-items: flex-end; } .massrow label { flex: 1; } .massrow input { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.dev { min-width: 9em; padding-bottom: .9rem; font-weight: 600; } .dev.ok { color: var(--ok); } .dev.bad { color: var(--err); }
.box.target { background: var(--chip); }

/* attachments */
.gallery { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0; }
figure.file { margin: 0; width: 150px; } figure.file img { width: 150px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.fileicon { display: flex; align-items: center; justify-content: center; width: 150px; height: 110px; border-radius: 8px; border: 1px solid var(--line); background: var(--chip); font-weight: 700; color: var(--muted); }
figure.file figcaption { font-size: .8rem; overflow-wrap: anywhere; margin-top: .2rem; }
form.attachform { display: grid; grid-template-columns: 1fr; gap: .4rem; margin: .4rem 0; } @media (min-width: 700px) { form.attachform { grid-template-columns: 2fr 1fr 1fr auto; align-items: center; } }
form.attachform input[type=file] { padding: .4rem; }
details.stepfiles { margin: .2rem 0; } details.stepfiles summary { cursor: pointer; }

/* measurement template form */
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; } @media (max-width: 480px) { .mgrid { grid-template-columns: 1fr; } }
.mfield { margin: .2rem 0; } .mfield span.small { display: block; }

/* reports, trace, certificate (N10, N11) */
.btn.small { font-size: .82rem; padding: .25rem .6rem; }
.bar { background: var(--chip); border-radius: 4px; height: .6rem; overflow: hidden; min-width: 80px; } .bar i { display: block; height: 100%; background: var(--accent); }
.badge.dev-empty_slot, .badge.dev-not_on_bom, .badge.dev-revision { background: #fde9c9; } .badge.dev-mass, .badge.dev-measurement, .badge.dev-hold { background: #f8d2d2; }
.badge.age-2 { background: #f8d2d2; } .badge.age-1 { background: #fde9c9; }
table.devs td { vertical-align: top; }
.cert h1 { margin-bottom: 0; } .cert .stamp { color: var(--muted); font-size: .85rem; } .cert table { width: 100%; } .cert h2 { margin-top: 1.2rem; border-bottom: 1px solid var(--line); padding-bottom: .2rem; }
.cert dl.facts { grid-template-columns: max-content 1fr max-content 1fr; }
@media print {
  header, nav.tabbar, .ribbon, .noprint, #flash { display: none !important; }
  body { background: #fff; } main { max-width: none; padding: 0; } .card { box-shadow: none; border: 0; padding: 0; page-break-inside: avoid; }
  .cert dl.facts { grid-template-columns: max-content 1fr; } a { color: inherit; text-decoration: none; }
  table.list td, table.events td { font-size: .8rem; } .cert h2 { page-break-after: avoid; }
}

/* settings menu (header): theme, admin pages, sign out */
/* drop-down menus in the header (the main menu on the left, settings on the right) */
.dropmenu { position: relative; flex: none; }
.dropmenu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .3rem .6rem; border-radius: 8px; color: var(--muted); white-space: nowrap; }
.dropmenu > summary::-webkit-details-marker { display: none; }
.dropmenu > summary:hover, .dropmenu[open] > summary { background: var(--chip); color: var(--ink); }
.dropmenu .menu { position: absolute; top: calc(100% + 6px); z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .5rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.dropmenu .menu a, .dropmenu .menu button.link { display: flex; align-items: center; min-height: 40px; padding: .3rem .6rem; border-radius: 6px; color: var(--ink); width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.dropmenu .menu a:hover, .dropmenu .menu button.link:hover { background: var(--chip); text-decoration: none; }
.dropmenu .menu a.on { background: var(--chip); color: var(--accent); font-weight: 600; }
.dropmenu .menu hr { border: 0; border-top: 1px solid var(--line); margin: .4rem 0; }
.usermenu { margin-left: auto; } .usermenu .menu { right: 0; min-width: 240px; }
.usermenu .menu .who { padding: .3rem .6rem .5rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; } .usermenu .menu .who b { display: block; }
.navmenu .menu { left: 0; width: min(640px, calc(100vw - 2rem)); }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px; position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; } .burger::before { top: -6px; } .burger::after { top: 6px; }
.navmenu .home { font-weight: 600; margin-bottom: .2rem; }
/* ribbon under the header: the main menu, then the pages of the current section */
.ribbon { display: flex; align-items: center; gap: .4rem; padding: .2rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); min-width: 0; }
.ribbon .navmenu > summary { color: var(--ink); }
.sublinks { display: flex; align-items: center; gap: .15rem; overflow-x: auto; scrollbar-width: none; min-width: 0; border-left: 1px solid var(--line); padding-left: .5rem; }
.sublinks::-webkit-scrollbar { display: none; }
.sublinks .menulabel { padding: 0 .5rem 0 .2rem; flex: none; }
.sublinks a { flex: none; padding: .45rem .7rem; color: var(--muted); white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
.sublinks a:hover { color: var(--ink); text-decoration: none; }
.sublinks a.on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 640px) { .ribbon .navmenu .label { display: none; } .sublinks .menulabel { display: none; } }
.navgroups { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem .6rem; }
.navgroup { padding: .2rem 0 .4rem; }
@media (max-width: 640px) { .navgroups { grid-template-columns: 1fr 1fr; } }
.themepick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--chip); border-radius: 8px; padding: 2px; margin: .2rem .3rem .4rem; }
.themepick button { min-height: 36px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: .88rem; }
.themepick button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; }
.menulabel { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: .2rem .6rem 0; }
@media (max-width: 899px) { .topsearch { order: 5; flex-basis: 100%; } header.top { flex-wrap: wrap; } }

/* sign-in */
.signin { text-align: center; padding-top: 1.5rem; } .signin img.mark { width: 96px; height: auto; margin: 0 auto .8rem; display: block; }
.signin h1 { font-size: 2rem; } .signin form, .signin .people { text-align: left; } .signin .people { justify-content: center; }

/* example data: a quiet badge, and the admin switch in the settings menu */
.badge.exbadge { background: transparent; border: 1px dashed var(--muted); color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.menurow { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: .3rem .6rem; }
.switch { position: relative; width: 40px; height: 24px; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; padding: 0; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--accent); } .switch[aria-checked="true"] i { left: 19px; background: var(--accent-ink); }

/* info bubbles (templates/_info.html): a small "i"; the panel holds the help, diagrams and examples */
details.info { display: inline-block; position: relative; vertical-align: middle; }
details.info > summary { list-style: none; cursor: pointer; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font: italic 700 .78rem/1 Georgia, serif; user-select: none; }
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary:hover, details.info[open] > summary { border-color: var(--accent); color: var(--accent); }
.info-panel { position: absolute; z-index: 30; top: calc(100% + 8px); left: -10px; width: min(340px, calc(100vw - 2rem)); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: .75rem .85rem; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); font-size: .9rem; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--ink); text-align: left; white-space: normal; }
details.info.wide .info-panel { width: min(480px, calc(100vw - 2rem)); }
.info-panel p { margin: .3rem 0; } .info-panel ul, .info-panel ol { margin: .3rem 0; padding-left: 1.2rem; }
.info-title { font: 500 .98rem/1.3 var(--font-display); margin-bottom: .35rem; }
.info-ex { display: flex; gap: .5rem; align-items: baseline; padding: .3rem .5rem; border-radius: 6px; margin: .3rem 0; font-family: var(--font-mono); font-size: .82rem; }
.info-ex.good { background: color-mix(in srgb, var(--ok) 16%, transparent); } .info-ex.good b { color: var(--ok); }
.info-ex.bad { background: color-mix(in srgb, var(--err) 14%, transparent); } .info-ex.bad b { color: var(--err); }
@media (max-width: 640px) {
  .info-panel { position: fixed; left: .5rem; right: .5rem; bottom: calc(64px + env(safe-area-inset-bottom)); top: auto; width: auto; max-height: 60vh; overflow-y: auto; }
  details.info.wide .info-panel { width: auto; }
}
/* demos */
.info-demo { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; margin: .45rem 0; font-size: .86rem; }
.dm-row { display: flex; gap: .6rem; align-items: center; margin: .2rem 0; flex-wrap: wrap; } .dm-k { width: 6.5rem; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.dm-box { display: inline-flex; gap: .25rem; align-items: baseline; border-bottom: 1.5px solid var(--accent); padding: 0 .3rem; min-width: 4.5rem; }
.dm-box i { font-style: normal; color: var(--muted); font-size: .85em; }
.dm-type { display: inline-block; overflow: hidden; white-space: nowrap; width: 0; animation: dm-type 3.2s steps(4, end) infinite; font-weight: 600; }
@keyframes dm-type { 0%, 20% { width: 0; } 55%, 90% { width: 2.4em; } 100% { width: 0; } }
.dm-list { margin: 0; padding-left: 1.3rem; } .dm-list li { margin: .2rem 0; }
.dm-tick { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; margin-right: .4rem; border: 1.5px solid var(--muted); border-radius: 4px;
  color: transparent; font-size: .75rem; animation: dm-tick 4s infinite; animation-delay: calc(var(--d) * .7s); }
@keyframes dm-tick { 0%, 15% { background: transparent; color: transparent; border-color: var(--muted); } 25%, 85% { background: var(--ok); color: var(--accent-ink); border-color: var(--ok); } 100% { background: transparent; color: transparent; } }
.dm-label { position: relative; display: flex; align-items: center; gap: .6rem; width: fit-content; padding: .4rem .6rem; background: #fff; color: #111; border-radius: 4px; overflow: hidden; font-family: var(--font-mono); font-size: .78rem; }
.dm-qr { width: 28px; height: 28px; background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0 0 / 7px 7px; }
.dm-beam { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; box-shadow: 0 0 6px #ef4444; animation: dm-beam 1.6s ease-in-out infinite alternate; }
@keyframes dm-beam { from { top: 10%; } to { top: 88%; } }
@media (prefers-reduced-motion: reduce) { .dm-type { animation: none; width: auto; } .dm-tick, .dm-beam { animation: none; } .dm-tick { background: var(--ok); color: var(--accent-ink); } }

/* phone + laptop: the "join laptop session" prompt (theme.js) */
.joinbar { display: flex; align-items: center; gap: .5rem; padding: .45rem 1rem; background: color-mix(in srgb, var(--accent) 16%, var(--card)); border-bottom: 1px solid var(--line); font-size: .9rem; }
.joinbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu .joinlink { font-weight: 600; }

/* from the older-pages pass */
table.list td { overflow-wrap: anywhere; }
@media (max-width: 600px) { .cert dl.facts { grid-template-columns: max-content 1fr; } .massrow .dev { min-width: 0; } }
[data-theme="dark"] .badge.age-2, [data-theme="dark"] .badge.dev-mass, [data-theme="dark"] .badge.dev-measurement, [data-theme="dark"] .badge.dev-hold { background: #4a2328; color: #f6c3c3; }
[data-theme="dark"] .badge.age-1, [data-theme="dark"] .badge.dev-empty_slot, [data-theme="dark"] .badge.dev-not_on_bom, [data-theme="dark"] .badge.dev-revision { background: #4a3a1c; color: #fbdca0; }

/* roles (templates/_roles.html): the line shown where a control is missing for lack of a role */
.needrole { display: inline-block; }

/* Phone: hit areas of at least 40px for the small controls, without changing desktop density (UI-010).
   The info bubble keeps its 22px circle; the summary around it is the 40px target. */
@media (max-width: 899px) {
  .btn.small, .btn.tiny, .btn.chip, .themepick button { min-height: 40px; }
  summary.muted { padding-top: .7rem; padding-bottom: .7rem; }
  details.box > summary, details.stepfiles > summary { padding-top: .55rem; padding-bottom: .55rem; }
  .switch { box-sizing: content-box; border: 8px solid transparent; background-clip: padding-box; margin: -8px 0; }
  nav.tabbar a.scan { padding-top: .65rem; padding-bottom: .65rem; }
  details.info > summary { width: 40px; height: 40px; border: 0; margin: -9px; position: relative; }
  details.info > summary::before { content: ""; position: absolute; inset: 9px; border: 1.5px solid currentColor; border-radius: 50%; }
}
/* Home on a phone: two tiles (open work orders, NCRs), the work comes next */
@media (max-width: 640px) { .tile.more { display: none; } }
