/* Vulpes Drill Rehberi
   Palette laws (see DESIGN.md):
   --fur   red-fox rufous: offence players + "us" (selection, primary action)
   --sky   slate blue: defence players + wind, nothing else
   --turf  pitch green: the field surface only
   --cone  amber: cones/markers only
   --tip   tail-tip white: the disc and field lines
   --ink   fox stocking brown-black: text */

@font-face { font-family: 'Geist'; font-weight: 100 900; font-display: swap; src: url(../fonts/geist-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist'; font-weight: 100 900; font-display: swap; src: url(../fonts/geist-latinext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage'; font-weight: 200 800; font-display: swap; src: url(../fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage'; font-weight: 200 800; font-display: swap; src: url(../fonts/bricolage-latinext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light dark;
  --ground: oklch(0.968 0.012 135);
  --surface: oklch(0.993 0.005 135);
  --raised: oklch(1 0 0);
  --ink: oklch(0.25 0.025 45);
  --ink-2: oklch(0.44 0.025 50);
  --ink-3: oklch(0.54 0.02 60);
  --line: oklch(0.89 0.014 135);
  --line-2: oklch(0.82 0.016 135);

  --fur: oklch(0.645 0.175 44);
  --fur-deep: oklch(0.53 0.16 40);
  --fur-wash: oklch(0.93 0.045 50);
  --on-fur: oklch(0.99 0.01 60);
  --sky: oklch(0.52 0.095 248);
  --sky-wash: oklch(0.93 0.025 245);
  --turf: oklch(0.55 0.105 145);
  --turf-2: oklch(0.58 0.105 145);
  --turf-ez: oklch(0.5 0.1 148);
  --turf-out: oklch(0.47 0.07 140);
  --cone: oklch(0.83 0.16 82);
  --tip: oklch(0.985 0.006 95);

  --r-s: 8px; --r-m: 14px; --r-l: 22px;
  --shadow-float: 0 1px 2px oklch(0.3 0.03 140 / 0.10), 0 12px 32px oklch(0.3 0.03 140 / 0.14);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --dock-h: 68px; /* island bar height */
  --gutter: 20px;

  --font-ui: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage', 'Geist', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: oklch(0.19 0.018 150);
    --surface: oklch(0.225 0.018 150);
    --raised: oklch(0.26 0.02 150);
    --ink: oklch(0.95 0.012 90);
    --ink-2: oklch(0.79 0.018 100);
    --ink-3: oklch(0.68 0.02 110);
    --line: oklch(0.3 0.018 150);
    --line-2: oklch(0.37 0.02 150);
    --fur: oklch(0.7 0.165 46);
    --fur-deep: oklch(0.76 0.14 50);
    --fur-wash: oklch(0.32 0.06 45);
    --on-fur: oklch(0.2 0.03 45);
    --sky: oklch(0.72 0.09 245);
    --sky-wash: oklch(0.3 0.04 245);
    --turf: oklch(0.42 0.085 148);
    --turf-2: oklch(0.445 0.085 148);
    --turf-ez: oklch(0.38 0.08 150);
    --turf-out: oklch(0.32 0.05 145);
    --shadow-float: 0 1px 2px oklch(0 0 0 / 0.3), 0 16px 40px oklch(0 0 0 / 0.45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
::selection { background: var(--fur); color: var(--on-fur); }
:focus-visible { outline: 2.5px solid var(--fur); outline-offset: 2px; border-radius: 6px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--ground); padding: 10px 14px; border-radius: var(--r-s); z-index: 50; }
.skip:focus { top: 12px; }
svg { display: block; }

/* ---------- buttons ---------- */
.primary, .secondary, .ghost, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 15px;
  transition: transform 120ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}
.primary { background: var(--fur); color: var(--on-fur); }
.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.ghost { background: transparent; color: var(--ink-2); padding: 0 12px; }
.icon-btn { padding: 0; width: 44px; background: transparent; color: var(--ink); }
.icon-btn svg, .primary svg, .secondary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary:active, .secondary:active, .ghost:active, .icon-btn:active, .dock-btn:active, .chip:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: var(--fur-deep); color: var(--on-fur); }
  .secondary:hover, .icon-btn:hover, .ghost:hover { background: var(--line); }
}
.wide { width: 100%; }

