@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Newsreader:opsz,wght@6..72,500&display=swap");

:root {
  --bg-0: #f4f6f4;
  --bg-1: #e2ece8;
  --ink-0: #10221e;
  --ink-1: #2a4d45;
  --surface: rgba(255, 255, 255, 0.72);
  --line: rgba(16, 34, 30, 0.12);
  --good: #147a58;
  --mid: #ce8f00;
  --bad: #c1493d;
  --accent: #0e6b53;
  --accent-soft: rgba(14, 107, 83, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink-0);
  background: radial-gradient(1200px 700px at 10% 10%, #d2ebe4, transparent),
    radial-gradient(1000px 700px at 100% 0%, #f2e3c7, transparent),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.5;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  background: #8fd3c0;
  right: -90px;
  top: -80px;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  background: #f2c084;
  left: -100px;
  bottom: -120px;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.2rem 1rem 3rem;
}

.hero {
  animation: rise 500ms ease-out forwards;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: var(--ink-1);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
  font-family: "Newsreader", serif;
}

.status {
  margin-top: 0.7rem;
  color: var(--ink-1);
}

.grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.card {
  backdrop-filter: blur(8px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(16, 34, 30, 0.08);
  animation: rise 520ms ease-out forwards;
}

.kpi h2,
.section-head h2 {
  margin: 0;
  font-size: 1rem;
}

.kpi-value {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.kpi-note,
.section-head p {
  margin: 0;
  color: var(--ink-1);
  font-size: 0.9rem;
}

.chart-card,
.list-card {
  margin-top: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.chart {
  width: 100%;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;      /* scales with width via viewBox ratio (250/900) */
  min-height: 140px; /* floor for very narrow screens */
}

.axis,
.grid-line {
  stroke: rgba(16, 34, 30, 0.18);
  stroke-width: 1;
}

.beach-map {
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  align-items: stretch;
}

.map-zone {
  height: 126px;
  min-width: 0;
  border: 0;
  border-right: 1px solid rgba(16, 34, 30, 0.18);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.12;
  font-size: 0.9rem;
  padding: 0.55rem 0.45rem;
  overflow: hidden;
  word-break: break-word;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
  background: #e9dfcd;
  color: #4d4436;
}

.map-zone:last-child {
  border-right: 0;
}

.map-zone.is-active {
  background: rgba(14, 107, 83, 0.15);
  color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.map-zone-badge {
  display: inline-block;
  margin-top: 0.32rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

.spot-general-rating {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.hourly-rating {
  margin: 0.18rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.kpi-split {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 0;
}

.kpi-half {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.kpi-half-top {
  padding-bottom: 0.25rem;
}

.kpi-half-bottom {
  padding-top: 0.45rem;
}

.kpi-divider {
  height: 1px;
  background: var(--line);
}

.quality-very-low {
  color: #8d0f0a;
}

.quality-low {
  color: #c65c55;
}

.quality-medium {
  color: #b28815;
}

.quality-high {
  color: #4e9965;
}

.quality-very-high {
  color: #0d6a38;
}

.quality-loading {
  color: rgba(16, 34, 30, 0.6);
}

.slider-wrap {
  margin-top: 0.8rem;
  padding-left: 5.11%;  /* 46/900 — matches SVG chart's left pad */
  padding-right: 2.22%; /* 20/900 — matches SVG chart's right pad */
}

.slider-label {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-1);
}

.range-slider {
  position: relative;
  height: 30px;
}

.range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  height: 6px;
  border-radius: 999px;
  background: rgba(16, 34, 30, 0.14);
}

.range-fill {
  position: absolute;
  top: 12px;
  height: 6px;
  border-radius: 999px;
  background: rgba(14, 107, 83, 0.45);
}

.range-slider input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  top: 4px;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: all;
  cursor: pointer;
}

.range-slider input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: all;
  cursor: pointer;
}

.range-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
}

.range-slider input[type="range"]::-moz-range-track {
  height: 6px;
  background: transparent;
}

.range-line {
  stroke: rgba(14, 107, 83, 0.55);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.axis-label {
  fill: rgba(16, 34, 30, 0.72);
  font-size: 10px;
  font-family: "Space Grotesk", sans-serif;
}

.axis-title {
  fill: rgba(16, 34, 30, 0.88);
  font-size: 11px;
  font-weight: 600;
  font-family: "Space Grotesk", sans-serif;
}

.briefing {
  margin: 0;
  line-height: 1.45;
  font-size: 0.97rem;
  color: var(--ink-0);
}

.muted-briefing {
  margin-top: 0.6rem;
  color: var(--ink-1);
}

.chat-log {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  padding-right: 0.1rem;
}

.chat-bubble {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.35;
}

.chat-user {
  background: rgba(14, 107, 83, 0.12);
  border-color: rgba(14, 107, 83, 0.24);
}

.chat-ai {
  background: rgba(255, 255, 255, 0.75);
}

.chat-thinking {
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-1);
  font-style: italic;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.chat-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
}

.chat-form button {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.tide-curve {
  fill: none;
  stroke: #0b4946;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: reveal 900ms ease forwards;
}

@keyframes reveal {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 740px) {
  .page {
    padding: 1.2rem 0.8rem 2rem;
  }
}

@media (max-width: 600px) {
  .beach-map {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-zone {
    border-right: 1px solid rgba(16, 34, 30, 0.18);
    border-bottom: 1px solid rgba(16, 34, 30, 0.18);
  }

  .map-zone:nth-child(2),
  .map-zone:nth-child(4) {
    border-right: 0;
  }

  .map-zone:nth-child(3),
  .map-zone:nth-child(4) {
    border-bottom: 0;
  }
}
