/* Three Coasts - Surfline Inspired Design
   Light theme only. Soft slate typography (never pitch black #000000).
   Beloved condition rating colors preserved.
*/

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --surface-subtle: #F1F5F9;
  --surface-active: #E2E8F0;
  
  /* Soft Slate Typography Tokens */
  --ink: #1E293B;            /* Deep slate primary text (replaces harsh black) */
  --ink-heading: #0F172A;    /* Crisp dark slate for main titles */
  --muted: #64748B;          /* Cool slate for secondary info, units, labels */
  --muted-light: #94A3B8;    /* Lighter slate for tertiary meta */
  --line: #E2E8F0;           /* Soft border lines */
  --line-strong: #CBD5E1;    /* Stronger border lines */
  --accent: #0284C7;         /* Clean ocean blue accent */
  --accent-light: #E0F2FE;   /* Light ocean tint */
  --star-gold: #F59E0B;      /* Favorite star */

  /* Conditions: pale to dark green (Exact original rating palette from BRAND.md) */
  --c0: #EEF1EE; /* Flat */
  --c1: #E5F5E0; /* Crap */
  --c2: #C7E9C0; /* Meh */
  --c3: #A1D99B; /* Meh to fun */
  --c4: #5DB866; /* Fun */
  --c5: #2B8344; /* Fun to good */
  --c6: #1A6B35; /* Good */
  --c7: #003D18; /* Firing */

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.03);
  --shadow-float: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);

  --font: 'Commissioner', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Rating color helper classes: labels sit in ink on light greens, white on dark greens */
