/* Riak - Field guide direction. Tokens documented in design.md. */
:root {
  --paper: #f5f0e7;
  --card: #ffffff;
  --ink: #1d2a27;
  --muted: #56625e;
  --rule: #e5ddcf;
  --accent: #1f5f4a;
  --accent-ink: #ffffff;
  --accent-soft: #e3ece4;
  --warn: #8a3b22;
  --warn-soft: #f6e6dc;
  --gold: #87590c;
  --shadow: 0 1px 2px rgba(48, 42, 30, 0.04), 0 8px 24px rgba(48, 42, 30, 0.07);
  --surface-2: #f1ece2;
  --glow: rgba(214, 184, 120, 0.22);
  --shadow-1: 0 1px 2px rgba(48, 42, 30, 0.05), 0 4px 12px rgba(48, 42, 30, 0.06);
  --shadow-2: 0 1px 2px rgba(48, 42, 30, 0.04), 0 10px 28px rgba(48, 42, 30, 0.09);
  --shadow-3: 0 2px 6px rgba(48, 42, 30, 0.06), 0 24px 56px rgba(48, 42, 30, 0.16);
  --shadow-btn: 0 1px 1px rgba(20, 40, 32, 0.12), 0 6px 16px rgba(20, 60, 45, 0.22);
  --r-sm: 12px;
  --r-lg: 26px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --nav-h: 0px;
  --r: 18px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #141a18;
  --card: #1b2320;
  --ink: #ece6d8;
  --muted: #a9b3ad;
  --rule: #2f3a36;
  --accent: #6fbf9c;
  --accent-ink: #0e1513;
  --accent-soft: #20322b;
  --warn: #e59a7c;
  --warn-soft: #3a2620;
  --gold: #e2b450;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  --surface-2: #222c28;
  --glow: rgba(111, 191, 156, 0.08);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.32);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 56px rgba(0, 0, 0, 0.5);
  --shadow-btn: 0 1px 1px rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141a18;
    --card: #1b2320;
    --ink: #ece6d8;
    --muted: #a9b3ad;
    --rule: #2f3a36;
    --accent: #6fbf9c;
    --accent-ink: #0e1513;
    --accent-soft: #20322b;
    --warn: #e59a7c;
    --warn-soft: #3a2620;
    --gold: #e2b450;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
    --surface-2: #222c28;
    --glow: rgba(111, 191, 156, 0.08);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.22);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.32);
    --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.35), 0 24px 56px rgba(0, 0, 0, 0.5);
    --shadow-btn: 0 1px 1px rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: 0.005em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; border-radius: var(--r); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.noscript { padding: 24px; }

/* ---------- top bar ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font: 600 24px var(--serif); letter-spacing: 0.01em; margin: 0; line-height: 1.1; }
.brand-tag { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
button.chip { cursor: pointer; }
.chip svg { color: var(--gold); }
.level-bar { width: 44px; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; display: inline-block; }
.level-bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.4s ease-out; }

/* ---------- nav ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; }

main { padding: 24px; padding-bottom: calc(24px + var(--nav-h)); max-width: 1440px; margin: 0 auto; outline: none; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.quiet { border-color: var(--rule); }
.btn.danger { border-color: var(--warn); color: var(--warn); }
.btn.icon { padding: 0; width: 44px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { flex-shrink: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* ---------- tank layout ---------- */
.tank-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.plate { margin: 0; border: 1px solid var(--rule); background: var(--card); padding: 10px; border-radius: 2px; box-shadow: var(--shadow); min-width: 0; }
.tank-wrap { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 1px; overflow: hidden; background: #2f6f66; }
.tank-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.tank-wrap canvas[data-mode="feed"] { cursor: crosshair; }
.tank-wrap canvas[data-mode="clean"] { cursor: grab; }
.tank-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: rgba(16, 28, 26, 0.72);
  color: #f5f1e8;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--r);
  pointer-events: none;
  text-align: center;
}
.caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--muted); }
.caption .tank-name { font: 600 18px var(--serif); color: var(--ink); background: none; border: 0; padding: 0; }
.caption select.tank-name { min-height: 36px; cursor: pointer; border-bottom: 1px dashed var(--rule); }
.caption-meta { display: flex; gap: 14px; flex-wrap: wrap; }
.toolbar { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin-top: 10px; border-top: 1px solid var(--rule); padding-top: 10px; }
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tool:hover { background: var(--accent-soft); }
.tool[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tool .badge { position: relative; }
.modebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); }
.modebar .label { font-weight: 600; margin-right: 4px; }
.picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; scrollbar-width: thin; }
.pick {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 76px;
  min-height: 56px;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
}
.pick small { color: var(--muted); }
.pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pick:disabled { opacity: 0.45; }

