: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; }

/* ---------- viewfinder ---------- */
.view-viewfinder { overflow: hidden; background: #000; }
.vf-stage { position: absolute; inset: 0; overflow: hidden; }
.vf-video { position: absolute; object-fit: fill; background: #050505; max-width: none; }
.vf-overlay { position: absolute; inset: 0; pointer-events: none; }
.ln-gate { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.ln-frame { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 1.2; }
.ln-corner { fill: none; stroke: var(--accent); stroke-width: 3; }
.ln-thirds { stroke: rgba(255, 255, 255, .28); stroke-width: 1; }
.ln-safe { fill: none; stroke: rgba(255, 255, 255, .35); stroke-dasharray: 5 5; }
.ln-center { stroke: rgba(255, 255, 255, .85); stroke-width: 1.4; }
.ln-horizon { stroke: rgba(255, 255, 255, .7); stroke-width: 2; stroke-linecap: round; }
.ln-horizon.level { stroke: var(--ok); }
.path-sun { fill: none; stroke: var(--sun); stroke-width: 2; stroke-dasharray: 2 5; stroke-linecap: round; opacity: .9; }
.path-moon { fill: none; stroke: var(--moon); stroke-width: 1.6; stroke-dasharray: 1 6; stroke-linecap: round; opacity: .8; }
.tick-sun { fill: var(--sun); }
.tick-moon { fill: var(--moon); }
.tick-label { fill: var(--sun); font: 600 11px var(--mono); paint-order: stroke; stroke: rgba(0, 0, 0, .6); stroke-width: 3px; }
.sun-disc { fill: var(--sun); }
.sun-ring { fill: none; stroke: var(--sun); stroke-width: 1.5; opacity: .6; }
.moon-disc { fill: var(--moon); }
.sky-label { fill: #fff; font: 700 12px var(--mono); paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 3px; }
.edge-sun { fill: var(--sun); }
.edge-moon { fill: var(--moon); }

.vf-hud { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; padding: calc(6px + var(--sat)) calc(12px + var(--sar)) 6px calc(12px + var(--sal)); background: linear-gradient(rgba(0, 0, 0, .75), rgba(0, 0, 0, 0)); pointer-events: none; }
.hud-cell { pointer-events: auto; display: flex; flex-direction: column; gap: 0; background: none; border: 0; padding: 4px 0; text-align: left; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .7); min-width: 0; }
.hud-cell b { font-size: 13px; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-cell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-cell.mid { align-items: center; text-align: center; }
.hud-cell.mid b { font-size: 17px; }
.hud-cell.right { align-items: flex-end; text-align: right; }

.vf-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 4px calc(10px + var(--sar)) 10px calc(10px + var(--sal)); display: flex; flex-direction: column; gap: 8px; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .8) 35%); }
.vf-strip-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vf-fov { font-size: 11px; color: rgba(255, 255, 255, .6); }
.lens-strip { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding: 2px 4px; scrollbar-width: none; scroll-snap-type: x proximity; }
.lens-strip::-webkit-scrollbar { display: none; }
.lens { flex: none; min-width: 46px; height: 36px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(20, 20, 20, .6); color: #fff; font: 700 14px var(--mono); padding: 0 10px; scroll-snap-align: center; }
.lens.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.lens.extra { border-style: dashed; }
.lens.edit { font-size: 11px; letter-spacing: .06em; color: rgba(255, 255, 255, .7); }
.vf-buttons { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; justify-items: center; gap: 6px; }
.vf-round { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(30, 30, 30, .7); display: grid; place-items: center; color: #fff; }
.aspect-chip { font-size: 11px; font-weight: 700; }
.vf-thumb { width: 46px; height: 46px; border-radius: 10px; border: 1.5px solid rgba(255, 255, 255, .5); background: #222 center/cover; }
.vf-thumb.empty { opacity: .4; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 4px; display: grid; place-items: center; }
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: .15s; }
.shutter:active span { transform: scale(.9); }
.shutter.video span { background: var(--rec); }
.recording .shutter span { width: 46%; height: 46%; border-radius: 6px; }
.vf-warn { position: absolute; left: 50%; top: calc(64px + var(--sat)); transform: translateX(-50%); background: rgba(0, 0, 0, .7); border: 1px solid rgba(245, 166, 35, .5); color: #ffd28a; font: 600 12px var(--mono); padding: 6px 10px; border-radius: 8px; z-index: 4; text-align: center; max-width: calc(100% - 32px); }
.vf-warn.rec { border-color: var(--rec); color: #fff; background: rgba(255, 69, 58, .85); }
.flash .vf-stage::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .5; animation: flash .18s ease-out forwards; }
@keyframes flash { to { opacity: 0; } }

.view-viewfinder.land .vf-controls { left: auto; top: 0; width: calc(132px + var(--sar)); padding: calc(10px + var(--sat)) calc(10px + var(--sar)) calc(10px + var(--sab)) 10px; background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .82) 30%); flex-direction: row-reverse; gap: 6px; }
.view-viewfinder.land .vf-buttons { grid-template-columns: none; grid-template-rows: 1fr 1fr auto 1fr 1fr; height: 100%; }
.view-viewfinder.land .vf-strip-wrap { height: 100%; }
.view-viewfinder.land .vf-fov { display: none; }
.view-viewfinder.land .lens-strip { flex-direction: column; overflow-y: auto; overflow-x: hidden; max-height: 100%; scroll-snap-type: y proximity; }
.view-viewfinder.land .vf-hud { right: calc(132px + var(--sar)); }

.vf-start { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 80% at 50% 20%, #1d1910 0%, #000 70%); }
.vf-start-card { max-width: 340px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.vf-start-card p { margin: 0; color: var(--muted); }
.vf-start.busy button { opacity: .6; pointer-events: none; }
.brand-mark { font: 800 26px/1 var(--mono); letter-spacing: .28em; color: var(--accent); padding-left: .28em; }
.start-icon { width: 84px; height: 84px; border-radius: 19px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06); }

/* ---------- sun ---------- */
.place-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; }
.place-card > div { flex: 1; display: flex; flex-direction: column; }
.place-card .ic { color: var(--accent); }
.place-card .chev { font-size: 13px; color: var(--accent); font-weight: 600; }
.dial-card { padding: 10px; }
.dial svg { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.d-sky { fill: #0f1726; }
.d-ring { fill: none; stroke: rgba(255, 255, 255, .1); }
.d-ring.horizon { stroke: rgba(255, 255, 255, .35); stroke-width: 1.4; }
.d-deg { stroke: rgba(255, 255, 255, .3); }
.d-card { fill: var(--muted); font: 700 12px var(--mono); text-anchor: middle; }
.d-card.n { fill: var(--rec); }
.d-ray { stroke: rgba(226, 154, 60, .5); stroke-dasharray: 3 4; }
.d-sunpath { fill: none; stroke: var(--sun); stroke-width: 2.5; stroke-linecap: round; }
.d-goldpath { fill: none; stroke: var(--ph-gold); stroke-width: 4.5; stroke-linecap: round; }
.d-moonpath { fill: none; stroke: var(--moon); stroke-width: 1.6; stroke-dasharray: 2 4; opacity: .8; }
.d-tick { fill: #0f1726; stroke: var(--sun); stroke-width: 1.2; }
.d-hour { fill: rgba(255, 255, 255, .7); font: 600 9px var(--mono); text-anchor: middle; }
.d-sun { fill: var(--sun); stroke: #fff; stroke-width: 1.5; }
.d-sunglow { fill: rgba(255, 201, 77, .25); }
.d-moon { fill: var(--moon); stroke: #fff; stroke-width: 1; }
.d-zenith { fill: rgba(255, 255, 255, .35); font: 12px var(--mono); text-anchor: middle; }
.d-wedge { fill: rgba(245, 166, 35, .16); stroke: rgba(245, 166, 35, .55); }
.d-wedge-axis { stroke: var(--accent); stroke-width: 1.5; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 6px 0 4px; font-size: 12px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg.sun::before { background: var(--sun); }
.lg.gold::before { background: var(--ph-gold); height: 5px; }
.lg.moon::before { background: var(--moon); }
.lg.cam::before { background: var(--accent); opacity: .5; height: 8px; }
.time-out { font-size: 20px; font-weight: 600; color: var(--accent); }
.time-slider { width: 100%; accent-color: var(--accent); margin: 10px 0 6px; height: 28px; }
.timeline { display: flex; flex-direction: column; gap: 4px; }
.tl-bar { position: relative; height: 22px; border-radius: 7px; }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.tl-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); }

/* ---------- tools ---------- */
.dof-bar { position: relative; height: 54px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dof-zone { position: absolute; top: 10px; bottom: 10px; background: linear-gradient(90deg, rgba(245, 166, 35, .2), rgba(245, 166, 35, .55), rgba(245, 166, 35, .2)); border-radius: 6px; border: 1px solid rgba(245, 166, 35, .6); }
.dof-focus { position: absolute; top: 4px; bottom: 4px; width: 2px; background: #fff; }
.dof-cam { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font: 700 10px var(--mono); color: var(--dim); }
.dof-end { position: absolute; right: 8px; bottom: 4px; font-size: 10px; color: var(--dim); }
.gel-row { display: flex; align-items: center; gap: 10px; }
.gel-row b { flex: 1; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .15); flex: none; }

/* ---------- scout ---------- */
.contact-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; }
@media (max-width: 480px) { .contact-row { grid-template-columns: 1fr 1fr auto; } .contact-row input:nth-child(3) { grid-column: 1 / 3; } .contact-row .icon-btn { grid-row: 1; grid-column: 3; } }
.weather { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.weather b { font-size: 17px; }
.shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shot { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.shot.done { opacity: .55; }
.shot.done b { text-decoration: line-through; }
.shot-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; text-align: left; padding: 4px 0; }
.shot-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-no { font-weight: 700; color: var(--accent); min-width: 44px; }
.shot-order { display: flex; flex-direction: column; gap: 4px; }
.check { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

/* ---------- gallery ---------- */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.thumb { position: relative; aspect-ratio: 16 / 9; border: 0; border-radius: 6px; background: var(--surface-3) center/cover; padding: 0; }
.thumb-meta { position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 1px 5px; border-radius: 4px; }
.thumb-badge { position: absolute; right: 4px; top: 4px; font: 700 10px var(--mono); color: #fff; background: rgba(0, 0, 0, .6); padding: 2px 5px; border-radius: 4px; }
.day-head { margin-top: 8px; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; overflow-y: auto; }
.viewer-bar { position: sticky; top: 0; display: flex; justify-content: space-between; padding: calc(10px + var(--sat)) calc(12px + var(--sar)) 10px calc(12px + var(--sal)); background: linear-gradient(#000 60%, rgba(0, 0, 0, 0)); z-index: 2; }
.viewer-stage { display: grid; place-items: center; padding: 0 calc(8px + var(--sar)) 0 calc(8px + var(--sal)); }
.viewer-media { max-width: 100%; max-height: 70vh; max-height: 70dvh; border-radius: 4px; display: block; }
.viewer-info { padding: 18px calc(16px + var(--sar)) calc(30px + var(--sab)) calc(16px + var(--sal)); display: flex; flex-direction: column; gap: 14px; max-width: 760px; width: 100%; margin: 0 auto; }

#print-root { display: none; }

/* ---------- print (scout report) ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  html, body { height: auto; overflow: visible; background: #fff; color: #111; font: 10.5pt/1.4 var(--sans); }
  #app, #toast, .sheet-wrap, .viewer { display: none !important; }
  #print-root { display: block; }
  .pr-brand { font: 700 8.5pt var(--mono); letter-spacing: .18em; color: #b06d00; }
  .pr-cover h1 { font-size: 26pt; margin: 6pt 0 2pt; letter-spacing: -.01em; }
  .pr-sub { margin: 0 0 12pt; color: #555; }
  .pr-notes { white-space: pre-wrap; color: #333; }
  .pr-kv { display: grid; grid-template-columns: 30mm 1fr; gap: 3pt 10pt; margin: 0 0 10pt; }
  .pr-kv dt { color: #777; font-size: 9pt; text-transform: uppercase; letter-spacing: .04em; }
  .pr-kv dd { margin: 0; white-space: pre-wrap; }
  .pr-table { width: 100%; border-collapse: collapse; margin: 8pt 0; font-size: 9.5pt; }
  .pr-table th { text-align: left; font: 700 8pt var(--mono); text-transform: uppercase; letter-spacing: .05em; color: #666; border-bottom: 1.2pt solid #111; padding: 4pt 6pt 4pt 0; }
  .pr-table td { border-bottom: .5pt solid #ccc; padding: 5pt 6pt 5pt 0; vertical-align: top; }
  .pr-muted { color: #777; font-size: 8.5pt; }
  .pr-loc { break-before: page; }
  .pr-loc-head { display: flex; align-items: baseline; gap: 10pt; border-bottom: 1.5pt solid #111; padding-bottom: 4pt; margin-bottom: 10pt; }
  .pr-loc-head h2 { margin: 0; font-size: 18pt; }
  .pr-num { font: 700 12pt var(--mono); color: #b06d00; }
  .pr-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14pt; }
  .pr-sun { background: #f6f3ec; padding: 8pt; border-radius: 4pt; grid-template-columns: 26mm 1fr; }
  .pr-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 8pt; margin-top: 8pt; }
  .pr-photos figure { margin: 0; break-inside: avoid; }
  .pr-photos img { width: 100%; display: block; border-radius: 2pt; }
  .pr-photos figcaption { font: 7.5pt var(--mono); color: #555; margin-top: 2pt; }
  .pr-shots { break-before: page; }
  .pr-shots h2 { font-size: 18pt; margin: 0 0 6pt; }
  .pr-foot { margin-top: 16pt; font: 7.5pt var(--mono); color: #888; }
}

body[data-view="viewfinder"] #toast { bottom: calc(var(--tab-h) + 190px + var(--sab)); }
@media (orientation: landscape) and (max-height: 540px) {
  #toast { bottom: calc(16px + var(--sab)); }
  body[data-view="viewfinder"] #toast { bottom: calc(16px + var(--sab)); left: calc(50% - 30px); }
}
.btn.wide { white-space: normal; text-align: left; min-height: 48px; padding: 8px 14px; }

/* ---------- 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; }

/* ---------- zoom control ---------- */
.lens-strip.is-zoom { width: 100%; }
.zoom { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.zoom-mid { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 120px; }
.zoom-slider { width: 100%; accent-color: var(--accent); height: 26px; }
.zoom-label { font-size: 15px; font-weight: 700; color: var(--accent); }
.view-viewfinder.land .lens-strip.is-zoom { width: auto; }
.view-viewfinder.land .zoom { flex-direction: column; height: 100%; }
.view-viewfinder.land .zoom-mid { flex: 1; min-width: 0; justify-content: center; }
.view-viewfinder.land .zoom-slider { writing-mode: vertical-lr; direction: rtl; width: 26px; height: 100%; min-height: 120px; }

/* ---------- calibration ---------- */
.cal-panel { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--sab)); z-index: 7; width: min(440px, calc(100% - 20px)); background: rgba(14, 15, 18, .92); border: 1px solid rgba(245, 166, 35, .45); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cal-help { margin: 0; font-size: 12.5px; color: var(--muted); }
.cal-readout { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text); }
.cal-readout .mono { color: var(--accent); }
.cal-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-actions .input { width: 104px; min-height: 34px; padding: 4px 10px; flex: none; }
.cal-pad { display: flex; gap: 4px; margin-left: auto; }
.cal-pad .icon-btn { font-size: 16px; font-weight: 700; }
.cal-ring { fill: none; stroke: var(--sun); stroke-width: 2; }
.cal-cross { stroke: var(--sun); stroke-width: 2; }
.calibrating .vf-stage { touch-action: none; cursor: grab; }
.view-viewfinder.land .cal-panel { width: min(330px, 42%); left: auto; right: calc(10px + var(--sar)); transform: none; bottom: calc(10px + var(--sab)); max-height: calc(100% - 20px); overflow-y: auto; }
.calibrating .vf-controls { visibility: hidden; }
.vf-fov { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- full screen / immersive ---------- */
.vf-side { position: absolute; z-index: 4; left: calc(12px + var(--sal)); top: calc(64px + var(--sat)); display: flex; flex-direction: column; gap: 10px; }
.vf-side .vf-round { width: 42px; height: 42px; position: relative; }
.vf-side .ic { width: 20px; height: 20px; }
.vf-sky .ic { color: var(--sun); }
.vf-sky .ic + .ic { color: var(--moon); }
.vf-sky.both .ic { width: 15px; height: 15px; }
.vf-sky.both { display: flex; align-items: center; justify-content: center; gap: 0; }
.vf-sky.off .ic { color: rgba(255, 255, 255, .45); }
.vf-sky.off::after { content: ""; position: absolute; width: 26px; height: 2px; background: rgba(255, 255, 255, .6); transform: rotate(-45deg); }
.cal-dot { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #000; }
.vf-cal.fresh .cal-dot { background: var(--ok); }
body.immersive .tabbar { display: none; }
body.immersive #app { grid-template-rows: 1fr; grid-template-columns: 1fr; }
.calibrating .vf-side { display: none; }
@media (orientation: landscape) and (max-height: 540px) {
  .cal-help { display: none; }
  .cal-panel { padding: 10px; gap: 6px; }
  .cal-panel .toggle { min-height: 34px; font-size: 13px; }
}