/* ---------- layout ---------- */
.app { padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 40px); }
.main { padding: 0 var(--gutter); max-width: 760px; margin: 0 auto; }

.top { display: flex; flex-direction: column; gap: 14px; padding: calc(18px + env(safe-area-inset-top)) 0 10px; }
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px; height: 44px; border-radius: 50%; background: var(--fur);
  display: grid; place-items: center; flex: none;
}
.mark svg { width: 28px; height: 28px; fill: var(--on-fur); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.sub { font-size: 14px; color: var(--ink-2); }

.search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  background: var(--surface); border-radius: var(--r-m); box-shadow: inset 0 0 0 1.5px var(--line);
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--fur); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; height: 100%; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
kbd { font: 500 12px var(--font-ui); color: var(--ink-3); border: 1.5px solid var(--line-2); border-radius: 6px; padding: 1px 7px; }
@media (pointer: coarse) { kbd { display: none; } }

.summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 0 8px; color: var(--ink-2); font-size: 15px; }
.summary strong { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink); letter-spacing: -0.01em; }
.summary .tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.summary .tag { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); white-space: nowrap; }
.summary .tag.wind { background: var(--sky-wash); box-shadow: none; color: var(--ink); }

/* ---------- list: drill plates ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.plate {
  display: grid; grid-template-columns: 116px 1fr; gap: 16px; align-items: center;
  width: 100%; text-align: left; padding: 10px 14px 10px 10px; border: 0;
  background: var(--surface); border-radius: var(--r-l);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 120ms var(--ease-out), box-shadow 150ms ease;
}
.plate:active { transform: scale(0.985); }
.plate[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--fur); }
@media (hover: hover) and (pointer: fine) { .plate:hover { box-shadow: inset 0 0 0 1.5px var(--line-2); } .plate[aria-current="true"]:hover { box-shadow: inset 0 0 0 2px var(--fur); } }
.thumb { width: 116px; height: 116px; border-radius: 14px; overflow: hidden; background: var(--turf); }
.thumb svg { width: 100%; height: 100%; }
.plate-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.plate-no { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; gap: 8px; align-items: center; }
.plate-no .cat { color: var(--fur-deep); font-weight: 600; }
.plate-name { font-family: var(--font-display); font-weight: 650; font-size: 19px; line-height: 1.15; letter-spacing: -0.01em; }
.plate-en { font-size: 13.5px; color: var(--ink-3); margin-top: -3px; }
.habitat { display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.habitat span { display: inline-flex; align-items: center; gap: 5px; }
.habitat svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.habitat .windy { color: var(--sky); font-weight: 600; }
.fav-mark svg { width: 14px; height: 14px; fill: var(--fur); stroke: none; }
.fav-btn[aria-pressed="true"] svg { fill: var(--fur); stroke: var(--fur); }
.new-badge { font-size: 11.5px; font-weight: 700; color: var(--on-fur); background: var(--fur); border-radius: 999px; padding: 1px 8px; }
.summary .tag.new { background: var(--fur); color: var(--on-fur); box-shadow: none; font-weight: 600; }
.lib-meta { text-align: center; color: var(--ink-3); font-size: 13.5px; margin: 24px 0 8px; }
.source a { color: var(--fur-deep); font-weight: 600; }
.in-plan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fur); display: inline-block; }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty h2 { font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.empty .primary { margin-top: 16px; }

/* ---------- pack counter (fox-ear stepper) ---------- */
.pack { display: flex; align-items: center; gap: 4px; }
.pack-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center;
  transition: transform 120ms var(--ease-out);
}
.pack-btn:active { transform: scale(0.94); }
.pack-btn svg { width: 18px; height: 18px; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.pack-btn:disabled { opacity: 0.35; cursor: default; }
.pack-num {
  position: relative; min-width: 76px; text-align: center; padding: 4px 6px 2px;
  background: var(--fur); color: var(--on-fur); border-radius: 16px; margin-top: 8px;
  display: flex; flex-direction: column; line-height: 1;
}
/* fox ears */
.pack-num::before, .pack-num::after {
  content: ''; position: absolute; top: -9px; width: 18px; height: 14px; background: var(--fur);
  clip-path: polygon(0 100%, 30% 0, 100% 100%);
}
.pack-num::before { left: 8px; }
.pack-num::after { right: 8px; clip-path: polygon(0 100%, 70% 0, 100% 100%); }
.pack-num b { font-family: var(--font-display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pack-num small { font-size: 12px; font-weight: 500; opacity: 0.92; padding-bottom: 2px; }

/* ---------- floating island ----------
   Closed: a pill with Filtre, the fox-ear counter and Plan.
   Open: the same object grows wider and unfolds the filter panel upward (grid-rows 0fr -> 1fr). */
/* --island-x: centre of the list column on desktop (set by JS), viewport centre otherwise.
   left is clamped so the island never leaves the screen as it grows. */
.island {
  --iw: min(372px, calc(100vw - 24px));
  position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25;
  width: var(--iw);
  left: clamp(calc(var(--iw) / 2 + 12px), var(--island-x, 50vw), calc(100vw - var(--iw) / 2 - 12px));
  transform: translateX(-50%);
  background: var(--surface); border-radius: 34px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-float);
  transition: width 440ms var(--ease-sheet), left 440ms var(--ease-sheet), border-radius 440ms var(--ease-sheet);
}
.island.open { --iw: min(640px, calc(100vw - 24px)); border-radius: 26px; }
.island-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 440ms var(--ease-sheet); }
.island.open .island-panel { grid-template-rows: 1fr; }
.island-clip { min-height: 0; overflow: hidden; opacity: 0; transition: opacity 140ms ease; }
.island.open .island-clip { opacity: 1; transition: opacity 240ms ease 140ms; }
.island-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 4px 22px; }
.island-head h2 { font-size: 21px; letter-spacing: -0.01em; }
.island-scroll { max-height: min(54dvh, 500px); overflow-y: auto; overscroll-behavior: contain; padding: 8px 22px 16px; }
.island-foot { padding: 4px 14px 10px; }
.island-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px; padding: 6px 10px; min-height: var(--dock-h); }
.island.open .island-bar { box-shadow: 0 -1px 0 var(--line); }
.island-scrim {
  position: fixed; inset: 0; z-index: 24; background: oklch(0.2 0.03 140 / 0.32);
  opacity: 0; pointer-events: none; transition: opacity 300ms ease;
}
.island-scrim.show { opacity: 1; pointer-events: auto; }
.island-bar .dock-btn { justify-self: center; min-width: 76px; padding: 0 14px; border-radius: 999px; transition: transform 120ms var(--ease-out), background-color 200ms ease; }
#open-filters[aria-expanded="true"] { background: var(--fur-wash); }
#open-filters[aria-expanded="true"] svg { stroke: var(--fur-deep); }
.island .pack-num { margin-top: 10px; }
.dock-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 56px; justify-content: center; border: 0; background: none; border-radius: var(--r-m);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  transition: transform 120ms var(--ease-out);
}
.dock-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--fur); color: var(--on-fur); font-size: 12px; font-weight: 700;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}

