:root {
  --surface-page: #f3f5f8;
  --surface-card: #ffffff;
  --surface-sunk: #e9edf2;
  --ink: #111827;
  --ink-muted: #4b5563;
  --line: #d1d7e0;
  --line-strong: #6b7280;
  --primary: #0b6e4f;
  --primary-hover: #08563d;
  --primary-soft: #dcf2e8;
  --on-primary: #ffffff;
  --location: #1d4ed8;
  --location-soft: #dbe6fd;
  --container: #6d28d9;
  --container-soft: #ebe2fc;
  --group: #b4400a;
  --group-soft: #fde5d4;
  --item: #0e7490;
  --item-soft: #d5f0f6;
  --flag: #facc15;
  --flag-soft: #fef9c3;
  --problem: #b91c1c;
  --problem-soft: #fde2e2;
  --waiting: #b45309;
  --waiting-soft: #fdecd3;
  --waiting-ink: #7a3606;
  --tap: 52px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-card: 0 1px 2px rgba(17,24,39,.06), 0 1px 3px rgba(17,24,39,.08);
  --shadow-float: 0 8px 24px rgba(17,24,39,.16);
  --bg: var(--surface-page);
  --panel: var(--surface-card);
  --muted: var(--ink-muted);
  --side: #ffffff;
  --side-ink: var(--ink);
  --side-muted: var(--ink-muted);
  --accent: var(--primary);
  --accent-ink: #fff;
  --accent-soft: var(--primary-soft);
  --danger: var(--problem);
  --warn: var(--waiting);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 16px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
h1 { margin: 0 0 4px; } h2 { margin: 0 0 10px; } h3 { margin: 16px 0 8px; }
.mono { font-family: var(--mono); }

/* layout */
.shell { display: grid; height: 100vh; }
.side { overflow-y: auto; display: flex; flex-direction: column; }
.side .brand { font-weight: 700; letter-spacing: .2px; }
.side .sect { text-transform: uppercase; letter-spacing: .08em; }
.side a { text-decoration: none; display: flex; align-items: center; }
.side .spacer { flex: 1; }
.side .who { padding: 10px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.side .who b { display: block; font-weight: 600; }
.main { overflow-y: auto; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

.card { background: var(--panel); }

/* controls */
.btn { font: inherit; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; background: #fff; color: var(--ink); width: 100%; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
label { display: block; }
label > input, label > select, label > textarea { color: var(--ink); }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.form .wide { grid-column: 1 / -1; }
.form .help { margin-top: 2px; }
.req::after { content: " *"; color: var(--danger); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--ink); font-size: 13px; }
.checks label { display: flex; gap: 5px; align-items: center; color: var(--ink); font-size: 13px; }

/* tables */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; }
tbody tr.click { cursor: pointer; }.tablewrap { overflow-x: auto; background: #fff; }
.tablewrap table td, .tablewrap table th { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }

/* bits */
.tag { display: inline-block; margin: 1px 2px 1px 0; }
.flagdot { display: inline-block; background: var(--warn); color: #fff; text-align: center; }
.flag { border-left: 4px solid var(--warn); padding: 8px 10px; background: #fffaf3; border-radius: 4px; margin-bottom: 8px; }
.flag.resolved { opacity: .6; background: #f7f7f5; }
.kv { display: grid; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { border-color: var(--accent); }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.err { color: var(--danger); }
.ref-picker { position: relative; }
.ref-results { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.08); max-height: 240px; overflow-y: auto; }
.ref-results div { padding: 6px 9px; cursor: pointer; } .ref-results div:hover { background: var(--accent-soft); }
.chips { margin-top: 4px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 2px 4px 2px 9px; font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; }
pre.sql { background: #f3f4f1; padding: 8px; border-radius: 6px; font: 12px var(--mono); white-space: pre-wrap; margin: 0; }
.permgrid td { text-align: center; } .permgrid td:first-child { text-align: left; }
dialog { padding: 0; width: min(560px, 94vw); }
dialog .dhead { border-bottom: 1px solid var(--line); }
dialog .dfoot { border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* login + toasts */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(340px, 100%); display: grid; gap: 12px; }
#toasts { position: fixed; display: grid; gap: 8px; z-index: 99; }
.toast { color: #fff; max-width: 420px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.err { background: var(--danger); }

/* movement app */
.move { margin: 0 auto; }
.move header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.move .step { background: #fff; }
.move .step h2 { display: flex; gap: 8px; align-items: center; }
.move .step h2 .n {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
}
.move .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.move .item:last-child { border-bottom: 0; }
.move .dest { font-weight: 600; }
.move .big { padding: 14px; }
.move video { width: 100%; border-radius: 8px; margin-top: 8px; background: #000; }
.move .blocked { color: var(--danger); }
[hidden] { display: none !important; }
.tablewrap.wrap td { white-space: normal; }
.chk { display: flex !important; gap: 8px; color: var(--ink) !important; }
.chk input { flex: none; }
.split { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.pagehead select, .pagehead .row > input { width: auto; }
.lrow { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-top: 6px; background: #fbfbf9; }
.lhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 600; }
.form.lattrs { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; }
.form.lattrs textarea { min-height: 40px; }
div.fld { display: block; }
div.fld > .ref-picker, div.fld > .links, div.fld > .checks { margin-top: 3px; font-size: 14px; color: var(--ink); }
.move { padding-bottom: max(80px, env(safe-area-inset-bottom)); }
.syncbar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; background: #fff; border: 1px solid var(--line); }
.syncbar .dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; }
.syncbar.off { background: #fff7ed; border-color: #fed7aa; } .syncbar.off .dot { background: #ea580c; }
.syncbar .btn { margin-left: auto; }
.step.attention { border-color: #fecaca; background: #fff8f7; }
/* CMS on phones and small tablets */
.mtop, .scrim { display: none; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mtop {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 30;
}
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .shell.navopen .side { transform: none; }
  .shell.navopen .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35; }
  .pagehead { align-items: stretch; }
  .pagehead .row { width: 100%; }
  .pagehead .row > input, .pagehead select { flex: 1; width: auto; }
  .split { grid-template-columns: 1fr; }
  .form { grid-template-columns: 1fr; }
  dialog { width: 96vw; }
}
/* photos */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumbs figure { margin: 0; width: 120px; } .thumbs figure img { width: 120px; height: 100px; }
.thumbs figcaption { font-size: 11px; margin-top: 3px; line-height: 1.3; }
/* filters, chips */
.card.filters { margin-bottom: 10px; }
.chip button { font-weight: 700; }
input.calc { background: #f3f4f1; color: var(--ink); font-weight: 600; }
.card.gaps { border-color: #fed7aa; background: #fffaf3; } .card.gaps h3 { margin-top: 8px; }
/* dashboard */
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-width: 130px; background: #fff; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
.tile .big { font-size: 24px; font-weight: 650; line-height: 1.2; }
.sbar { display: flex; overflow: hidden; gap: 2px; background: #fff; }
.sbar span { min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 6px; color: var(--ink); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
svg.chart { width: 100%; height: auto; font: 11px var(--font); }
svg.chart text { fill: var(--muted); } svg.chart text.tl { fill: var(--ink); font-weight: 600; }
svg.chart rect[fill="transparent"]:hover + rect { opacity: .8; }
table.compact th, table.compact td { padding: 5px 8px; font-size: 13px; }
/* location tree */
table.tree td { white-space: nowrap; }
.tw { display: inline-block; width: 20px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 12px; }
.card > .row > div:first-child { flex: 1 1 360px; }
.card .row > select, .card .row > .btn { width: auto; }
form.photoform { display: grid; gap: 6px; margin-top: 8px; }
tr.chg td { background: #fffaf3; }
.crumbs { line-height: 1.8; }
ul.tree-list { list-style: none; margin: 4px 0; padding-left: 16px; border-left: 2px solid var(--line); }
ul.tree-list li { margin: 3px 0; }
.ctree > ul.tree-list { padding-left: 10px; }
.modes { display: flex; gap: 6px; margin-bottom: 12px; }
.modes button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; }
.modes button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.flagdot.inside { background: #fff; color: var(--warn); border: 1px solid var(--warn); }
.flagdot.blk { background: var(--danger); color: #fff; border-color: var(--danger); }
.flagdot.inside.blk { background: #fff; color: var(--danger); border-color: var(--danger); }
h3.inh { margin-top: 12px; }
.curloc { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 12px; border-radius: 6px; background: #f3f6f4; }
.curloc > div { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 600; }
.locchip { white-space: nowrap; }

/* packing workflow */
.move .guide { border-radius: 6px; margin-top: 6px; }
.move .modes.apps button { padding: 8px; font-size: 14px; }
.move .row select { flex: 1; min-width: 0; }
.move h3 { margin: 0; }

/* type-ahead under scan boxes */
.has-sugg { position: relative; }
.sugg {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line);
  max-height: 60vh;
  overflow: auto;
}
.sugg .opt { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.sugg .opt:last-child { border-bottom: 0; }
.sugg .opt.on, .sugg .opt:hover { background: var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; }
.tog { background: #fff; border-radius: 999px; font: inherit; cursor: pointer; }
.sugg .opt b { color: var(--ink); }

/* tappable choice list (radio or checkbox in a card) */
.opts { display: grid; }
.opts label {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  line-height: 1.3;
}
.opts input[type=radio], .opts input[type=checkbox] { width: 20px; height: 20px; }
.opts .sub { display: block; }

.filebtn { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
.filebtn.on { border-color: var(--accent); background: var(--accent-soft); }
.move .item[data-go] { cursor: pointer; }
.move .chev { color: var(--muted); line-height: 1; padding: 0 4px; }
.move h3.daygrp { margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.move .sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 2px; }
.move .flagline { margin-top: 4px; color: #8a4b00; }
.move .flagline.blocks { color: var(--danger); }
.move .fieldline { margin-top: 4px; }

.tog:focus { outline: none; }
.tog:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tog:disabled { cursor: default; opacity: .75; }
div.fld > .chips { margin-top: 4px; }

.move details > summary { cursor: pointer; list-style-position: outside; }
.move details > summary h2 { margin: 0; }
.move .item > div:first-child { flex: 1; min-width: 0; }
.move .item > .row { flex-wrap: nowrap; flex-shrink: 0; gap: 4px; }

/* responsive: one column on phones, two side by side on tablets and laptops */
.move .scan input { min-width: 0; }
.move .cols { display: block; }
@media (min-width: 860px) {
  .move .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; align-items: start; }
  .move > header, .move > .syncbar, .move > #attention, .move > .modes { max-width: none; }
  .move .loclist .daygrp { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .move { padding-left: 8px; padding-right: 8px; }
  .move .step { padding: 12px; }
  .move .scan .btn { padding: 10px 9px; }
}

.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }

.move .item.dim { opacity: .6; }

/* confirmation after a move / pack / take-out */
.move .donecard { border-color: var(--accent); }
.move .donestate { margin-top: 4px; color: var(--muted); }
.move .donecard.ok .donestate { color: var(--accent); font-weight: 600; }

/* confirmation strip / bar (phone and CMS) */
.notice { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.notice button { border: 0; background: none; line-height: 1; cursor: pointer; padding: 0 4px; }
.move .packinto { margin: 10px 0 4px; border-radius: 10px; display: grid; gap: 6px; }

/* ---- flagged = yellow, everywhere (on the record itself, or on something inside it) ---- */
:root { --flag-bg: #fef9c3; --flag-line: #facc15; --flag-ink: #713f12; }
tr.flagged > td { background: var(--flag-bg); }
.flagbanner {
  background: var(--flag-bg);
  border-left: 6px solid var(--flag-line);
  color: var(--flag-ink);
  border-radius: 10px;
  display: grid;
  gap: 4px;
  margin-top: 8px;
}
.flagbanner.blocks { border-left-color: #eab308; }
.flagbanner a { color: var(--flag-ink); }
.flagpill { display: inline-block; border: 1px solid var(--flag-line); color: var(--flag-ink); border-radius: 999px; }
.move .item:has(.flagline), .move .item.flagged { background: var(--flag-bg); box-shadow: inset 5px 0 0 var(--flag-line); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.move .flagline, .move .flagline.blocks { color: var(--flag-ink); background: none; }
.move .flagline.blocks { font-weight: 500; }
/* My work */
.workgrid { display: grid; }
.workcard {
  display: grid;
  border-radius: 12px;
  border-left: 6px solid var(--flag-line);
  color: var(--ink);
  text-decoration: none;
}
.workcard:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.workcard .wtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.workcard .wnote { font-style: italic; }
.flagdot, .flagdot.blk { background: var(--flag-line); color: var(--flag-ink); border: 0; font-weight: 700; }
.flagdot.inside, .flagdot.inside.blk { background: var(--flag-bg); color: var(--flag-ink); border: 1px solid var(--flag-line); }

/* =====================================================================
   v0.12 design: bigger text, clearer inputs and actions, colour by kind.
   Values come from the design system tokens at the top of this file.
   ===================================================================== */
h1 { font-size: 30px; line-height: 36px; letter-spacing: -.01em; }
h2 { font-size: 22px; line-height: 28px; margin-bottom: 12px; }
h3 { font-size: 18px; line-height: 24px; }
.small { font-size: 14px; line-height: 20px; } .muted { color: var(--ink-muted); }
.mono { font-size: 15px; }
label { font-size: 15px; font-weight: 600; color: var(--ink); }
label > input, label > select, label > textarea { margin-top: 8px; font-size: 16px; font-weight: 400; }
.form { gap: 18px 20px; } .form .help { font-size: 14px; color: var(--ink-muted); font-weight: 400; }

/* buttons: a verb and the thing; one primary per screen */
.btn { min-height: 44px; padding: 0 18px; border: 2px solid var(--line-strong); border-radius: var(--radius-md); font-weight: 600; font-size: 16px;
       display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface-card); }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.danger { color: var(--problem); border-color: var(--problem); background: var(--surface-card); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 15px; }
.btn:focus-visible, .tog:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* fields: 2px border, big text, label above */
input, select, textarea { border: 2px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 14px; min-height: 48px; font-size: 16px; }
textarea { padding: 10px 14px; min-height: 90px; }
input[readonly], select:disabled, input:disabled { background: var(--surface-sunk); border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { min-height: 0; width: 22px; height: 22px; }
.chk { font-size: 16px; font-weight: 400; align-items: center; } .chk input { margin-top: 0; }
.checks, .checks label { font-size: 16px; font-weight: 400; }

/* oval toggle tags: one tap on or off; on = green with a tick */
.tog { min-height: 44px; padding: 0 16px; border: 2px solid var(--line-strong); color: var(--ink); font-weight: 600; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; }
.tog.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tog.on::before { content: "✓"; font-weight: 700; }
.chips { gap: 8px; }

/* small status tags and counts */
.tag { font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-sunk); color: var(--ink); }
.tag.on { background: var(--primary-soft); color: var(--primary-hover); }
.tag.warn { background: var(--waiting-soft); color: var(--waiting-ink); }
.flagdot { min-width: 24px; height: 24px; line-height: 24px; border-radius: 999px; font-size: 13px; padding: 0 7px; }

/* record kinds: colour + word, never colour alone */
.kind { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
        text-transform: uppercase; color: #fff; background: var(--line-strong); vertical-align: 2px; white-space: nowrap; }
.kind.k-loc { background: var(--location); }.kind.k-grp { background: var(--group); } .kind.k-itm { background: var(--item); }

/* cards and tables */
.card { border: 0; box-shadow: var(--shadow-card); border-radius: var(--radius-md); padding: 20px 24px; }
.card + .card { margin-top: 20px; }
.tablewrap { border: 0; box-shadow: var(--shadow-card); border-radius: var(--radius-md); }
th { font-size: 14px; font-weight: 700; color: var(--ink-muted); background: var(--surface-sunk); padding: 12px 16px; }
td { padding: 14px 16px; font-size: 16px; border-bottom-color: var(--line); }
tbody tr.click:hover { background: #f6f8fb; }
.kv { grid-template-columns: 180px 1fr; gap: 0; } .kv dt, .kv dd { padding: 10px 0; border-top: 1px solid var(--line); }
.kv dt { font-size: 15px; font-weight: 600; }
.tabs a { padding: 10px 16px; font-weight: 600; font-size: 16px; } .tabs a.on { border-bottom-width: 3px; color: var(--primary); }
.pagehead { margin-bottom: 20px; } .pagehead h1 { margin: 0; }
.empty { font-size: 16px; }
dialog { border: 0; border-radius: 16px; box-shadow: var(--shadow-float); }
dialog .dhead { font-size: 20px; font-weight: 700; padding: 18px 20px; } dialog .dbody { padding: 20px; } dialog .dfoot { padding: 14px 20px; }
dialog::backdrop { background: rgba(17,24,39,.5); }
.ref-results div, .sugg .opt { padding: 12px 14px; font-size: 16px; } .sugg .opt b { font-size: 16px; }
.sugg { border-radius: var(--radius-md); box-shadow: var(--shadow-float); }

/* CMS sidebar: white, coloured icons */
.shell { grid-template-columns: 256px 1fr; }
.side { background: #fff; color: var(--ink); border-right: 1px solid var(--line); padding: 18px 12px; gap: 2px; }
.side .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; padding: 2px 8px 16px; }
.side .brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.side .sect { color: var(--ink-muted); font-size: 13px; font-weight: 700; padding: 18px 12px 6px; }
.side a { color: var(--ink); font-weight: 600; font-size: 16px; min-height: 42px; padding: 0 12px; border-radius: 10px; gap: 10px; justify-content: flex-start; }
.side a > .lbl { flex: 1; }
.side a:hover { background: var(--surface-page); }
.side a.on { background: var(--primary-soft); color: var(--primary-hover); }
.side .ico { width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700;
             background: var(--line-strong); flex: none; letter-spacing: .02em; }
.side .ico.k-loc { background: var(--location); }.side .ico.k-grp { background: var(--group); } .side .ico.k-itm { background: var(--item); }
.side .ico.k-work { background: var(--flag-ink); }
.side .who { color: var(--ink-muted); font-size: 14px; border-top-color: var(--line); } .side .who b { color: var(--ink); font-size: 15px; }
.main { padding: 28px 32px 60px; }
@media (max-width: 800px) {
  .mtop { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); }
  .mtop .btn { background: #fff; color: var(--ink); border-color: var(--line-strong); }
  .main { padding: 18px 16px 60px; }
}
#toasts { bottom: 20px; right: 20px; } .toast { background: var(--ink); font-size: 16px; padding: 12px 16px; border-radius: 10px; }

/* notice bar: says what just happened, in words */
.notice { padding: 12px 16px; font-size: 16px; font-weight: 600; border: 2px solid var(--primary); background: var(--primary-soft); color: var(--primary-hover);
          border-radius: var(--radius-sm); box-shadow: var(--shadow-float); }
.notice b { font-weight: 700; }
.notice.wait { border-color: var(--waiting); background: var(--waiting-soft); color: var(--waiting-ink); }
.notice.bad { border-color: var(--problem); background: var(--problem-soft); color: var(--problem); }
.notice button { color: inherit; min-width: 36px; min-height: 36px; font-size: 24px; }

/* flags: yellow, always with words */
.flagbanner { font-size: 16px; line-height: 24px; padding: 14px 18px; border: 2px solid var(--flag); border-left-width: 8px; }
.flagbanner b, .flagbanner strong { font-size: 17px; }
.flagpill { font-size: 14px; font-weight: 700; background: var(--flag); border-color: var(--flag); padding: 2px 10px; }
tr.flagged > td:first-child { box-shadow: inset 5px 0 0 var(--flag); }
.workcard { background: #fff; border: 0; border-top: 6px solid var(--flag); box-shadow: var(--shadow-card); padding: 18px 20px; gap: 8px; font-size: 16px; }
.workcard.mine { border-top-color: var(--primary); }
.workcard .wrec { font-size: 20px; font-weight: 700; }
.workgrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ---------------- phone app ---------------- */
.move { font-size: 17px; line-height: 1.5; max-width: 1180px; padding: 0 16px 110px; }
.move > header { border-bottom: 1px solid var(--line); }
.move > header .who { display: flex; align-items: center; gap: 10px; }
.move > header .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.move > header .name { font-weight: 700; font-size: 17px; line-height: 20px; }
.move > header .sub { font-size: 14px; color: var(--ink-muted); line-height: 18px; }
.move > header .row .btn { min-height: 40px; }
.move .syncbar { margin: 12px 0; font-size: 15px; border: 0; box-shadow: var(--shadow-card); }
.move .syncbar.on { background: var(--primary-soft); color: var(--primary-hover); font-weight: 600; }
.move .syncbar.off { background: var(--waiting-soft); color: var(--waiting-ink); font-weight: 600; }
.move .step { border: 0; box-shadow: var(--shadow-card); border-radius: var(--radius-md); padding: 18px 16px; margin-bottom: 16px; }
.move .step h2 { font-size: 22px; line-height: 28px; margin: 0 0 10px; }
.move .step h2 .n { width: 30px; height: 30px; font-size: 15px; }
.move h3 { font-size: 18px; }
.move .item { padding: 12px 0; gap: 12px; min-height: var(--tap); }
.move .item b { font-size: 18px; font-weight: 650; }
.move .item .muted.small, .move .item .small { font-size: 14px; }
.move .item .btn.sm { min-height: 44px; }
.move .item .btn.sm.primary { background: #fff; color: var(--primary); border-color: var(--primary); }
.move .item .btn.sm.primary::before { content: ""; }
.move h3.daygrp, .move .sub-h { font-size: 14px; font-weight: 700; margin: 18px 0 4px; }
.move h3.daygrp.late { color: var(--problem); }
.move .chev { font-size: 28px; }
.move .guide { font-size: 15px; background: var(--surface-page); border-left: 4px solid var(--primary); padding: 10px 12px; }
.move .big { min-height: var(--tap); font-size: 17px; border-radius: var(--radius-md); width: 100%; }
.move .dest { font-size: 19px; }
.move .blocked { font-size: 15px; font-weight: 600; }
.move .flagline { font-size: 15px; }
.move .packinto { background: var(--container-soft); border: 2px solid var(--container); padding: 12px; }
.move .packinto .tog.on { background: var(--container); border-color: var(--container); }

/* the scan box: thick green outline, big text, the most obvious thing on the screen */
.move .scan { display: flex; align-items: center; gap: 6px; padding: 5px; border: 3px solid var(--primary); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-card); }
.move .scan::before { content: ""; width: 26px; height: 26px; flex: none; margin-left: 8px;
  background: no-repeat center/26px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b6e4f' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 8V5a1 1 0 011-1h3M16 4h3a1 1 0 011 1v3M20 16v3a1 1 0 01-1 1h-3M8 20H5a1 1 0 01-1-1v-3M8 9v6M11 9v6M14 9v6M17 9v6'/%3E%3C/svg%3E"); }
.move .scan input { border: 0; outline: 0; font-size: 20px; font-weight: 500; min-height: 46px; padding: 0 6px; background: transparent; }
.move .scan input:focus { outline: 0; }
.move .scan:focus-within { outline: 3px solid var(--primary-soft); }
.move .scan .btn { min-height: 46px; padding: 0 14px; }
.move .scan .btn:not([data-cam]):not([type=button]) { background: var(--primary); border-color: var(--primary); color: #fff; }
.move .scan .btn[data-cam] { border-color: var(--line); }
@media (min-width: 860px) and (max-width: 1100px) { .move .scan input { font-size: 18px; } }
@media (max-width: 380px) { .move .scan input { font-size: 17px; } .move .scan::before { display: none; } }

/* Move / Pack into / Take out: a segmented control */
.move .modes:not(.apps) { background: var(--surface-sunk); padding: 4px; border-radius: var(--radius-md); gap: 4px; }
.move .modes:not(.apps) button { min-height: 44px; border: 0; background: transparent; font-size: 16px; color: var(--ink); }
.move .modes:not(.apps) button.on { background: #fff; color: var(--primary-hover); box-shadow: var(--shadow-card); }

/* bottom tab bar */
.move .modes.apps { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 4px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding: 6px 8px max(10px, env(safe-area-inset-bottom)); }
.move .modes.apps button, .move .modes.apps a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 56px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-muted); font: 600 14px var(--font); text-decoration: none; }
.move .modes.apps .on { background: var(--primary-soft); color: var(--primary-hover); font-weight: 700; }
.move .modes.apps svg { width: 24px; height: 24px; }
.move .modes.apps .cnt { position: absolute; margin-left: 30px; margin-top: -2px; background: var(--flag); color: var(--flag-ink); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 0 6px; }

/* sticky notice under the header */
.move #pnotice { margin-top: 12px; }
.move #pnotice .notice { margin-bottom: 0; }

/* done card */
.move .donecard { border: 2px solid var(--primary); background: var(--primary-soft); text-align: center; padding: 24px 16px 18px; }
.move .donecard.bad { border-color: var(--problem); background: var(--problem-soft); }
.move .donecard.wait { border-color: var(--waiting); background: var(--waiting-soft); }
.move .donehead { font-size: 24px; line-height: 30px; font-weight: 700; color: var(--ink); }
.move .donehead .tick { display: block; width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 32px; line-height: 60px; }
.move .donecard.bad .donehead .tick { background: var(--problem); } .move .donecard.wait .donehead .tick { background: var(--waiting); }
.move .donecard.bad .donehead { color: var(--problem); }
.move .donetext { font-size: 17px; margin-top: 6px; }
.move .donestate { font-size: 15px; }
.move .donecard .btn { min-height: var(--tap); }

/* tappable choice cards (problem sheet etc.) */
.opts { gap: 10px; }
.opts label { min-height: 60px; padding: 10px 14px; border: 2px solid var(--line-strong); border-radius: var(--radius-md); font-size: 17px; font-weight: 650; }
.opts label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.opts input[type=checkbox], .opts input[type=radio] { width: 26px; height: 26px; accent-color: var(--primary); }
.opts .sub { font-size: 14px; font-weight: 400; color: var(--ink-muted); }
@media (max-width: 600px) {
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; max-height: 92vh; }
  dialog .dfoot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  dialog .dfoot .btn { flex: 1; min-height: var(--tap); }
}
.login .btn { min-height: var(--tap); }
div.fld { font-size: 15px; font-weight: 600; color: var(--ink); }
div.fld > .ref-picker, div.fld > .links, div.fld > .checks, div.fld > .chips { margin-top: 8px; font-size: 16px; font-weight: 400; }
div.fld .ref-picker input { font-size: 16px; }
.btn { line-height: 1.2; }
.move .syncbar { border-radius: var(--radius-md); }
body:has(.move) #toasts { left: 16px; right: 16px; }
body:has(.move) .toast { max-width: none; }
/* phone fixes */
/* header scrolls away: a sticky bar under the iPhone status bar gets blurred by iOS */
/* "Updated" notice sits just above the bottom tabs, always in view, clear of the status bar */
.move #pnotice { position: fixed; left: 12px; right: 12px; z-index: 45; margin: 0; }
@media (min-width: 860px) { .move #pnotice { left: 50%; right: auto; width: 540px; transform: translateX(-50%); } }
/* one slim sync line */
.move .syncbar { padding: 6px 6px 6px 14px; min-height: 52px; }
.move .syncbar .btn { margin-left: auto; min-height: 40px; }
.move .syncbar > span:not(.dot) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* camera: a compact icon button so the scan hint reads in full */
.move .scan .btn.cam { min-width: 46px; padding: 0 8px; border: 0; background: var(--surface-page); font-size: 20px; }
@media (max-width: 430px) { .move .scan::before { display: none; } .move .scan input { padding-left: 10px; } }
/* my locations: one card each, with progress */
.move .loclist { display: grid; gap: 10px; }
.move .loccard { background: #fff; border: 2px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; cursor: pointer; display: grid; gap: 6px; }
.move .loccard:hover { border-color: var(--line-strong); }
.move .loccard.dim { opacity: .6; }
.move .lctop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.move .lctop b { font-size: 19px; font-weight: 650; line-height: 24px; }
.move .lcmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.move .bar { height: 8px; border-radius: 999px; background: var(--surface-sunk); overflow: hidden; }
.move .bar > span { display: block; height: 100%; background: var(--primary); }
@media (min-width: 860px) { .move .loclist { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 14px; } }
/* packing group: what's in the box vs what you could still add */
.move .step h2 .count { display: inline-flex; min-width: 30px; height: 30px; padding: 0 9px; margin-left: 6px; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--surface-sunk); font-size: 16px; vertical-align: 3px; }
.move .inbox { border: 3px solid var(--container); }
.move .inbox h2 .count { background: var(--container); color: #fff; }
.move .inbox .item.packed { flex-wrap: wrap; align-items: flex-start; background: var(--container-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; border-bottom: 0; }
.move .inbox .item.packed > div:nth-child(2) { flex: 1; min-width: 0; }
.move .inbox .ptick { width: 28px; height: 28px; flex: none; border-radius: 999px; background: var(--container); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.move .inbox .acts { width: 100%; padding-left: 40px; flex-wrap: wrap; gap: 6px; }
.move .inbox .emptybox { padding: 16px; border: 2px dashed var(--container); border-radius: var(--radius-sm); color: var(--ink-muted); text-align: center; }
.move .toadd { border: 2px dashed var(--line-strong); box-shadow: none; background: #fbfcfd; }
.move .toadd .item { background: #fff; }
.move details.more > summary { min-height: 48px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--primary); cursor: pointer; list-style: none; }
.move details.more[open] > summary { display: none; }

/* packing screen */
.move .loctitle { font-size: 28px; line-height: 34px; margin: 10px 0 4px; }
.move .loctitle .code { font: 600 17px var(--mono); color: var(--location); white-space: nowrap; }
.move .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.move .lab, .move .scanlab { display: block; font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.move .startpg { border: 3px dashed var(--container); box-shadow: none; }
.move .startpg .two { margin-bottom: 12px; }
.move .pgcard { border: 3px solid var(--container); }
.move .pghead { display: flex; align-items: center; gap: 12px; }
.move .pgicon { width: 48px; height: 48px; border-radius: 12px; background: var(--container); color: #fff; font-size: 26px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.move .pgcode { font: 700 22px/28px var(--mono); color: var(--container); }
.move .pgpills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.move .pgpill { font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--container-soft); color: #4c1d95; }
.move .pgpill.n { background: var(--container); color: #fff; }
.move .carried { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--waiting-soft); border: 2px solid var(--waiting); color: var(--waiting-ink); display: grid; gap: 8px; }
.cpill { display: inline-block; margin: 2px 4px 2px 0; font-size: 14px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: #fff; color: var(--waiting-ink); border: 2px solid var(--waiting); }
.cpill.hz { background: var(--problem); color: #fff; border-color: var(--problem); }
.cpill.sm { font-size: 12px; padding: 1px 8px; border-width: 1.5px; }
.move .kc { font-size: 14px; font-weight: 700; color: var(--line-strong); }
.move .kc.k-grp { color: var(--group); } .move .kc.k-itm { color: var(--item); }.move .kc.k-loc { color: var(--location); }
.move .item[data-row] { cursor: pointer; }
.move .item.np { background: var(--flag-bg); box-shadow: inset 5px 0 0 var(--flag-line); margin: 4px -16px; padding-left: 16px; padding-right: 16px; }
.move .item.np .flagpill { background: var(--flag); white-space: nowrap; }
.move .inbox .item.packed { cursor: pointer; }
.move .boxdet > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; min-height: 48px; }
.move .boxdet > summary::-webkit-details-marker { display: none; }
.move .boxdet > summary > span:first-child { display: grid; } .move .boxdet > summary b { font-size: 22px; line-height: 28px; }
.move .boxdet[open] > summary .linkbtn { visibility: hidden; }
.move .finish { border: 2px solid var(--primary); }
.move .chips.one { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.move .chips.one .tog { justify-content: center; }
.move .destline { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.move .destline.k-loc { background: var(--location-soft); }.move .confirmbox { margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--flag-bg); border: 2px solid var(--flag-line); color: var(--flag-ink); display: grid; gap: 4px; font-size: 15px; }
.move .confirmbox b { font-size: 17px; }
dialog .btn.big.danger, .move .btn.big.danger { color: var(--problem); border-color: var(--problem); }
dialog .btn.big { width: 100%; min-height: var(--tap); font-size: 17px; }

/* take out: pick what comes out */
.move .picklist { display: grid; gap: 8px; }
.move .pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border-radius: var(--radius-md); border: 2px solid var(--line); background: #fff; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.move .pick .ptick { width: 28px; height: 28px; border-radius: 999px; border: 2px solid var(--line-strong); color: transparent; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.move .pick.on { border-color: var(--container); background: var(--container-soft); }
.move .pick.on .ptick { background: var(--container); border-color: var(--container); color: #fff; }
.move .pick .pmain { display: grid; gap: 2px; } .move .pick .pmain b { font-size: 18px; }

/* My work on the phone */
.move .seg { display: flex; gap: 4px; background: var(--surface-sunk); padding: 4px; border-radius: var(--radius-md); margin: 4px 0 14px; }
.move .seg button { flex: 1 1 auto; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; font: 600 15px var(--font); color: var(--ink); white-space: nowrap; cursor: pointer; }
.move .seg button.on { background: #fff; color: var(--primary-hover); font-weight: 700; box-shadow: var(--shadow-card); }
.move .wcard { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 16px; margin-bottom: 14px; border-top: 6px solid var(--flag); display: grid; gap: 6px; cursor: pointer; }
.move .wcard.prog { border-top-color: var(--primary); } .move .wcard.blk { border-top-color: var(--problem); }
.move .wcard .wtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.move .wcard .wname { font-size: 19px; font-weight: 700; line-height: 24px; }
.move .flagbanner { margin: 0 0 16px; }
.move .chips.one3 .tog { flex: 1 1 auto; justify-content: center; }
.move .phgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.move .phbox { border: 2px solid var(--line); border-radius: var(--radius-md); padding: 10px; display: grid; gap: 8px; align-content: start; }
.move .phbox.over { border-color: var(--primary); background: var(--primary-soft); }
.move .phh { font-size: 15px; font-weight: 700; }
.move .phs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.move .ph { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface-sunk); cursor: pointer; align-self: start; line-height: 0; }
.move .ph img { width: 100%; height: auto; display: block; }   /* whole photo, so the mark-up layer lines up */
.ov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.move .ph .mk { position: absolute; left: 4px; bottom: 4px; white-space: nowrap; line-height: 16px; font-size: 11px; font-weight: 700; background: var(--ink); color: #fff; border-radius: 6px; padding: 1px 6px; }
.move .phadd { min-height: 48px; border: 2px dashed var(--primary); border-radius: 10px; background: #f3faf6; color: var(--primary-hover); font-weight: 600; }
dialog.mkd { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; background: #111827; color: #fff; padding: 0; display: flex; flex-direction: column; }
dialog.mkd[open] { display: flex; }
.mkbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
.mkbar .mkt { display: grid; text-align: center; font-size: 15px; } .mkbar .mkt .mono { color: #9ca3af; font-size: 12px; }
.mkstage { position: relative; flex: 1; min-height: 0; margin: 0 12px; display: flex; align-items: center; justify-content: center; }
.mkwrap { position: relative; display: inline-block; line-height: 0; }
.mkstage img { max-width: calc(100vw - 24px); max-height: calc(100vh - 250px); display: block; }
.mkstage svg.ov { position: absolute; touch-action: none; }
.mktoggle { position: absolute; top: 8px; left: 8px; background: rgba(17,24,39,.85) !important; color: #fff !important; border-color: transparent !important; }
.mkcols { display: flex; justify-content: center; gap: 12px; padding: 6px; }
.mkcols .sw { width: 34px; height: 34px; border-radius: 999px; border: 3px solid transparent; cursor: pointer; }
.mkcols .sw.on { border-color: #fff; outline: 2px solid #111827; }
.mktools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 6px 10px max(16px, env(safe-area-inset-bottom)); }
.mktools button { min-height: 52px; border: 0; border-radius: 10px; background: transparent; color: #e5e7eb; font: 600 14px var(--font); cursor: pointer; }
.mktools button.on { background: #374151; color: #fff; }
.move .btn.big { white-space: normal; height: auto; min-height: var(--tap); padding-top: 10px; padding-bottom: 10px; line-height: 1.25; text-align: center; }

/* one chosen place: replaces the scan box until removed */
.move .picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; padding: 10px 12px; border-radius: var(--radius-md); border: 2px solid var(--primary); background: var(--primary-soft); }
.move .picked .pmain { display: grid; gap: 2px; min-width: 0; } .move .picked .pmain b { font-size: 18px; overflow-wrap: anywhere; }
.move .picked .btn { flex: none; }
/* iPhone home-screen app: never show page background under the tab bar */
.move .modes.apps::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: #fff; }

/* suggestions: one compact row each, short list that scrolls, never under the keyboard */
.move .sugg { max-height: min(46vh, 320px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.move .sugg .opt { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; }
.move .sugg .opt b { font-size: 17px; flex: 1 1 auto; min-width: 0; }
.move .sugg .opt .kind { flex: none; font-size: 11px; padding: 0 6px; }
.move .sugg .opt .muted { flex-basis: 100%; font-size: 13px; }
.move .sugg .opt .muted:empty { display: none; }
.move .scan input { scroll-margin-top: calc(env(safe-area-inset-top) + 90px); }
body.typing .move { padding-bottom: 70vh; }   /* room to bring the search box up to the top while typing */
body.typing .move .modes.apps, body.typing .move #pnotice { display: none; }   /* more room above the keyboard */

/* confirmations at the top of the screen, fading out by themselves */
.move #pnotice { bottom: auto; }
body:has(.move) #toasts { bottom: auto; }
.move #pnotice .notice { box-shadow: var(--shadow-float); animation: noteIn .2s ease-out; }
.move #pnotice .notice.fading { opacity: 0; transform: translateY(-8px); transition: opacity .4s, transform .4s; }
@keyframes noteIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
body.typing .move #pnotice { display: block; }

/* testing: choose who to be */
.move .rolecard { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 4px; align-items: center;
  width: 100%; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 18px 16px; margin-bottom: 12px; font: inherit; color: var(--ink); cursor: pointer; min-height: 88px; }
.move .rolecard b { font-size: 21px; } .move .rolecard span { color: var(--muted); font-size: 15px; grid-column: 1; }
.move .rolecard .go { grid-column: 2; grid-row: 1 / span 2; font-size: 30px; color: var(--primary); }
.move .rolecard:active { border-color: var(--primary); background: var(--primary-soft); }
.move .testbanner { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; letter-spacing: .02em; text-align: center;
  color: #111827; background: repeating-linear-gradient(135deg, #fde68a 0 12px, #fcd34d 12px 24px); border: 2px dashed #b45309; }
.move > header .row { flex-wrap: nowrap; flex: none; } .move > header .who { min-width: 0; }
.move > header .who .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* iPhone: the header stays at the top while the page scrolls under it. Since iOS 26 the iPhone blurs anything
   position: fixed at the top edge of a home-screen web app (and content scrolled under the clock), so the app
   doesn't scroll the page itself: #root is the scrolling area and the header is sticky inside it. The page never
   moves, so nothing sits under the system's blur. */
html:has(#root > .move), body:has(#root > .move) { height: 100%; overflow: hidden; overscroll-behavior: none; }
#root:has(> .move) { height: 100%; height: 100dvh; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.move > header {
  position: sticky;
  top: 0;
  margin: 0 -16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}
.move { padding-top: 0 !important; }
.move #pnotice { top: calc(env(safe-area-inset-top) + 70px); }
body:has(.move) #toasts { top: calc(env(safe-area-inset-top) + 70px); }

/* CMS overview: tiles and side-by-side cards line up (no stacking gap between cards in a row or grid) */
.row > .card, .grid2 > .card, .stattiles > .card { margin-top: 0; }
.stattiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stattiles > .card { padding: 16px 20px; }
.tablewrap.compact .opt { display: none; }
.stattiles .stype { font-size: 19px; font-weight: 650; line-height: 1.25; color: var(--ink); }
.stattiles .scount { font-size: 16px; color: var(--ink-muted); margin-top: 4px; font-family: var(--font); }
/* overview: recent activity with tabs */
.acttabs { margin: 4px 0 12px; }
.actlist { display: grid; }
.actrow { display: grid; grid-template-columns: 12px 1fr; gap: 12px; align-items: start; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.actrow:last-child { border-bottom: 0; }
.actdot { width: 10px; height: 10px; border-radius: 999px; margin-top: 6px; background: var(--ink-muted); }
.actdot.k-moves { background: var(--location, #2563eb); } .actdot.k-packing { background: var(--container, #6d28d9); }
.actdot.k-conservation { background: #b91c1c; } .actdot.k-flags { background: var(--flag, #eab308); }
/* long location names wrap instead of being cut off */
.tablewrap table td.loc { white-space: normal; max-width: 260px; min-width: 120px; overflow-wrap: anywhere; }
.actrow > div { min-width: 0; overflow-wrap: anywhere; }
/* status share bar: taller, labelled, so it reads as a chart not a divider */
.sbar { height: 30px; border-radius: 8px; }
.sbar span { display: flex; align-items: center; padding: 0 10px; overflow: hidden; white-space: nowrap; color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.sbar span:first-child { border-radius: 8px 0 0 8px; } .sbar span:last-child { border-radius: 0 8px 8px 0; } .sbar span:only-child { border-radius: 8px; }

/* record page alignment */
summary.btn { display: inline-flex !important; align-items: center; justify-content: center; list-style: none; min-height: 40px; }
summary.btn::-webkit-details-marker { display: none; }
#below { margin-top: 20px; }
#below > .card + .card, #sidepanel > .card + .card { margin-top: 20px; }
.tablewrap table.tree td:first-child { white-space: normal; max-width: 420px; overflow-wrap: anywhere; }
/* change history under each field, on demand */
.histbar { display: flex; justify-content: flex-end; margin: -4px 0 8px; }
.fhist { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--line); background: #f8f9fa; border-radius: 0 6px 6px 0; font-size: 13px; font-weight: 400; display: grid; gap: 4px; color: var(--ink); }
/* Move: what's inside a PG / crate / cage, flagged ones first */
.move details.inside { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.move details.inside > summary { padding: 8px 10px; cursor: pointer; font-size: 15px; }
.move details.inside .flagcount { color: #92400e; }
.move .inlist { display: grid; gap: 2px; padding: 0 10px 8px; }
.move .inrow { padding: 6px 0; border-top: 1px solid var(--line); font-size: 15px; }
.move .inrow.fl { background: #fefce8; margin: 0 -10px; padding-right: 10px; padding-left: 10px; }
.move #items .item > details.inside { flex-basis: 100%; }
.move .wsec { margin: 6px 0 10px; font-size: 18px; color: var(--ink-muted); }
/* phone header: long titles shorten instead of running under the buttons */
.move header .who { min-width: 0; flex: 1; }
.move header .who > div { min-width: 0; }
.move header .who .name, .move header .who .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move header .row { flex-shrink: 0; }
.move > header { gap: 10px; }
/* tablets and laptops: the phone app runs full width, one column, same order as on a phone */
@media (min-width: 860px) {
  .move { max-width: none; }
  .move .cols { display: block; }
  .move .loclist { display: block; }
  .move > header { padding-left: 16px; padding-right: 16px; }
  .move .modes.apps { left: 0; right: 0; transform: none; max-width: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
}
/* scan boxes: no barcode picture, no Set/Add button (a scanner presses Enter; typing shows matches to tap);
   the camera button only where there's a camera to point at a label (phones and tablets) */
.move .scan::before { display: none !important; }
.move .scan input { padding-left: 12px; flex: 1; }
/* still-to-pack rows: Problem and + Add side by side */
.move .item .rowbtns { flex-wrap: nowrap; flex-shrink: 0; gap: 6px; }
.move .item .rowbtns .btn { white-space: nowrap; }
@media (max-width: 560px) {
  .move .item:has(.rowbtns) { flex-wrap: wrap; }
  .move .item:has(.rowbtns) > div:first-child { flex-basis: 100%; }
  .move .item .rowbtns { margin-left: auto; margin-top: 6px; }
}
/* fields that need filling in: red outline until they have a value */
.needtxt { display: block; color: var(--danger); font-weight: 600; margin-top: 2px; }
/* camera scanner: an overlay in the middle of the screen, with a confirm step */
dialog.camdlg { width: min(520px, 94vw); padding: 0; }
.camdlg .camview { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.camdlg video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camdlg .camaim { position: absolute; inset: 22% 12%; border: 3px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.camdlg .camres { margin-top: 12px; padding: 12px 14px; border: 2px solid var(--primary); border-radius: 12px; background: var(--primary-soft, #e6f2ec); display: grid; gap: 4px; }
.camdlg .camcode { font-size: 20px; font-weight: 700; }
.camdlg .dfoot { display: flex; gap: 8px; justify-content: flex-end; }
dialog.camdlg { margin: auto !important; inset: 0; border-radius: 16px !important; max-height: 92vh; }
.camdlg .camview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#ctype, #itype { width: 100%; max-width: 100%; box-sizing: border-box; }
.chist { display: grid; gap: 8px; margin-bottom: 10px; } .chist .chrow { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
/* container page: where it is now, big, at the top */
.wherebar {
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-md, 12px);
  margin-bottom: 14px;
}
.wherebar .wlab { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wherebar .wloc { font-weight: 700; line-height: 1.25; }
.wherebar .win { margin-top: 4px; font-size: 15px; }
.fullbelow { margin-top: 14px; } .fullbelow > #below > .card { margin-top: 14px; } .fullbelow > #below > .card:first-child { margin-top: 0; }
/* container page: flags in the same bar as the location */
.wherebar { display: grid; align-items: start; }
.wherebar .wflags h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
@media (max-width: 800px) {.wherebar .wflags { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; } }
/* flags go under the location in the same bar */
.wherebar .wflags { border-left: 0; padding-left: 0; }
/* container page bar: location and flags on the left, photos on the right */
.wherebar { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.wherebar .wleft { display: grid; align-content: start; }
.wherebar .wphotos { border-left: 1px solid var(--line); }
.wherebar .wphotos h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
@media (max-width: 800px) { .wherebar { grid-template-columns: 1fr; } .wherebar .wphotos { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; } }
.grid2.onecol { grid-template-columns: 1fr !important; }
.grid2.onecol > #sidepanel { display: none; }
/* container bar, condensed: one line for where it is, one for flags, small photos */
.wherebar { padding: 10px 16px; gap: 14px; }
.wherebar .wleft { gap: 6px; }
.wherebar .wwhere { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.wherebar .wloc { font-size: 20px; margin-top: 0; }
.wherebar .wlab { font-size: 11px; }
.wherebar .wflags { border-top: 0; padding-top: 0; }
.wherebar .wflagline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.wherebar .wflagline .flagpill { font-size: 13px; padding: 1px 8px; }
.wherebar .wmore > summary { cursor: pointer; list-style: none; }
.wherebar .wmore[open] { flex-basis: 100%; }
.wherebar .wphotos { padding-left: 14px; }
.wherebar .wphotos h2 { margin-bottom: 2px; }
.wherebar .wphotos .thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.wherebar .wphotos figure { margin: 0; } .wherebar .wphotos figcaption { display: none; }
.wherebar .wphotos img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.wherebar .wphotos .photoform { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wherebar .wphotos .photoform input[name=c] { display: none; }
.wherebar .wphotos .photoform .btn { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.wherebar .wcount { font-size: 15px; } .wherebar .wcount .wlab { margin-right: 6px; }
/* container details: compact form */
.compactform { padding: 12px 16px !important; }
.compactform .form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compactform .form .wide { grid-column: span 2; }
.compactform .form label, .compactform .form .fld { font-size: 13px; }
.compactform .form input, .compactform .form select { min-height: 36px; padding: 4px 10px; font-size: 15px; }
.compactform .form textarea { min-height: 36px; height: 36px; padding: 6px 10px; font-size: 15px; resize: vertical; }
.compactform .histbar .btn { min-height: 30px; padding: 2px 10px; font-size: 13px; }
.compactform .row { margin-top: 8px !important; }
.compactform .row .btn.primary { min-height: 34px; padding: 4px 14px; }
@media (max-width: 1000px) { .compactform .form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* container details: the short fields share one line, description and notes full width under them */
.compactform .form { display: flex !important; flex-wrap: wrap; gap: 8px 12px; }
.compactform .form > * { flex: 1 1 140px; min-width: 0; }
.compactform .form > .wide { flex: 1 1 100%; order: 2; }
@media (max-width: 1000px) { .compactform .form > * { flex-basis: 45%; } }
.compactform { position: relative; }
.compactform .histbar { float: none; position: absolute; right: 16px; bottom: 12px; margin: 0; }
/* container "Change where it is": the fields side by side on one row */
.chgrow { display: grid; gap: 8px 12px; align-items: end; margin-top: 10px; }
.chgrow .ccol { display: grid; gap: 4px; min-width: 0; }
.chgrow .ccol > label { font-size: 13px; font-weight: 600; }
.chgrow .cgo { align-self: end; }
.chgrow .cgo .btn { width: 100%; white-space: nowrap; }
.chgrow .cnote { grid-column: 1 / -1; }
.chgrow { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.chgrow .ccol input, .chgrow .ccol select { min-height: 44px; box-sizing: border-box; }
.chgrow .cgo .btn { min-height: 44px; }
/* container: Change where it is beside Contents; long contents scroll inside the card */
.cpair { display: grid; gap: 16px; align-items: start; }
.cpair > .card { margin: 0; min-width: 0; }
.cpair .chgrow { grid-template-columns: 1fr; }
.cscroll { max-height: 460px; overflow: auto; }
.cfind { width: 100%; margin: 8px 0; box-sizing: border-box; }
@media (max-width: 900px) { .cpair { grid-template-columns: 1fr; } }
/* contents as a table */
.ctable { width: 100%; }
.ctable td { vertical-align: middle; }
.ctable thead th { position: sticky; top: 0; background: var(--card, #fff); z-index: 1; }
.cpair { grid-template-columns: minmax(280px, 320px) 1fr; }
.ctable .cwhat { white-space: nowrap; }
.ctable .kind { white-space: nowrap; font-size: 10px; }
.ctable .flagpill { white-space: nowrap; font-size: 12px; padding: 2px 8px; }
.ctable td, .ctable th { padding-top: 5px; padding-bottom: 5px; }
/* Change where it is full width again; unpack chooser spans the row */
.chgrow .cpick { grid-column: 1 / -1; display: grid; gap: 6px; }
.chgrow .cpick > label { font-size: 13px; font-weight: 600; }
.chgrow .cpick .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chgrow .cpick .tog.on .muted { color: inherit; opacity: .8; }
.wsplit { display: grid; gap: 2px; margin: 2px 0 4px; font-size: 14px; }
tr.hflag td { background: #fffbeb; }
tr.hflag td { white-space: normal; overflow: visible; text-overflow: clip; max-width: none; }
/* phone location header: a little more room */
.move .lochead .loctitle { margin: 18px 0 8px; }
.move .lochead > .muted { margin-bottom: 4px; }
.move .lochead .row { gap: 10px; }
.move .lochead .row + .row, .move .lochead .muted + .row { margin-top: 16px !important; }
/* the location code sits on the title's own line (baseline), not floated in the middle */
.move .step h2.loctitle { display: block; }
.move .loctitle .code { vertical-align: baseline; margin-left: 4px; }
.move .loctitle .code { display: block; margin: 2px 0 0; }
/* scan button: a barcode-scan icon, opens the scan overlay */
.btn.cam { display: inline-grid; place-items: center; color: var(--accent, #0b6e4f); }
.btn.cam .scanico { width: 26px; height: 26px; }
/* box type and size on the Packing now card */
.move .pgcard .pgtype { gap: 10px; }
.move .pgcard .pgtype label { font-weight: 600; display: grid; }
/* matches: one line each so more fit above the keyboard */
.move .sugg .opt .sline { flex: 1 0 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.move .sugg .opt { min-height: 0; padding: 8px 14px; }
/* help text with a Hide button (remembered per person on this phone) */
.move .hint { display: flex; gap: 10px; margin: 4px 0 8px; }
.move .hint > span { flex: 1; }
.move .hint .hintx { flex: none; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; color: var(--muted, #5b6470); cursor: pointer; }
/* location problem and photo side by side */
.move .lochead .locacts { display: grid; grid-template-columns: 1fr auto; gap: 10px; flex-wrap: nowrap; }
.move .lochead .locacts .btn { white-space: nowrap; }
/* scan boxes still to fill: red, like other required fields; the main button waits for them */
.move #go:disabled { opacity: .55; cursor: not-allowed; }
/* picked things: photo / flag / remove stacked down the right, so the details get the width */
.move .iacts { display: flex; flex-direction: column; gap: 6px; align-self: flex-start; }
.move .iacts .btn { min-width: 64px; padding-left: 10px; padding-right: 10px; justify-content: center; }
.move #items .item { align-items: flex-start; }
/* Packing now card: condensed */
.move .step.pgcard { padding: 12px 14px; }
.move .pgcard .pghead { gap: 10px; }
.move .pgcard .pgicon { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
.move .pgcard .pgtxt { flex: 1; min-width: 0; }
.move .pgcard .pglab { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5b6470); line-height: 14px; }
.move .pgcard .pgcode { font-size: 20px; line-height: 24px; }
.move .pgcard .pgpills { margin-top: 0; justify-content: flex-end; }
.move .pgcard .pgtype { margin-top: 10px; }
.move .pgcard .pgtype label { gap: 2px; font-size: 13px; }
.move .pgcard .pgtype select { min-height: 42px; }
/* required outline softened: a lighter red, no glow */
:root { --need: #e7a39b; }
:is(input, select, textarea):required:invalid { border: 1.5px solid var(--need) !important; box-shadow: none; background-color: #fffafa; }
.move .scan.need { border-color: var(--need); box-shadow: var(--shadow-card); background: #fffafa; }
/* picked thing: what's inside sits under its location, beside the buttons; a long list scrolls */
.move #items .item > div:first-child { min-width: 0; flex: 1; }
.move #items .nowline { overflow-wrap: anywhere; }
.move #items .inside { margin-top: 6px; }
.move #items .inside .inlist { max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.move #items .inside > summary { list-style-position: inside; }
/* Hide sits at the bottom right of the help text */
.move .hint { align-items: flex-end; }
/* Move list: Flag and remove top right; what's inside runs the full width underneath */
.move #items .item { flex-wrap: wrap; }
.move #items .item > .inside { flex: 1 0 100%; margin-top: 8px; }
/* containers get their own colour (brown, like a crate); packing groups stay violet */
:root { --box: #8a5a2b; --box-soft: #f3e8dc; }
.kind.k-box { background: var(--box); } .kind.k-pg { background: var(--container); }
.side .ico.k-box { background: var(--box); } .side .ico.k-pg { background: var(--container); }
.move .kc.k-box { color: var(--box); } .move .kc.k-pg { color: var(--container); }
.move .destline.k-box { background: var(--box-soft); } .move .destline.k-pg { background: var(--container-soft); }
.move .picked.k-box { border-color: var(--box); background: var(--box-soft); } .move .picked.k-pg { border-color: var(--container); background: var(--container-soft); }
/* the Inside list uses the same coloured type badges as everywhere else */
.move .inside .kcounts { flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.move .inrow .kind { margin-left: 6px; }
.move .inside .kcounts { display: flex; margin: 4px 0 0 18px; }
/* status bar: plain status + Show history; history panel under the bar */
.move .syncbar .syncstate { font-weight: 600; }
.move #devsec { margin-top: 0 !important; margin-bottom: 14px; }
.move #devsec .hhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.move #devsec .hhead h2 { margin: 0 0 4px; font-size: 20px; }
.move #devsec .hsec { margin-top: 14px; }
.move #devsec .hsec h3 { font-size: 15px; margin: 0 0 6px; }
.move #devsec .warnsec { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; }
.move #devsec .hday { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #5b6470); margin: 10px 0 2px; }
.move #devsec .hrow {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.move #devsec .hrow:last-child { border-bottom: 0; }
.move #devsec .hico { text-align: center; color: var(--muted, #5b6470); }
.move #devsec .htxt { min-width: 0; overflow-wrap: anywhere; }
.move #devsec .htime { font-size: 13px; color: var(--muted, #5b6470); font-variant-numeric: tabular-nums; }
/* history: its own full screen, Back to close */
.move #devsec.sheet { position: fixed; inset: 0; z-index: 200; margin: 0 !important; border-radius: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface-page, #f3f4f6); padding: calc(14px + env(safe-area-inset-top)) 16px 40px; box-shadow: none; }
.move #devsec.sheet .hhead { display: flex; align-items: center; gap: 12px; justify-content: flex-start; position: sticky; top: -14px; background: var(--surface-page, #f3f4f6); padding: 6px 0 8px; z-index: 1; }
.move #devsec.sheet .hhead h2 { margin: 0; }
.move #devsec.sheet .hsec:not(.warnsec) { background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-card); }
body.histopen { overflow: hidden; }
.move .syncbar { flex-wrap: wrap; row-gap: 4px; }
.move .syncbar #hist { margin-left: 4px; }
.move .syncbar #syncnow { margin-left: auto; }
.move #devsec .hrow { align-items: start; } .move #devsec .hrow .htime, .move #devsec .hrow .tag { margin-top: 1px; }
.move .trackline { margin-top: 4px; color: var(--container); font-weight: 600; }

/* iOS home-screen app: with viewport-fit=cover the page's full height comes up short by the status-bar height,
   which left a strip below the bottom bar (WebKit 237961). Adding the top inset back makes it reach the bottom. */
@media (display-mode: standalone) {
  html:has(#root > .move), body:has(#root > .move) { height: calc(100% + env(safe-area-inset-top)); min-height: calc(100% + env(safe-area-inset-top)); }
  #root:has(> .move) { height: calc(100% + env(safe-area-inset-top)); }
}
.sugg .sfoot { position: sticky; bottom: 0; padding: 10px 14px; text-align: center; background: #f4f5f8; border-top: 1px solid var(--line); cursor: default; }
/* the app's own yes/no dialog (ask / askText in common.js) */
.askdlg { width: min(440px, 92vw); }
.askdlg .askmsg { white-space: pre-line; font-size: 16px; line-height: 1.45; }
.askdlg .dfoot .btn.danger { background: var(--problem); border-color: var(--problem); color: #fff; }
.askdlg label { display: grid; gap: 6px; font-weight: 600; }
.askdlg .dhead + .dfoot { border-top: 0; }
/* a record named anywhere in the CMS: in its kind's colour (location blue, collection group orange, item teal,
   packing group violet, container brown) - see recLink() */
a.rl { font-weight: 600; text-decoration-thickness: 1px; }
a.rl.k-loc { color: var(--location); } a.rl.k-grp { color: var(--group); } a.rl.k-itm { color: var(--item); }
a.rl.k-pg { color: var(--container); } a.rl.k-box { color: var(--box); }
/* phone: a pop-up message while the confirmation strip is showing goes underneath it, not on top of it */
body:has(.move #pnotice .notice) #toasts { top: calc(env(safe-area-inset-top) + 140px); }
/* a kind colour inside a heading or label colours the words only: same size and weight as the text around them */
.move h2 .kc, .move .scanlab .kc, .move label .kc { font-size: inherit; font-weight: inherit; }
.move .iacts .btn { white-space: nowrap; }
/* the location's action buttons stack on narrow phones rather than running off the screen */
@media (max-width: 359px) { .move .lochead .locacts { grid-template-columns: 1fr; } }
@media (max-width: 359px) { .move > header .btn.sm { padding-left: 9px; padding-right: 9px; font-size: 14px; } .move > header .row { gap: 6px; } }

/* =====================================================================================================================
   Interaction states, one system for the CMS and the phone app.
   Every control shows: hover (mouse/trackpad devices only, so it never "sticks" on a phone), pressed, keyboard focus
   (a clear ring, shown only when using the keyboard) and disabled.
   Kinds of control, so an action never looks like a toggle or a tag:
     .btn.primary  the main action (filled)          .btn  another action (CMS: outlined in green)
     .btn.danger   deletes / removes (red)            .tog  on/off choice (grey pill)       .tag  label, not clickable
   ===================================================================================================================== */

/* keyboard focus: the same visible ring on anything you can tab to */
:where(a, button, summary, select, input[type=checkbox], input[type=radio], [tabindex]:not([tabindex="-1"]), .opt):focus-visible {
  outline: 3px solid var(--primary); outline-offset: 2px; }
:where(input, select, textarea):focus-visible { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.tog:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* pressed: a small push so taps and clicks feel registered, on phones too */
:where(.btn, .tog, .modes button, .move .loccard, .move .rolecard, .move .pick, .workcard, .tile, .linkbtn):active:not(:disabled) {
  transform: translateY(1px); }
.btn:active:not(:disabled) { filter: brightness(.94); }
.btn, .tog, .tile, .workcard, .move .loccard, .move .pick, .side a, tbody tr.click, .modes button {
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s, transform .06s; }

/* disabled: clearly not available, and nothing reacts to it */
.btn:disabled, .tog:disabled, button:disabled { cursor: not-allowed; opacity: .5; }

/* everything clickable gets the hand pointer */
:where(button, summary, select, label.chk, input[type=checkbox], input[type=radio], th[data-s]:not([data-s=""]), tbody tr.click,
       [data-open], [data-go], .opt, .chip button, .tile, .workcard) { cursor: pointer; }

/* --- CMS: actions look like actions --- */
.shell .btn:not(.primary):not(.danger):not(.cam) { color: var(--primary); border-color: var(--primary); background: var(--surface-card); }
.shell .btn.danger { color: var(--problem); border-color: var(--problem); }

@media (hover: hover) {
  /* buttons */
  .btn:hover:not(:disabled) { border-color: var(--ink); background: var(--surface-page); }
  .btn.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); box-shadow: 0 2px 8px rgba(11,110,79,.25); }
  .btn.danger:hover:not(:disabled) { background: var(--problem); border-color: var(--problem); color: #fff; }
  .shell .btn:not(.primary):not(.danger):hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary-hover); color: var(--primary-hover); }
  .btn.cam:hover { background: var(--primary-soft); }
  /* toggles and choices */
  .tog:hover:not(:disabled):not(.on) { border-color: var(--ink); background: var(--surface-page); }
  .tog.on:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
  .modes button:hover:not(.on) { border-color: var(--line-strong); background: var(--surface-page); }
  /* links and text buttons */
  a:hover { text-decoration-thickness: 2px; }
  a.rl:hover { text-decoration: underline; text-decoration-thickness: 2px; }
  .linkbtn:hover { color: var(--primary); text-decoration-style: solid; }
  .tabs a:hover:not(.on) { color: var(--ink); border-bottom-color: var(--line-strong); }
  .side a:hover:not(.on) { background: var(--surface-sunk); }
  .chip button:hover { color: var(--problem); }
  /* rows, cards and lists */
  tbody tr.click:hover { background: var(--primary-soft); }
  th[data-s]:not([data-s=""]):hover { background: var(--surface-sunk); color: var(--ink); }
  .tile:hover, a.tile:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
  .workcard:hover { border-color: var(--primary); }
  .move .loccard:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
  .move .rolecard:hover { border-color: var(--primary); }
  .move .pick:hover:not(.on) { border-color: var(--line-strong); background: var(--surface-page); }
  .ref-results div:hover, .sugg .opt:hover { background: var(--primary-soft); }
  /* form fields: show they can be typed in */
  :where(input:not([type=checkbox]):not([type=radio]), select, textarea):hover:not(:focus):not(:disabled):not([readonly]) { border-color: var(--ink); }
  label.chk:hover { color: var(--primary); }
  summary:hover { color: var(--primary); }
}
/* sortable column headers: the whole header is a button */
th[data-s] { padding: 0 !important; }
.thbtn { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; cursor: pointer; font: inherit; font-weight: 700; color: inherit; white-space: nowrap; }
.thbtn .sarr { font-size: 12px; color: var(--ink-muted); opacity: .45; }
.thbtn.on { color: var(--primary); } .thbtn.on .sarr { opacity: 1; color: var(--primary); }
.thbtn:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
@media (hover: hover) { .thbtn:hover { background: var(--surface-sunk); color: var(--ink); } .thbtn:hover .sarr { opacity: 1; } }
/* advanced search */
.filters .advhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.filters .advhead h2 { margin: 0; font-size: 20px; }
.advrow { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(200px, 2fr) auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.advrow .av { display: flex; gap: 8px; min-width: 0; } .advrow .av[hidden] { display: flex; visibility: hidden; }
.advrow [data-rm] { justify-self: end; }
/* the rows stack when the panel itself is narrow (tablets, or a narrow window), whatever the screen size */
.filters { container-type: inline-size; }
@container (max-width: 700px) { .advrow { grid-template-columns: 1fr auto; } .advrow .ao, .advrow .av { grid-column: 1; } .advrow [data-rm] { grid-column: 2; grid-row: 1; } }

/* tablets and narrow windows: one column with the menu bar across the top (an earlier rule set two columns always) */
@media (max-width: 800px) { .shell { grid-template-columns: 1fr; } }
/* list cells holding a place and what it's packed in wrap rather than cut the tag off */
.tablewrap table td.wrapcell { white-space: normal; min-width: 180px; }
.tablewrap table td.wrapcell .tag { white-space: nowrap; }
