@font-face {
  font-family: Inter;
  src: url("/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url("/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --canvas: #F6F5F1;
  --surface: #FFFFFF;
  --ink: #192B31;
  --muted: #52636A;
  --line: #DDE2E0;
  --focus: #185E87;
  --ferry: #185E87;
  --ferry-bg: #EDF4F8;
  --water: #176F67;
  --water-bg: #EAF4EE;
  --ochre: #875617;
  --ochre-bg: #F4EDDC;
  --crime: #B53E42;
  --crime-bg: #F8EEEE;
  --radius: 24px;
  --radius-sm: 12px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  overflow-x: clip;
}

button, summary { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection { background: #D5E6F1; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 5;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--ink);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

h1, .foot-name {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.voice {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  text-align: right;
}

.module { margin-top: 40px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-note, .section-side, #glance-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: right;
}

.section-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-btn {
  appearance: none;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.text-btn:disabled { opacity: 0.55; cursor: default; }

.overview, .panel, .crime-card, .urgent {
  background: var(--surface);
  border-radius: var(--radius);
}

.overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ov {
  padding: 20px;
  min-width: 0;
  border-top: 1px solid var(--line);
}
.ov:nth-child(-n + 2) { border-top: 0; }
.ov-day, .ov-air { grid-column: 1 / -1; }

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.weather { color: var(--ochre); }
.eyebrow.water, .eyebrow.good { color: var(--water); }
.eyebrow.ferry { color: var(--ferry); }

.clock, .temp, .metric {
  margin: 8px 0 0;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
}
.clock { font-size: 56px; }
.temp { font-size: 40px; }
.metric { font-size: 32px; }
.period {
  font-size: 0.38em;
  letter-spacing: 0;
  font-weight: 500;
  margin-left: 4px;
  color: var(--muted);
}

.caption, .meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.caption span, .day-lines span { display: block; }

.rail {
  height: 4px;
  margin-top: 16px;
  background: #E7E1D4;
  border-radius: 999px;
  overflow: hidden;
}
.rail > span {
  display: block;
  height: 100%;
  background: var(--ochre);
  border-radius: inherit;
}

.air-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--water-bg);
  color: var(--water);
}
.pill.moderate { background: var(--ochre-bg); color: var(--ochre); }
.pill.usg, .pill.unhealthy, .pill.very, .pill.hazard { background: var(--crime-bg); color: var(--crime); }
.pill.scheduled { background: var(--ferry-bg); color: var(--ferry); }
.pill.delayed { background: var(--ochre-bg); color: var(--ochre); }
.pill.neutral { background: var(--canvas); color: var(--muted); }

.air-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mini-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mini-value {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}

.split { display: grid; gap: 20px; }
.split.follow { margin-top: 20px; }

.panel { padding: 20px; min-width: 0; }
.ferry-panel { background: var(--ferry-bg); }
.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ferry-panel .panel-title, .ferry-panel .lede { color: var(--ferry); }
.lede { margin: 6px 0 0; font-size: 15px; }

.ferry-times {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-top: 20px;
}
.later { text-align: right; }
.later p { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; }
.later .meta { margin-top: 4px; }

.road {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.road:first-of-type { border-top: 0; padding-top: 4px; }
.road h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.road .where { color: var(--muted); font-weight: 400; }
.sign-lines {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.subhead {
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.closure { padding-top: 10px; }
.closure p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; }

.tide-layout {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}
.tide-kind {
  margin: 8px 0 0;
  color: var(--water);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tide-kind.high { color: var(--ferry); }

.urgent {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--crime-bg);
  color: var(--ink);
}
.urgent h2 { margin: 0 0 4px; font-size: 18px; }
.urgent p { margin: 0; }

.checking, .empty, .problem { margin: 8px 0 0; color: var(--muted); }
.problem { color: var(--ochre); }

.crime-card {
  display: grid;
  gap: 20px;
  padding: 16px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 14px;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--crime);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}
.map {
  height: 280px;
  border-radius: 16px;
  background: #E7ECE8;
  overflow: hidden;
}
.map-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.crime-count {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
}
.cat-list, .incident-list { list-style: none; margin: 12px 0 0; padding: 0; }
.cat-list li, .incident-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.cat-list span { font-variant-numeric: tabular-nums lining-nums; color: var(--muted); }
.incident-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  min-height: 44px;
  cursor: pointer;
  font-size: 15px;
}
.incident-list li.is-selected { background: var(--canvas); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.incident-btn .when { display: block; color: var(--muted); font-size: 13px; }

.selected {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.selected h3 { margin: 0; font-size: 18px; font-weight: 600; }
.disclaimer { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.disclaimer a, .panel a, .source-list a { color: var(--ferry); text-decoration: none; font-weight: 600; }
.disclaimer a:hover, .panel a:hover, .source-list a:hover { text-decoration: underline; }

.foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); }
.foot-brand .voice { text-align: left; margin-top: 4px; }
.independent { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.sources { margin-top: 20px; }
.sources summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
.sources summary::-webkit-details-marker { display: none; }
.sources summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.sources[open] summary::after { transform: translateY(2px) rotate(225deg); }
.sources-body {
  margin-top: 8px;
  padding-top: 8px;
  color: var(--ink);
  font-size: 15px;
}
.source-list { list-style: none; margin: 8px 0 0; padding: 0; }
.source-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.source-list span { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }

.noscript {
  margin: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.maplibregl-map { font-family: var(--font); }
.maplibregl-ctrl-group {
  box-shadow: none !important;
  border: 1px solid var(--line);
}
.maplibregl-ctrl-group button {
  width: 44px !important;
  height: 44px !important;
}
.maplibregl-ctrl-attrib {
  font-size: 11px;
  background: rgba(246, 245, 241, 0.92) !important;
  color: var(--muted) !important;
}

@media (min-width: 640px) {
  .wrap { width: min(1280px, calc(100% - 48px)); }
  .overview { grid-template-columns: 1fr 1fr; }
  .ov-day, .ov-air { grid-column: auto; }
  .ov:nth-child(odd) { border-top: 0; }
  .ov:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .clock { font-size: 64px; }
  .temp { font-size: 56px; }
}

@media (min-width: 1100px) {
  .wrap { width: min(1280px, calc(100% - 64px)); padding-top: 40px; }
  h1, .foot-name { font-size: 28px; }
  .section-head h2 { font-size: 26px; }
  .overview {
    grid-template-columns: 1.15fr 1fr 1.2fr 1.25fr;
  }
  .overview .ov { padding: 28px 24px 24px; border-top: 0; border-left: 1px solid var(--line); }
  .overview .ov:first-child { border-left: 0; }
  .clock { font-size: 76px; }
  .temp { font-size: 68px; }
  .metric { font-size: 40px; }
  .ferry-times .metric { font-size: 46px; }
  .split { grid-template-columns: 7fr 5fr; gap: 24px; }
  .split.follow { margin-top: 24px; }
  .panel { padding: 28px; }
  .crime-card {
    grid-template-columns: 1.22fr 1fr;
    gap: 28px;
    padding: 20px 24px 24px;
  }
  .map { height: 420px; }
  .crime-count { font-size: 40px; }
}

@media (min-width: 1440px) {
  .wrap { width: min(1280px, calc(100% - 160px)); }
}

@media (max-width: 639px) {
  .ferry-times { flex-direction: column; align-items: flex-start; }
  .later { text-align: left; }
  .later p { font-size: 16px; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .voice { text-align: left; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .section-note, .section-side, #glance-meta { text-align: left; }
  .section-side { width: 100%; justify-content: space-between; }
  h1 { font-size: 24px; }
  .map { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.drive-row { margin-top: 20px; }