/* ---------- sheets (native <dialog>) ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 640px;
  max-height: min(88dvh, 820px); border-radius: var(--r-l) var(--r-l) 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float);
  display: none; flex-direction: column; overscroll-behavior: contain;
}
.sheet[open] { display: flex; animation: sheet-in 340ms var(--ease-sheet); }
.sheet.closing { animation: sheet-out 200ms var(--ease-out) forwards; }
.sheet::backdrop { background: oklch(0.2 0.03 140 / 0.42); animation: fade 200ms ease; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--gutter) 6px; }
.sheet-head h2 { font-size: 22px; letter-spacing: -0.01em; }
.sheet-body { overflow-y: auto; padding: 6px var(--gutter) 16px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -1px 0 var(--line); }
.sheet-foot.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-direction: column; gap: 22px; }
.filters fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.filters legend { font-weight: 600; font-size: 15px; margin-bottom: 10px; padding: 0; }
.pack-field { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; transition: transform 120ms var(--ease-out); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 999px; background: var(--ground); box-shadow: inset 0 0 0 1.5px var(--line-2);
  font-size: 15px; color: var(--ink); transition: background-color 150ms ease, color 150ms ease;
}
.chip input:checked + span { background: var(--ink); color: var(--ground); box-shadow: none; }
.chip input:focus-visible + span { outline: 2.5px solid var(--fur); outline-offset: 2px; }
.chip small { color: inherit; opacity: 0.6; font-size: 13px; font-variant-numeric: tabular-nums; }
[data-group="wind"] .chip input:checked + span { background: var(--sky); color: var(--raised); }

/* ---------- detail ---------- */
.detail {
  position: fixed; inset: 0; z-index: 30; background: var(--ground); overflow-y: auto;
  overscroll-behavior: contain; padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.detail.enter { animation: detail-in 300ms var(--ease-out); }
@keyframes detail-in { from { transform: translateY(24px); opacity: 0; } }
.d-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px;
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px; background: var(--ground);
}
.d-bar .spacer { flex: 1; }
.d-plate { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.d-inner { padding: 0 var(--gutter); max-width: 760px; margin: 0 auto; }
.d-title { font-size: clamp(28px, 7vw, 36px); line-height: 1.05; letter-spacing: -0.02em; font-weight: 750; }
.d-en { color: var(--ink-3); margin: 4px 0 0; font-size: 15px; }
.d-summary { font-size: 17px; margin: 12px 0 18px; color: var(--ink); }

/* stage */
.stage { background: var(--turf); border-radius: var(--r-l); overflow: hidden; position: relative; }
.stage svg { width: 100%; height: auto; max-height: 62dvh; }
.stage-cap {
  position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; gap: 10px; align-items: baseline;
  color: var(--tip); font-weight: 600; font-size: 15px; text-shadow: 0 1px 2px oklch(0.2 0.05 145 / 0.6);
  pointer-events: none;
}
.stage-cap .n { font-variant-numeric: tabular-nums; opacity: 0.8; font-weight: 500; }
.wind-flag {
  position: absolute; top: 10px; right: 10px; display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px;
  border-radius: 999px; background: var(--sky); color: oklch(0.99 0 0); font-size: 13px; font-weight: 600;
}
.wind-flag svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.controls { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.controls .spacer { flex: 1; }
.stage { touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.stage.scrubbing { cursor: ew-resize; }
.stage-cap .tm { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 500; opacity: 0.85; }
.stage-state {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: oklch(0.2 0.03 145 / 0.45); opacity: 0; transform: scale(0.9);
  transition: opacity 160ms ease, transform 160ms var(--ease-out); pointer-events: none;
}
.stage-state::before { content: ''; position: absolute; left: 25px; top: 20px; border-left: 20px solid var(--tip); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.stage.is-paused:not(.scrubbing) .stage-state { opacity: 1; transform: scale(1); }
.play {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--fur); color: var(--on-fur);
  display: grid; place-items: center; flex: none; transition: transform 120ms var(--ease-out);
}
.play:active { transform: scale(0.94); }
.play svg { width: 24px; height: 24px; fill: currentColor; }
.speed { min-width: 52px; padding: 0 10px; font-variant-numeric: tabular-nums; font-weight: 600; }

/* fox-tail scrubber: rufous tail, white tip is the playhead */
.scrub { position: relative; margin-top: 10px; }
.ticks { position: absolute; left: 12px; right: 12px; top: 50%; height: 18px; transform: translateY(-50%); pointer-events: none; }
.ticks i { position: absolute; top: 0; width: 2px; height: 18px; margin-left: -1px; border-radius: 1px; background: var(--ink-3); opacity: 0.55; }
.tail { position: relative; display: block; width: 100%; height: 48px; -webkit-appearance: none; appearance: none; background: none; margin: 0; --p: 0%; touch-action: none; cursor: pointer; }
.tail::-webkit-slider-runnable-track {
  height: 10px; border-radius: 6px;
  background: linear-gradient(90deg, var(--fur-deep), var(--fur) var(--p), var(--line-2) var(--p));
}
.tail::-moz-range-track { height: 10px; border-radius: 6px; background: var(--line-2); }
.tail::-moz-range-progress { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--fur-deep), var(--fur)); }
.tail::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -8px; border-radius: 50% 50% 50% 12%;
  transform: rotate(45deg); background: var(--tip); box-shadow: 0 0 0 3px var(--fur), 0 2px 6px oklch(0.2 0.05 50 / 0.3);
}
.tail::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50% 50% 50% 12%; transform: rotate(45deg); background: var(--tip); box-shadow: 0 0 0 3px var(--fur); }

