:root {
  --bg: #071018;
  --bg-2: #0c1a28;
  --card: #122033;
  --card-2: #183047;
  --line: #2a4158;
  --text: #f4f7f5;
  --muted: #b4c2cf;
  --teal: #2bc4b2;
  --teal-dim: #1a7f74;
  --navy: #0a1628;
  --gold: #e2b15a;
  --danger: #ef6b6b;
  --ok: #5cd67a;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --tap: 48px;
  color-scheme: dark;
}

:root.sun {
  --bg: #f3ecd8;
  --bg-2: #efe4c8;
  --card: #fffdf6;
  --card-2: #f7f0dc;
  --line: #1c3348;
  --text: #0b1a28;
  --muted: #2c4458;
  --teal: #0a6d62;
  --teal-dim: #08574e;
  --navy: #10233a;
  --gold: #8a5a00;
  --danger: #b42318;
  --ok: #157a32;
  --shadow: 0 6px 16px rgba(16, 30, 40, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 20% -10%, #16324a 0%, var(--bg) 55%);
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  padding-bottom: 88px;
}

h1, h2, h3 { margin: 0 0 0.4rem; letter-spacing: 0.01em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 0.75rem; }

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; }
.brand strong { font-size: 1.05rem; }
.brand span { color: var(--muted); font-size: 0.78rem; }
.header-actions { display: flex; gap: 8px; }

button, .btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: var(--tap); min-width: var(--tap);
  padding: 10px 14px; border-radius: 12px;
  background: var(--card-2); color: var(--text);
  font: inherit; font-weight: 650;
}
button.primary, .btn.primary {
  background: var(--teal); color: #06211d;
}
:root.sun button.primary { color: #fff; }
button.ghost { background: transparent; border: 1px solid var(--line); }
button.danger { background: var(--danger); color: #fff; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.wrap { padding: 14px; max-width: 720px; margin: 0 auto; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.ok { color: var(--ok); }
.warn { color: var(--gold); }
.err { color: var(--danger); }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  background: var(--gold); color: #23180a; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.04em;
}
:root.sun .badge { color: #fff; }

.species-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.species-btn {
  min-height: 64px;
  background: var(--card-2);
  border: 2px solid transparent;
  font-size: 0.95rem;
  padding: 8px 6px;
}
.species-btn[aria-pressed="true"] {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 22%, var(--card-2));
}

.length-row, .stepper {
  display: flex; align-items: center; gap: 10px;
}
.stepper button { font-size: 1.4rem; width: 56px; }
.stepper input {
  flex: 1; min-height: var(--tap); text-align: center;
  font-size: 1.4rem; font-weight: 750;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); width: 100%;
}

label.field { display: block; margin: 12px 0 6px; font-weight: 650; }
input[type="text"], input[type="date"], input[type="number"], textarea, select {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit;
}
textarea { min-height: 88px; resize: vertical; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button[aria-pressed="true"] { background: var(--teal); color: #06211d; }
:root.sun .seg button[aria-pressed="true"] { color: #fff; }

.conditions dl {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0;
}
.conditions dt { color: var(--muted); font-size: 0.78rem; }
.conditions dd { margin: 2px 0 0; font-weight: 700; }

.gps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gps code { font-size: 0.85rem; }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 2px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--navy) 94%, black);
  border-top: 1px solid var(--line);
}
nav.tabs button {
  min-width: 0; min-height: 56px; padding: 6px 2px;
  background: transparent; color: var(--muted);
  font-size: 0.68rem; font-weight: 750; letter-spacing: 0.02em;
}
nav.tabs button[aria-current="page"] { color: var(--teal); }
nav.tabs .ico { display: block; font-size: 1.1rem; margin-bottom: 2px; }

.view { display: none; }
.view.active { display: block; }

.catch-item {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.catch-item:last-child { border-bottom: 0; }
.catch-item h3 { font-size: 1.05rem; }
#map { height: 68vh; min-height: 360px; border-radius: 16px; border: 1px solid var(--line); }

.bar {
  height: 10px; border-radius: 99px; background: var(--card-2); overflow: hidden;
}
.bar > span { display: block; height: 100%; background: var(--teal); }
.trend-row { margin: 10px 0; }
.trend-row .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }

.plan-stop { border-left: 4px solid var(--teal); padding-left: 10px; margin: 14px 0; }
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--teal); color: #06211d; padding: 10px 16px; border-radius: 999px;
  font-weight: 750; z-index: 40; display: none;
}
details.more { margin-top: 8px; }
details.more > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#other-wrap { display: none; margin-top: 8px; }
#other-wrap.show { display: block; }

@media (min-width: 700px) {
  .species-grid { grid-template-columns: repeat(4, 1fr); }
}