/* ---------- notes column ---------- */
.notes { min-width: 0; }
.notes section { border-top: 1px solid var(--rule); padding: 14px 0; }
.notes section:first-child { border-top: 0; padding-top: 0; }
.notes h2 { font-size: 20px; margin-bottom: 6px; }
.notes h3 { font-size: 16px; margin-bottom: 8px; font-family: var(--sans); font-weight: 600; text-transform: none; }
.status-line { font: 600 22px/1.25 var(--serif); margin-bottom: 8px; }
.status-line.bad { color: var(--warn); }
.readings { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: 10px 0 0; }
.reading { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2, rgba(0, 0, 0, 0.03)); }
.reading-label { font-size: 13px; color: var(--muted); }
.reading-value { font-size: 18px; font-variant-numeric: tabular-nums; }
.reading .lvl { display: inline-flex; align-items: center; gap: 6px; }
.reading .lvl::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.reading .lvl.high::before, .reading .lvl.low::before { background: var(--warn); }
.explain-more { margin-top: 10px; }
.explain-more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent); min-height: 44px; display: flex; align-items: center; }
.lvl { font-size: 13px; color: var(--muted); }
.lvl.high, .lvl.low { color: var(--warn); font-weight: 600; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dotted var(--rule); font-size: 15px; }
ul.plain li:last-child { border-bottom: 0; }
.need { color: var(--warn); }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
}
.check .box { width: 22px; height: 22px; border: 1.5px solid var(--muted); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.check.done { color: var(--muted); }
.check.done .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check small { margin-left: auto; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease-out; }
.meter.warn i { background: var(--warn); }
.order { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px dotted var(--rule); }
.order:last-child { border-bottom: 0; }
.order .reward { font-size: 13px; color: var(--gold); font-weight: 600; }
.order.done { color: var(--muted); }

/* ---------- lists, cards, grids ---------- */
.list-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.list-row:last-child { border-bottom: 0; }
.list-row.button-like { cursor: pointer; }
.list-row.button-like:hover { background: var(--accent-soft); }
.list-row canvas, .thumb { width: 64px; height: 44px; display: block; }
.list-row .title { font-weight: 600; }
.list-row .sub { font-size: 14px; color: var(--muted); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--rule); background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; padding: 2px 8px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); }
.tag.gold { background: transparent; border: 1px solid var(--gold); color: var(--gold); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.muted { background: transparent; border: 1px solid var(--rule); color: var(--muted); }
.rar-1 { color: var(--muted); }
.rar-2 { color: var(--accent); }
.rar-3, .rar-4, .rar-5 { color: var(--gold); }
.empty { color: var(--muted); padding: 16px 0; }

/* ---------- segmented ---------- */
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); padding: 2px; background: var(--card); gap: 2px; max-width: 100%; overflow-x: auto; }
.seg-btn { min-height: 40px; padding: 0 14px; border: 0; background: none; border-radius: 3px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg-btn[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- sheets ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 22, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  padding: 16px;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 6px;
  width: min(560px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(16, 24, 22, 0.18);
  transform: translateY(8px);
  transition: transform 0.2s ease-out;
}
.sheet.wide { width: min(820px, 100%); }
.sheet-backdrop.open .sheet { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--rule); }
.sheet-title { font-size: 20px; }
.sheet-body { padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.sheet-body h3 { margin: 16px 0 8px; }
.sheet-body h3:first-child { margin-top: 0; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 14px; }
.field input[type="text"], .field select, .input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--paper);
  width: 100%;
}
.field input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 44px; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--rule); }
.field-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--rule); transition: background 0.15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.explain { font-size: 14px; color: var(--muted); margin: 2px 0 10px; }