.steps { list-style: none; margin: 14px 0 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps button {
  white-space: nowrap; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; color: var(--ink-2);
}
.steps button[aria-current="step"] { background: var(--ink); color: var(--ground); box-shadow: none; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-m); overflow: hidden; margin: 22px 0 6px; }
.facts div { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts .windy { color: var(--sky); }

.d-sec { margin-top: 26px; }
.d-sec h2 { font-size: 19px; margin-bottom: 8px; letter-spacing: -0.01em; }
.d-sec ol, .d-sec ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.d-sec li::marker { color: var(--fur-deep); font-weight: 600; }
.small-note { background: var(--fur-wash); border-radius: var(--r-m); padding: 14px 16px; margin-top: 24px; }
.small-note h2 { font-size: 17px; margin-bottom: 4px; }
.small-note p { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 14px; }
.lg-o { border-radius: 50%; background: var(--fur); }
.lg-d { background: var(--sky); transform: rotate(45deg) scale(0.8); border-radius: 2px; }
.lg-disc { border-radius: 50%; background: var(--tip); box-shadow: inset 0 0 0 1.5px var(--ink); }
.lg-run { height: 0 !important; border-top: 2px solid var(--ink-2); width: 18px !important; }
.lg-throw { height: 0 !important; border-top: 2px dashed var(--ink-2); width: 18px !important; }
.lg-cone { width: 0 !important; height: 0 !important; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--cone); }
.source { font-size: 13.5px; color: var(--ink-3); margin-top: 26px; }
.d-actions { display: flex; gap: 10px; margin-top: 22px; }
.d-actions .primary, .d-actions .secondary { flex: 1; }

