:root { --bg: #16161a; --card: #222228; --ink: #f4f1ea; --muted: #9a978f; --line: #34343c; --accent: #ffc94d; --ok: #59c98a; --danger: #ff6b6b;
  --open: #6cb4ff; --main: #ffc94d; --close: #c69cff; --journey: #8f8f99; font-size: 17px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; -webkit-tap-highlight-color: transparent; }
#app { max-width: 640px; margin: 0 auto; padding: 12px 16px calc(32px + env(safe-area-inset-bottom)); }
header { padding: 8px 0 4px; } header.sticky { position: sticky; top: 0; background: var(--bg); z-index: 5; padding-top: calc(8px + env(safe-area-inset-top)); }
h1 { font-size: 1.5rem; margin: 6px 0; } h2 { font-size: 1.1rem; margin: 4px 0 8px; }
.sub, .muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
a { color: var(--accent); text-decoration: none; } .back { color: var(--muted); font-size: .95rem; }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin: 12px 0; display: block; }
.card.link { display: flex; justify-content: space-between; color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; }
label { display: block; margin: 8px 0; color: var(--muted); font-size: .9rem; } label > input, label > textarea, label > select { margin-top: 4px; }
input, textarea, select { width: 100%; background: #18181d; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
button, .btn { background: var(--accent); color: #1b1b1b; border: 0; border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-block; text-align: center; white-space: nowrap; }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); } button.danger { color: var(--danger); }
button:disabled { opacity: .35; } .btn.big { display: block; padding: 16px; font-size: 1.1rem; margin: 16px 0; }
.icon { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: 8px 10px; min-width: 40px; } .icon.on { color: var(--accent); border-color: var(--accent); }
.stop-row { display: grid; grid-template-columns: 1fr repeat(4, auto); gap: 6px; margin: 8px 0 14px; align-items: center; }
.stop-row > input:first-child { grid-column: 1 / -1; } form.stop-row { grid-template-columns: 1fr auto; }
.shot-edit { display: grid; grid-template-columns: 6.5em 1fr auto; gap: 6px; margin: 6px 0; }
details { margin-top: 10px; } summary { color: var(--muted); cursor: pointer; margin-bottom: 6px; } details button { margin-top: 6px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 8px 0; } .bar i { display: block; height: 100%; background: var(--ok); }
.beat { font-size: .8rem; padding: 3px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.beat-opening { color: var(--open); } .beat-main { color: var(--main); } .beat-closing { color: var(--close); } .beat-journey { color: var(--journey); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 12px; border: 1px solid var(--line); }
.chip.on { border-color: var(--accent); color: var(--accent); } .chip.full small { color: var(--ok); } .chip small { color: var(--muted); }
.theme { border-left: 3px solid var(--accent); padding-left: 10px; margin: 8px 0 0; }
.shots { display: grid; gap: 10px; margin: 12px 0; }
.shot { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.shot .tick { flex: 1; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; text-align: left; background: none; color: var(--ink);
  border-radius: 0; padding: 16px 0 16px 14px; font-weight: 500; min-height: 64px; white-space: normal; }
.shot .label small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; margin-top: 3px; }
.shot .refbtn { flex: none; background: none; color: var(--muted); border-left: 1px solid var(--line); border-radius: 0; padding: 0 12px; font-size: .78rem; font-weight: 500; }
.shot.ai { border-left: 3px solid var(--open); }
.shot .box { width: 34px; height: 34px; border-radius: 9px; border: 2px solid var(--muted); display: grid; place-items: center; font-size: 1.3rem; }
.shot .kind { display: block; font-style: normal; color: var(--muted); font-size: .78rem; font-weight: 400; margin-bottom: 2px; } .shot.done { border-color: var(--ok); background: #1e2a23; }
.shot.done .box { background: var(--ok); border-color: var(--ok); color: #10251a; } .shot.done .label { color: var(--muted); }
.rec { flex: none; padding: 14px 16px; background: #2f2f37; color: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.rec.on { background: var(--danger); color: #fff; }
.note { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); } .note > span:nth-child(2) { flex: 1; } .note .icon { margin-left: auto; }
.pager { margin: 18px 0; } ul { margin: 4px 0 10px; padding-left: 20px; } li { margin: 3px 0; }
.tip { background: #2a2618; border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; font-size: .9rem; color: #f2dfae; }
.card.link.ai { border: 1px solid var(--accent); align-items: center; }
button.card.link { width: 100%; text-align: left; font-weight: 400; white-space: normal; align-items: center; }
.prep { background: #1d2430; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: .9rem; }
.stop-meta { display: grid; grid-template-columns: 9em 1fr; gap: 8px; } .stop-meta label { margin: 4px 0; }
.say { border-left: 3px solid var(--open); padding: 2px 0 2px 10px; margin: 10px 0 0; } .say p { margin: 4px 0; } .say b { font-size: .85rem; color: var(--open); }
/* shot reference drawings */
.ref { margin: 12px 0; background: var(--card); border-radius: 14px; overflow: hidden; } .ref figcaption { padding: 10px 14px 4px; } .ref ul { font-size: .9rem; color: #d9d5cc; }
.ref svg { display: block; width: 100%; height: auto; }
.ref .bg { fill: #2b2b33; } .ref .gd { stroke: #ffffff26; stroke-dasharray: 2 2; stroke-width: .5; fill: none; }
.ref .ln { stroke: var(--ink); stroke-width: 1.2; fill: none; stroke-linecap: round; stroke-linejoin: round; } .ref .ln.thin { stroke-width: .7; opacity: .7; }
.ref .pf { fill: var(--accent); } .ref .pl { stroke: var(--accent); stroke-linecap: round; fill: none; } .ref .eye { fill: #2b2b33; }
.ref .sh { fill: #ffc94d55; } .ref .sf { fill: #3d3d48; } .ref .mt { fill: #ffffff12; } .ref .fd { fill: #e89a5a; }
.ref .ar { stroke: var(--open); stroke-width: 1.2; stroke-dasharray: 2 1.5; } .ref .ar-h { fill: var(--open); }
.ref text { fill: var(--muted); font-size: 6px; }
.sheet { position: fixed; inset: 0; background: #000a; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { background: var(--bg); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-body .ref { background: var(--card); }
