/* Shakedown. Light and dark follow the system; nothing is fetched. */
:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --ink: #1d1d1f;
  --ink-2: #57575c;
  --ink-3: #8a8a8f;
  --line: #d9d9de;
  --line-2: #ececf0;
  --accent: #0a64d6;
  --accent-soft: rgba(10, 100, 214, 0.12);
  --pass: #1f7a3a;
  --pass-soft: rgba(31, 122, 58, 0.13);
  --fail: #b3261e;
  --fail-soft: rgba(179, 38, 30, 0.12);
  --partly: #9a5b00;
  --partly-soft: rgba(154, 91, 0, 0.14);
  --sim-bg: #e9e9ee;
  --sim-pane: #ffffff;
  --sim-lit: #ffd84d;
  --sim-lit-soft: rgba(255, 196, 0, 0.28);
  /* The dot's four colours (the order of 2026-10-13): true green, orange,
     red, and white with an edge. */
  --dot-white: #ffffff;
  --dot-edge: #8a8a8f;
  --dot-green: #28a745;
  --dot-orange: #f08c00;
  --dot-red: #e0342b;
  --match: #0a64d6;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --panel: #242426;
    --panel-2: #2c2c2e;
    --ink: #f2f2f7;
    --ink-2: #b4b4bb;
    --ink-3: #8a8a90;
    --line: #3a3a3e;
    --line-2: #323236;
    --accent: #4c9bff;
    --accent-soft: rgba(76, 155, 255, 0.18);
    --pass: #4fc46f;
    --pass-soft: rgba(79, 196, 111, 0.16);
    --fail: #ff6b60;
    --fail-soft: rgba(255, 107, 96, 0.16);
    --partly: #f0a83c;
    --partly-soft: rgba(240, 168, 60, 0.18);
    --sim-bg: #161618;
    --sim-pane: #2a2a2d;
    --sim-lit: #ffcf33;
    --sim-lit-soft: rgba(255, 207, 51, 0.22);
    --dot-white: #f2f2f7;
    --dot-edge: #9a9aa0;
    --dot-green: #30d158;
    --dot-orange: #ff9f0a;
    --dot-red: #ff453a;
    --match: #4c9bff;
  }
}
@media (prefers-contrast: more) {
  :root { --line: #8a8a8f; --ink-2: var(--ink); --ink-3: var(--ink-2); }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
button:hover { border-color: var(--ink-3); }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.quiet { border-color: transparent; background: transparent; }
button.quiet:hover { background: var(--line-2); }
button.linkish { border: none; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
textarea, input[type=text], select {
  border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 4px 8px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { color: var(--ink-2); font-size: 12.5px; margin: 6px 0; }
.warn { color: var(--partly); font-weight: 600; }
.error { color: var(--fail); font-weight: 600; }
.empty { color: var(--ink-2); padding: 24px; text-align: center; }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }
body.dropping::after {
  content: "Drop the checklist and its map, or a results file"; position: fixed; inset: 12px; border: 3px dashed var(--accent);
  border-radius: 16px; display: grid; place-items: center; font-size: 20px; background: var(--accent-soft); pointer-events: none;
}

/* ---- Start ---- */
.start { max-width: 560px; margin: 8vh auto; padding: 0 16px; }
.start h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: -0.01em; }
.lede { color: var(--ink-2); font-size: 15px; }
.start-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin: 18px 0; display: grid; gap: 6px; }
.start-box label { font-weight: 600; }
.start-box input { font-size: 16px; padding: 7px 10px; }
.start-box button.primary { justify-self: start; padding: 8px 14px; margin-top: 6px; }
.start-box button { justify-self: start; }
/* The first screen with the apps' data: a card per app, then the file way in
   (the cloud session's design). */
.app-cards { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.app-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "go facts" "other other"; gap: 4px 16px; align-items: center;
}
.app-card.under-way { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.app-go { grid-area: go; min-width: 170px; padding: 9px 14px; text-align: left; font-size: 15px; }
.app-go-verb { opacity: 0.85; }
.app-go-name { font-weight: 600; }
.app-facts { grid-area: facts; }
.app-facts p { margin: 1px 0; }
.app-facts .muted { color: var(--ink-2); font-size: 12.5px; }
.run-line { color: var(--accent); font-weight: 600; }
.app-card > button.quiet { grid-area: other; justify-self: start; color: var(--accent); }
.app-card-more { grid-area: other; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.app-card-more button.quiet { color: var(--accent); }
.other-way { margin-top: 28px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.other-way h2 { font-size: 15px; margin: 0; color: var(--ink-2); }
.other-way .start-box { background: transparent; margin-top: 8px; }
@media (max-width: 480px) {
  .app-card { grid-template-columns: 1fr; grid-template-areas: "go" "facts" "other"; }
}
.saved ul { padding-left: 18px; }
.saved li { margin: 6px 0; }

/* ---- Working ---- */
.work-screen { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: clip; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.run-id { display: flex; align-items: center; gap: 10px; }
.app-name { font-weight: 700; font-size: 16px; }
.build-label { color: var(--ink-2); font-size: 12.5px; }
.build { width: 9em; }
.modes { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.modes button { border: none; border-radius: 0; padding: 4px 12px; background: transparent; }
.modes button + button { border-left: 1px solid var(--line); }
.modes button.on { background: var(--accent); color: #fff; }
.show-pick { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.show-pick select.show { font-size: 13px; padding: 2px 6px; }
.progress { display: flex; align-items: center; gap: 8px; min-width: 200px; flex: 1; }
.progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; min-width: 60px; max-width: 220px; }
.progress .fill { height: 100%; background: var(--pass); }
.progress .count { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .has-unread { color: var(--partly); border-color: var(--partly); }
.top .storage-warn { flex-basis: 100%; margin: 0; }

.work { flex: 1; display: flex; min-height: 0; position: relative; }
.dock-right .work { flex-direction: row-reverse; }
.listpanel { flex: 0 0 44%; display: flex; flex-direction: column; min-width: 0; background: var(--panel-2); }
.simpanel { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.divider { flex: 0 0 7px; cursor: col-resize; background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat; }
.divider:hover, .divider:focus-visible { background-color: var(--accent-soft); }
.dock-ghost { position: absolute; top: 0; bottom: 0; width: 44%; background: var(--accent-soft); border: 2px dashed var(--accent); pointer-events: none; }
.dock-ghost[data-side=left] { left: 0; }
.dock-ghost[data-side=right] { right: 0; }

.listhead { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.grip { cursor: grab; color: var(--ink-3); font-size: 16px; padding: 0 4px; user-select: none; touch-action: none; }
.group-pick { flex: 1; min-width: 0; }
.groupinfo { padding: 8px 14px 4px; }
.rows .groupinfo { padding: 6px 4px 6px; }
.group-title { font-size: 15px; margin: 2px 0 0; }
.group-count { color: var(--ink-2); font-size: 12.5px; margin: 2px 0 4px; }
.how { margin: 4px 0; font-size: 13px; }
.bulk {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 10px; padding: 6px 8px;
  border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent);
}
.bulk-count { font-weight: 600; margin-right: 4px; }
.rows { flex: 1; overflow: auto; padding: 4px 10px 40px; }
.pane-heading { margin: 16px 2px 6px; }
.pane-heading h3 { font-size: 13.5px; margin: 0 0 4px; }
.pane-note-box summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.pane-note-editor { display: grid; gap: 6px; margin: 6px 0; }
.pane-note { width: 100%; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin: 8px 0; cursor: default;
}
.card.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card.picked { background: var(--accent-soft); }
.card.answered:not(.current) { opacity: 0.86; }
.card-top { display: flex; align-items: baseline; gap: 8px; }
.pick { margin: 0; transform: translateY(1px); }
.rid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-2); }
.rtitle { font-size: 14px; margin: 0; flex: 1; }
.what { margin: 6px 0; }
.where {
  display: inline-block; text-align: left; font-size: 12.5px; color: var(--ink-2); background: var(--line-2);
  border: none; border-radius: 6px; padding: 2px 8px; margin-bottom: 4px;
}
p.where { background: none; padding: 0; }
.pid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.thing { color: var(--ink-3); }
.meta { font-size: 12px; color: var(--ink-3); margin: 2px 0 6px; }
.verdicts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.v { min-width: 72px; }
.v-passed.on { background: var(--pass); border-color: var(--pass); color: #fff; }
.v-failed.on { background: var(--fail); border-color: var(--fail); color: #fff; }
.v-partly.on { background: var(--partly); border-color: var(--partly); color: #fff; }
.bulk .v-passed { color: var(--pass); }
.bulk .v-failed { color: var(--fail); }
.bulk .v-partly { color: var(--partly); }
.addr-label { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; color: var(--ink-2); cursor: pointer; }
.card.kept { opacity: 0.6; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fields textarea { width: 100%; resize: none; min-height: 30px; overflow: hidden; }

/* A row's parts (B-18), unfolded under the card, each with its own box and dot */
.parts { margin: 2px 0 6px; }
.parts-toggle { border: none; background: none; padding: 2px 0; color: var(--accent); font-size: 12.5px; cursor: pointer; }
.parts-toggle .disclosure { display: inline-block; width: 1em; }
.part-list { list-style: none; margin: 4px 0 0; padding: 0 0 0 18px; display: grid; gap: 2px; border-left: 2px solid var(--line-2); }
.part { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.part .mdot { width: 26px; height: 26px; }
.part .mdot::before { width: 16px; height: 16px; }
.part .mdot::after { font-size: 10px; }
.part-text { flex: 1; min-width: 0; }
.part.answered .part-text { color: var(--ink-2); }

/* ---- The simulated window ---- */
.simhead { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.sim-pick { max-width: 60%; }
.sim-name { font-weight: 600; }
.spacer { flex: 1; }
.scale { display: inline-flex; align-items: center; gap: 2px; }
.scale-now { min-width: 52px; font-variant-numeric: tabular-nums; }
.simscroll { flex: 1; overflow: auto; padding: 12px; background: var(--bg); }
.simhost { position: relative; margin: 0 auto; }
.sim { transform-origin: 0 0; position: absolute; top: 0; left: 0; }
.simpanel { position: relative; }
/* Where the map came from: small, in the drawing's corner, so nothing sits
   between the drawing and the list (App Claude's proposal, 2026-10-13). */
.sim-foot {
  position: absolute; right: 8px; bottom: 6px; max-width: calc(100% - 16px); margin: 0; padding: 2px 8px;
  font-size: 10.5px; color: var(--ink-3); background: color-mix(in srgb, var(--panel) 85%, transparent);
  border: 1px solid var(--line-2); border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.sim-frame {
  width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--sim-bg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.sim-titlebar { flex: 0 0 26px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sim-titlebar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.sim-title { margin-left: 8px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-body { flex: 1; display: flex; padding: 4px; min-height: 0; }
.sim-body > * { flex: 1 1 0; }
.sim-row, .sim-column { display: flex; gap: 4px; min-width: 0; min-height: 0; }
.sim-row { flex-direction: row; }
.sim-column { flex-direction: column; }
.sim-pane {
  min-width: 72px; min-height: 52px; overflow: hidden; display: flex; flex-direction: column;
  background: var(--sim-pane); border: 1px solid var(--line); border-radius: 5px;
}
.sim-pane.lit { border: 3px solid var(--sim-lit); box-shadow: 0 0 0 3px var(--sim-lit-soft); }
.sim-pane.missing { color: var(--fail); font-size: 12px; padding: 6px; }
.sim-pane.flash { animation: flash 0.8s ease-out 2; }
@keyframes flash { 50% { background: var(--sim-lit-soft); } }
@media (prefers-reduced-motion: reduce) { .sim-pane.flash { animation: none; outline: 3px dashed var(--sim-lit); } }
.sim-pane-head {
  display: flex; align-items: baseline; gap: 6px; border: none; border-bottom: 1px solid var(--line-2); border-radius: 0;
  background: transparent; padding: 3px 6px; text-align: left; width: 100%; font-size: 12px;
}
.sim-pane-head:hover { background: var(--accent-soft); }
.sim-pane-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; color: var(--ink-3); }
.sim-pane-name { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-count { font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sim-count.all-done { color: var(--pass); }
.sim-noted { font-size: 11px; color: var(--partly); }
.sim-things { list-style: none; margin: 0; padding: 2px 3px; overflow: hidden; flex: 1; position: relative; }
.sim-thing {
  display: flex; gap: 4px; width: 100%; text-align: left; border: none; border-radius: 3px; background: transparent;
  padding: 1px 3px; font-size: 10.5px; line-height: 1.25; color: var(--ink-2);
}
.sim-thing:hover { background: var(--accent-soft); color: var(--ink); }
.sim-thing.no-rows { color: var(--ink-3); }
.sim-thing.lit { background: var(--sim-lit); color: #1d1d1f; font-weight: 600; }
.sim-thing-n { flex: 0 0 auto; min-width: 12px; font-weight: 700; color: inherit; font-variant-numeric: tabular-nums; }
.sim-thing span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Dialogs ---- */
dialog.sheet { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; max-width: min(720px, 92vw); max-height: 80vh; background: var(--panel); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.3); }
dialog.sheet h2 { margin: 0 0 10px; font-size: 17px; }
dialog.sheet h3 { font-size: 14px; margin: 12px 0 4px; }
.sheet-foot { text-align: right; margin-top: 14px; }
.unread-list { margin: 0; padding-left: 18px; font-size: 12.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.unread-list li { margin: 3px 0; word-break: break-word; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.keys dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.keys dd { margin: 0; color: var(--ink-2); }

/* ---- An iPad's width and under: the list over the window ---- */
@media (max-width: 900px) {
  .work, .dock-right .work { flex-direction: column; }
  /* Stacked, each part keeps its own share and scrolls inside it; the page
     itself never scrolls (Jason, 2026-10-13, at about 885 x 625: the
     drawing took nearly all the height, the list was cut off). A flex item
     won't shrink below its contents unless it may (min-height: 0), and the
     list's own parts are kept inside it (overflow: hidden). */
  .listpanel { flex: 1 1 auto !important; min-height: 0; overflow: hidden; }
  .divider { display: none; }
  .simpanel { flex: 0 0 38vh; min-height: 0; border-top: 1px solid var(--line); order: -1; }
  .simscroll { min-height: 0; }
  .fields { grid-template-columns: 1fr; }
  .progress { min-width: 140px; }
}

/* Counts from a test build (ShakedownKit): Tried is a hint, never a verdict. */
.sim-pane.used { background-image: linear-gradient(rgba(255, 140, 0, var(--heat)), rgba(255, 140, 0, var(--heat))); }
.sim-used { margin-left: auto; font-size: 11px; color: var(--ink-2); }
table.counts { border-collapse: collapse; width: 100%; margin: 4px 0 12px; font-size: 13px; }
table.counts th, table.counts td { text-align: left; padding: 3px 8px; border-bottom: 1px solid var(--line-2); }
.counts-body h3 { margin: 14px 0 4px; font-size: 14px; }

/* ---- Hosted (spec/hosted.md): only drawn when served, never from a file ---- */
.conn { font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-2); }
.conn::before { content: "●"; margin-right: 5px; }
.conn-live { color: var(--pass); border-color: var(--pass); }
.conn-connecting { color: var(--ink-2); }
.conn-offline { color: var(--partly); border-color: var(--partly); }
.send-phone { white-space: nowrap; color: var(--accent); }
.sign-in input { width: 100%; }
.hosted-foot { margin-top: 28px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.keys-box summary { cursor: pointer; font-weight: 600; }
.key-list { padding-left: 18px; }
.key-list li { margin: 4px 0; }
.key-new { display: flex; gap: 6px; flex-wrap: wrap; }
.key-made { margin: 10px 0; }
.key-line { white-space: pre-wrap; word-break: break-all; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 12px; }
.signed-in { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ctx {
  position: fixed; z-index: 50; min-width: 220px; display: grid; padding: 4px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.ctx button { border: none; text-align: left; padding: 6px 10px; border-radius: 5px; background: transparent; }
.ctx button:hover, .ctx button:focus-visible { background: var(--accent); color: #fff; outline: none; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 13px; transition: opacity 0.2s, transform 0.2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.undo-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 61;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); padding: 6px 6px 6px 14px; border-radius: 10px; font-size: 14px; transition: opacity 0.2s, transform 0.2s;
}
.undo-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.undo-btn { border: none; border-radius: 7px; padding: 8px 14px; min-height: 36px; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .undo-toast { transition: none; } }
.shake-on { border: none; background: none; color: color-mix(in srgb, var(--bg) 80%, transparent); font-size: 12px; text-decoration: underline; padding: 6px 4px; min-height: 36px; }
.undo-toast:has(.shake-on) { flex-wrap: wrap; }
.ask-sheet { max-width: min(420px, 92vw); }
.ask-text { margin: 0 0 14px; font-size: 15px; line-height: 1.4; }
.ask-sheet .sheet-foot { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 600px) {
  .hosted .start { margin: 4vh auto; }
  .hosted .start-box input, .hosted .start-box button { min-height: 44px; }
  .hosted .app-go { min-height: 48px; }
  .hosted dialog.sheet { max-width: 94vw; width: 94vw; }
  .hosted dialog.sheet .sheet-foot button { min-height: 44px; min-width: 88px; }
}

/* ---- The box and the dot (js/marks.js): both screens ---- */
/* The dot is drawn small inside a larger button, so it's easy to hit. A
   colour wears a mark too (✓, ~, ✕), so it never rests on colour alone. */
.mdot {
  flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer;
}
.mdot::before {
  content: ""; grid-area: 1 / 1; width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
  background: var(--dot-white); border: 2px solid var(--dot-edge);
}
.mdot::after { grid-area: 1 / 1; font-size: 12px; font-weight: 800; line-height: 1; color: #fff; }
.mdot-green::before { background: var(--dot-green); border-color: var(--dot-green); }
.mdot-orange::before { background: var(--dot-orange); border-color: var(--dot-orange); }
.mdot-red::before { background: var(--dot-red); border-color: var(--dot-red); }
.mdot-green::after { content: "✓"; }
.mdot-orange::after { content: "!"; font-weight: 800; }
.mdot-red::after { content: "✕"; }
.mdot.tried::before { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px color-mix(in srgb, var(--match) 45%, transparent); }
.mdot:hover { background: var(--line-2); }
input.addr { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.card-top .mdot { margin-left: auto; }

/* Search, Show and Sort, at the top of the list */
.listtools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.listtools .search { flex: 1 1 160px; min-width: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: 4px 8px; font: inherit; }
.sort-pick { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.listtools.narrowed .search:not(:placeholder-shown), .listtools.narrowed .show { border-color: var(--match); box-shadow: 0 0 0 1px var(--match); }

/* A filter or search on: the panes holding what it picks out are lit, the rest stand back */
.sim-pane.match { border: 2px solid var(--match); box-shadow: 0 0 0 3px color-mix(in srgb, var(--match) 25%, transparent); }
.sim.filtering .sim-pane:not(.match):not(.lit) { opacity: 0.45; }

.bulk .v-white { color: var(--ink-2); }
.batch-note-box { display: grid; gap: 10px; min-width: min(420px, 80vw); }
.batch-note-box textarea { width: 100%; font-size: 16px; padding: 8px 10px; border-radius: 8px; }

/* ---- The phone as an iPhone app (the order of 2026-10-13, 01:30) ----
   A stack of levels, each with a bar floating over what scrolls beneath,
   inset grouped lists as Settings has them, Mail's swipe actions. Sizes in
   rem: the phone's own text size where Safari gives it (-apple-system-body). */
html:has(.phone-screen) { font-size: 17px; scroll-padding-top: 120px; scroll-padding-bottom: 120px; }
html.ios-type:has(.phone-screen) { font: -apple-system-body; }
:root {
  --ios-bg: #f2f2f7; --ios-cell: #ffffff; --ios-sep: rgba(60, 60, 67, 0.29); --ios-ink-2: rgba(60, 60, 67, 0.6);
  --ios-tint: #007aff; --ios-fill: rgba(118, 118, 128, 0.12); --ios-bar: rgba(249, 249, 249, 0.78); --ios-destructive: #ff3b30;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ios-bg: #000000; --ios-cell: #1c1c1e; --ios-sep: rgba(84, 84, 88, 0.6); --ios-ink-2: rgba(235, 235, 245, 0.6);
    --ios-tint: #0a84ff; --ios-fill: rgba(118, 118, 128, 0.24); --ios-bar: rgba(22, 22, 24, 0.78); --ios-destructive: #ff453a;
  }
}
body:has(.phone-screen) { background: var(--ios-bg); }
.phone-screen {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--ios-bg);
  font-size: 1rem; line-height: 1.3; touch-action: pan-y pinch-zoom;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.phone-screen button { font: inherit; color: inherit; }

/* The floating layer: the bar, and the search field with it */
.ios-top {
  position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top);
  background: var(--ios-bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 0.15s;
}
.ios-top.has-large:not(.scrolled) { background: var(--ios-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ios-top.scrolled { box-shadow: 0 0.5px 0 var(--ios-sep); }
.ios-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-height: 44px; padding: 0 8px; }
.ios-bar-side { display: flex; align-items: center; gap: 2px; min-width: 0; }
.ios-bar-right { justify-content: flex-end; }
.ios-title { font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; padding: 0 4px; transition: opacity 0.15s; }
.ios-top.has-large:not(.title-shown) .ios-title { opacity: 0; }
.ios-back, .ios-barbtn {
  border: none; background: transparent; color: var(--ios-tint); min-height: 44px; min-width: 44px; padding: 0 8px;
  display: inline-flex; align-items: center; gap: 2px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.ios-back { padding-left: 0; max-width: 100%; }
.ios-back-text { overflow: hidden; text-overflow: ellipsis; }
.ios-barbtn.strong { font-weight: 600; }
.ios-barbtn:disabled { color: var(--ios-ink-2); opacity: 0.5; cursor: default; }
.ios-back:hover, .ios-barbtn:hover { background: transparent; }
/* Chevrons drawn, not typed: the system's shape at the system's weight */
.ios-chev, .ios-chev-right, .ios-up::before, .ios-down::before, .ios-menu-btn::before {
  content: ""; display: inline-block; width: 0.62em; height: 0.62em; border: solid currentColor; border-width: 0 0 0.16em 0.16em;
}
.ios-chev { transform: rotate(45deg); margin: 0 0.25em 0 0.45em; width: 0.7em; height: 0.7em; }
.ios-chev-right { transform: rotate(-135deg); color: var(--ios-ink-2); flex: 0 0 auto; margin: 0 1rem 0 0.4rem; width: 0.5em; height: 0.5em; border-width: 0 0 0.13em 0.13em; }
.ios-up::before { transform: rotate(135deg) translate(-0.15em, -0.15em); }
.ios-down::before { transform: rotate(-45deg) translate(-0.15em, -0.15em); }
.ios-menu-btn::before {
  width: 1.3em; height: 1.3em; border: 0.1em solid currentColor; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0.09em, transparent 0.1em) 0.28em 50% / 0.38em 0.38em repeat-x;
}
.ios-searchrow { padding: 0 1rem 0.5rem; }
.ios-search {
  width: 100%; min-height: 36px; border: none; border-radius: 10px; background: var(--ios-fill); color: inherit;
  padding: 0 0.6rem 0 2rem; font: inherit; font-size: 1rem;
  background-repeat: no-repeat; background-position: 0.55rem 50%; background-size: 1rem 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='6.8' cy='6.8' r='5'/%3E%3Cpath d='M10.6 10.6 14.5 14.5'/%3E%3C/svg%3E");
}
.ios-filterline { margin: -0.2rem 1rem 0.5rem; font-size: 0.8rem; color: var(--ios-ink-2); }
.ios-link { border: none; background: none; color: var(--ios-tint); padding: 0 0.2rem; min-height: 32px; cursor: pointer; }
.ph-banner { margin: 0; padding: 0.5rem 1rem; background: color-mix(in srgb, var(--ios-tint) 14%, transparent); font-weight: 600; font-size: 0.88rem; }

/* The content: large titles, inset grouped lists */
.ios-content { flex: 1; padding: 0 0 1.5rem; }
.ios-large { font-size: 2rem; font-weight: 700; letter-spacing: 0.01em; margin: 0.1rem 1rem 0.6rem; line-height: 1.15; }
.ios-sub { margin: -0.3rem 1rem 0.8rem; color: var(--ios-ink-2); font-size: 0.88rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.ios-note { margin: 1.2rem 1.25rem; color: var(--ios-ink-2); }
.ios-group { margin: 0 1rem 1.4rem; }
.ios-group-head { margin: 0 1rem 0.4rem; font-size: 0.8rem; font-weight: 400; color: var(--ios-ink-2); text-transform: uppercase; letter-spacing: 0.02em; }
.ios-list { list-style: none; margin: 0; padding: 0; background: var(--ios-cell); border-radius: 10px; overflow: hidden; }
.ios-cell { position: relative; min-height: 44px; background: var(--ios-cell); }
/* Separators inset from the left, as Settings has them */
.ios-cell + .ios-cell::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--ios-sep); z-index: 2; }
.ph-line + .ph-line::before { left: 5.2rem; }
.ios-cell-link {
  display: flex; align-items: center; width: 100%; min-height: 44px; border: none; border-radius: 0; background: transparent;
  padding: 0.6rem 0 0.6rem 1rem; text-align: left; cursor: pointer;
}
.ios-cell-link:active, .ph-name:active { background: var(--ios-fill); }
.ios-cell-text { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.ios-cell-sub { font-size: 0.8rem; color: var(--ios-ink-2); }
.ios-cell-plain { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1rem; }
.ios-cell-plain .ios-cell-title { flex: 1; }
.ios-cell-link.destructive { color: var(--ios-destructive); justify-content: center; padding-left: 0; }
.ios-seg { display: flex; margin: 0 1rem 1rem; padding: 2px; border-radius: 9px; background: var(--ios-fill); }
.ios-seg button { flex: 1; min-height: 32px; border: none; border-radius: 7px; background: transparent; font-size: 0.82rem; font-weight: 500; }
.ios-seg button.on { background: var(--ios-cell); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); font-weight: 600; }
.ios-seg button:disabled { opacity: 0.4; }

/* A section's rows: box, dot, name, chevron; the swipe tiles beneath */
.ph-line { overflow: hidden; }
.cell-front { position: relative; z-index: 1; display: flex; align-items: center; min-height: 44px; background: var(--ios-cell); transition: transform 0.25s ease; }
.ph-line.dragging .cell-front { transition: none; }
.ph-line.current .cell-front { box-shadow: inset 3px 0 0 var(--ios-tint); }
.ph-line.kept .cell-front > :not(.ios-chev-right) { opacity: 0.5; }
.ph-line.picked .cell-front { background: color-mix(in srgb, var(--ios-tint) 12%, var(--ios-cell)); }
.ph-box { flex: 0 0 2.6rem; align-self: stretch; display: grid; place-items: center; cursor: pointer; padding-left: 0.3rem; }
.ph-box input.addr { width: 1.35rem; height: 1.35rem; }
.ph-line .mdot { width: 2.4rem; height: 2.6rem; flex: 0 0 auto; }
.ph-line .mdot::before { width: 1.4rem; height: 1.4rem; }
.ph-line .mdot::after { font-size: 0.8rem; }
.ph-name {
  flex: 1; min-width: 0; align-self: stretch; text-align: left; border: none; border-radius: 0; background: transparent;
  padding: 0.65rem 0.2rem 0.65rem 0.3rem; line-height: 1.25; cursor: pointer;
}
.ph-name .rid { font-size: 0.72rem; color: var(--ios-ink-2); margin-right: 0.2rem; }
.swipe-under { position: absolute; top: 0; bottom: 0; display: flex; visibility: hidden; }
.ph-line.show-left .swipe-under-left, .ph-line.open-right .swipe-under-left { visibility: visible; }
.ph-line.show-right .swipe-under-right, .ph-line.open-left .swipe-under-right { visibility: visible; }
.swipe-under-left { left: 0; right: 0; background: var(--ios-tint); }
.swipe-under-right { right: 0; }
.swipe-under button { border: none; border-radius: 0; color: #fff; font-size: 0.8rem; font-weight: 600; min-width: 64px; padding: 0 0.4rem; cursor: pointer; }
.swipe-tick { background: var(--ios-tint); width: 96px; text-align: left; padding-left: 1rem !important; }
.swipe-white { background: #8e8e93; }
.swipe-green { background: var(--dot-green); }
.swipe-orange { background: var(--dot-orange); }
.swipe-red { background: var(--dot-red); }
.selmark { flex: 0 0 3rem; align-self: stretch; border: none; border-radius: 0; background: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; }
.selmark::before { content: ""; width: 1.4rem; height: 1.4rem; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--ios-ink-2); }
.selmark[aria-checked="true"]::before {
  content: "✓"; background: var(--ios-tint); border-color: var(--ios-tint); color: #fff; font-size: 0.85rem; font-weight: 800;
  display: grid; place-items: center;
}

/* The bottom toolbar: floating, as the bar is */
.ios-toolbar {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  min-height: 44px; padding: 0.25rem 0.75rem calc(0.25rem + env(safe-area-inset-bottom));
  background: var(--ios-bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--ios-sep);
}
.ios-toolbar-text { font-size: 0.75rem; color: var(--ios-ink-2); font-variant-numeric: tabular-nums; }
.ios-toolbar .conn { font-size: 0.7rem; }
.show-laptop::after { content: " ↗"; }
.ph-batch { display: grid; gap: 0.25rem; }
.ph-batch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem; }
.ph-batch-colour { flex: 0 0 44px; min-width: 44px; min-height: 44px; border: none; border-radius: 8px; background: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; }
.ph-batch-colour .mdot { width: 1.6rem; height: 1.6rem; pointer-events: none; }
.ph-batch-colour:disabled { opacity: 0.4; }
.ph-batch-count { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* The row's page */
.ph-rowpage { display: grid; gap: 1rem; padding: 0.4rem 1rem 1.5rem; align-content: start; }
.ph-row { -webkit-user-select: text; user-select: text; }
.ph-crumb { margin: 0 0 0.3rem; color: var(--ios-ink-2); font-size: 0.8rem; }
.ph-row .rtitle { font-size: 1.4rem; line-height: 1.2; margin: 0 0 0.5rem; font-weight: 700; }
.ph-row .what { margin: 0; line-height: 1.4; }
.ph-row .meta { font-size: 0.8rem; color: var(--ios-ink-2); margin: 0.5rem 0 0; }
.ph-bars { display: grid; border-radius: 10px; overflow: hidden; background: var(--ios-cell); }
.cbar {
  position: relative; display: flex; align-items: center; gap: 0.75rem; min-height: 50px; padding: 0 1rem; border: none; border-radius: 0;
  background: var(--ios-cell); font-weight: 600; text-align: left; cursor: pointer;
}
.cbar + .cbar::before { content: ""; position: absolute; top: 0; left: 3.2rem; right: 0; height: 0.5px; background: var(--ios-sep); }
.cbar .mdot { width: 1.6rem; height: 1.6rem; pointer-events: none; }
.cbar-green.on { background: color-mix(in srgb, var(--dot-green) 16%, var(--ios-cell)); }
.cbar-orange.on { background: color-mix(in srgb, var(--dot-orange) 18%, var(--ios-cell)); }
.cbar-red.on { background: color-mix(in srgb, var(--dot-red) 16%, var(--ios-cell)); }
.cbar-white.on { background: var(--ios-fill); }
.cbar.on::after { content: "✓"; margin-left: auto; color: var(--ios-tint); font-weight: 700; }
.ph-addr { display: flex; align-items: center; gap: 0.75rem; min-height: 50px; padding: 0 1rem; border-radius: 10px; background: var(--ios-cell); font-weight: 600; cursor: pointer; }
.ph-addr input.addr { width: 1.4rem; height: 1.4rem; }
.ph-addr .hint { margin: 0 0 0 auto; font-weight: 400; font-size: 0.75rem; text-align: right; color: var(--ios-ink-2); }
.ph-fields { display: grid; gap: 0.6rem; }
.ph-fields textarea { width: 100%; font: inherit; font-size: 1rem; padding: 0.7rem 0.9rem; border-radius: 10px; border: none; background: var(--ios-cell); color: inherit; resize: vertical; min-height: 4rem; }

/* The Show and Sort menu, a pull-down from the bar */
.ios-menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.ios-menu {
  position: fixed; z-index: 41; top: calc(env(safe-area-inset-top) + 48px); right: 0.75rem; width: min(17rem, 80vw); max-height: 70vh; overflow: auto;
  display: grid; padding: 0.3rem 0; border-radius: 13px; font-size: 1rem;
  background: color-mix(in srgb, var(--ios-cell) 88%, transparent); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22), 0 0 0 0.5px var(--ios-sep);
}
.ios-menu-head { margin: 0.4rem 1rem 0.1rem; font-size: 0.75rem; color: var(--ios-ink-2); }
.ios-menu-item { display: flex; align-items: center; gap: 0.3rem; min-height: 44px; border: none; border-radius: 0; background: transparent; padding: 0 1rem 0 0.4rem; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.ios-menu-item:focus-visible, .ios-menu-item:hover { background: var(--ios-fill); outline: none; }
.ios-menu-check { width: 1.4rem; text-align: center; font-weight: 600; }

/* A row's parts on the phone (B-18): "▸ 4 parts" under the name; unfolded,
   indented beneath it as Reminders' subtasks */
.ph-namecol { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.ph-namecol .ph-name { flex: 1 0 auto; align-self: stretch; }
.ph-namecol:has(.parts-toggle) .ph-name { padding-bottom: 0.1rem; }
.ph-line .parts-toggle { align-self: flex-start; min-height: 32px; padding: 0 0.3rem 0.35rem; color: var(--ios-tint); font-size: 0.8rem; }
.ph-line, .ph-part { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ph-part .cell-front { padding-left: 2.4rem; min-height: 40px; }
.ph-part .mdot { width: 2.2rem; height: 2.4rem; }
.ph-part .mdot::before { width: 1.15rem; height: 1.15rem; }
.ph-part .ph-name { font-size: 0.92rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.ios-cell.ph-part::before, .ph-line + .ph-part::before { left: 4.6rem; }

/* Long-press: the row's preview, with quick actions under it, as Mail's */
.ios-preview-backdrop {
  position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
/* A tap anywhere but the card or the actions closes it, as on iOS: the
   preview's own empty space lets taps through to the backdrop (Jason,
   2026-10-13: "it wouldn't let me exit by tapping outside of the boxes"),
   and the backdrop is marked tappable for iPhone Safari. */
.ios-preview-backdrop { cursor: pointer; }
.ios-preview { pointer-events: none; }
.ios-preview > * { pointer-events: auto; }
.ios-preview {
  position: fixed; z-index: 45; left: 1rem; right: 1rem; top: calc(env(safe-area-inset-top) + 3.5rem);
  max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 5rem); overflow: auto;
  display: grid; gap: 0.6rem; align-content: start;
}
.ios-preview-card { padding: 1rem; border-radius: 14px; background: var(--ios-cell); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22); }
.ios-preview-card .rtitle { font-size: 1.15rem; margin: 0 0 0.4rem; }
.ios-preview-card .what { margin: 0; line-height: 1.4; }
.preview-parts { list-style: none; margin: 0.7rem 0 0; padding: 0.4rem 0 0; display: grid; gap: 0.25rem; border-top: 0.5px solid var(--ios-sep); }
.preview-part { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.preview-part .mdot { width: 1.3rem; height: 1.3rem; cursor: default; }
.preview-part .mdot::before { width: 1rem; height: 1rem; }
.preview-part .mdot::after { font-size: 0.6rem; }
.ios-menu-list {
  justify-self: start; width: min(17rem, 80vw); display: grid; padding: 0.3rem 0; border-radius: 13px;
  background: color-mix(in srgb, var(--ios-cell) 88%, transparent); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22), 0 0 0 0.5px var(--ios-sep);
}
.ios-menu-list .ios-menu-item + .ios-menu-item { border-top: 0.5px solid var(--ios-sep); }
.ios-menu-list .ios-menu-item .mdot { margin-left: auto; width: 1.4rem; height: 1.4rem; pointer-events: none; }
.ios-menu-list .ios-menu-item .mdot::before { width: 1.1rem; height: 1.1rem; }

/* The row's page: its parts as a small checklist, each with four colours */
.ph-partlist { margin: 0; }
.ph-partlist .ios-group-head { margin-top: 0; }
.ph-pagepart { padding: 0.5rem 0.6rem 0.6rem 0.3rem; display: grid; gap: 0.4rem; }
.ph-pagepart-top { display: flex; align-items: flex-start; gap: 0.2rem; }
.ph-pagepart .ph-box { align-self: flex-start; padding-top: 0.15rem; }
.ph-pagepart-text p { margin: 0; }
.ph-pagepart-title { font-weight: 600; }
/* The Inspector (B-20, stage B): what the test build's loupe is on. */
.ph-looking { padding: 0.7rem 1rem; }
.ph-look-state { margin: 0; font-size: 0.78rem; color: var(--ios-ink-2); text-transform: uppercase; letter-spacing: 0.02em; }
.ph-look-name { margin: 0.15rem 0 0; font: 600 1.05rem ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.ph-look-where { margin: 0.2rem 0 0; font-size: 0.85rem; color: var(--ios-ink-2); }
.ph-inspect .ph-inspect-notebtn { color: var(--ios-tint); font-size: 0.95rem; padding: 0; justify-self: start; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ph-pagepart-what { font-size: 0.85rem; color: var(--ios-ink-2); line-height: 1.3; }
.ph-minibars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem; padding-left: 0.3rem; }
.minibar {
  display: flex; align-items: center; justify-content: center; gap: 0.3rem; min-height: 36px; padding: 0 0.3rem;
  border: none; border-radius: 8px; background: var(--ios-fill); font-size: 0.75rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.minibar .mdot { width: 1.1rem; height: 1.1rem; pointer-events: none; }
.minibar .mdot::before { width: 0.95rem; height: 0.95rem; }
.minibar .mdot::after { font-size: 0.55rem; }
.minibar.on { box-shadow: inset 0 0 0 2px var(--ios-tint); }
@media (prefers-reduced-transparency: reduce) {
  .ios-preview-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, 0.45); }
  .ios-menu-list { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--ios-cell); }
}

/* The edge swipe: the page slides, the level above beneath it */
.app.edge-dragging, .app.edge-settling { position: relative; z-index: 10; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18); }
.app.edge-settling { transition: transform 0.22s ease-out; }
.ios-underlay { position: fixed; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; background: var(--ios-bg); }
.ios-underlay > .app { min-height: 100vh; }
.ios-underlay::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.08); }
body:has(.ph-batch) .toast, body:has(.ios-toolbar) .toast, body:has(.ph-batch) .undo-toast, body:has(.ios-toolbar) .undo-toast { bottom: calc(110px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) { .cell-front, .ios-top, .ios-title, .app.edge-settling { transition: none; } }

/* Field promotion (B-11): a suggested green, unticked until he ticks it: a
   pale fill and a dashed edge, so it never reads as his own answer. */
.mdot.suggested::before { background: color-mix(in srgb, var(--dot-green) 28%, transparent); border: 2px dashed var(--dot-green); }
.mdot.suggested::after { content: "✓"; color: var(--dot-green); }
@media (prefers-contrast: more) { .mdot.suggested::before { border-width: 3px; } }

/* Nesting you can see (Jason, 2026-10-13: "grouped box + tint rule"): in the
   phone's lists each row is its own box; a row with parts is bold, and its
   parts sit inside its box, inset on a light tint with a line down their left. */
.ph-lines .ios-list { background: transparent; border-radius: 0; overflow: visible; }
.ph-lines .ph-line { border-radius: 10px; margin-top: 0.5rem; }
.ph-lines .ph-line:first-child { margin-top: 0; }
.ph-lines .ph-line:has(+ .ph-part) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ph-lines .ph-part:not(:has(+ .ph-part)) { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; overflow: hidden; }
.ph-lines .ph-line::before { display: none; }
.ph-line.has-parts .ph-name-text { font-weight: 600; }
.ph-part, .ph-inspect.is-part { background: color-mix(in srgb, var(--ios-tint) 6%, var(--ios-cell)); }
.ph-part .cell-front { background: transparent; }
.ph-part::after, .ph-inspect.is-part::after {
  content: ""; position: absolute; left: 1.5rem; top: 0.35rem; bottom: 0.35rem; width: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--ios-tint) 60%, transparent); z-index: 2; pointer-events: none;
}
.ph-inspect.has-parts .ph-pagepart-title { font-size: 1.02rem; }
.ph-inspect.is-part { padding-left: 2.4rem; }
.ph-inspect.is-part .ph-pagepart-title { font-weight: 500; font-size: 0.95rem; }
@media (forced-colors: active) { .ph-part::after, .ph-inspect.is-part::after { background: CanvasText; } }

/* The loupe lights its rows (B-24): the loupe's orange, a tint and a rule. */
.ph-line.looked .cell-front, .ph-part.looked { background: color-mix(in srgb, #ff9500 16%, var(--ios-cell)); }
.ph-line.looked .cell-front { box-shadow: inset 4px 0 0 #ff9500; }
.card.looked { box-shadow: 0 0 0 2px #ff9500; }
.part.looked { background: color-mix(in srgb, #ff9500 14%, transparent); border-radius: 6px; }
.ph-loupebar {
  display: flex; align-items: center; gap: 0.6rem; width: calc(100% - 2rem); margin: 0.4rem 1rem 0.6rem; padding: 0.55rem 0.8rem;
  border: none; border-radius: 10px; text-align: left; background: color-mix(in srgb, #ff9500 16%, var(--ios-cell)); color: inherit; font-size: 0.9rem;
}
.ph-loupebar-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-loupebar-go { color: var(--ios-tint); font-weight: 600; }
@media (forced-colors: active) { .ph-line.looked .cell-front, .card.looked { outline: 2px solid Highlight; } }

/* Shapes beside colours everywhere (B-26, Jason 2026-10-13): tick, bang,
   cross, so a colour reads in StandBy's red night mode and without colour
   vision. Hidden from VoiceOver (the word is said already). */
.v-passed::before { content: "✓ " / ""; }
.v-partly::before { content: "! " / ""; font-weight: 800; }
.v-failed::before { content: "✕ " / ""; }
.swipe-green::before { content: "✓" / ""; display: block; font-size: 1.1rem; }
.swipe-orange::before { content: "!" / ""; display: block; font-size: 1.1rem; font-weight: 800; }
.swipe-red::before { content: "✕" / ""; display: block; font-size: 1.1rem; }
.swipe-white::before { content: "○" / ""; display: block; font-size: 1.1rem; }