.c0 { --c: var(--c0); --c-text: var(--ink); }
.c1 { --c: var(--c1); --c-text: var(--ink); }
.c2 { --c: var(--c2); --c-text: var(--ink); }
.c3 { --c: var(--c3); --c-text: var(--ink); }
.c4 { --c: var(--c4); --c-text: var(--ink); }
.c5 { --c: var(--c5); --c-text: #FFFFFF; }
.c6 { --c: var(--c6); --c-text: #FFFFFF; }
.c7 { --c: var(--c7); --c-text: #FFFFFF; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Main App Container */
#app {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

@media (min-width: 1024px) {
  #app {
    max-width: 88rem;
    padding: 0 2rem 4rem;
    display: flex;
    gap: 2.25rem;
    align-items: flex-start;
  }

  .sidebar-overlay {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    width: 17.5rem !important;
    flex-shrink: 0 !important;
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 30 !important;
  }

  .sidebar-drawer {
    position: sticky !important;
    top: 0 !important;
    height: 100vh !important;
    width: 17.5rem !important;
    transform: translateX(0) !important;
    box-shadow: none !important;
    border-right: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
  }

  #close-sidebar,
  #toggle-sidebar {
    display: none !important;
  }

  .app-main-pane {
    flex: 1;
    min-width: 0;
  }
}

/* Top App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin: 0 -1rem 1rem;
  padding: 0.75rem 1rem;
}

@media (min-width: 1024px) {
  .app-header {
    margin: 0 0 1.25rem;
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.header-brand img { width: 1.875rem; height: 1.875rem; }
.header-title-box { display: flex; flex-direction: column; }
.header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-heading);
  line-height: 1.2;
}
.header-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-icon:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}
.btn-icon svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 16-Day Interactive Horizontal Scrubber */
.scrubber-section {
  margin-bottom: 1.25rem;
}
.scrubber-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.scrubber-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.scrubber-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.day-scrubber {
  display: flex;
  gap: 0.375rem;
  overflow-x: auto;
  padding: 0.25rem 0.125rem 0.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.day-scrubber::-webkit-scrollbar { display: none; }

.day-pill {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 3.875rem;
  padding: 0.5rem 0.375rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.day-pill:hover:not(.active) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.day-pill .dp-weekday {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}
.day-pill .dp-date {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0.125rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.day-pill .dp-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  margin-top: 0.25rem;
}

/* Active day pill (soft slate contrast, clean) */
.day-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.15);
}
.day-pill.active .dp-weekday { color: #CBD5E1; }
.day-pill.active .dp-date { color: #FFFFFF; }

/* Coast Filter Pills */
.coast-filters {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}
.coast-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 0.3125rem 0.875rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* Best Bet Banner */
.plan-card {
  padding: 1rem 1.125rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.plan-title { margin: 0 0 0.5rem; font-size: 1.0625rem; font-weight: 800; color: var(--ink-heading); }
.plan-card p { margin: 0 0 0.5rem; max-width: 70ch; color: var(--ink); line-height: 1.5; }
.plan-card .plan-wait { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.plan-note { display: block; color: var(--muted); font-size: 0.75rem; }

.best-bet-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.125rem;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-left: 4px solid var(--c4);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.best-bet-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (min-width: 768px) {
  .best-bet-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.125rem 1.5rem;
  }
  .best-bet-content {
    flex: 1;
  }
  .best-bet-chips {
    margin-top: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
  }
}
.best-bet-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c5);
}
.best-bet-headline {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-heading);
  margin: 0;
}
.best-bet-desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}
.best-bet-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Condition Rating Badge */
.cond-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.625rem;
  border-radius: var(--radius-sm);
  background: var(--c);
  color: var(--c-text, var(--ink));
  box-shadow: inset 0 0 0 1px rgba(30, 41, 59, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Overview: every spot on one row, the same day columns, scrolling sideways together */
.overview { --ov-col: 5.75rem; margin-bottom: 1.5rem; }
.ov-scroll {
  overflow-x: auto;
  padding: 0 0.25rem 0.75rem;
  margin: 0 -0.25rem;
  scrollbar-width: thin;
  user-select: none;
  -webkit-user-select: none;
}
.ov-head, .ov-days { display: grid; grid-template-columns: repeat(16, var(--ov-col)); }
.ov-head { width: max-content; padding: 0 calc(1rem + 1px); }
.ov-dayhead {
  display: grid; justify-items: center; gap: 0.0625rem; margin: 0 0.25rem; padding: 0.375rem 0;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--muted);
}
.ov-dayhead b { font-size: 1.0625rem; font-weight: 800; color: var(--ink-heading); }
.ov-dayhead:hover:not(.active) { background: var(--surface-hover); }
.ov-dayhead.active { background: var(--ink-heading); color: #CBD5E1; }
.ov-dayhead.active b { color: #FFFFFF; }
.ov-spot {
  display: block; width: max-content; min-width: 100%; margin-top: 0.75rem; padding: 0.875rem 1rem 0.875rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); -webkit-user-drag: none;
}
.ov-spot:hover { border-color: var(--line-strong); }
/* The name stays in view while the days scroll under it. */
.ov-name { position: sticky; left: 1rem; display: inline-flex; align-items: baseline; gap: 0.5rem; font-size: 1.0625rem; font-weight: 700; color: var(--ink-heading); }
.ov-name small { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.ov-days { position: relative; margin-top: 0.75rem; }
/* Sits just above the dashes, so pale "Crap" dashes don't disappear into it. */
.ov-wave { position: absolute; left: 0; bottom: 1rem; width: 100%; height: 2rem; }
.ov-wave path { fill: var(--c1); }
.ov-day { position: relative; display: grid; justify-items: center; gap: 0.75rem; padding: 0.25rem 0.375rem 0.375rem; border-radius: var(--radius-sm); }
.ov-day.selected { background: rgba(15, 23, 42, 0.05); }
/* Spot page: one row, no name, and each day is a button that picks the day for the table. */
.ov-single .ov-days { margin-top: 0; }
button.ov-day { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
button.ov-day:hover:not(.selected) { background: var(--surface-hover); }
button.ov-day.selected { background: rgba(15, 23, 42, 0.05); }
.ov-day b { font-size: 0.9375rem; font-weight: 800; color: var(--ink-heading); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-day b small { margin-left: 0.125rem; font-size: 0.6875rem; font-weight: 600; color: var(--muted); }
.ov-dashes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; width: 100%; }
.ov-dashes i { height: 0.375rem; border-radius: 999px; background: var(--c, var(--line)); }

/* Spots Grid & Cards */
.spots-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .spots-list {
    grid-template-columns: repeat(auto-fill, minmax(21.5rem, 1fr));
    gap: 1.25rem;
  }
  .spot-card {
    margin-bottom: 0 !important;
  }
}

/* Surfline-Style Spot Cards */
.spot-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 0.875rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.spot-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.spot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem 0.375rem;
}
.spot-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.spot-card-name {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--ink-heading);
  line-height: 1.25;
}
.spot-card-coast {
  font-size: 0.8125rem;
  color: var(--muted);
}
.fav-btn {
  background: none;
  border: 0;
  padding: 0.25rem;
  color: var(--muted-light);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.fav-btn.is-fav {
  color: var(--star-gold);
}
.fav-btn svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

/* Hero Metrics Row inside card */
.spot-card-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.375rem 1rem 0.625rem;
  gap: 0.5rem;
}
.spot-wave-box {
  display: flex;
  flex-direction: column;
}
.spot-wave-height {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--ink-heading);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.spot-wave-height small {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.125rem;
}
.spot-wave-desc {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.125rem;
}

