:root {
  color-scheme: dark;
  --black: #000;
  --orange: #ff9900;
  --peach: #ffcc99;
  --gold: #ffcc66;
  --butter: #ffff99;
  --lilac: #cc99cc;
  --peri: #9999cc;
  --sky: #99ccff;
  --rust: #cc6666;
  --green: #99cc99;
  --cream: #ffeecc;
  --tint: rgba(153, 153, 204, 0.12);
  --rail: 64px;
  --bar: 32px;
  --barb: 30px;
  --gap: 5px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--peach);
  font-family: "Antonio", "Arial Narrow", "Avenir Next Condensed", "Roboto Condensed", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.016) 50%, transparent 50%);
  background-size: 100% 4px;
  mix-blend-mode: screen;
}

a {
  color: inherit;
}

::selection {
  background: var(--orange);
  color: var(--black);
}

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

.shell {
  width: min(100%, 1280px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 12px 14px 14px;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "top top"
    "rail main"
    "foot foot";
  row-gap: var(--gap);
}

/* ---- top frame: elbow + bar + banner ---- */

.frame-top {
  grid-area: top;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
}

.elbow {
  background: var(--orange);
}

.elbow-top {
  border-radius: 48px 0 0 0;
}

.frame-top-right {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* concave inner curve where the bar meets the rail */
.frame-top-right::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--bar);
  width: 52px;
  height: 40px;
  background: var(--orange);
}

.frame-top-right::after {
  content: "";
  position: absolute;
  left: 0;
  top: var(--bar);
  width: 52px;
  height: 40px;
  background: var(--black);
  border-radius: 40px 0 0 0;
}

.frame-top-bar {
  display: flex;
  gap: var(--gap);
  height: var(--bar);
}

.frame-top-bar::before {
  content: "";
  flex: 0 0 64px;
  background: var(--orange);
}

.locate-button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0 16px;
  background: var(--gold);
  color: var(--black);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.locate-button:hover {
  background: var(--butter);
}

.locate-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.button-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--black);
  animation: blink 1.8s steps(1) infinite;
}

@keyframes blink {
  0%, 64% { opacity: 1; }
  65%, 100% { opacity: 0.25; }
}

.seg {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-style: normal;
}

.seg-stretch {
  flex: 1;
  background: var(--lilac);
}

.seg-num {
  padding: 0 12px;
  background: var(--peri);
  color: var(--black);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .seg-num {
    padding: 0 8px;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }

  .locate-button {
    padding: 0 10px;
    font-size: 0.66rem;
  }
}

.seg-cap {
  flex: 0 0 36px;
  background: var(--peach);
  border-radius: 0 999px 999px 0;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 14px 6px 8px 70px;
}

.banner h1 {
  margin: 0;
  color: var(--orange);
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--black);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.alert-chip[hidden] {
  display: none;
}

.loc-source {
  flex: 1 0 100%;
  margin: 0;
  color: var(--peri);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: right;
}

