/* YesInventory: phone first, 390 px is the design width; the laptop is the same, wider. No emoji: SVG marks (YESREEL pass 1). */
:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #15181e; --muted: #626a78; --line: #e3e6eb;
  --accent: #0f6fe0; --accent-ink: #ffffff; --soft: #eaf2fe;
  --good-bg: #e3f6e8; --good-ink: #146c33; --warn-bg: #fff1d6; --warn-ink: #7a4f00; --bad-bg: #fde7e5; --bad-ink: #9d2419; --info-bg: #e8f0fe; --info-ink: #1a4fa3;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --tap: 46px; --gutter: 16px; --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1216; --card: #171b21; --ink: #eef1f5; --muted: #9aa3b2; --line: #2a303a; --accent: #4d8ff2; --soft: #16263d;
    --good-bg: #123a22; --good-ink: #8fe0a8; --warn-bg: #3d2d08; --warn-ink: #ffd27a; --bad-bg: #44160f; --bad-ink: #ffa39b; --info-bg: #142a4d; --info-ink: #9cc1ff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; padding-bottom: calc(84px + var(--sab)); }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }
.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ico.big { width: 28px; height: 28px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); padding-top: var(--sat); }
.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.top h1 { font-size: 18px; line-height: 1.2; margin: 0; flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; } /* the name wraps, never an ellipsis on it (YESREEL c842); a long name steps down to 16 px */
.top h1.long { font-size: 16px; }
.top .sub { font-size: 13px; color: var(--muted); font-weight: 400; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); flex: 0 0 auto; padding: 0; }
.iconbtn:active { background: var(--soft); }

/* cards and rows */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px var(--gutter); margin: 12px 0; }
.card h2 { font-size: 15px; margin: 0 0 8px; color: var(--muted); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.row { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; }
.row .meta { font-size: 13px; color: var(--muted); }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--soft); margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
.row .lt { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--line); flex: 0 0 auto; }
.row .lt.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.qp { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.qty { font-weight: 700; font-size: 20px; line-height: 1; }
.thumbs { display: flex; gap: 4px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.thumbs img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--line); }
.thumbs img.md { width: 56px; height: 56px; border-radius: 8px; }

