:root {
  color-scheme: dark;
  --ink: #f6f0df;
  --muted: #aeb9b8;
  --panel: #10191a;
  --panel-2: #172322;
  --line: rgba(246, 240, 223, 0.14);
  --teal: #2fc6b1;
  --green: #79c66b;
  --amber: #e7b75f;
  --red: #e66958;
  --sand: #d6c18e;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  background: #081011;
}

body {
  margin: 0;
  min-width: 320px;
  background: #081011;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 2px solid rgba(47, 198, 177, 0.72);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 198, 177, 0.18), transparent 30rem),
    linear-gradient(145deg, #071112 0%, #0c1718 44%, #11140f 100%);
}

.hero {
  position: relative;
  min-height: 43vh;
  overflow: hidden;
  padding: calc(18px + env(safe-area-inset-top)) clamp(16px, 4vw, 48px) 24px;
  border-bottom: 1px solid var(--line);
}

.hero-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b3344;
}

.tile-grid {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.9;
  filter: saturate(0.78) hue-rotate(132deg) brightness(0.82) contrast(1.08);
}

.tile-grid img {
  position: absolute;
  width: 256px;
  height: 256px;
  object-fit: cover;
}

.map-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 12, 12, 0.05), rgba(7, 12, 12, 0.46)),
    radial-gradient(circle at 70% 72%, rgba(214, 193, 142, 0.1), transparent 18rem),
    linear-gradient(125deg, rgba(9, 36, 49, 0.38) 0%, rgba(11, 64, 80, 0.26) 42%, rgba(10, 25, 25, 0.5) 100%);
}

.swell-line {
  position: absolute;
  left: -16vw;
  width: 72vw;
  height: 36vh;
  border: 2px solid rgba(246, 240, 223, 0.19);
  border-color: transparent transparent rgba(246, 240, 223, 0.22) transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
}

.swell-a {
  top: 2vh;
}

.swell-b {
  top: 15vh;
  left: -11vw;
}

.swell-c {
  top: 28vh;
  left: -6vw;
}

.topbar,
.hero-content {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(38px, 8vw, 78px);
  line-height: 0.92;
  letter-spacing: 0;
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.icon-button,
.pill-button,
.chip-button,
.favorite-button,
.close-button,
.primary-button,
.text-button,
.bottom-tabs button {
  border: 1px solid rgba(246, 240, 223, 0.18);
  border-radius: 8px;
  background: rgba(7, 16, 17, 0.58);
  color: var(--ink);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  height: 44px;
}

.pill-button,
.chip-button,
.favorite-button {
  min-height: 44px;
  padding: 0 14px;
  font-weight: 800;
}

.pill-button,
.primary-button {
  background: var(--ink);
  color: #101716;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 25vh;
  padding-top: 56px;
}

.spot-summary h2 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
}

.spot-summary p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
}

