:root {
  --bg: #121418;
  --fg: #ecece8;
  --muted: #9a9a94;
  --line: #2a2c32;
  --accent: #c9a45c;
  --cell: #1b1d22;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 1280px;
  padding: 28px 20px 64px;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 "Segoe UI", system-ui, sans-serif;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.account {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.account button {
  margin-left: 8px;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 4px 8px;
  cursor: pointer;
}

.acct-guest,
.acct-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.acct-chip strong {
  color: var(--fg);
  font-weight: 600;
}

.acct-form,
.acct-card {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.acct-card {
  flex-direction: column;
  max-width: 320px;
  padding: 12px;
  background: var(--cell);
  border: 1px solid var(--line);
}

.acct-title {
  margin: 0;
  color: var(--fg);
  font-weight: 600;
}

.acct-card label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.acct-form input,
.acct-card input {
  padding: 8px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
}

.acct-actions {
  display: flex;
  gap: 8px;
}

.acct-err {
  margin: 0;
  color: #e8b4b4;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.meta,
.note {
  color: var(--muted);
  font-size: 13px;
}

.hill-wrap {
  margin: 0;
  min-width: 220px;
}

.hill-wrap figcaption {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.hill svg {
  display: block;
  width: 220px;
  height: 200px;
}

.hill .peak {
  fill: #1c222c;
  stroke: #6a7380;
  stroke-width: 1.5;
}

.hill .base-line {
  stroke: #6a7380;
  stroke-width: 1;
}

.hill .spot {
  cursor: pointer;
}

.hill .spot circle {
  fill: var(--cell);
  stroke: #cfcfc8;
  stroke-width: 2;
}

.hill .spot.selected circle {
  fill: var(--accent);
  stroke: #f0d9a0;
}

.hill .spot text {
  fill: var(--fg);
  font-size: 11px;
}

.hill .spot .elev {
  fill: var(--muted);
  font-size: 9px;
}

.hill .tide-fill {
  fill: #c5d4e2;
  opacity: 0.45;
}

.tide-stage {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.tide-read {
  margin: 8px 0;
}

.tide-dates {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 12px;
}

.tide-day {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 6px 8px;
  background: var(--cell);
  color: var(--fg);
  border: 1px solid var(--line);
  cursor: pointer;
  font: 11px/1.25 "Segoe UI", system-ui, sans-serif;
  text-align: center;
}

.tide-day .day-snow {
  display: block;
  color: var(--muted);
}

.tide-day.snowy .day-snow {
  color: var(--fg);
  font-weight: 600;
}

.tide-day.on {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.gauge {
  margin: 8px 0 16px;
  padding-bottom: 8px;
}

.gauge-track {
  position: relative;
  height: 36px;
  background: linear-gradient(90deg, #1b1d22 0%, #2a2418 100%);
  border: 1px solid var(--accent);
}

.gauge-now,
.gauge-proj {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
}

.gauge-proj {
  background: #7ea3c2;
}

.gauge-now {
  background: #c5d4e2;
}

.gauge-mark {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  background: none;
  border: 0;
  padding: 40px 0 0;
  color: var(--muted);
  cursor: help;
  font: 10px/1.2 "Segoe UI", system-ui, sans-serif;
  text-align: center;
  z-index: 1;
}

.gauge-mark .mark-line {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 1px;
  height: 44px;
  background: #8a8a84;
}

.gauge-mark.filled {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  transform: translateX(-100%);
  padding-right: 8px;
  text-align: right;
  z-index: 2;
}

.gauge-mark.filled .mark-line {
  left: auto;
  right: 0;
  width: 5px;
  height: 48px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(201, 164, 92, 0.7);
}

.gauge-ends {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 28px;
}

.gauge-pct {
  flex: 1;
  text-align: center;
  color: var(--fg);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 8px;
  text-align: center;
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

th.model,
td.model {
  text-align: left;
  white-space: nowrap;
}

.snow {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.sub {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.lvl-0 { background: var(--cell); color: var(--muted); }
.lvl-1 { background: #243044; }
.lvl-2 { background: #2f4d6a; }
.lvl-3 { background: #3d6f8f; }
.lvl-4 { background: #8a6a32; }
.lvl-5 { background: #b8873a; color: #111; }

td.wx-rain .sub,
td.wx-wet .sub,
td.wx-snow .sub,
td.wx-good .sub {
  color: inherit;
  opacity: 0.8;
}

td.wx-smoke .sub {
  color: #3a2f18;
  opacity: 0.75;
}

td.wx-rain,
.swatch.wx-rain {
  background: #1d4e89;
  color: #e8f1ff;
}

td.wx-wet,
.swatch.wx-wet {
  background: #5b3a7a;
  color: #f3e9ff;
}

td.wx-good,
.swatch.wx-good {
  background: #c45c12;
  color: #fff4e8;
}

td.wx-smoke,
.swatch.wx-smoke {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f7ecd0 0%, #e0c48a 55%, #c9a45c 100%);
  color: #3a2f18;
}

td.wx-none {
  background: var(--cell);
}

td.wx-snow,
.swatch.wx-snow {
  background: #3d5368;
  color: #e8eef4;
}

.wx-fx {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.wx-fx::before,
.wx-fx::after {
  content: "";
  position: absolute;
}

.wx-fx::before {
  left: 18%;
  bottom: -6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow:
    14px 10px 0 1px rgba(255, 248, 220, 0.55),
    28px 4px 0 0 rgba(255, 255, 255, 0.45),
    8px 16px 0 -1px rgba(255, 255, 255, 0.35);
  animation: wx-bubbles 2.4s ease-in infinite;
}

.wx-fx::after {
  left: 8%;
  right: 8%;
  top: -20%;
  height: 75%;
  background:
    radial-gradient(ellipse at 40% 80%, rgba(255, 255, 255, 0.5), transparent 55%),
    radial-gradient(ellipse at 70% 90%, rgba(255, 248, 220, 0.4), transparent 60%);
  filter: blur(5px);
  animation: wx-smoke 3.2s ease-in-out infinite;
}

@keyframes wx-bubbles {
  0% { transform: translateY(8px); opacity: 0; }
  20% { opacity: 0.85; }
  100% { transform: translateY(-28px); opacity: 0; }
}

@keyframes wx-smoke {
  0%, 100% { opacity: 0.2; transform: translateX(0) scale(1); }
  50% { opacity: 0.55; transform: translateX(7px) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .wx-fx::before,
  .wx-fx::after {
    animation: none;
    opacity: 0.35;
  }
}

.wx-key {
  margin: 10px 0 14px;
}

.wx-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  position: relative;
  overflow: hidden;
  min-width: 92px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.wx-prefs {
  margin-top: 10px;
}

.wx-prefs summary {
  cursor: pointer;
  color: var(--accent);
}

.wx-prefs label {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.wx-prefs input {
  width: 72px;
  margin: 0 6px;
  padding: 4px 6px;
  background: var(--cell);
  color: var(--fg);
  border: 1px solid var(--line);
}

.wx-prefs button {
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--cell);
  color: var(--fg);
  border: 1px solid var(--line);
  cursor: pointer;
}

.fresh-callout {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--cell);
  border-left: 3px solid var(--accent);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.45;
}

.status,
.sources,
.tide,
.planning,
.matrix-block,
.play {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.status h2,
.sources h2,
.tide h2,
.planning h2,
.matrix-block h2,
.play h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

#plan {
  min-width: 1100px;
}

#plan th.metric,
#plan td.metric {
  text-align: left;
  white-space: nowrap;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
  min-width: 148px;
}

.prios {
  text-align: left;
  font-size: 11px;
  line-height: 1.35;
}

.has-tip {
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}

.float-tip {
  position: fixed;
  z-index: 40;
  width: 280px;
  padding: 12px 14px;
  background: #1f2127;
  color: var(--fg);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: auto;
}

.float-tip::before {
  content: "";
  position: absolute;
  inset: -18px;
  z-index: -1;
}

.float-tip p {
  margin: 0;
}

.float-tip.has-map {
  width: min(1200px, calc(100vw - 24px));
}

.float-tip iframe {
  display: block;
  width: 100%;
  height: 640px;
  margin-top: 8px;
  border: 0;
  background: #ddd;
}

.open-hero,
.crowd-hero {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.open-hero .sub-hero {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.diffs {
  display: grid;
  gap: 6px;
  max-width: 520px;
  margin: 12px 0;
}

.diff {
  display: grid;
  grid-template-columns: 110px 1fr 110px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.diff-bar {
  height: 10px;
  background: #1b1d22;
  border: 1px solid var(--line);
}

.diff-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.diff.green .diff-bar span { background: #3d8c5a; }
.diff.blue .diff-bar span { background: #3d6f8f; }
.diff.blue_black .diff-bar span { background: #4a5f88; }
.diff.black .diff-bar span { background: #cfcfc8; }
.diff.double_black .diff-bar span { background: #8a8a84; }

.crowd-hero.low { color: #8fbf9a; }
.crowd-hero.moderate { color: var(--accent); }
.crowd-hero.high { color: #d7b48a; }
.crowd-hero.very-high { color: #e08a6a; }

.sources a,
.status a {
  color: var(--accent);
}

.go {
  outline: 1px solid var(--accent);
}

.warn {
  color: #d7b48a;
}

.flag {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: var(--cell);
  border-left: 3px solid var(--accent);
}

.flag .conf {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ask-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  padding: 12px 16px;
  background: var(--accent);
  color: #1a1408;
  border: 0;
  font: 600 14px/1.2 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.ask-meter {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
}

.ask-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 46;
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: #1b1d22;
  border: 1px solid var(--line);
  padding: 14px;
}

.ask-panel[hidden] {
  display: none;
}

.ask-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.ask-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.ask-close,
.ask-form button,
.ask-bob {
  background: var(--cell);
  color: var(--fg);
  border: 1px solid var(--line);
  padding: 6px 10px;
  cursor: pointer;
}

.ask-form button {
  background: var(--accent);
  color: #1a1408;
  border: 0;
  font-weight: 600;
}

.ask-log {
  flex: 1;
  overflow-y: auto;
  margin: 12px 0;
  min-height: 80px;
  font-size: 13px;
}

.ask-turn {
  margin: 0 0 10px;
}

.ask-turn .who {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ask-form textarea,
.ask-key input,
.ask-key select {
  width: 100%;
  margin: 4px 0 8px;
  padding: 8px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  font: 14px/1.4 "Segoe UI", system-ui, sans-serif;
}

.ask-form {
  display: grid;
  gap: 8px;
}

.ask-key label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.ask-bob {
  margin: 0 6px 0 0;
  background: transparent;
  color: var(--accent);
  border: 0;
  padding: 0;
  text-decoration: underline;
  font: inherit;
}