.fish-hero { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: center; margin-bottom: 12px; }
.fish-hero canvas { width: 160px; height: 110px; background: linear-gradient(#e7efe9, #cfe0d8); border-radius: var(--r); }
:root[data-theme="dark"] .fish-hero canvas { background: linear-gradient(#22312c, #1a2723); }
.fish-hero h3 { font-size: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 8px 0 12px; }
.stat-grid div { display: grid; gap: 4px; font-size: 14px; }
.stat-grid b { font-weight: 600; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 76px; right: 24px; display: grid; justify-items: end; gap: 6px; z-index: 60; width: min(340px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--r); font-size: 14px; line-height: 1.35; max-width: 100%; opacity: 0; transform: translateY(-6px); transition: opacity 0.2s ease-out, transform 0.2s ease-out; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.toast.show { opacity: 1; transform: none; }
.toast.good { border-left: 4px solid var(--accent); }
.toast.warn { border-left: 4px solid var(--warn); }
.toast.big { font: 600 15px var(--serif); border-left: 4px solid var(--gold); }

/* ---------- visit bar ---------- */
.visit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 24px; background: var(--accent-soft); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }

/* ---------- fishing ---------- */
.spot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.spot {
  display: grid;
  grid-template-rows: 96px auto;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
  text-align: left;
  padding: 0;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.spot:hover { border-color: var(--accent); }
.spot:disabled { cursor: not-allowed; }
.spot canvas { width: 100%; height: 96px; display: block; }
.spot .spot-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.spot .spot-title { font: 600 18px var(--serif); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.spot .spot-meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.spot.locked { opacity: 0.6; }
.scene { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.scene-wrap { position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; background: #9fbfb7; }
.scene-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.scene-status { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(16, 28, 26, 0.72); color: #f5f1e8; padding: 6px 14px; border-radius: var(--r); font-weight: 600; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
.reel { margin-top: 12px; display: grid; gap: 10px; }
.reel-track { position: relative; height: 34px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.reel-zone { position: absolute; top: 2px; bottom: 2px; background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 3px; }
.reel-fish { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--card); }
.reel-progress { height: 8px; }
.reel-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.reel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.reel-legend i { display: inline-block; width: 12px; height: 12px; }
.reel-legend .k-fish { border-radius: 50%; background: var(--gold); }
.reel-legend .k-zone { background: var(--accent-soft); border: 2px solid var(--accent); border-radius: 2px; }
.reel-legend .k-prog { width: 18px; height: 6px; border-radius: 3px; background: var(--accent); }
.explore-list { display: grid; gap: 8px; }
.explore-row { display: grid; gap: 2px; width: 100%; min-height: 44px; padding: 10px 12px; text-align: left; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); cursor: pointer; }
.explore-row:hover { background: var(--accent-soft); border-color: var(--accent); }
.explore-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.explore-row span { font-size: 14px; }
.big-btn { min-height: 56px; font-size: 17px; width: 100%; user-select: none; -webkit-user-select: none; touch-action: none; }
.bait-list { display: grid; gap: 8px; }
.bait {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--card);
  cursor: pointer;
  min-height: 56px;
}
.bait[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.bait small { color: var(--muted); grid-column: 1 / -1; }
.bite-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- garden ---------- */
.trays { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tray { border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); padding: 12px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.tray canvas { width: 100%; height: 150px; display: block; background: linear-gradient(#eef3ec, #e2e9de); border-radius: 3px; }
:root[data-theme="dark"] .tray canvas { background: linear-gradient(#202b27, #1a2420); }
.tray .tray-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; }
.coral-card canvas { width: 100%; height: 120px; display: block; background: linear-gradient(#1f4f66, #12324a); border-radius: 3px; }
.coral-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.inv-section { border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); padding: 14px; }

/* ---------- journal ---------- */
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.dex-item {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--card);
  padding: 8px 8px 10px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.dex-item:hover { border-color: var(--accent); }
.dex-item canvas { width: 100%; height: 72px; display: block; }
.dex-item .dex-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-item .dex-sub { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 4px; }
.dex-item.unknown .dex-name { color: var(--muted); }
.progress-line { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-line .meter { flex: 1; max-width: 320px; }
.ms-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ms { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); }
.ms .ms-icon { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--rule); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.ms.done .ms-icon { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ms .ms-sub { font-size: 13px; color: var(--muted); }

/* ---------- focus ---------- */
.focus-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.timer { font: 600 64px/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; margin: 8px 0 12px; }
.focus-tank { aspect-ratio: 16 / 9; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; margin-top: 8px; }
.week .bar { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 4px; height: 100%; text-align: center; font-size: 12px; color: var(--muted); }
.week .bar i { align-self: end; display: block; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; }
.breath { display: grid; justify-items: center; gap: 10px; padding: 12px 0; }
.breath-ring { width: 140px; height: 140px; border-radius: 50%; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; position: relative; }
.breath-ring i { position: absolute; inset: 20px; border-radius: 50%; background: var(--accent-soft); transform: scale(0.55); transition: transform 4s linear; }
.breath-ring span { position: relative; font-weight: 600; }

/* ---------- watch mode ---------- */
body.watch .top, body.watch .tabs, body.watch .notes, body.watch .toolbar, body.watch .caption, body.watch .modebar, body.watch .visit-bar { display: none !important; }
body.watch main { padding: 0; max-width: none; }
body.watch .tank-layout { display: block; }
body.watch .plate { position: fixed; inset: 0; padding: 0; border: 0; border-radius: 0; z-index: 40; background: #000; }
body.watch .tank-wrap { aspect-ratio: auto; height: 100vh; height: 100dvh; }
.watch-clock { position: fixed; z-index: 41; right: 28px; bottom: 24px; color: rgba(255, 255, 255, 0.92); text-align: right; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); pointer-events: none; }
.watch-clock b { display: block; font: 600 72px/1 var(--serif); font-variant-numeric: tabular-nums; }
.watch-clock span { font-size: 16px; }
.watch-exit { position: fixed; z-index: 42; top: 16px; right: 16px; background: rgba(16, 28, 26, 0.6); color: #fff; border-color: transparent; }

/* ---------- onboarding ---------- */
.onb-starters { display: grid; gap: 8px; }
.onb-starter { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); cursor: pointer; text-align: left; min-height: 60px; }
.onb-starter[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.onb-starter canvas { width: 72px; height: 48px; }
.tips { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ---------- responsive ---------- */
/* ---------- angler: flick casting, reel, gauges, tournaments, album ---------- */
.angler-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 16px; }
.angler-stats { font-size: 14px; margin-left: auto; }
.duel-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--gold); border-left-width: 4px; border-radius: var(--r); background: var(--card); }
.duel-banner.beaten { border-color: var(--accent); }
.duel-banner b { font-family: var(--serif); font-size: 17px; }
.rig { margin-top: 12px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); display: flex; gap: 16px; align-items: center; }
.rig[hidden] { display: none; }
.rig-main { flex: 1; min-width: 0; display: grid; gap: 10px; }
.rig-top { display: flex; gap: 16px; align-items: end; }
.gauges { flex: 1; min-width: 0; display: grid; gap: 6px; transition: opacity 0.2s; }
.gauges.idle { opacity: 0.45; }
.gauge { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.gauge-bar { height: 10px; border-radius: 5px; background: var(--rule); overflow: hidden; }
.gauge-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; }
.gauge-bar.warn i { background: var(--warn); }
.gauge-bar.fish i { background: var(--gold); }
.line-out { display: grid; text-align: right; font-size: 13px; min-width: 76px; }
.line-out b { font: 600 22px var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.rig-drag { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.crank { width: 120px; height: 120px; flex-shrink: 0; border-radius: 50%; background: var(--paper); border: 1px solid var(--rule); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.crank:active { cursor: grabbing; }
.crank:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.crank canvas { width: 100%; height: 100%; display: block; }
.rig-label { font-size: 13px; font-weight: 600; color: var(--muted); }
@media (min-width: 901px) {
  .scene-wrap { aspect-ratio: 21 / 10; max-height: max(320px, calc(100vh - 420px)); }
}
.notes .toggles { margin-top: 10px; }
.bait.lure b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.catch-stats { display: flex; gap: 8px; align-items: baseline; margin: 4px 0 8px; }
.catch-stats b { font: 600 20px var(--serif); color: var(--accent); }
.catch-share { margin-top: 4px; }
.tourney-bar { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); font-size: 15px; }
.tourney-clock { font: 600 20px var(--serif); font-variant-numeric: tabular-nums; color: var(--accent); }
.tourney-clock.low { color: var(--warn); }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.board li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; padding: 6px 8px; border-radius: 3px; font-variant-numeric: tabular-nums; }
.board li.human { font-weight: 600; }
.board li.me { background: var(--accent-soft); }
.board-rank { color: var(--muted); }
.lead-line { font: 600 18px var(--serif); margin-bottom: 10px; }
.form-stack { display: grid; gap: 8px; }
.form-stack h3 { font-size: 14px; font-family: var(--sans); font-weight: 600; margin-top: 8px; }
.quest-list { display: grid; gap: 6px; margin-top: 10px; }
.list-row.quest { grid-template-columns: minmax(0, 1fr) auto; }
.list-row.quest.claimed .title { color: var(--muted); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.album-card { border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); padding: 10px; display: grid; gap: 8px; }
.album-card canvas { width: 100%; height: 110px; background: linear-gradient(#e7efe9, #cfe0d8); border-radius: 3px; }
:root[data-theme="dark"] .album-card canvas { background: linear-gradient(#22312c, #1a2723); }
.album-meta { display: grid; gap: 2px; font-size: 14px; }

@media (max-width: 1100px) {
  .tank-layout, .focus-layout, .scene, .two-col { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
}
@media (max-width: 900px) {
  :root { --nav-h: calc(64px + env(safe-area-inset-bottom)); }
  .top { padding: 10px 16px; }
  .brand-tag { display: none; }
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: var(--card);
    border-top: 1px solid var(--rule);
    border-bottom: 0;
    padding: 0 4px env(safe-area-inset-bottom);
    justify-content: space-around;
    gap: 0;
    overflow: visible;
  }
  .tab { flex: 1 1 0; flex-direction: column; gap: 2px; min-height: 64px; padding: 6px 2px; font-size: 12px; border-bottom: 0; border-top: 2px solid transparent; min-width: 0; }
  .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tab[aria-current="page"] { border-top-color: var(--accent); }
  main { padding: 16px; padding-bottom: calc(20px + var(--nav-h)); }
  .tank-layout, .focus-layout, .scene, .two-col { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tank-wrap { aspect-ratio: 1 / 1; max-height: 46vh; }
  .toasts { top: 64px; right: 50%; transform: translateX(50%); justify-items: center; }
  .tool { min-height: 54px; }
  .scene-wrap { aspect-ratio: 4 / 3; }
  .toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .timer { font-size: 52px; }
  .visit-bar { padding: 10px 16px; }
}
@media (max-width: 420px) {
  .chip { padding: 0 10px; }
  .level-bar { width: 28px; }
  .fish-hero { grid-template-columns: minmax(0, 1fr); }
  .fish-hero canvas { width: 100%; }
  .sheet-backdrop { padding: 0; align-items: flex-end; }
  .sheet { width: 100%; border-radius: 12px 12px 0 0; max-height: 92vh; }
  .watch-clock b { font-size: 52px; }
}
@media (max-width: 560px) {
  .rig { gap: 12px; padding: 10px; }
  .crank { width: 104px; height: 104px; }
  .gauge { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rig-top { flex-direction: column; align-items: stretch; gap: 6px; }
  .line-out { text-align: left; grid-template-columns: auto auto; justify-content: start; gap: 8px; align-items: baseline; }
  .line-out b { font-size: 18px; }
  .angler-stats { margin-left: 0; width: 100%; }
}

/* ---------- depth layer (v1.2): floating cards, soft light, glass tank ---------- */
body {
  background:
    radial-gradient(1100px 520px at 50% -160px, var(--glow), transparent 70%),
    radial-gradient(900px 600px at 100% 100%, rgba(31, 95, 74, 0.05), transparent 70%),
    var(--paper);
}
.top { border-bottom: 0; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: 8px; }
.chip { border-color: transparent; box-shadow: var(--shadow-1); }
button.chip { transition: transform 0.15s ease-out, box-shadow 0.15s ease-out; }
button.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.level-bar { height: 6px; border-radius: 3px; background: var(--surface-2); }

/* floating segmented nav on wide screens */
.tabs {
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 4px auto 0;
  padding: 5px;
  gap: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-2);
}
.tab { min-height: 42px; padding: 0 18px; border-bottom: 0; border-radius: 999px; transition: background 0.15s ease-out, color 0.15s ease-out; }
.tab:hover { background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-btn); }
.tab[aria-current="page"] .dot { background: var(--accent-ink); }

/* buttons: soft pills that lift */
.btn {
  border-radius: 999px;
  border-color: var(--rule);
  background: var(--card);
  box-shadow: var(--shadow-1);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out, color 0.15s ease-out;
}
.btn:hover { background: var(--card); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.btn.primary { box-shadow: var(--shadow-btn); }
.btn.primary:hover { box-shadow: 0 2px 2px rgba(20, 40, 32, 0.12), 0 10px 24px rgba(20, 60, 45, 0.28); }
.btn.ghost, .btn.quiet { box-shadow: none; background: transparent; }
.btn.ghost:hover, .btn.quiet:hover { background: var(--surface-2); box-shadow: none; }
.btn.icon { border-radius: 50%; }
.btn.danger { background: var(--card); }
.btn[aria-pressed="true"] { box-shadow: var(--shadow-btn); }
.btn[aria-pressed="true"]:hover { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { transform: none; box-shadow: none; }

/* the tank as a framed glass box sitting on a card */
.plate { border: 0; border-radius: var(--r-lg); padding: 14px; box-shadow: var(--shadow-3); }
.tank-wrap {
  border-radius: 16px;
  background: #2f6f66;
  box-shadow: 0 0 0 4px #27322f, 0 0 0 5px rgba(255, 255, 255, 0.08), 0 14px 26px -10px rgba(10, 30, 26, 0.55);
  margin: 5px 5px 14px;
  width: calc(100% - 10px);
}
.tank-wrap::before {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: -14px;
  height: 10px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(#2c3734, #1c2422);
  pointer-events: none;
}
.tank-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 24px rgba(0, 20, 24, 0.28);
  pointer-events: none;
}
.tank-wrap { overflow: visible; }
.tank-wrap canvas { border-radius: inherit; }
.tank-hint { border-radius: 999px; background: rgba(16, 28, 26, 0.7); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.caption { padding: 0 4px; }
.toolbar { border-top: 0; gap: 8px; padding-top: 4px; }
.tool { border-radius: 16px; background: var(--surface-2); border: 1px solid var(--rule); transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out; }
.tool:hover { background: var(--card); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.tool:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.tool[aria-pressed="true"] { background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.modebar { border-radius: var(--r); background: var(--surface-2); border-color: transparent; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05); }
.pick { border-radius: 14px; box-shadow: var(--shadow-1); border-color: transparent; }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent), var(--shadow-1); }

/* side column: each block is its own floating card */
.notes { display: grid; gap: 14px; }
.notes section, .notes section:first-child { border: 0; padding: 16px 18px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-2); }
.meter, .gauge-bar { background: var(--surface-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08); }
.check .box { border-radius: 7px; }

/* cards, tiles and rows */
.card, .tray, .inv-section, .album-card, .ms, .dex-item, .spot, .bait, .explore-row, .onb-starter, .tourney-bar, .rig, .duel-banner {
  border-color: transparent;
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
}
.dex-item, .spot, .explore-row, .bait, .album-card { transition: transform 0.18s ease-out, box-shadow 0.18s ease-out; }
.dex-item:hover, .spot:hover:not(:disabled), .explore-row:hover, .album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: transparent; }
.bait:hover { transform: translateY(-1px); box-shadow: var(--shadow-3); }
.bait[aria-pressed="true"], .onb-starter[aria-pressed="true"], .coral-card.selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow-2); border-color: transparent; }
.explore-row:hover { background: var(--card); }
.duel-banner { border-left: 0; box-shadow: inset 4px 0 0 var(--gold), var(--shadow-2); }
.duel-banner.beaten { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-2); }
.spot canvas, .dex-item canvas { border-radius: 12px; }
.spot { padding: 8px; grid-template-rows: 112px auto; }
.spot canvas { height: 112px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); }
.spot .spot-body { padding: 10px 6px 4px; }
.tray canvas, .coral-card canvas, .album-card canvas, .fish-hero canvas { border-radius: 14px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); }
.list-row { padding: 12px; margin-bottom: 8px; border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-1); }
.list-row:last-child { border-bottom: 0; }
.list-row.button-like { transition: transform 0.15s ease-out, box-shadow 0.15s ease-out; }
.list-row.button-like:hover { background: var(--card); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.list-row canvas, .thumb { border-radius: 10px; background: var(--surface-2); }
.sheet .list-row, .notes .list-row { background: var(--surface-2); box-shadow: none; }
.tag { border-radius: 999px; padding: 2px 10px; }
.ms .ms-icon { box-shadow: var(--shadow-1); border-color: transparent; background: var(--card); }
.board li { border-radius: 10px; }
.week .bar i { border-radius: 6px 6px 2px 2px; }

/* segmented control: soft inset track with a raised thumb */
.seg { border: 0; border-radius: 999px; padding: 4px; background: var(--surface-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06); }
.seg-btn { border-radius: 999px; transition: background 0.15s ease-out, color 0.15s ease-out; }
.seg-btn[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }

/* inputs */
.field input[type="text"], .field select, .input { border-radius: 14px; background: var(--surface-2); border-color: transparent; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06); }
.field input[type="text"]:focus, .field select:focus, .input:focus { background: var(--card); box-shadow: 0 0 0 2px var(--accent); outline: none; }

/* sheets float with a large radius; a grab handle on phones */
.sheet-backdrop { background: rgba(20, 26, 24, 0.36); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-3); transform: translateY(14px) scale(0.98); }
.sheet-head { border-bottom: 0; padding: 18px 16px 6px 24px; }
.sheet-body { padding: 12px 24px 18px; }
.sheet-foot { border-top: 0; padding: 8px 24px 20px; }
.sheet-title { font-size: 22px; }

/* toasts and overlays */
.toast { border-radius: 16px; padding: 10px 14px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-3); border-left: 0 !important; }
.toast.good { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-3); }
.toast.warn { box-shadow: inset 4px 0 0 var(--warn), var(--shadow-3); }
.toast.big { box-shadow: inset 4px 0 0 var(--gold), var(--shadow-3); }
.visit-bar { margin: 8px 16px 0; border: 0; border-radius: var(--r); box-shadow: var(--shadow-1); }

/* fishing scene and rig */
.scene-wrap { margin-inline: auto; border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.scene-status { border-radius: 999px; background: rgba(16, 28, 26, 0.7); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
.reel-track { border: 0; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); }
.reel-zone { border-radius: 999px; }
.crank { filter: drop-shadow(0 8px 14px rgba(20, 40, 32, 0.22)); }
.breath-ring { box-shadow: var(--shadow-2); background: var(--card); }
.watch-exit { border-radius: 999px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* watch mode keeps the full-bleed tank */
body.watch .tank-wrap { margin: 0; width: 100%; border-radius: 0; box-shadow: none; }
body.watch .tank-wrap::before, body.watch .tank-wrap::after { display: none; }
body.watch .plate { box-shadow: none; }

@media (max-width: 900px) {
  :root { --nav-h: calc(88px + env(safe-area-inset-bottom)); }
  .tabs {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    margin: 0;
    padding: 6px;
    border-radius: 24px;
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-3);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .tab { min-height: 58px; border-top: 0; border-radius: 18px; padding: 6px 2px; }
  .tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
  .tab[aria-current="page"] .dot { background: var(--warn); }
  .plate { padding: 10px; border-radius: 22px; }
  .tank-wrap { box-shadow: 0 0 0 3px #27322f, 0 0 0 4px rgba(255, 255, 255, 0.08), 0 12px 22px -10px rgba(10, 30, 26, 0.55); margin: 4px 4px 12px; width: calc(100% - 8px); border-radius: 14px; }
  .tank-wrap::before { bottom: -11px; height: 8px; }
  .toolbar { gap: 6px; }
  .tool { border-radius: 14px; }
  .scene-wrap { border-radius: 20px; }
}
@media (max-width: 420px) {
  .sheet { border-radius: 26px 26px 0 0; }
  .sheet-head { position: relative; padding-top: 22px; }
  .sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--rule); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .tool:hover, .dex-item:hover, .spot:hover, .explore-row:hover, .album-card:hover, .list-row.button-like:hover, button.chip:hover { transform: none; }
}


/* ---------- v1.2.1: toggles, nav scrim, garden bench, field-guide journal ---------- */
/* toggle pills show a clear on/off dot and stay readable when on */
.btn.quiet[aria-pressed]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  box-sizing: border-box;
  flex: none;
}
.btn.quiet[aria-pressed="true"],
.btn.quiet[aria-pressed="true"]:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.btn.quiet[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); }
.row.toggles { gap: 8px; flex-wrap: wrap; }

/* the main fishing action matches the scene width instead of the whole column */
.big-btn { display: flex; max-width: 560px; margin-inline: auto; justify-self: center; border-radius: 999px; }

/* toasts have a fixed lane in the header bar, clear of content and controls */
@media (min-width: 901px) {
  .toasts { top: 16px; bottom: auto; right: 50%; transform: translateX(50%); justify-items: center; width: min(420px, calc(100% - 640px)); }
}
@media (max-width: 900px) {
  .toasts { top: calc(10px + env(safe-area-inset-top)); right: 50%; transform: translateX(50%); width: calc(100% - 24px); justify-items: stretch; }
  .toast { min-height: 44px; display: flex; align-items: center; }
}

/* phone: content fades out under the floating nav instead of showing through */
@media (max-width: 900px) {
  main { padding-bottom: calc(40px + var(--nav-h)); }
  body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--nav-h) + 4px);
    background: linear-gradient(to bottom, transparent 0, var(--paper) 14px);
    pointer-events: none;
    z-index: 29;
  }
  body.watch::after { display: none; }
}

/* garden bench: loop, seed shelf and orders fill the greenhouse */
.garden-main { display: grid; gap: 16px; min-width: 0; }
.garden-main > .explain { margin: -4px 0 0; }
.garden-side { display: grid; gap: 16px; }
.garden-loop { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 14px 16px; }
.garden-loop h3 { margin: 0 0 10px; font-size: 15px; font-family: var(--sans); }
.garden-loop ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.garden-loop li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.3; padding: 8px 10px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink); }
.garden-loop .step-no { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 13px; }
.seed-section .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.seed-section h3 { margin: 0; }
.seed-section .section-head .muted { font-size: 14px; }
.seed-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.seed { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 10px 12px 12px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.seed canvas { width: 100%; height: 96px; display: block; border-radius: 12px; background: linear-gradient(#f1f4ee, #e6ece2); }
:root[data-theme="dark"] .seed canvas { background: linear-gradient(#202b27, #1a2420); }
.seed b { font-size: 15px; margin-top: 4px; }
.seed .muted { font-size: 13px; line-height: 1.35; }
.seed .btn { justify-self: start; margin-top: 6px; }
.garden-orders h3 { margin-top: 0; }
@media (max-width: 900px) {
  .garden-loop ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seed-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* field-guide journal: catalogue numbers, Latin names, paper grain */
.dex-item { position: relative; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-color: var(--card); }
.dex-item .dex-no { position: absolute; top: 8px; left: 10px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.dex-item canvas { margin-top: 10px; }
.dex-sci { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-item .dex-sub { border-top: 1px dashed var(--rule); padding-top: 6px; margin-top: 2px; }
.inv-section, .garden-loop { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .dex-item, :root[data-theme="dark"] .inv-section, :root[data-theme="dark"] .garden-loop { background-image: none; }

/* journal: a thin rarity band on every card; undiscovered species show as ink silhouettes */
.dex-item[data-rar="2"] { box-shadow: inset 0 3px 0 var(--accent), var(--shadow-1, 0 1px 2px rgba(0, 0, 0, 0.06)); }
.dex-item[data-rar="3"] { box-shadow: inset 0 3px 0 var(--gold), var(--shadow-1, 0 1px 2px rgba(0, 0, 0, 0.06)); }
.dex-item[data-rar="4"], .dex-item[data-rar="5"] { box-shadow: inset 0 4px 0 var(--gold), inset 0 0 0 1px rgba(201, 152, 58, 0.35), var(--shadow-1, 0 1px 2px rgba(0, 0, 0, 0.06)); }
.dex-item.unknown canvas { background: radial-gradient(ellipse at 50% 55%, rgba(31, 95, 74, 0.08), transparent 70%); }

/* ---------- v1.4: field-guide side cards, loop links, greenhouse bays, focus ---------- */
.field-card h3 { margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.plate-head { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; font: 600 15px var(--serif); color: var(--ink); }
.plate-no { font: italic 500 13px var(--serif); color: var(--gold); min-width: 18px; }
.from-head { margin: 10px 0 2px; font: italic 14px var(--serif); color: var(--muted); }
.ledger li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; }
.ledger .leader { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-3px); }
.loop-links { display: grid; gap: 2px; margin-top: 8px; }
.loop-link { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 10px; margin: 0 -10px; border-radius: 10px; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.loop-link:hover { background: var(--accent-soft); }
.loop-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.loop-link .ic { flex: none; transition: transform 0.15s ease-out; }
.loop-link:hover .ic { transform: translateX(3px); }
.entry-no { font: italic 500 13px var(--serif); color: var(--gold); margin-right: 8px; }
.tray canvas { height: 168px; background: #e4ece2; }
.breath-section .breath { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; gap: 16px; padding: 0; }
.breath-section .breath-ring { width: 96px; height: 96px; }
.breath-section .breath-ring i { inset: 12px; }
.breath-section .breath-ring span { font-size: 13px; }
.breath-section h3 { margin: 0 0 4px; }
.breath-section .explain { margin: 0 0 8px; }
.week { height: 96px; }
.week.empty .bar i { background: transparent; border: 1.5px dashed var(--rule); border-bottom: 0; }
.week .bar.today span { color: var(--ink); font-weight: 600; }
.week .bar.today i { box-shadow: 0 0 0 2px var(--accent-soft); }
.week-note { margin: 8px 0 0; font: italic 14px/1.45 var(--serif); color: var(--muted); }
@media (min-width: 901px) {
  /* one line in the header band, between the wordmark and the pills, so it never covers content or the nav */
  .toasts { top: 14px; bottom: auto; right: 50%; transform: translateX(50%); justify-items: center; width: min(560px, calc(100% - 620px)); }
  .toast { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
}
.btn:disabled { opacity: 1; background: var(--surface-2); color: var(--muted); border-color: var(--rule); box-shadow: none; }
.dex-hint { font: italic 13px/1.35 var(--serif); color: var(--muted); margin-top: 2px; }
.crank-wrap { display: grid; justify-items: center; gap: 6px; }
.crank-cap { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 560px) {
  .trays { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tray { padding: 10px; gap: 6px; }
  .tray canvas { height: 118px; }
  .tray .btn { width: 100%; justify-content: center; }
  .tank-hint { font-size: 13px; padding: 6px 12px; white-space: nowrap; }
}

/* v1.4 care gauges: a scale with the safe band and a marker for the reading */
.reading .gauge { position: relative; display: block; height: 6px; margin: 4px 0 2px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 18%, transparent); }
.reading .gauge-safe { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: color-mix(in srgb, var(--accent) 38%, transparent); }
.reading .gauge-mark { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1.5px; border-radius: 2px; background: var(--ink, #1b2422); }
.reading.high .gauge-mark, .reading.low .gauge-mark { background: var(--warn); }
.reading { background: var(--card); border: 1px solid var(--rule); }

/* v1.5 koi pond */
.pond-layout { display: grid; gap: 14px; }
.pond-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 24px; }
.pond-head h2 { margin: 0 0 4px; }
.pond-head p { margin: 0; max-width: 62ch; }
.pond-stat { font-size: 14px; }
.pond-stage { position: relative; height: clamp(420px, 72vh, 820px); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); background: #2a5a55; isolation: isolate; }
.pond-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; outline: none; }
.pond-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.pond-hint { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; background: rgba(14, 30, 28, 0.62); color: #f4f1ea; font-size: 14px; white-space: nowrap; max-width: calc(100% - 96px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; transition: opacity 0.6s ease-out; }
.pond-hint.gone { opacity: 0; }
.pond-eye { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; background: rgba(251, 248, 241, 0.82); color: #1d2a27; box-shadow: var(--shadow-1); }
.pond-dock { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px; max-width: calc(100% - 24px); border-radius: 24px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-2); transition: opacity 0.4s ease-out; }
.pond-dock .btn { min-height: 40px; white-space: nowrap; }
.pond-dock .btn.quiet[aria-pressed]::before { display: none; }
.pond-layers + .muted, .pond-layers + p { margin-top: 10px; }
.pond-dock .btn[aria-pressed="true"], .pond-layers .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.pond-layers { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet input[type="range"] { width: 100%; accent-color: var(--accent); }
.focus-layout .loop-link { margin-top: 10px; }
body.pond-calm .top, body.pond-calm .tabs, body.pond-calm .pond-head, body.pond-calm .skip { display: none !important; }
body.pond-calm .pond-stage { position: fixed; inset: 0; height: 100vh; height: 100dvh; border-radius: 0; z-index: 60; box-shadow: none; }
body.pond-calm .pond-dock, body.pond-calm .pond-hint { opacity: 0; pointer-events: none; }
body.pond-calm .pond-eye { background: rgba(251, 248, 241, 0.5); }
@media (max-width: 900px) {
  .pond-stage { height: max(360px, calc(100svh - 300px)); border-radius: 20px; }
  .pond-head h2 { font-size: 22px; }
  .pond-head p.muted:not(.pond-stat) { font-size: 14px; }
  .pond-dock { bottom: 10px; gap: 4px; padding: 6px; border-radius: 20px; }
  .pond-dock .btn { min-height: 40px; padding: 0 10px; font-size: 13px; }
  .pond-hint { font-size: 12px; top: 10px; }
}
@media (max-width: 520px) {
  .pond-dock .btn span:not(.ic) { display: none; }
  .pond-dock { flex-wrap: nowrap; }
  .pond-dock .btn { width: 42px; min-width: 42px; padding: 0; justify-content: center; }
}