.spot-badge-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
}

/* Secondary Condition Chips */
.spot-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
  font-size: 0.8125rem;
}
.chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  background: var(--surface-subtle);
  color: var(--ink);
  font-weight: 600;
}
.chip-pill.offshore {
  background: #ECFDF5;
  color: #065F46;
}
.chip-pill.onshore {
  background: #FEF2F2;
  color: #991B1B;
}
.chip-pill.cross-shore {
  background: #FFFBEB;
  color: #92400E;
}
.arr {
  width: 0.85em;
  height: 0.85em;
  transform: rotate(var(--d, 0deg));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 16-Day Visual Forecast Strip in Spot Card */
.forecast-strip {
  border-top: 1px solid var(--line);
  background: #FAFBFD;
  padding: 0.5rem 0.75rem;
}
.strip-days {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 2px;
}
.strip-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.125rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.strip-col:hover {
  background: var(--surface-hover);
}
.strip-col.is-active-day {
  background: #E2E8F0;
  box-shadow: inset 0 0 0 1px #94A3B8;
}
.strip-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  max-width: 1.125rem;
  height: 1.625rem;
}
.strip-bars i {
  flex: 1;
  border-radius: 1.5px;
  background: var(--c, #E2E8F0);
}
.strip-label {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.25rem;
  text-align: center;
}
.strip-col.is-active-day .strip-label {
  color: var(--ink);
  font-weight: 700;
}

.period-cell-name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.25;
}
.period-cell-time {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.125rem;
}

/* Sidebar Drawer & Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 19.5rem;
  max-width: 85vw;
  background: #FFFFFF;
  border-right: 1px solid var(--line);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  z-index: 95;
}
.sidebar-overlay.is-open .sidebar-drawer {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink-heading);
}
.sidebar-brand img { width: 1.625rem; height: 1.625rem; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background 0.15s ease;
}
.sidebar-nav-item:hover {
  background: var(--surface-subtle);
}
.sidebar-nav-item.active {
  background: var(--surface-subtle);
  color: var(--accent);
  font-weight: 700;
}
.sidebar-nav-item svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-places {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}
.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.5rem 0.5rem;
}
.sidebar-coast-group {
  margin-bottom: 1rem;
}
.sidebar-coast-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.375rem 0.5rem;
}
.sidebar-spot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.1s ease;
}
.sidebar-spot-item:hover {
  background: var(--surface-subtle);
}
.sidebar-spot-item.active {
  background: var(--surface-subtle);
  font-weight: 700;
}

.sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--line);
  background: #FAFBFD;
}
.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--muted);
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Spot Detail View */
.spot-detail-page {
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.875rem;
}
.back-link:hover { color: var(--ink); }

.detail-hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
}
.detail-title {
  margin: 0 0 0.25rem;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--ink-heading);
}
.detail-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.verdict-box {
  background: #F8FAFC;
  border-left: 3px solid var(--accent);
  padding: 0.875rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1rem;
}
.verdict-box p { margin: 0; font-size: 0.9375rem; color: var(--ink); line-height: 1.5; }
.verdict-box small { display: block; margin-top: 0.375rem; color: var(--muted); font-size: 0.75rem; }