.hero-metrics div,
.window-card,
.reason-stack article,
.score-breakdown,
.spots-panel,
.forecast-panel,
.map-panel,
.control-strip,
.account-nudge,
.auth-card {
  border: 1px solid var(--line);
  background: rgba(16, 25, 26, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-metrics div {
  min-height: 84px;
  padding: 14px;
  border-radius: 8px;
}

.hero-metrics span {
  display: block;
  font-size: 24px;
  font-weight: 850;
}

.hero-metrics small {
  color: var(--muted);
}

.control-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: -22px clamp(16px, 4vw, 48px) 18px;
  padding: 12px;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}

.segmented {
  display: flex;
  padding: 4px;
  border-radius: 8px;
  background: rgba(246, 240, 223, 0.08);
}

.day-tabs {
  max-width: min(720px, 100%);
  overflow-x: auto;
  scrollbar-width: thin;
}

.segmented button {
  min-width: 96px;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segmented .active {
  background: var(--ink);
  color: #101716;
}

.toggle,
.range-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.range-control {
  margin-left: auto;
}

.range-control input {
  accent-color: var(--teal);
}

.range-control strong {
  min-width: 28px;
  color: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(320px, 1fr) 390px;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 48px) 36px;
}

.spots-panel,
.map-panel,
.forecast-panel {
  border-radius: 8px;
  min-width: 0;
}

.spots-panel,
.forecast-panel {
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.panel-heading span,
.timeline-heading span {
  color: var(--muted);
  font-size: 12px;
}

.account-nudge {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: none;
}

.account-nudge span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.spot-list {
  display: grid;
  gap: 8px;
  max-height: 642px;
  overflow: auto;
  padding-right: 3px;
}

.spot-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(246, 240, 223, 0.1);
  border-radius: 8px;
  background: rgba(246, 240, 223, 0.04);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.spot-button.active {
  border-color: rgba(47, 198, 177, 0.7);
  background: rgba(47, 198, 177, 0.12);
}

.spot-button strong,
.spot-button small {
  display: block;
}

.spot-button small {
  margin-top: 3px;
  color: var(--muted);
}

.spot-score {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(246, 240, 223, 0.08);
  font-weight: 850;
}

.favorite-mark {
  color: var(--amber);
}

.map-panel {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.map-panel:focus,
.map-panel *:focus {
  outline: none;
}

.map-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0b3344;
}

.map-panel .tile-grid {
  opacity: 0.96;
  filter: saturate(0.82) hue-rotate(132deg) brightness(0.92) contrast(1.08);
}

.map-swell {
  position: absolute;
  z-index: 2;
  min-width: 130px;
  padding: 8px 10px;
  border: 1px solid rgba(246, 240, 223, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(8, 16, 17, 0.58);
  font-weight: 800;
}

.map-swell::before {
  content: "";
  display: inline-block;
  width: 38px;
  height: 2px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--teal);
  box-shadow: 12px 8px 0 rgba(47, 198, 177, 0.55), 24px 16px 0 rgba(47, 198, 177, 0.32);
}

.swell-one {
  left: 8%;
  top: 21%;
}

.swell-two {
  left: 20%;
  bottom: 18%;
}

.map-pins {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.map-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 5;
  display: grid;
  gap: 6px;
}

.map-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(246, 240, 223, 0.2);
  border-radius: 8px;
  background: rgba(8, 16, 17, 0.78);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.pin {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(8, 16, 17, 0.8);
  border-radius: 50%;
  background: var(--amber);
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 0 0 5px rgba(8, 16, 17, 0.22);
  z-index: 1;
}

.wind-arrow {
  position: absolute;
  left: 50%;
  top: -22px;
  width: 24px;
  height: 2px;
  background: rgba(246, 240, 223, 0.82);
  transform-origin: left center;
}

.wind-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 7px solid rgba(246, 240, 223, 0.82);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.pin.good {
  background: var(--green);
}

.pin.poor {
  background: var(--red);
}

.pin.active {
  width: 26px;
  height: 26px;
  border-color: var(--ink);
  z-index: 5;
}

.pin:hover,
.pin:focus-visible {
  z-index: 6;
}

.pin .pin-label {
  position: absolute;
  left: 24px;
  top: 50%;
  width: max-content;
  max-width: 142px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(8, 16, 17, 0.78);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  transform: translateY(-50%);
  white-space: nowrap;
  z-index: 2;
}

.pin.label-side-left .pin-label {
  right: 24px;
  left: auto;
}

.pin.label-offset-1 .pin-label {
  transform: translateY(calc(-50% + 16px));
}

.pin.label-offset-2 .pin-label {
  transform: translateY(calc(-50% - 16px));
}

.pin.label-offset-3 .pin-label {
  transform: translateY(calc(-50% + 30px));
}

.pin.label-offset-4 .pin-label {
  transform: translateY(calc(-50% - 30px));
}

.pin.label-compact .pin-label {
  max-width: 126px;
  padding: 3px 5px;
  font-size: 10px;
}

.pin.label-compact .wind-arrow {
  display: none;
}

.pin.label-roomy .pin-label {
  font-size: 12px;
}

.map-legend,
.map-attribution {
  position: absolute;
  z-index: 4;
  border-radius: 8px;
  background: rgba(8, 16, 17, 0.72);
}

.map-legend {
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.map-attribution {
  right: 12px;
  bottom: 12px;
  margin: 0;
  padding: 5px 7px;
  color: rgba(246, 240, 223, 0.72);
  font-size: 10px;
}

.map-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 50%;
}

.map-legend .legend-wind {
  position: relative;
  width: 24px;
  height: 2px;
  border-radius: 0;
  background: rgba(246, 240, 223, 0.82);
  vertical-align: middle;
}

.map-legend .legend-wind::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  width: 0;
  height: 0;
  border-left: 7px solid rgba(246, 240, 223, 0.82);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.legend-good {
  background: var(--green);
}

.legend-maybe {
  background: var(--amber);
}

.legend-poor {
  background: var(--red);
}

.detail-heading strong {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(121, 198, 107, 0.14);
  color: var(--green);
}

.window-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border-radius: 8px;
  box-shadow: none;
}

.window-card h3 {
  margin-bottom: 4px;
  font-size: 30px;
}

.window-card span {
  color: var(--muted);
  font-size: 13px;
}

.score-ring {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 86%, rgba(246, 240, 223, 0.12) 86% 100%);
}

