:root {
  color-scheme: light;
  --ink: #1d2529;
  --muted: #60717a;
  --line: #d7e0df;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-2: #c2410c;
  --blue: #2563eb;
  --green: #15803d;
  --yellow: #b45309;
  --red: #b91c1c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.app-shell {
  width: min(1880px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.site-footer {
  width: min(1880px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 0 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.site-footer a {
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.search-row {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: min(420px, 100%);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  flex: 1;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-weight: 650;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.58;
  cursor: progress;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
}

.is-hidden {
  display: none !important;
}

.learning-home {
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
}

.learning-form {
  display: flex;
  align-items: end;
  gap: 10px;
  max-width: 760px;
  margin-bottom: 14px;
}

.learning-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.learning-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.learning-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.learning-card-top strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}

.learning-current {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #eef8f5;
}

.learning-current span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.learning-current strong {
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
  font-weight: 950;
}

.learning-current em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

.learning-current.missing {
  border-color: var(--line);
  background: #f8faf8;
}

.learning-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.learning-mini span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.learning-mini strong {
  font-size: 0.9rem;
}

.learning-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.learning-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.forecast-brief {
  display: grid;
  grid-template-columns: minmax(520px, 1.25fr) minmax(460px, 0.75fr);
  gap: 24px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}

.forecast-brief h2 {
  margin: 7px 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.forecast-brief p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 650;
}

.brief-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.brief-columns ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.38;
  font-weight: 650;
}

.brief-columns li + li {
  margin-top: 7px;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.summary-band > div {
  min-height: 86px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 6px;
}

.summary-band > div:last-child {
  border-right: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-band strong {
  font-size: 1rem;
}

.current-band {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(3, minmax(180px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #f8faf8;
}

.current-band > div {
  min-height: 112px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  display: grid;
  align-content: center;
  gap: 7px;
}

.current-band > div:last-child {
  border-right: 0;
}

.current-band strong {
  font-size: 1.25rem;
}

.current-main strong {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
}

.current-band p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
}

.calibration-band {
  display: grid;
  grid-template-columns: 160px minmax(180px, 280px) 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.calibration-band p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.35;
}

.learning-progress {
  width: min(280px, 100%);
  height: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eeee;
}

.learning-progress i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.view-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 0 0;
}

.tab-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 850;
}

.tab-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.chart-section {
  padding: 28px 0;
}

canvas {
  width: 100%;
  height: auto;
  min-height: 260px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.comparison-section,
.hourly-section {
  padding: 0 0 28px;
}

.method-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.4;
}

.method-note strong {
  color: var(--ink);
}

.nerd-section {
  padding: 24px 0 0;
}

.methodology-warning {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #f1c27d;
  border-radius: 8px;
  background: #fff8eb;
  color: #70430a;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.methodology-warning strong {
  color: #1d2529;
}

.nerd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.nerd-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--accent);
  background: var(--panel);
  font-size: 0.84rem;
  font-weight: 850;
  text-decoration: none;
}

.nerd-days {
  display: grid;
  gap: 12px;
}

.nerd-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  display: grid;
  gap: 14px;
}

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

.nerd-card h3 {
  margin: 4px 0 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.formula-grid section {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

code {
  display: block;
  min-height: 58px;
  margin: 8px 0 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f4f7f6;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
}

.formula-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
}

.equation-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.equation-list div {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(72px, auto);
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid #edf2f1;
}

.equation-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.equation-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  text-align: right;
}

.comparison-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  background: #f8faf8;
}

tbody th {
  width: 90px;
  font-size: 0.9rem;
}

td strong {
  display: block;
  font-size: 1rem;
}

td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.3;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

.hourly-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.hour-pill {
  min-height: 94px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  align-content: center;
  gap: 5px;
}

.hour-pill span,
.hour-pill em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

.hour-pill strong {
  font-size: 1.4rem;
  line-height: 1;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.day-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-height: 390px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.day-card.is-today-current {
  border-width: 2px;
  border-color: var(--accent);
  background: linear-gradient(180deg, #eef8f5 0, #ffffff 190px);
}

.day-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.date {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.value-kind {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.temp {
  margin: 3px 0 0;
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1;
  font-weight: 900;
}

.condition {
  margin: 6px 0 0;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 850;
}

.badge {
  border-radius: 999px;
  padding: 6px 9px;
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.badge.high {
  background: var(--green);
}

.badge.medium {
  background: var(--yellow);
}

.badge.low {
  background: var(--red);
}

.today-forecast-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.today-forecast-note span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.today-forecast-note strong {
  font-size: 0.94rem;
  line-height: 1.3;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mini strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.confidence-split {
  display: grid;
  gap: 7px;
}

.confidence-part {
  display: grid;
  grid-template-columns: 72px 1fr 34px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.confidence-part div {
  height: 7px;
  border-radius: 999px;
  background: #edf2f1;
  overflow: hidden;
}

.confidence-part i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.confidence-part strong {
  color: var(--ink);
  font-size: 0.76rem;
  text-align: right;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f2f7f5;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.chip.quiet {
  color: var(--muted);
  background: #f7f8f4;
}

.signal {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.confidence-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.signal strong,
.confidence-note strong {
  color: var(--ink);
}

.loading,
.error,
.empty-state {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 750;
}

.error {
  color: var(--red);
}

@media (max-width: 920px) {
  .toolbar {
    display: grid;
    align-items: stretch;
  }

  .forecast-brief,
  .current-band,
  .summary-band,
  .calibration-band {
    grid-template-columns: 1fr;
  }

  .day-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1600px) {
  .app-shell {
    width: min(1920px, calc(100vw - 72px));
  }

  .toolbar {
    gap: 48px;
  }

  .search-row {
    min-width: 520px;
  }

  .chart-section {
    padding: 32px 0;
  }

  .day-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 14px;
  }

  .site-footer {
    width: min(100vw - 20px, 1180px);
    display: grid;
  }

  .search-row {
    display: grid;
  }

  .summary-band,
  .current-band,
  .day-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

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

  .brief-columns {
    grid-template-columns: 1fr;
  }

  .summary-band > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .current-band > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .current-band > div:last-child {
    border-bottom: 0;
  }

  .summary-band > div:last-child {
    border-bottom: 0;
  }
}
