/* SITE by EYASTRA — app styles.
   Professional sibling of HOME: same deep teal / warm paper / brass identity, but built for a site
   manager outdoors — high contrast for daylight, 48–64px touch targets for gloves, one-handed reach
   (primary actions low on the screen), and very little chrome. */
:root {
  --paper: #f2f3ee; --card: #ffffff; --sunk: #e8ebe5; --ink: #10242b; --muted: #4a5e62; --line: #cfd8d5; --line-strong: #8a9c99;
  --night: #0c1b24; --night-2: #163039; --on-night: #f3efe6; --on-night-muted: #b3c4c2;
  --brass: #c9a46d; --brass-2: #dcbc86; --brass-ink: #6f5430;
  --safety: #b3261e; --safety-bg: #fbe8e5; --ok: #1b5b52; --ok-bg: #e0eee9; --high: #7a4f0d; --high-bg: #f6ecd6;
  --focus: #0b5fa5; --radius: 12px; --shadow: 0 1px 2px rgba(12, 27, 36, .07), 0 6px 20px rgba(12, 27, 36, .07);
  --font: var(--ey-font);
  --tabs-h: 66px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1a20; --card: #14262d; --sunk: #102027; --ink: #eef2ee; --muted: #a8bbb7; --line: #2a3f46; --line-strong: #5d7c84;
    --night: #071217; --night-2: #13303a; --brass-ink: #dcbc86; --safety: #ff8f84; --safety-bg: #3b1916; --ok: #7fcab9; --ok-bg: #143631;
    --high: #f0c46a; --high-bg: #3a2d10; --focus: #7fb9ee; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--paper); overflow-x: hidden; }
body.has-tabs { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 12px); }
body.cam-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--card); padding: 10px 14px; z-index: 100; border-radius: 8px; }
.skip:focus { top: 8px; }
.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.fine { color: var(--muted); font-size: 13px; margin: 28px 0 8px; }

