/* NC Fishing — light, coastal palette, mobile first. Light always (same rule as The Miller Table). */
:root {
  --bg: #f4f8fb;
  --card: #ffffff;
  --ink: #15262f;
  --muted: #5b6b74;
  --line: #dbe5eb;
  --accent: #0f5c7a;
  --accent-ink: #ffffff;
  --accent-soft: #dcedf4;
  /* Score colors: each carries white text at ≥ 4.5:1 contrast. */
  --good: #1f7a45;
  --ok: #8a6100;
  --meh: #5f6b73;
  --nogo: #b3261e;
  --radius: 14px;
  --tabbar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 8px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 9px; }
.brand-name { display: none; font-weight: 700; }
.topbar h1 { font-size: 1.2rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { max-width: 760px; margin: 0 auto; padding: 12px 12px 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: .8rem;
}
.tabbar a span { font-size: 1.4rem; }
.tabbar a.on { color: var(--accent); font-weight: 700; }

@media (min-width: 900px) {
  .brand-name { display: inline; }
  .tabbar { position: sticky; top: 0; justify-content: center; border: 0; }
  .tabbar a { flex: 0 0 110px; }
}

/* ---------- Pieces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }
.pad { padding: 20px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.big { font-size: 1.5rem; font-weight: 700; margin: 0 0 4px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 3px 0; }
.banner { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: .92rem; }
.attrib { font-size: .75rem; margin-top: 12px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .92rem; font-weight: 600; }
input, select {
  font: inherit; font-size: 16px; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--nogo); }
.btn.link { border: 0; background: none; color: var(--accent); padding: 6px; min-height: 0; }
.btn:disabled { opacity: .55; cursor: default; }
#view > div > .btn { width: 100%; margin-bottom: 12px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; max-width: 92vw; font-size: .92rem;
}
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 25, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto;
}

/* ---------- Sign-in ---------- */
.auth { text-align: center; padding: 24px 18px; max-width: 420px; margin: 24px auto; }
.auth-logo { border-radius: 20px; margin-bottom: 8px; }

/* ---------- Map ---------- */
.map { height: 52vh; min-height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--accent-soft); }
.map-help { font-size: .85rem; margin: 6px 2px 10px; }
.pin {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--meh);
  color: #fff; font-weight: 700; font-size: .8rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: pointer; padding: 0;
}
.spot-list { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.spot-list li + li { border-top: 1px solid var(--line); }
.spot-list a { display: flex; align-items: center; gap: 10px; padding: 12px; min-height: 52px; color: var(--ink); text-decoration: none; }
.spot-name { flex: 1; font-weight: 600; }
.score {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 28px; padding: 0 6px;
  border-radius: 8px; color: #fff; font-weight: 700; font-size: .85rem; background: var(--meh);
}
.score.pending { background: var(--line); color: var(--muted); }

/* ---------- Spot ---------- */
.go { display: flex; gap: 14px; align-items: center; }
.big-score {
  flex: 0 0 72px; height: 72px; border-radius: 16px; color: #fff; font-size: 1.6rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.go.nogo .big-score { font-size: 1rem; }
.alert { border-color: var(--nogo); }
.windows { padding-left: 20px; margin: 0 0 10px; }
.windows li { margin-bottom: 8px; }
.windows .score { height: 22px; min-width: 34px; font-size: .78rem; margin-left: 6px; vertical-align: middle; }
.strip { display: flex; align-items: flex-end; gap: 1px; height: 84px; padding-bottom: 16px; position: relative; }
.strip .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.strip .bar i { display: block; border-radius: 2px 2px 0 0; }
.strip .bar span { position: absolute; bottom: -16px; left: 0; font-size: .65rem; color: var(--muted); white-space: nowrap; }
svg.tide { width: 100%; height: 64px; }
svg.tide path { fill: none; stroke: var(--accent); stroke-width: 2.5; }

/* ---------- Catch ---------- */
.photo-btn { flex-direction: row; cursor: pointer; }
.preview { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: #000; }
.verdict .call { font-size: 1.4rem; margin-bottom: 4px; }
.verdict.keep { border: 2px solid var(--good); }
.verdict.release { border: 2px solid var(--nogo); }
.verdict.measure, .verdict.check, .verdict.unsure { border: 2px solid var(--ok); }
.site-adv { border-left: 4px solid var(--nogo); padding-left: 10px; margin: 8px 0; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.log li > div { flex: 1; }
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--accent-soft); flex: 0 0 64px; }