.score-ring span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.reason-stack {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.reason-stack article {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  box-shadow: none;
}

.reason-stack b {
  display: block;
}

.reason-stack span {
  color: var(--muted);
  font-size: 13px;
}

.reason-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(47, 198, 177, 0.14);
  color: var(--teal);
  font-weight: 900;
}

.score-breakdown {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  box-shadow: none;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) 1fr 34px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.breakdown-row b,
.breakdown-row small {
  display: block;
}

.breakdown-row b {
  color: var(--ink);
  font-size: 12px;
  text-transform: capitalize;
}

.breakdown-row small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(246, 240, 223, 0.1);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--green));
}

.timeline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.timeline-heading h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.hour-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid rgba(246, 240, 223, 0.1);
  border-radius: 8px;
  background: rgba(246, 240, 223, 0.04);
}

.hour-card strong {
  font-size: 13px;
}

.mini-bars {
  display: grid;
  gap: 5px;
}

.mini-bars span {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(246, 240, 223, 0.12);
  overflow: hidden;
}

.mini-bars i {
  display: block;
  height: 100%;
  background: var(--teal);
}

.hour-card em {
  font-style: normal;
  font-weight: 850;
}

.bottom-tabs {
  display: none;
}

.auth-sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: end center;
  padding: 16px;
  background: rgba(3, 8, 9, 0.72);
}

.auth-sheet.open {
  display: grid;
}

.auth-card {
  position: relative;
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 8px;
}

.auth-card h2 {
  margin-bottom: 8px;
  font-size: 30px;
}

.auth-card p {
  color: var(--muted);
}

.auth-card form,
.auth-card label {
  display: grid;
  gap: 8px;
}

.auth-card form {
  gap: 12px;
}

.auth-card label span {
  color: var(--muted);
  font-size: 13px;
}

.auth-card input {
  min-height: 46px;
  width: 100%;
  border: 1px solid rgba(246, 240, 223, 0.18);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(246, 240, 223, 0.06);
  color: var(--ink);
}

.primary-button {
  min-height: 48px;
  font-weight: 900;
}

.text-button {
  min-height: 40px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--teal);
}

.muted-action {
  color: var(--muted);
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: #ffb3a9;
  font-size: 13px;
}

.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 260px 1fr;
  }

  .forecast-panel {
    grid-column: 1 / -1;
  }

  .map-panel {
    min-height: 560px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .hero {
    min-height: 48vh;
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    align-items: center;
  }

  .pill-button {
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-content {
    display: block;
    padding-top: 42px;
  }

  .spot-summary h2 {
    font-size: clamp(34px, 11vw, 46px);
  }

  .spot-summary p:last-child {
    font-size: 16px;
  }

  .hero-metrics {
    margin-top: 20px;
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-metrics div {
    min-height: 74px;
    padding: 10px;
  }

  .hero-metrics span {
    font-size: 20px;
  }

  .control-strip {
    display: grid;
    grid-template-columns: 1fr;
    margin: -14px 12px 12px;
    gap: 12px;
  }

  .segmented {
    overflow-x: auto;
  }

  .segmented button {
    flex: 1 0 94px;
  }

  .range-control {
    margin-left: 0;
    justify-content: space-between;
  }

  .range-control input {
    width: 100%;
  }

  .workspace {
    display: block;
    padding: 0 12px 16px;
  }

  .app-section {
    display: none;
  }

  .app-section.active {
    display: block;
  }

  .map-panel {
    min-height: min(68vh, 620px);
  }

  .map-controls {
    display: none;
  }

  .spots-panel,
  .forecast-panel {
    padding: 14px;
  }

  .spot-list {
    max-height: none;
    padding-bottom: 8px;
  }

  .spot-button {
    min-height: 78px;
  }

  .pin .pin-label {
    display: none;
  }

  .pin.active .pin-label,
  .pin:focus-visible .pin-label {
    display: block;
    max-width: 128px;
    white-space: normal;
  }

  .map-attribution {
    left: 12px;
    right: auto;
    bottom: 58px;
  }

  .bottom-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    background: rgba(8, 16, 17, 0.86);
    backdrop-filter: blur(18px);
  }

  .bottom-tabs button {
    min-height: 46px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 850;
  }

  .bottom-tabs button.active {
    background: var(--ink);
    color: #101716;
  }

  .auth-sheet {
    padding: 10px;
  }

  .auth-card {
    padding: 20px 16px;
  }
}