/* Spot Detail Desktop Layout */
.spot-detail-body {
  display: block;
}

@media (min-width: 1024px) {
  .spot-detail-body {
    display: grid;
    grid-template-columns: 1fr 22.5rem;
    gap: 2rem;
    align-items: start;
  }
  .spot-detail-aside .rate-form {
    position: sticky;
    top: 5rem;
  }
}

/* Sessions Page Desktop Layout */
.sessions-layout-grid {
  display: block;
}

@media (min-width: 1024px) {
  .sessions-layout-grid {
    display: grid;
    grid-template-columns: 22.5rem 1fr;
    gap: 2rem;
    align-items: start;
  }
  .sessions-rate-aside #rate-modal-container {
    display: block !important;
    position: sticky;
    top: 5rem;
  }
  #btn-show-rate {
    display: none !important;
  }
}

/* Hourly Table */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hours th {
  padding: 0.75rem 0.875rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: #FAFBFD;
}
@media (min-width: 768px) {
  .hours th,
  .hours td {
    padding: 0.875rem 1.125rem;
  }
}
.hours td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.hours tr:last-child td { border-bottom: 0; }
.hours tr:hover td { background: var(--surface-hover); }
.hours small { display: block; color: var(--muted); font-size: 0.75rem; }
.period-cell-cond { margin-top: 0.375rem; }

/* Wave height and swell: big number, size bar, direction and period chips */
.size-num { display: block; font-size: 1.25rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; color: var(--ink-heading); }
.hours .size-num small { display: inline; margin-left: 0.125rem; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.size-bar { display: block; width: 6.5rem; height: 0.375rem; margin: 0.4375rem 0; border-radius: 999px; background: var(--surface-subtle); overflow: hidden; }
.size-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink-heading); }
.size-bar.swell i { background: var(--muted-light); }
.size-meta { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 0.125rem; padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-sm); background: var(--surface-subtle); color: var(--ink);
  font-size: 0.75rem; font-weight: 600;
}
/* Phones: each time of day becomes a block. Name, time and condition on top; waves, swell and wind
   side by side underneath, each with its own label. */
@media (max-width: 639px) {
  .hours thead { display: none; }
  .hours, .hours tbody { display: block; white-space: normal; }
  .hours tr { display: grid; grid-template-columns: 1.15fr 1fr 0.9fr; column-gap: 0.75rem; padding: 0.875rem 1rem; border-bottom: 1px solid var(--line); }
  .hours tr:last-child { border-bottom: 0; }
  .hours td { padding: 0; border: 0; min-width: 0; }
  .hours tr:hover td { background: none; } /* the row-hover tint would paint patchy cells here, and sticks on touch */
  .hours td:first-child { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.625rem; }
  .hours td:first-child .period-cell-cond { margin: 0 0 0 auto; }
  .hours td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 0.25rem;
    color: var(--muted); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  }
  .size-num { font-size: 1.125rem; }
  .size-bar { width: 100%; }
}

/* Logbook & Rating Form */
.section-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink-heading);
  margin: 1.5rem 0 0.75rem;
}

.entries { margin: 0; padding: 0; list-style: none; }
.entry-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}
.entry-author {
  font-weight: 700;
  color: var(--ink-heading);
}
.entry-time {
  font-size: 0.75rem;
  color: var(--muted);
}
.entry-quote {
  font-style: italic;
  color: var(--ink);
  margin: 0.375rem 0;
  font-size: 0.9375rem;
}
.entry-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

/* Forms */
.rate-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
  margin: 0.75rem 0 1rem;
  border: 0;
  padding: 0;
}
.ratings-grid label {
  position: relative;
  display: block;
}
.ratings-grid input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.ratings-grid span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ratings-grid span::before {
  content: "";
  width: 1.25rem;
  height: 0.3125rem;
  border-radius: 1px;
  background: var(--c);
}
.ratings-grid input:checked + span {
  border-color: var(--ink);
  background: var(--surface-subtle);
  font-weight: 700;
}

.input-field {
  width: 100%;
  min-height: 2.625rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}