/* ---------- pitch SVG ---------- */
.pitch, .stage svg { font-family: var(--font-ui); }
.f-out { fill: var(--turf-out); }
.f-turf { fill: var(--turf); }
.f-stripe { fill: var(--turf-2); }
.f-ez { fill: var(--turf-ez); }
.f-line { stroke: var(--tip); stroke-width: calc(0.22px * var(--k, 1)); fill: none; opacity: 0.9; }
.cone { fill: var(--cone); stroke: oklch(0.45 0.09 70); stroke-width: 0.12; }
.measure line { stroke: var(--tip); stroke-width: calc(0.12px * var(--k, 1)); stroke-dasharray: calc(0.3px * var(--k, 1)); opacity: 0.75; }
.measure text { fill: var(--tip); font-size: calc(1.15px * var(--k, 1)); font-weight: 600; opacity: 0.9; }
.wind-arrow path { stroke: oklch(0.86 0.06 240); stroke-width: calc(0.35px * var(--k, 1)); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wind-arrow text { fill: oklch(0.9 0.05 240); font-size: calc(1.2px * var(--k, 1)); font-weight: 700; }
.tok { stroke-width: 0.2; }
.tok-o { fill: var(--fur); stroke: oklch(0.35 0.1 40); }
.tok-d { fill: oklch(0.52 0.095 248); stroke: oklch(0.32 0.07 250); }
.tok-l { fill: oklch(0.99 0.01 60); font-size: 1.15px; font-weight: 700; text-anchor: middle; }
.disc { fill: var(--tip); stroke: oklch(0.25 0.02 50); stroke-width: 0.16; }
.disc-shadow { fill: oklch(0.2 0.05 145 / 0.35); opacity: 0; }
.disc-g.flying .disc-shadow { opacity: 1; }
.run { stroke-width: calc(0.2px * var(--k, 1)); fill: none; stroke-linecap: round; }
.run-head { stroke-width: calc(0.2px * var(--k, 1)); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.run-o { stroke: oklch(0.93 0.07 60); }
.run-d { stroke: oklch(0.88 0.05 245); }
.throw { stroke: var(--tip); stroke-width: calc(0.2px * var(--k, 1)); fill: none; stroke-dasharray: calc(0.55px * var(--k, 1)) calc(0.45px * var(--k, 1)); stroke-linecap: round; }
.throw-head { stroke: var(--tip); stroke-width: calc(0.2px * var(--k, 1)); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.paths .step-paths { opacity: 0.22; transition: opacity 200ms ease; }
.paths .step-paths.current { opacity: 1; }
.paths.static .step-paths { opacity: 0.9; }
.all-faint .step-paths { opacity: 0.85; }
.all-faint .run, .all-faint .throw, .all-faint .run-head, .all-faint .throw-head { stroke-width: calc(0.32px * var(--k, 1)); }

/* ---------- plan ---------- */
.plan-total { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: p; }
.plan-item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 8px 6px 8px 14px; border-radius: var(--r-m); background: var(--ground);
}
.plan-item .no { font-family: var(--font-display); font-weight: 800; color: var(--fur-deep); font-size: 18px; font-variant-numeric: tabular-nums; min-width: 18px; }
.plan-item .nm { display: flex; flex-direction: column; min-width: 0; }
.plan-item .nm button { all: unset; cursor: pointer; font-weight: 600; }
.plan-item .nm button:focus-visible { outline: 2.5px solid var(--fur); outline-offset: 2px; border-radius: 4px; }
.plan-item .nm small { color: var(--ink-3); font-size: 13.5px; }
.plan-item .acts { display: flex; }
.plan-item .acts .icon-btn { width: 40px; min-height: 40px; }
.plan-item .acts .icon-btn svg { width: 18px; height: 18px; }
.plan-empty { color: var(--ink-2); padding: 18px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 30px); z-index: 60;
  transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--ground); padding: 8px 8px 8px 16px; border-radius: 999px;
  box-shadow: var(--shadow-float); font-size: 15px; max-width: calc(100vw - 32px);
  animation: toast-in 220ms var(--ease-out);
}
.toast button { border: 0; background: var(--fur); color: var(--on-fur); border-radius: 999px; min-height: 36px; padding: 0 14px; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- tablet ---------- */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .main { max-width: 980px; }
  .list { grid-template-columns: 1fr 1fr; }
  .top { flex-direction: row; align-items: center; justify-content: space-between; }
  .search { width: min(380px, 50%); }
}