/* pills: how sure the AI is */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.3; border: 1px solid transparent; }
.pill-counted { background: var(--good-bg); color: var(--good-ink); }
.pill-estimated { background: var(--warn-bg); color: var(--warn-ink); }
.pill-check { background: var(--bad-bg); color: var(--bad-ink); }
.pill-missing { background: var(--bad-ink); color: #fff; }
.pill-info { background: var(--info-bg); color: var(--info-ink); }
.pill-plain { background: var(--soft); color: var(--muted); }
.spills { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.spills .pill { font-size: 14px; padding: 6px 12px; cursor: pointer; }
.spills .pill.on { border-color: currentColor; box-shadow: 0 0 0 2px var(--card) inset; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; width: 100%; }
.btn:active { transform: scale(.99); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.big { min-height: 64px; font-size: 18px; }
.btn.small { width: auto; min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.danger { color: var(--bad-ink); }
.btn[disabled] { opacity: .5; }
.btns { display: flex; gap: 10px; }
.btns .btn { flex: 1; min-width: 0; }
.btns .btn.big { padding: 10px 10px; font-size: 17px; }
.btns .btn.tight { font-size: 15px; padding: 10px 8px; }
.btns .btn.iconly { flex: 0 0 54px; padding: 10px 0; }
.btns .btn.fit { flex: 0 0 auto; width: auto; }

/* chips: wrap, never a cut chip (YESREEL A5) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.chip { flex: 0 0 auto; min-height: 38px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.ghost { border-style: dashed; color: var(--muted); font-weight: 500; }

/* forms */
label.f { display: block; margin: 12px 0; }
label.f span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.in { width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
textarea.in { min-height: 72px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 6px 0; }
.tog { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; flex: 0 0 auto; margin: 0; cursor: pointer; }
.tog::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.tog:checked { background: var(--good-ink); }
.tog:checked::after { left: 23px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
details.more { margin: 8px 0; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 8px 0; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }

/* bottom bar */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line); padding: 10px var(--gutter) calc(10px + var(--sab)); }
.bottom .wrap { display: flex; gap: 10px; padding: 0; }
.bottom .btn { flex: 1; }

/* sheets (bottom dialogs) */
dialog.sheet { border: 0; padding: 0; margin: 0; width: 100%; max-width: 640px; max-height: 92vh; background: var(--card); color: var(--ink); border-radius: 18px 18px 0 0; position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; top: auto; box-shadow: 0 -8px 30px rgba(0,0,0,.2); overflow: auto; }
dialog.sheet::backdrop { background: rgba(0,0,0,.35); }
dialog.sheet .body { padding: 8px var(--gutter) calc(16px + var(--sab)); }
dialog.sheet .handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 10px auto 4px; }
dialog.sheet h3 { margin: 8px 0 4px; font-size: 18px; }
.sheet .hint { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.sheet .foot { position: sticky; bottom: 0; background: var(--card); padding: 10px 0 0; margin-top: 8px; border-top: 1px solid var(--line); }

/* bands: one meaning per colour; .note is the grey line for a fact the user cannot act on */
.band { border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 15px; }
.band.warn { background: var(--warn-bg); color: var(--warn-ink); }
.band.good { background: var(--good-bg); color: var(--good-ink); }
.band.info { background: var(--info-bg); color: var(--info-ink); }
.band.bad { background: var(--bad-bg); color: var(--bad-ink); }
.band.note { background: var(--soft); color: var(--muted); font-size: 14px; padding: 8px 12px; }

/* the camera's strip of photos taken so far, each with its state */
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.strip figure { margin: 0; text-align: center; min-width: 0; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--line); display: block; }
.strip figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.strip .pill { font-size: 11px; padding: 2px 7px; }

/* misc */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 36px 8px; }
.marks { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--accent); margin-bottom: 14px; }
.marks .ico { width: 40px; height: 40px; stroke-width: 1.6; }
.marks .arrow { color: var(--muted); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: 90vw; box-shadow: var(--shadow); align-items: center; gap: 16px; white-space: nowrap; }
.toast .undo { background: none; border: 0; color: var(--bg); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 12px 10px; margin: -12px -10px; cursor: pointer; }
.photo-full { width: 100%; border-radius: 12px; background: #000; }
.area-head { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 6px; }
.area-head h2 { flex: 1; font-size: 17px; margin: 0; }
.area-head .count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.ailine a.fold { font-weight: 600; }
.ailine { font-size: 13px; color: var(--muted); margin: 6px 2px 0; line-height: 1.45; }
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .tog::after { transition: none; } }

/* YESREEL pass 2 (4 Nov 2026, John: "go through it and upgrade"): the home's three steps; the rooms strip; room heads that stick under the
   top bar; denser item rows (the proof thumbnails on one line with "seen in N photos", the note clamped to two lines); bigger proof on the
   item sheet; the filter said in words. Colours and sizes only; the pills keep their meanings. */
.empty.lead { padding: 22px 8px 4px; }
.howto { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 14px; }
.howto li { display: flex; gap: 12px; align-items: flex-start; }
.howto .n { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.howto .n svg { width: 22px; height: 22px; }
.howto b { display: block; font-size: 16px; line-height: 1.3; }
.howto .w { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.rooms { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.rooms .chip { display: inline-flex; align-items: center; text-decoration: none; min-height: 36px; padding: 6px 12px; font-size: 14px; font-weight: 500; color: var(--ink); }
.rooms .chip b { color: var(--muted); font-weight: 600; margin-left: 4px; }
.area-head { position: sticky; top: var(--topbar, 56px); z-index: 2; background: var(--bg); padding: 10px 0 6px; margin: 12px 0 0; scroll-margin-top: var(--topbar, 56px); }
.row .meta.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .proof { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.row .proof img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; background: var(--line); }
.thumbs.proofbig img.md { width: 88px; height: 88px; border-radius: 10px; }
.filterline { margin: 0 0 6px; }

/* Fixtures, fittings and the fabric (John, 4 Nov 2026): the cross-off on a row and the "not on this list" line. */
.row .x { flex: 0 0 40px; width: 40px; height: 40px; margin: 0 -10px 0 -6px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 26px; line-height: 1; padding: 0 0 3px; cursor: pointer; }
.row .x:active { background: var(--soft); }
.offlist { margin: 8px 2px 0; }