.form-group {
  margin-bottom: 0.875rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

/* Custom Date Picker (dd/mm/yyyy, Monday-first) */
.picker-component {
  position: relative;
  display: flex;
  flex-direction: column;
}

.picker-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.625rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  margin-top: 0.25rem;
}
.picker-trigger-btn:hover {
  border-color: var(--ink);
  background: var(--surface-hover);
}
.picker-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.picker-display-val {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  color: var(--ink);
}
.picker-date-str {
  font-weight: 700;
  color: var(--ink-heading);
  letter-spacing: 0.02em;
}
.picker-day-tag {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.calendar-popover {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 0;
  z-index: 70;
  width: 19rem;
  max-width: calc(100vw - 2.5rem);
  padding: 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  animation: fadeIn 0.12s ease;
}

.cal-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cal-month-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink-heading);
}
.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-nav-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}
.cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
  margin-bottom: 0.375rem;
}
.cal-weekdays span {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}
.cal-day-cell {
  height: 2.125rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.1s ease;
}
.cal-day-cell:hover:not(:disabled):not(.is-selected) {
  background: var(--surface-subtle);
}
.cal-day-cell.is-today {
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.cal-day-cell.is-selected {
  background: var(--ink);
  color: #FFFFFF;
  font-weight: 700;
}
.cal-day-cell:disabled {
  color: #CBD5E1;
  cursor: not-allowed;
  opacity: 0.5;
}

.cal-shortcuts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--line);
}
.cal-quick-btn {
  flex: 1;
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-quick-btn:hover {
  background: var(--surface-active);
  border-color: var(--line-strong);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 1.25rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: #FFFFFF;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.primary-btn:hover { opacity: 0.92; }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.status-msg {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* Windy Container */
.windy-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1rem;
}
.windy-box iframe {
  display: block;
  width: 100%;
  height: 24rem;
  border: 0;
}

/* Auth / Passcode Screen */
.auth-container {
  max-width: 22rem;
  margin: 3rem auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.auth-logo { width: 4rem; height: 4rem; margin-bottom: 0.75rem; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--ink-heading); margin: 0 0 0.5rem; }
.auth-desc { font-size: 0.875rem; color: var(--muted); margin-bottom: 1.25rem; }

@media (min-width: 48rem) {
  #app { padding: 0 1.5rem 6rem; }
  .spot-card-hero { padding: 0.5rem 1.25rem 0.875rem; }
  .spot-card-top { padding: 1rem 1.25rem 0.375rem; }
  .spot-chips-row { padding: 0 1.25rem 0.875rem; }
  .forecast-strip { padding: 0.625rem 1rem; }
}

/* Coast tags: blue north, amber west, violet south. Kept clear of the rating greens. */
:root {
  --north: #1D4ED8; --north-bg: #DBEAFE;
  --west: #B45309;  --west-bg: #FEF3C7;
  --south: #6D28D9; --south-bg: #EDE9FE;
}
.coast-north { --coast: var(--north); --coast-bg: var(--north-bg); }
.coast-west  { --coast: var(--west);  --coast-bg: var(--west-bg); }
.coast-south { --coast: var(--south); --coast-bg: var(--south-bg); }

.coast-tag {
  display: inline-block; padding: 0.0625rem 0.5rem; border-radius: var(--radius-sm);
  background: var(--coast-bg); color: var(--coast);
  font-size: 0.75rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.coast-dot { display: inline-block; flex-shrink: 0; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--coast); }

.coast-chip { display: inline-flex; align-items: center; gap: 0.375rem; }
.coast-chip.active { background: var(--coast); border-color: var(--coast); color: #FFFFFF; }
.coast-chip.active .coast-dot { background: #FFFFFF; }
.sidebar-coast-title.coast-north, .sidebar-coast-title.coast-west, .sidebar-coast-title.coast-south { display: flex; align-items: center; gap: 0.5rem; color: var(--coast); }

.plan-day { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-top: 0.25rem; }
.plan-day b { margin-right: 0.25rem; color: var(--ink-heading); }
.plan-day + p { margin-top: 0.25rem; }
.entry-time .coast-tag, .detail-meta .coast-tag { margin: 0 0.25rem; }
