:root {
  --bg: #0b0c0e;
  --surface: #141619;
  --surface-2: #1c1f24;
  --surface-3: #252930;
  --line: #2b3038;
  --line-2: #3a404a;
  --text: #ece9e2;
  --muted: #9097a1;
  --dim: #6b717b;
  --accent: #f5a623;
  --accent-ink: #1a1102;
  --accent-soft: rgba(245, 166, 35, .14);
  --rec: #ff453a;
  --ok: #4cd08a;
  --sun: #ffc94d;
  --moon: #b4cdf7;
  --blue: #6d9cff;
  --ph-night: #0d1220;
  --ph-astro: #17223f;
  --ph-nautical: #233a6e;
  --ph-blue: #3e63b8;
  --ph-gold: #e29a3c;
  --ph-day: #9cc3e8;
  --radius: 14px;
  --radius-s: 9px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --tab-h: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.xl { width: 46px; height: 46px; color: var(--accent); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.fine { font-size: 12px; color: var(--dim); margin: 0; }
.block { display: block; }
.center { text-align: center; }
.pad { padding: 24px 8px; }
.accent { color: var(--accent); }
.eyebrow { font: 600 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.row.wrap { flex-wrap: wrap; }
.gap-s { gap: 8px; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.push { margin-left: auto; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2.tight { gap: 8px; }

/* ---------- app shell ---------- */
#app { height: 100%; display: grid; grid-template-rows: 1fr auto; }
.views { position: relative; min-height: 0; }
.view { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tabbar { display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(11, 12, 14, .96); border-top: 1px solid var(--line); padding: 4px calc(4px + var(--sar)) calc(4px + var(--sab)) calc(4px + var(--sal)); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 20; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; text-decoration: none; color: var(--dim); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; border-radius: 10px; }
.tab.on { color: var(--accent); }
.tab .ic { width: 24px; height: 24px; }

@media (orientation: landscape) and (max-height: 540px) {
  #app { grid-template-rows: none; grid-template-columns: auto 1fr; }
  .tabbar { grid-template-columns: none; grid-template-rows: repeat(5, 1fr); order: -1; border-top: 0; border-right: 1px solid var(--line); padding: calc(4px + var(--sat)) 4px calc(4px + var(--sab)) calc(4px + var(--sal)); width: calc(70px + var(--sal)); }
  .tab { justify-content: center; }
}

.view-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal)); background: linear-gradient(var(--bg) 70%, rgba(11, 12, 14, 0)); }
.view-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-head h1.sm { font-size: 19px; }
.view-head .push + .icon-btn, .view-head .row.push { flex: none; }
.view-body { padding: 4px calc(16px + var(--sar)) calc(32px + var(--sab)) calc(16px + var(--sal)); display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.seg-wrap { padding: 0 calc(16px + var(--sar)) 6px calc(16px + var(--sal)); max-width: 760px; margin: 0 auto; }
.seg-wrap.flush { padding: 0; margin: 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn .ic { width: 18px; height: 18px; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.lg { min-height: 52px; font-size: 16px; padding: 0 26px; border-radius: 14px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff7b72; border-color: rgba(255, 69, 58, .35); background: rgba(255, 69, 58, .08); }
.btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; border: 0; background: var(--surface-2); color: var(--text); flex: none; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.icon-btn[disabled] { opacity: .3; }
.link { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 0 0 0 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--dim); }
.input, select { width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); outline: none; font-size: 16px; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea.input { resize: vertical; min-height: 64px; }
.input:focus, select:focus { border-color: var(--accent); }
input[type=date].input { min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chips.seg { flex-wrap: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.chips.seg .chip { flex: 1; border: 0; background: none; border-radius: 9px; justify-content: center; color: var(--muted); white-space: nowrap; }
.chips.seg .chip.on { background: var(--surface-3); color: var(--text); }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 48px; height: 28px; border-radius: 14px; background: var(--surface-3); position: relative; transition: background .15s; flex: none; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.result-card { background: linear-gradient(160deg, #1d1a14, var(--surface)); border: 1px solid rgba(245, 166, 35, .28); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.result-card p { margin: 0; }
.big { font-size: 44px; font-weight: 600; line-height: 1.05; color: var(--accent); }
.ok { color: var(--ok); }
.warn-text { color: #ffb44d; }
.badge { font: 700 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 4px 6px; border-radius: 5px; }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 12px; }
.empty-state h2 { margin: 6px 0 0; font-size: 21px; }
.empty-state p { margin: 0 0 8px; max-width: 34ch; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-card, .loc-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.list-card:active, .loc-card:active { background: var(--surface-2); }
.chev { color: var(--dim); font-size: 22px; flex: none; }
.loc-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--surface-3) center/cover; display: grid; place-items: center; color: var(--dim); flex: none; }
.list-btn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; }
.project-meta { display: flex; flex-direction: column; gap: 2px; }

dl.times { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 14px; }
dl.times dt { color: var(--muted); }
dl.times dd { margin: 0; text-align: right; }
.tone-gold { color: var(--ph-gold) !important; }
.tone-blue { color: var(--blue) !important; }

.readouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.readout { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.readout b { font-size: 20px; font-weight: 600; }

/* ---------- sheets / toast ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column; background: var(--surface); border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); max-width: 640px; margin: 0 auto; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-body { overflow-y: auto; padding: 16px 16px calc(28px + var(--sab)); }
.sheet-body h3.eyebrow { margin-top: 8px; }
@media (orientation: landscape) and (max-height: 540px) {
  .sheet { max-height: 96dvh; left: auto; right: 0; top: 0; border-radius: 20px 0 0 20px; width: min(440px, 70vw); transform: translateX(100%); border-top: 0; border-left: 1px solid var(--line-2); }
}

#toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + var(--sab)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #f2efe8; color: #141414; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; display: flex; align-items: center; z-index: 80; transition: .2s; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast .link { color: #a65f00; }

/* ---------- pickers ---------- */
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-row { display: flex; gap: 6px; align-items: center; }
.pick-row .pick { flex: 1; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; min-height: 48px; }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick.on b { color: var(--accent); }
.pick .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
input[type=search].input { -webkit-appearance: none; }

.btn.wide { white-space: normal; text-align: left; min-height: 48px; padding: 8px 14px; }
.day-head { margin-top: 8px; }

/* ---------- gear kit ---------- */
.tabbar.four { grid-template-columns: repeat(4, 1fr); }
@media (orientation: landscape) and (max-height: 540px) { .tabbar.four { grid-template-columns: none; grid-template-rows: repeat(4, 1fr); } }
.tab { position: relative; }
.tab[data-badge]::after { content: attr(data-badge); position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--rec); color: #fff; font: 700 10.5px/17px var(--sans); text-align: center; }
.head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.head-title h1 { flex: none; }
.head-sub { font: 600 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary { font-size: 13px; color: var(--muted); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-16px - var(--sar)) 0 calc(-16px - var(--sal)); padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal)); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; white-space: nowrap; }
.sheet-body .chips.scroll { margin: 0 -16px; padding: 0 16px; }
.chips.mono-chips .chip { font-family: var(--mono); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plain { background: none; border: 0; padding: 0; text-align: left; }
.danger-text { color: #ff7b72; }
.ok-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(76, 208, 138, .09); border: 1px solid rgba(76, 208, 138, .3); color: #9fe8bf; font-size: 13.5px; }
.warn-note { display: block; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(245, 166, 35, .1); border: 1px solid rgba(245, 166, 35, .35); color: #ffd28a; font-size: 13.5px; text-decoration: none; }
.warn-text { color: #ffb44d; }
.link { background: none; border: 0; color: var(--accent); font-weight: 700; text-decoration: none; padding: 0; }
.list-btn { width: 100%; color: inherit; }
.list-btn > .ic { color: var(--accent); }
.list-btn .grow { gap: 1px; }
.gap-xs { gap: 6px; }
.pre { white-space: pre-wrap; margin: 4px 0 0; }

/* overview */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 13px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; min-width: 0; }
.stat-card b { font-size: 21px; font-weight: 600; letter-spacing: -.02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card:first-child b { color: var(--accent); }
.stat-label { font: 600 10.5px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat-sub { font-size: 12px; color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card.warn b { color: #ffb44d; }
.stat-card.bad b { color: #ff7b72; }
.stat-card.good b { color: var(--ok); }
.stat-card.on { border-color: var(--accent); background: var(--accent-soft); }
.stat-card:active { transform: scale(.985); }
.need-bar { display: flex; flex-direction: column; gap: 6px; }
.list-tools { gap: 6px; }
.mini-select { width: auto; min-height: 32px; padding: 4px 26px 4px 10px; font-size: 13px; border-radius: 9px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }

/* rows */
.item-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; min-height: 64px; }
a.item-row:active, .item-row.selectable:active { background: var(--surface-2); }
.item-row.selectable { cursor: pointer; }
.item-row.selectable.on { border-color: var(--accent); background: var(--accent-soft); }
.item-row b, .check-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.grow-link { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.item-thumb { width: 46px; height: 46px; border-radius: 10px; background: var(--surface-3) center/cover; flex: none; display: grid; place-items: center; color: var(--dim); }
.item-thumb.sm { width: 36px; height: 36px; border-radius: 8px; }
.item-thumb .ic { width: 22px; height: 22px; }
.item-thumb.sm .ic { width: 18px; height: 18px; }
.badge.out { background: var(--accent); color: var(--accent-ink); }
.badge.repair { background: #e5483a; color: #fff; }
.badge.in { background: var(--surface-3); color: var(--muted); }
.badge.muted { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.list-card .grow { gap: 3px; }
.kit-thumbs { display: flex; flex: none; }
.kit-thumbs:empty { display: none; }
.kit-thumbs > * + * { margin-left: -14px; }
.kit-thumbs > * { box-shadow: 0 0 0 2px var(--surface); }
.mini-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.mini-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mini-row:last-child { border-bottom: 0; }

/* select mode */
.bulk-bar { position: sticky; bottom: calc(8px + var(--sab)); z-index: 6; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(28, 31, 36, .96); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.bulk-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bulk-actions .btn { padding: 0 6px; }

/* add + editor */
.wide-buttons { width: 100%; max-width: 320px; }
.add-option { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: inherit; }
.add-option > .ic { width: 28px; height: 28px; color: var(--accent); }
.add-option .grow { gap: 3px; }
.editor .card { display: flex; flex-direction: column; gap: 14px; }
.card.more { padding: 0; }
.card.more summary { padding: 15px 16px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.card.more summary::-webkit-details-marker { display: none; }
.card.more summary::after { content: '+'; color: var(--muted); font-size: 20px; font-weight: 400; }
.card.more[open] summary::after { content: '–'; }
.card.more > .stack { padding: 0 16px 16px; }
.save-row { position: sticky; bottom: 0; z-index: 4; padding: 12px 0 calc(8px + var(--sab)); margin-bottom: calc(-32px - var(--sab)); background: linear-gradient(rgba(11, 12, 14, 0), var(--bg) 35%); }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-tile { position: relative; flex: none; width: 96px; }
.photo-img { display: block; width: 96px; height: 96px; border-radius: 12px; background: var(--surface-3) center/cover; }
.photo-kind { position: absolute; left: 5px; bottom: 5px; max-width: calc(100% - 10px); font: 700 9.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, .7); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-kind.static { pointer-events: none; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .7); color: #fff; padding: 0; }
.photo-del .ic { width: 15px; height: 15px; }
.scan-preview { width: 100%; max-height: 34vh; object-fit: contain; border-radius: 12px; background: #000; }
.scan-preview.full { max-height: 72vh; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; flex: 1; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.read-text summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.read-text pre { white-space: pre-wrap; font: 12px/1.4 var(--mono); color: var(--muted); background: var(--surface-2); padding: 10px; border-radius: 10px; max-height: 160px; overflow: auto; }

/* item page */
.photo-carousel { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 calc(-16px - var(--sar)) 0 calc(-16px - var(--sal)); padding: 0 calc(16px + var(--sar)) 0 calc(16px + var(--sal)); }
.photo-carousel::-webkit-scrollbar { display: none; }
.photo-slide { position: relative; flex: none; width: min(78%, 360px); aspect-ratio: 4 / 3; border: 0; border-radius: var(--radius); background: var(--surface-2) center/cover; scroll-snap-align: start; padding: 0; }
.photo-slide:only-child { width: 100%; max-width: none; }
.photo-slide .photo-kind { left: 10px; bottom: 10px; }
.photo-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 120px; border-radius: var(--radius); border: 1px dashed var(--line-2); background: var(--surface); color: inherit; }
.photo-empty .ic.xl { color: var(--dim); width: 38px; height: 38px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 9px 4px 7px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); }
.tag-chip .ic { width: 15px; height: 15px; color: var(--accent); }
dl.info-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; font-size: 14px; }
dl.info-list dt { color: var(--muted); }
dl.info-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .action-grid { grid-template-columns: repeat(3, 1fr); } }

/* shoots */
.shoot-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.shoot-card:active { background: var(--surface-2); }
.shoot-card > .row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.stage { flex: none; font: 700 10px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.stage.packed { background: rgba(109, 156, 255, .16); color: #a9c4ff; }
.stage.out { background: var(--accent); color: var(--accent-ink); }
.stage.returned { background: rgba(76, 208, 138, .14); color: var(--ok); }
.shoot-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.pack-progress { display: flex; align-items: center; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.check-row.tall { min-height: 58px; }
.check-row.done { opacity: .55; }
.check-row.done b { text-decoration: line-through; }
.check-row .grow { min-width: 0; }
.check { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin: 0; }
.schedule-total { display: flex; align-items: baseline; gap: 10px; }
.schedule-total b { font-size: 28px; font-weight: 600; color: var(--accent); }
.need-link { display: flex; justify-content: space-between; gap: 12px; color: inherit; text-decoration: none; padding: 2px 0; }
.need-link span { color: var(--accent); font-weight: 700; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-step > .ic { color: var(--accent); margin-top: 1px; }

/* QR scanner */
.scanner { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; }
.scanner-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--sat)) calc(14px + var(--sar)) 10px calc(14px + var(--sal)); background: rgba(0, 0, 0, .8); }
.scanner-bar b { flex: 1; font-size: 17px; }
.scanner-count { color: var(--accent); font-size: 13px; }
.scanner-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.scanner-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; left: 50%; top: 50%; width: min(64vw, 64vh, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); outline: 2px solid rgba(245, 166, 35, .9); display: grid; place-items: center; }
.scanner-frame .ic { width: 40px; height: 40px; color: rgba(255, 255, 255, .25); }
.scanner-status { padding: 16px calc(16px + var(--sar)) calc(18px + var(--sab)) calc(16px + var(--sal)); text-align: center; font-weight: 600; background: rgba(0, 0, 0, .85); color: var(--muted); min-height: 64px; }
.scanner-status.ok { color: var(--ok); }
.scanner-status.bad { color: #ff9b8f; }
#print-root { display: none; }

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { height: auto; overflow: visible; background: #fff; color: #111; font: 9.5pt/1.35 var(--sans); }
  #app, #toast, .sheet-wrap, .scanner { display: none !important; }
  #print-root { display: block; }
  #print-root h1 { font-size: 20pt; line-height: 1.1; margin: 4pt 0 6pt; letter-spacing: -.01em; }
  .pr-brand { font: 700 8pt var(--mono); letter-spacing: .18em; color: #b06d00; }
  .pr-sub { margin: 4pt 0 10pt; color: #555; }
  .pr-biz { display: flex; flex-direction: column; gap: 1pt; margin: 2pt 0 6pt; font-size: 9pt; color: #333; }
  .pr-biz b { font-size: 10.5pt; color: #111; }
  .pr-biz span:empty { display: none; }
  .pr-cat { font-size: 11.5pt; margin: 14pt 0 4pt; break-after: avoid; }
  .pr-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .pr-table th { text-align: left; font: 700 7pt var(--mono); text-transform: uppercase; letter-spacing: .05em; color: #666; border-bottom: 1.2pt solid #111; padding: 3pt 6pt 3pt 0; }
  .pr-table td { border-bottom: .5pt solid #ccc; padding: 4pt 6pt 4pt 0; vertical-align: top; }
  .pr-table tr { break-inside: avoid; }
  .pr-table thead { display: table-header-group; }
  .pr-table tfoot td { font-weight: 700; border-top: 1.2pt solid #111; border-bottom: 0; }
  .pr-summary { width: 60%; margin-bottom: 4pt; }
  .pr-table.check { table-layout: fixed; }
  .pr-table.check td.pr-box { font-size: 12pt; line-height: 1; }
  .pr-table.check th:nth-child(3) { width: 42%; }
  .pr-table.check th:nth-child(4) { width: 30%; }
  .pr-box { width: 30pt; color: #666; }
  .pr-mono { font-family: var(--mono); font-size: 8pt; overflow-wrap: anywhere; }
  .pr-num { text-align: right; white-space: nowrap; }
  .pr-nowrap { white-space: nowrap; }
  .pr-muted { color: #777; font-size: 8.5pt; }
  .pr-warn { color: #c0392b; font-style: italic; }
  .pr-thumb-cell { width: 34pt; }
  .pr-thumb { width: 30pt; height: 30pt; object-fit: cover; border-radius: 3pt; display: block; }
  .pr-total { text-align: right; font-weight: 700; font-size: 11pt; margin-top: 10pt; }
  .pr-pre { white-space: pre-wrap; margin: 0; }
  .pr-declare { margin: 18pt 0 0; font-size: 9pt; color: #333; break-inside: avoid; }
  .pr-sign { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18pt 24pt; margin-top: 22pt; break-inside: avoid; }
  .pr-sign > div, .pr-incident > div { display: flex; flex-direction: column; gap: 3pt; }
  .pr-line { display: block; border-bottom: .8pt solid #111; height: 16pt; }
  .pr-incident { display: flex; flex-direction: column; gap: 8pt; break-inside: avoid; }
  .pr-facts { display: grid; grid-template-columns: auto 1fr; gap: 2pt 12pt; margin: 4pt 0; }
  .pr-facts dt { color: #777; }
  .pr-facts dd { margin: 0; }
  .pr-kv { border-collapse: collapse; width: 100%; font-size: 9.5pt; margin-top: 4pt; }
  .pr-kv th { text-align: left; width: 32%; color: #666; font-weight: 600; padding: 3pt 8pt 3pt 0; vertical-align: top; border-bottom: .5pt solid #ddd; }
  .pr-kv td { padding: 3pt 0; border-bottom: .5pt solid #ddd; white-space: pre-wrap; }
  .pr-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8pt; }
  .pr-photos figure { margin: 0; break-inside: avoid; }
  .pr-photos img { width: 100%; height: 62mm; object-fit: contain; background: #f2f2f2; border-radius: 3pt; display: block; }
  .pr-photos figcaption { font: 700 7pt var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #666; margin-top: 2pt; }
  .pr-foot { margin-top: 16pt; font: 7pt var(--mono); color: #888; }
  /* QR label sheet: 3 × 8 labels per A4 page */
  .pr-label-page { display: grid; grid-template-columns: repeat(3, 62mm); grid-auto-rows: 33mm; gap: 0; break-after: page; }
  .pr-label-page:last-child { break-after: auto; }
  .pr-label { display: flex; align-items: center; gap: 2.5mm; padding: 2mm 2.5mm; border: .3pt dashed #bbb; overflow: hidden; }
  .pr-qr { width: 27mm; height: 27mm; flex: none; }
  .pr-qr svg { width: 100%; height: 100%; display: block; }
  .pr-label-text { display: flex; flex-direction: column; gap: .6mm; min-width: 0; }
  .pr-label-owner { font: 700 5.5pt var(--mono); letter-spacing: .12em; color: #b06d00; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pr-label-tag { font: 700 12pt var(--mono); letter-spacing: -.01em; }
  .pr-label-name { font-size: 7pt; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .pr-label-sn { font: 6pt var(--mono); color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pr-label-found { font-size: 5.5pt; line-height: 1.2; color: #444; }
}
.check-row.skipped { opacity: .5; cursor: default; }
.check-gap { width: 24px; flex: none; }
.meta-line { gap: 6px; }
.meta-line > * + *::before { content: '·'; margin-right: 6px; color: var(--dim); }
.badge.lent { background: rgba(109, 156, 255, .2); color: #a9c4ff; }
.stage.lent { background: rgba(109, 156, 255, .16); color: #a9c4ff; }
.stage.borrowed { background: rgba(190, 140, 255, .16); color: #d2b6ff; }
.stage.soon { background: rgba(245, 166, 35, .18); color: #ffc46b; }
.stage.overdue { background: rgba(255, 69, 58, .18); color: #ff8a80; }
.bad-text { color: #ff8a80; }
.stats.two { grid-template-columns: 1fr 1fr; }
.stat-card.static:first-child b { color: var(--text); }
.loan-alert { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 12px; text-decoration: none; color: #ffd28a; background: rgba(245, 166, 35, .1); border: 1px solid rgba(245, 166, 35, .35); }
.loan-alert.bad { color: #ffb3ab; background: rgba(255, 69, 58, .1); border-color: rgba(255, 69, 58, .4); }
.loan-alert .grow { gap: 1px; }
.loan-alert b { color: var(--text); }
.due-line { font-size: 17px; font-weight: 600; }
.item-row.compact { min-height: 52px; padding: 7px 10px; gap: 10px; }