.law-card a {
  color: var(--gold);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.law-card a:hover {
  color: var(--butter);
}

/* ---- left rail ---- */

.data-index {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.data-index a {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--peach);
  color: var(--black);
  text-decoration: none;
}

.data-index a:nth-child(1) { flex: 0 0 72px; background: var(--peri); }
.data-index a:nth-child(2) { flex: 0 0 66px; background: var(--green); }
.data-index a:nth-child(3) { flex: 0 0 84px; background: var(--lilac); }
.data-index a:nth-child(4) { flex: 0 0 60px; background: var(--sky); }
.data-index a:nth-child(5) { flex: 0 0 72px; background: var(--gold); }
.data-index a:nth-child(6) { flex: 0 0 60px; background: var(--orange); }
.data-index a:nth-child(7) { flex: 0 0 62px; background: var(--sky); }
.data-index a:nth-child(8) { flex: 0 0 60px; background: var(--orange); }
.data-index a:nth-child(9) { flex: 0 0 56px; background: var(--peach); }

.data-index a.alarm {
  background: var(--rust);
}

.data-index a:hover {
  filter: brightness(1.15);
}

.data-index::after {
  content: "";
  flex: 1 1 36px;
  min-height: 36px;
  background: var(--rust);
}

.data-index span {
  font-size: 0.54rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.data-index b {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

/* ---- main column ---- */

.main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 14px 4px 18px 24px;
  min-width: 0;
}

/* ---- hero briefing ---- */

.hero p {
  margin: 0;
  max-width: 72ch;
  color: var(--sky);
  font-size: 0.95rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: none;
}

.weather-now div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: var(--tint);
  border-left: 4px solid var(--lilac);
}

.metric-label {
  color: var(--peach);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.weather-now strong {
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

/* ---- dashboard panels ---- */

.dashboard {
  display: grid;
  gap: 22px 18px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: center;
  gap: var(--gap);
  margin-bottom: 12px;
}

.section-head::before {
  content: "";
  flex: 0 0 22px;
  align-self: stretch;
  background: var(--orange);
  border-radius: 999px 0 0 999px;
}

.section-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 2px 4px 2px 0;
}

.panel-code {
  color: var(--peri);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.section-head h2 {
  margin: 0;
  color: var(--peach);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 0.95;
}

.head-bar {
  flex: 1;
  min-width: 24px;
  height: 10px;
  background: var(--peri);
}

.panel:nth-of-type(2) .head-bar { background: var(--green); }
.panel:nth-of-type(3) .head-bar { background: var(--lilac); }
.panel:nth-of-type(4) .head-bar { background: var(--sky); }
.panel:nth-of-type(5) .head-bar { background: var(--gold); }
.panel:nth-of-type(6) .head-bar { background: var(--rust); }
.panel:nth-of-type(7) .head-bar { background: var(--orange); }
.panel:nth-of-type(8) .head-bar { background: var(--peach); }
.panel:nth-of-type(9) .head-bar { background: var(--lilac); }

.prov {
  margin-top: 10px;
  color: var(--peri);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.prov:empty {
  display: none;
}

.sunline {
  margin-top: 10px;
  color: var(--peach);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.sunline:empty {
  display: none;
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 26px;
  padding: 0 14px;
  border-radius: 0 999px 999px 0;
  background: var(--peach);
  color: var(--black);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.status-pill.caution { background: var(--gold); }
.status-pill.high { background: var(--rust); }
.status-pill.stable { background: var(--peach); }
.status-pill.neutral { background: var(--sky); }

/* ---- shared data cards ---- */

.price-row div,
.alert-stack div,
.hospital-list div,
.trail-grid article,
.law-card {
  min-width: 0;
  padding: 7px 10px;
  background: var(--tint);
  border-left: 4px solid var(--peri);
}

/* ---- weather panel ---- */

.weather-now {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: 12px;
}

.weather-now div {
  border-left-color: var(--lilac);
}

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

.timeline-row {
  display: grid;
  grid-template-columns: 52px 14px minmax(150px, 1fr) 84px;
  gap: 8px;
  align-items: center;
}

.timeline-row span,
.timeline-row em {
  color: var(--peach);
  font-size: 0.72rem;
  text-align: right;
}

.timeline-row em {
  color: var(--gold);
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-align: left;
}

.bar {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.bar.dry { background: var(--lilac); }
.bar.rain { background: var(--sky); }
.bar.wind { background: var(--orange); }
.bar.clear { background: var(--butter); }

.timeline-row b {
  color: var(--sky);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ---- body weather panel ---- */

.body-panel .weather-now div {
  border-left-color: var(--green);
}

.body-panel .weather-now strong {
  color: var(--green);
}

.body-list {
  margin-top: 2px;
}

/* ---- cost panel ---- */

.price-list,
.alert-stack,
.hospital-list,
.trail-grid {
  display: grid;
  gap: var(--gap);
}

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: var(--gap);
  align-items: stretch;
}

.price-row div {
  border-left-color: var(--lilac);
}

.price-row span {
  color: var(--cream);
  font-size: 0.9rem;
}

.price-row p {
  margin: 2px 0 0;
  color: var(--peri);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

.price-row strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  background: var(--gold);
  color: var(--black);
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 0 999px 999px 0;
}

.sample-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  margin-top: 10px;
  padding-right: 12px;
  background: var(--tint);
  border-radius: 999px;
  overflow: hidden;
  color: var(--peach);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.sample-note span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
  letter-spacing: 0.12em;
}

/* ---- safety panel ---- */

.alert-stack article {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: var(--gap);
  align-items: stretch;
}

.alert-dot {
  border-radius: 999px;
  background: var(--peri);
}

.alert-dot.yellow { background: var(--gold); }
.alert-dot.blue { background: var(--sky); }
.alert-dot.green { background: var(--green); }

.alert-stack div {
  border-left: 0;
}

.alert-stack strong {
  display: block;
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 500;
}

.alert-stack p {
  margin: 2px 0 0;
  color: var(--peri);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

/* ---- hospitals panel ---- */

.hospital-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: stretch;
}

.hospital-list div {
  border-left-color: var(--sky);
}

.hospital-list strong {
  display: block;
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 500;
}

.hospital-list p {
  margin: 2px 0 0;
  color: var(--peri);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.hospital-list a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 110px;
  padding: 0 14px;
  background: var(--gold);
  color: var(--black);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 0 999px 999px 0;
}

.hospital-list a:hover {
  background: var(--butter);
}

/* ---- law panel ---- */

.law-card {
  display: grid;
  gap: 6px;
  border-left-color: var(--rust);
}

.law-card span {
  color: var(--lilac);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.law-card strong {
  color: var(--cream);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.05;
}

.law-card p {
  margin: 0;
  color: var(--sky);
  font-size: 0.78rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ---- trails panel ---- */

.trail-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.trail-grid article {
  display: grid;
  gap: 4px;
  border-left-color: var(--orange);
}

.trail-grid strong {
  color: var(--cream);
  font-size: 0.88rem;
  font-weight: 500;
}

.trail-grid p {
  margin: 0;
  color: var(--peri);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.trail-grid span {
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

/* ---- bottom frame ---- */

.frame-bottom {
  grid-area: foot;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  margin-top: 6px;
}

.elbow-bottom {
  min-height: 78px;
  border-radius: 0 0 0 48px;
}

.frame-bottom-right {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.frame-bottom-right::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: var(--barb);
  width: 52px;
  height: 40px;
  background: var(--orange);
}

.frame-bottom-right::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: var(--barb);
  width: 52px;
  height: 40px;
  background: var(--black);
  border-radius: 0 0 0 40px;
}

.frame-bottom-bar {
  display: flex;
  gap: var(--gap);
  height: var(--barb);
}

.frame-bottom-bar::before {
  content: "";
  flex: 0 0 64px;
  background: var(--orange);
}

.frame-bottom-bar button.settings {
  background: var(--peri);
}

.frame-bottom-bar button {
  border: 0;
  padding: 0 16px;
  background: var(--gold);
  color: var(--black);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.frame-bottom-bar button:hover {
  background: var(--butter);
}

.frame-bottom-bar strong {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px;
  background: var(--peach);
  color: var(--black);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 0 999px 999px 0;
}

/* ---- larger screens ---- */

@media (min-width: 860px) {
  :root {
    --rail: 150px;
    --bar: 34px;
  }

  .shell {
    padding: 16px 20px 18px;
  }

  .data-index a {
    padding: 8px 12px;
  }

  .data-index span {
    font-size: 0.64rem;
  }

  .data-index b {
    font-size: 1.4rem;
  }

  .main {
    padding-left: 28px;
  }

  .dashboard {
    grid-template-columns: 1.05fr 0.95fr;
  }

  .weather-now strong {
    font-size: 1.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button-light {
    animation: none;
  }
}