/* ---------- desktop: list + detail, island floats over both ---------- */
@media (min-width: 1100px) {
  .app {
    display: grid; grid-template-columns: minmax(380px, 1fr) minmax(500px, 1.3fr);
    min-height: 100dvh; padding-bottom: 0;
  }
  .main { max-width: none; margin: 0; padding: 0 32px calc(var(--dock-h) + 48px); }
  .detail { padding-bottom: calc(var(--dock-h) + 48px); }
  .top { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .list { grid-template-columns: 1fr; }
  .detail {
    position: sticky; top: 0; height: 100dvh; inset: auto; z-index: 1;
    background: var(--surface); box-shadow: -1px 0 0 var(--line);
  }
  .detail.enter { animation: none; }
  .d-bar { background: var(--surface); }
  .d-bar .back { display: none; }
  .detail-empty { display: grid; place-items: center; height: 100%; color: var(--ink-3); text-align: center; padding: 40px; }
  .detail-empty svg { width: 220px; margin: 0 auto 16px; opacity: 0.9; }
  .sheet { margin: auto; border-radius: var(--r-l); }
  .sheet[open] { animation: pop-in 220ms var(--ease-out); }
  .sheet.closing { animation: pop-out 160ms var(--ease-out) forwards; }
  .sheet-grip { display: none; }
  @keyframes pop-in { from { opacity: 0; transform: scale(0.96); } }
  @keyframes pop-out { to { opacity: 0; transform: scale(0.96); } }
}
@media (min-width: 1500px) {
  .app { grid-template-columns: minmax(460px, 1fr) minmax(680px, 1.5fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