main { max-width: 920px; margin: 0 auto; padding: 16px 16px 24px; }
main:focus { outline: none; }
.page-title { font-size: 28px; letter-spacing: -.02em; line-height: 1.15; margin: 8px 0 14px; }
.page-title:focus, h1:focus { outline: none; }
.section-title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; font-weight: 700; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-ink); font-weight: 700; margin: 0 0 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; color: var(--muted); font-weight: 600; }
.back .ic { width: 18px; height: 18px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 18px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: var(--card); color: var(--ink); font-weight: 650; font-size: 16px; text-decoration: none; text-align: center; line-height: 1.15; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--night); border-color: var(--night); color: var(--on-night); }
.btn.primary .ic { color: var(--brass-2); }
.btn.big { min-height: 60px; font-size: 17px; width: 100%; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 14.5px; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { background: var(--safety); border-color: var(--safety); color: var(--paper); }
.btn.danger-quiet { border-color: transparent; background: transparent; color: var(--safety); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 10px; border: 0; background: transparent; color: inherit; flex: none; }
.icon-btn:hover { background: var(--sunk); }
.icon-btn.light { color: #fff; background: rgba(0,0,0,.35); }
.icon-btn.danger { color: var(--safety); }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 12px 4px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.row.end { justify-content: flex-end; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap .field { flex: 1; min-width: 0; }
.row.two > * { flex: 1 1 0; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.tight { gap: 8px; }

/* ---------- fields & chips ---------- */
.field { width: 100%; min-height: 50px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--card); padding: 12px 14px; font-size: 16px; }
textarea.field { resize: vertical; min-height: 64px; }
.field:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.phrases { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 14.5px; font-weight: 600; }
.chip:hover { border-color: var(--line-strong); }
.chip:active { background: var(--sunk); }
.tag { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--sunk); font-size: 14px; font-weight: 600; }
.tag-x { border: 0; background: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.tag-x .ic { width: 16px; height: 16px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 190px; overflow: auto; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .03em; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; }
.pill.safety { background: var(--safety); color: var(--paper); }
.pill.high { background: var(--high-bg); color: var(--high); border: 1px solid currentColor; }
.pill.low { background: var(--sunk); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--sunk); }
.callout.bad { background: var(--safety-bg); color: var(--safety); font-weight: 600; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.empty-hero { background: var(--night); color: var(--on-night); border-radius: 16px; padding: 28px 22px; }
.empty-hero h2 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 4px 0 12px; }
.empty-hero .eyebrow { color: var(--brass-2); }
.empty-hero .muted { color: var(--on-night-muted); margin-bottom: 20px; }
.empty-hero .btn.primary { background: var(--brass); border-color: var(--brass); color: var(--night); }
.empty-hero .btn.primary .ic { color: var(--night); }
.continue-card { display: grid; gap: 6px; text-decoration: none; background: var(--night); color: var(--on-night); border-radius: 16px; padding: 20px 20px 16px; box-shadow: var(--shadow); }
.continue-card .eyebrow { color: var(--brass-2); }
.cc-name { font-size: 24px; letter-spacing: -.01em; line-height: 1.15; }
.cc-ctx { display: flex; align-items: center; gap: 6px; color: var(--on-night-muted); font-weight: 600; }
.cc-ctx .ic { width: 18px; height: 18px; color: var(--brass-2); }
.cc-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.continue-card .cc-stats { color: var(--on-night-muted); }
.stat b { font-size: 15px; }
.stat.safety { color: var(--safety); display: inline-flex; align-items: center; gap: 3px; }
.stat.safety .ic { width: 16px; height: 16px; }
.continue-card .stat.safety { color: #ff9d92; }
.stat.ok { color: var(--ok); }
.continue-card .stat.ok { color: #8fd3c4; }
.cc-go { margin-top: 10px; min-height: 54px; border-radius: 10px; background: var(--brass); color: var(--night); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-weight: 700; font-size: 17px; }
.project-row .pr-main { display: grid; gap: 3px; text-decoration: none; }
.project-row .pr-main strong { font-size: 18px; }
.project-row .pr-main small { color: var(--muted); }
.project-row .row { margin: 10px 0 0; }

/* ---------- setup ---------- */
.block { margin: 22px 0; }
.block-title { display: block; font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.block-title .count { color: var(--muted); font-weight: 500; }
.trade-row { display: grid; grid-template-columns: minmax(0, 10.5em) minmax(0, 1fr); gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.trade-row strong { font-size: 15px; overflow-wrap: anywhere; }
.trade-row .field { min-height: 46px; }
@media (max-width: 420px) { .trade-row { grid-template-columns: minmax(0, 1fr); } }
.sticky-actions { position: sticky; bottom: 0; padding: 12px 0 calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--paper) 30%); }

/* ---------- capture ---------- */
.proj-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 2px 0 12px; }
.proj-name { font-size: 20px; margin: 0; line-height: 1.2; }
.proj-head .cc-stats { color: var(--muted); }
.context { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.context-label { margin: 0 4px 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.context-row { display: flex; gap: 8px; margin-bottom: 8px; }
.context-row .ctx-btn { flex: 1; min-width: 0; }
.ctx-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--paper); text-align: left; }
.ctx-btn > span:not(.ic) { display: grid; min-width: 0; flex: 1; }
.ctx-btn small { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-btn strong { font-size: 20px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-btn > .ic:first-child { color: var(--brass-ink); width: 24px; height: 24px; }
.ctx-btn > .ic:last-child { color: var(--muted); width: 18px; height: 18px; }
.ctx-btn.unset { border-color: var(--brass); border-style: dashed; }
.ctx-btn.small { min-height: 56px; }
.ctx-btn.small strong { font-size: 17px; }
.ctx-next { flex: none; display: grid; justify-items: center; align-content: center; min-width: 76px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--paper); padding: 4px 6px; line-height: 1.05; }
.ctx-next small { font-size: 11px; color: var(--muted); font-weight: 600; }
.ctx-next strong { font-size: 17px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-next .ic { width: 16px; height: 16px; color: var(--brass-ink); }
.capture-actions { display: grid; gap: 10px; margin: 14px 0; }
.shoot { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 112px; border-radius: 18px; border: 0; background: var(--night); color: var(--on-night); box-shadow: var(--shadow); padding: 12px 18px; }
.shoot .ic { width: 44px; height: 44px; color: var(--brass-2); }
.shoot > span:last-child { display: grid; text-align: left; }
.shoot strong { font-size: 24px; letter-spacing: -.01em; }
.shoot small { color: var(--on-night-muted); font-size: 14px; }
.shoot:active { transform: scale(.99); }
.capture-actions .row.two { margin: 0; }
.capture-actions .row.two .btn { min-height: 58px; font-size: 15.5px; padding: 0 10px; }
.sort-card { display: grid; gap: 10px; text-decoration: none; border-color: var(--brass); }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sc-head span { display: inline-flex; align-items: center; gap: 2px; color: var(--brass-ink); font-weight: 700; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; }
.strip img, .strip .thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: var(--sunk); }
.strip-btn { padding: 0; border: 0; background: none; border-radius: 8px; flex: none; }

/* ---------- issue list ---------- */
.issue-list { display: grid; gap: 10px; }
.issue-card { display: flex; gap: 12px; padding: 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); position: relative; min-height: 88px; }
.issue-card.is-safety { border-left: 6px solid var(--safety); }
.issue-card.is-closed { opacity: .78; }
.ic-thumb { width: 76px; height: 76px; border-radius: 8px; object-fit: cover; flex: none; background: var(--sunk); display: grid; place-items: center; color: var(--muted); }
.ic-body { display: grid; gap: 3px; min-width: 0; flex: 1; align-content: start; }
.ic-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ic-top strong { font-size: 16px; }
.ref { font-size: 13px; color: var(--brass-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.ref.big { font-size: 16px; }
.ic-text { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ic-body small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- filters ---------- */
.trade-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.tchip { flex: none; scroll-snap-align: start; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; min-height: 58px; padding: 6px 12px 6px 14px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--card); text-align: left; max-width: 220px; }
.tchip span { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tchip small { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tchip b { grid-column: 2; grid-row: 1 / span 2; min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--sunk); font-size: 14px; font-variant-numeric: tabular-nums; }
.tchip.on { background: var(--night); border-color: var(--night); color: var(--on-night); }
.tchip.on small { color: var(--on-night-muted); }
.tchip.on b { background: var(--brass); color: var(--night); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 12px; }
.fgroup { display: inline-flex; gap: 2px; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--card); font-weight: 650; font-size: 14.5px; max-width: 220px; white-space: nowrap; }
.fbtn .ic { width: 18px; height: 18px; }
.fbtn.on { background: var(--night); color: var(--on-night); border-color: var(--night); }
.fbtn.fx { padding: 0 10px; }
.fbtn.safety .ic { color: var(--safety); }
.fbtn.safety.on { background: var(--safety); border-color: var(--safety); color: var(--paper); }
.fbtn.safety.on .ic { color: var(--paper); }
.seg { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg-btn { border: 0; background: transparent; min-height: 46px; padding: 0 12px; font-weight: 650; font-size: 14.5px; }
.seg-btn + .seg-btn { border-left: 1.5px solid var(--line); }
.seg-btn.on { background: var(--night); color: var(--on-night); }
.seg-btn.high.on { background: var(--high); color: var(--paper); }
.issue-form .seg { display: flex; }
.issue-form .seg-btn { flex: 1; min-height: 52px; font-size: 16px; }
.result-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 6px 0 10px; }
.result-head strong { font-size: 18px; }
.result-head span { color: var(--muted); font-size: 14px; }
.report-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 15; display: flex; gap: 8px; padding: 10px 16px; background: color-mix(in srgb, var(--paper) 92%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.report-bar .btn { flex: 1; min-height: 52px; }
.page.issues { padding-bottom: 84px; }

/* ---------- sort ---------- */
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.group-head > span { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; min-width: 0; }
.group-head > span small { grid-column: 2; color: var(--muted); font-size: 14px; }
.group-head .ic { width: 18px; height: 18px; color: var(--brass-ink); }
.sel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .sel-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.sel-cell { position: relative; }
.sel-tile { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 3px solid transparent; border-radius: 10px; overflow: hidden; background: var(--sunk); position: relative; }
.sel-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sel-tile[aria-pressed="true"] { border-color: var(--brass); }
.sel-mark { position: absolute; top: 6px; left: 6px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); display: grid; place-items: center; color: transparent; }
.sel-mark .ic { width: 18px; height: 18px; }
.sel-tile[aria-pressed="true"] .sel-mark { background: var(--brass); border-color: var(--brass); color: var(--night); }
.zoom { position: absolute; right: 6px; bottom: 6px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; }
.zoom .ic { width: 18px; height: 18px; }
.action-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 16; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border-top: 2px solid var(--brass); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
.action-bar[hidden] { display: none; }
.action-bar { flex-wrap: wrap; }
.action-bar .count { font-weight: 700; margin-right: auto; white-space: nowrap; }
@media (max-width: 480px) { .action-bar .count { flex-basis: 100%; } .action-bar .btn { flex: 1 1 auto; } }
.action-bar .btn { min-height: 50px; padding: 0 12px; }
.empty { text-align: center; padding: 30px 12px; }
.empty p:first-child { font-size: 19px; font-weight: 700; margin: 0 0 6px; }

/* ---------- issue detail ---------- */
.issue-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.issue-title { font-size: 24px; line-height: 1.25; margin: 8px 0 6px; overflow-wrap: anywhere; }
.issue-meta { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 16px; }
.issue-meta .ic { width: 18px; height: 18px; color: var(--brass-ink); }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pg-cell { position: relative; }
.pg-img { display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--sunk); aspect-ratio: 4 / 3; }
.pg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-menu { position: absolute; top: 6px; right: 6px; min-width: 44px; height: 36px; border-radius: 8px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-weight: 800; letter-spacing: .08em; }
.closeout { margin: 22px 0; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1.5px solid var(--line); }
.closeout h2 { margin: 0 0 6px; font-size: 19px; display: flex; align-items: center; gap: 6px; }
.closeout.done { background: var(--ok-bg); border-color: var(--ok); }
.closeout.done h2 { color: var(--ok); }

/* ---------- tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 18; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--night); padding-bottom: var(--safe-b); border-top: 1px solid #22404a; }
.tabs[hidden] { display: none; }
.tab { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; height: var(--tabs-h); color: var(--on-night-muted); text-decoration: none; font-size: 12.5px; font-weight: 650; }
.tab .ic { width: 24px; height: 24px; }
.tab.on { color: var(--on-night); }
.tab.on .ic { color: var(--brass-2); }
.tab.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: var(--brass); border-radius: 0 0 3px 3px; }
.badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 20px; height: 20px; border-radius: 10px; background: var(--brass); color: var(--night); font-size: 12px; display: grid; place-items: center; padding: 0 5px; }

/* ---------- sheets ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -10px 40px rgba(0,0,0,.25); overflow: auto; overscroll-behavior: contain; }
dialog.sheet::backdrop { background: rgba(7, 18, 23, .55); }
dialog.sheet.tall { min-height: 60vh; }
@media (min-width: 700px) { dialog.sheet { margin: auto; max-width: 600px; border-radius: 18px; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-body { padding: 10px 16px calc(18px + var(--safe-b)); display: grid; gap: 12px; }
.sheet-body h2 { margin: 4px 0 0; font-size: 21px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { margin: 0; }
.ctx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row { display: grid; gap: 6px; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.issue-form .phrases { margin: 0; max-height: 132px; overflow: auto; }
.safety-toggle { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--card); text-align: left; }
.safety-toggle > .ic { width: 28px; height: 28px; color: var(--safety); }
.safety-toggle > span:not(.switch):not(.ic) { display: grid; flex: 1; }
.safety-toggle strong { font-size: 17px; }
.safety-toggle small { color: var(--muted); font-size: 13px; }
.switch { width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s; }
.safety-toggle.on { background: var(--safety-bg); border-color: var(--safety); }
.safety-toggle.on small { color: var(--safety); font-weight: 600; }
.safety-toggle.on .switch { background: var(--safety); }
.safety-toggle.on .switch::after { left: 25px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.pick-list { display: grid; gap: 8px; max-height: 52vh; overflow: auto; }
.pick { min-height: 56px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--paper); font-weight: 700; font-size: 16px; text-align: center; overflow-wrap: anywhere; }
.pick.on { background: var(--night); color: var(--on-night); border-color: var(--night); }
.pick.add { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 6px; border-style: dashed; border-color: var(--brass); }
.pick.wide { width: 100%; font-weight: 600; }
.pick.trade { display: grid; text-align: left; padding: 8px 14px; }
.pick.trade small { font-weight: 500; color: var(--muted); font-size: 13.5px; }
.pick.trade.on small { color: var(--on-night-muted); }
dialog.lightbox { background: #000; max-height: 100vh; height: 100%; border-radius: 0; margin: 0; max-width: 100%; }
@media (min-width: 700px) { dialog.lightbox { max-width: 100%; border-radius: 0; } }
dialog.lightbox .sheet-grip { display: none; }
.lb { display: grid; grid-template-rows: 1fr auto; height: 100%; }
.lb-img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.lb-bar { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 8px 8px calc(8px + var(--safe-b)); color: #fff; }
.lb-count { min-width: 60px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- camera ---------- */
.cam { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; border: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
.cam::backdrop { background: #000; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.cam-flash.go { animation: flash .18s ease-out; }
@keyframes flash { from { opacity: .7; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cam-flash.go { animation: none; } }
.cam-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: linear-gradient(rgba(0,0,0,.6), transparent); }
.cam-ctx { display: grid; line-height: 1.15; min-width: 0; text-align: left; background: rgba(0,0,0,.35); border: 1.5px solid rgba(255,255,255,.35); border-radius: 10px; padding: 6px 12px; color: #fff; min-height: 48px; }
div.cam-ctx { border-color: transparent; }
.cam-ctx small { font-size: 11px; letter-spacing: .12em; color: var(--brass-2); font-weight: 700; }
.cam-ctx strong { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-status { position: absolute; left: 0; right: 0; bottom: calc(128px + var(--safe-b)); text-align: center; margin: 0; font-weight: 700; text-shadow: 0 1px 3px #000; }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 16px 20px calc(20px + var(--safe-b)); background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.cam-shutter { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; }
.cam-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.cam-shutter:active span { background: var(--brass-2); transform: scale(.92); }
.cam-last { justify-self: start; width: 58px; height: 58px; border-radius: 10px; border: 2px solid #fff; background: #222 center / cover no-repeat; position: relative; }
.cam-count { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--brass); color: var(--night); font-weight: 800; font-size: 13px; display: grid; place-items: center; padding: 0 5px; }
.cam-done { justify-self: end; min-height: 52px; padding: 0 20px; border-radius: 26px; border: 0; background: var(--brass); color: var(--night); font-weight: 800; font-size: 17px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--safe-b) + 80px); z-index: 70; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px; background: var(--night); color: var(--on-night); padding: 10px 10px 10px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-weight: 600; font-size: 15px; }
.toast.bad { background: var(--safety); color: var(--paper); }
.toast button { min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--brass); background: transparent; color: var(--brass-2); font-weight: 700; }

@media (min-width: 900px) {
  .tabs, .report-bar, .action-bar { padding-left: calc((100vw - 900px) / 2); padding-right: calc((100vw - 900px) / 2); }
  .page-title { font-size: 32px; }
  .capture-actions { grid-template-columns: 1.3fr 1fr; align-items: stretch; }
  .capture-actions .row.two { flex-direction: column; }
  .capture-actions .linkish { grid-column: 1 / -1; justify-self: start; }
  .issue-list { grid-template-columns: 1fr 1fr; }
}
@media print { .tabs, .report-bar, .toasts { display: none !important; } }

/* keep the save button reachable in a long form */
.issue-form > button[type=submit] { position: sticky; bottom: calc(8px + var(--safe-b)); box-shadow: 0 6px 18px rgba(0,0,0,.18); }

/* dark mode: selected/primary states use brass so they stand out from dark surfaces */
@media (prefers-color-scheme: dark) {
  .btn.primary, .tchip.on, .fbtn.on, .seg-btn.on, .pick.on { background: var(--brass); border-color: var(--brass); color: #0c1b24; }
  .btn.primary .ic { color: #0c1b24; }
  .tchip.on small { color: #3a3020; }
  .tchip.on b { background: #0c1b24; color: var(--brass-2); }
  .pill.safety, .fbtn.safety.on, .btn.danger, .toast.bad { color: #1a0806; }
  .fbtn.safety.on .ic { color: #1a0806; }
}

/* ---------- ecosystem pass (2026-09-23): shared shell sits above; SITE-specific pieces below ---------- */
.lede { font-size: 17px; color: var(--muted); max-width: 52ch; }
.sub-title { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px; }
.tag { border: 0; cursor: pointer; padding: 0 12px; gap: 6px; min-height: 40px; color: var(--ink); }
.tag:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.tag small { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--card); color: var(--brass-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.trade-name { display: grid; text-align: left; gap: 1px; min-height: 48px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); }
.trade-name:hover { background: var(--sunk); }
.trade-name strong { font-size: 15px; overflow-wrap: anywhere; }
.trade-name small { font-size: 12px; color: var(--muted); font-weight: 600; }
.warn-text { color: var(--high); font-weight: 650; }
.callout.backup-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; border-left: 4px solid var(--brass); }
.callout.backup-nudge > span { flex: 1 1 220px; font-size: 14.5px; }
.facts { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.steps-list { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.about .block p { max-width: 64ch; }
.pick-areas { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-areas .pick { min-height: 48px; padding: 0 14px; }
.pick.area { background: var(--sunk); border-style: dashed; }
.pick.area.on { background: var(--night); border-style: solid; }
.pick .ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.chip.used { display: inline-flex; align-items: center; gap: 6px; border-color: var(--brass); background: color-mix(in srgb, var(--brass) 14%, var(--card)); }
.chip.used .ic { width: 15px; height: 15px; color: var(--brass-ink); }
.repeat-btn { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-radius: 12px; border: 1.5px dashed var(--brass); background: var(--card); color: var(--ink); text-align: left; }
.repeat-btn > .ic { color: var(--brass-ink); }
.repeat-btn > span { display: grid; min-width: 0; }
.repeat-btn small { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.repeat-btn strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.same-as { justify-content: flex-start; text-align: left; border-color: var(--brass); }
.btn.same-as > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.btn.same-as b { font-weight: 700; }
.search-field { margin: 0 0 12px; }
.result-head .grow { flex: 1; }
.result-head .linkish { padding: 10px 4px; min-height: 44px; }
button.issue-card { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.issue-card.selectable[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--brass); }
.sel-box { flex: none; align-self: center; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--card); }
.sel-box.on { background: var(--brass); border-color: var(--brass); color: var(--night); }
.sel-box .ic { width: 18px; height: 18px; }
.batch-bar .btn { min-height: 48px; }
.page.issues.selecting { padding-bottom: 150px; }

