:root {
  color-scheme: light;
  --ink: #24344d;
  --muted: #5f6f86;
  --paper: #f5f8fb;
  --panel: #ffffff;
  --line: #dce6ef;
  --blue: #237fca;
  --navy: #415a77;
  --teal: #8acfc4;
  --green: #3b9f76;
  --red: #e66d55;
  --pink: #f3a7bd;
  --yellow: #f7d774;
  --soft-blue: #f0f8fd;
  --soft-green: #f3fbf5;
  --shadow: 0 12px 28px rgba(31, 52, 78, 0.09);
}

/* Saved locations and the single-page Weather Care flow. */
[hidden] {
  display: none !important;
}

.location-manager {
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid #cfe1ed;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.location-manager-heading,
.location-tab-row,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.location-manager h1,
.dialog-heading h2 {
  margin: 0;
}

.location-manager .eyebrow,
.dialog-heading .eyebrow {
  margin-bottom: 5px;
}

.location-actions,
.empty-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.delete-location-button,
.retry-button,
.dialog-close {
  min-height: 44px;
  border-radius: 10px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #237fca;
  background: #237fca;
  color: #ffffff;
}

.secondary-button,
.retry-button {
  border: 1px solid #b9d5e8;
  background: #ffffff;
  color: #226fae;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.location-tab-row {
  align-items: flex-end;
  margin-top: 18px;
}

.location-tabs {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
}

.location-tab {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 112px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid #cfe1ed;
  border-radius: 12px;
  background: #f7fbfe;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.location-tab strong {
  font-size: 15px;
}

.location-tab small {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-tab.active {
  border-color: #237fca;
  background: #e8f5fd;
  box-shadow: inset 0 0 0 1px #237fca;
}

.delete-location-button {
  flex: 0 0 auto;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #a04d48;
  font-size: 12px;
}

.location-status,
.search-status {
  min-height: 1.4em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.location-status.success {
  color: #347e5c;
}

.location-status.error,
.search-status.error {
  color: #b24f45;
}

.empty-location-state {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 280px;
  padding: 32px;
  border: 1px dashed #b8d5e7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.empty-location-state > img {
  width: 100%;
  filter: drop-shadow(0 10px 18px rgba(31, 52, 78, 0.12));
}

.empty-location-state h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
}

.empty-location-state p:not(.eyebrow) {
  max-width: 640px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.8;
}

.dashboard-section,
.condition-section {
  margin-top: 30px;
}

.medical-note {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.location-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 24px;
  border: 1px solid #cfe1ed;
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(31, 52, 78, 0.24);
}

.location-dialog::backdrop {
  background: rgba(30, 48, 66, 0.38);
  backdrop-filter: blur(3px);
}

.dialog-close {
  width: 44px;
  padding: 0;
  border: 1px solid #d9e5ed;
  background: #ffffff;
  color: var(--muted);
  font-size: 24px;
}

.location-search-form {
  margin-top: 22px;
}

.location-search-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 900;
}

.location-search-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.location-search-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b9cfdd;
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  font: inherit;
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  overflow-y: auto;
}

.search-result {
  display: grid;
  gap: 3px;
  min-height: 52px;
  padding: 11px 13px;
  border: 1px solid #d5e4ed;
  border-radius: 10px;
  background: #f8fbfd;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus-visible {
  border-color: #68a8d2;
  background: #edf7fd;
}

.search-result span {
  color: var(--muted);
  font-size: 12px;
}

.site-footer {
  padding: 24px 18px 40px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  .location-manager {
    padding: 18px;
  }

  .location-manager-heading,
  .location-tab-row {
    align-items: stretch;
    flex-direction: column;
  }

  .location-actions > button,
  .empty-state-actions > button {
    flex: 1 1 140px;
  }

  .delete-location-button {
    align-self: flex-end;
  }

  .empty-location-state {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 24px 20px;
    text-align: center;
  }

  .empty-location-state > img {
    justify-self: center;
    width: 130px;
  }

  .empty-state-actions {
    justify-content: center;
  }

  .location-dialog {
    padding: 20px;
  }

  .location-search-form > div {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef6fb 0, var(--paper) 420px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic", Meiryo,
    system-ui, sans-serif;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 68px;
  padding: 0 44px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(215, 228, 239, 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #2f435c;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  padding: 4px;
  overflow: hidden;
  border: 1px solid rgba(125, 166, 202, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(249, 253, 255, 0.96), rgba(221, 236, 248, 0.96)),
    #eef7fd;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 7px 16px rgba(31, 52, 78, 0.08);
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.08) translateY(-1px);
  transform-origin: center;
  filter: drop-shadow(0 4px 8px rgba(31, 52, 78, 0.16));
}

.source-pill {
  border: 1px solid #d7e8f4;
  border-radius: 999px;
  background: #ffffff;
  color: #226fae;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 800;
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid #d7e8f4;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #2f435c;
}

.menu-toggle:focus-visible {
  outline: 3px solid rgba(35, 127, 202, 0.25);
  outline-offset: 2px;
}

.site-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 44px;
  width: min(280px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(31, 52, 78, 0.16);
}

.site-menu.open {
  display: grid;
}

.site-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  color: #2f435c;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}

.site-menu a:hover,
.site-menu a:focus-visible {
  background: #eef7fd;
  outline: none;
}

.page-summary {
  display: flex;
  justify-content: flex-start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 12px;
  position: relative;
  background: transparent;
}

.eyebrow {
  margin: 0 0 12px;
  color: #3577a7;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 900;
}

h1 span {
  color: var(--blue);
}

.lead {
  max-width: 650px;
  margin: 6px 0 0;
  color: #4c5e75;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.6;
}

.date-card {
  display: inline-grid;
  grid-template-columns: auto;
  gap: 5px;
  min-width: 220px;
  margin-top: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 52, 78, 0.08);
}

.date-card span {
  color: #5b6e84;
  font-size: 13px;
  font-weight: 900;
}

.date-card strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.page-intro {
  margin: 4px 0 22px;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.16;
  font-weight: 900;
}

.page-intro p:last-child {
  max-width: 720px;
  margin: 10px 0 0;
  color: #4d6077;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
}

.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin: 0 0 14px;
}

.archive-toolbar-label {
  color: #52667f;
  font-size: 15px;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.current-panel,
.memory-panel,
.metric-card,
.day-card,
.hour-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.current-panel,
.memory-panel {
  min-height: 300px;
  padding: 0;
  overflow: hidden;
}

.current-panel {
  background: #ffffff;
  border-color: #a9d3ef;
}

.memory-panel {
  background: #ffffff;
  border-color: #b8dfc6;
}

.archive-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid #ddebdc;
  border-radius: 8px;
  background: #f8fbf7;
}

.archive-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #40536d;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.archive-option-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  overflow: visible;
}

.archive-option-icon .weather-art {
  transform: none;
}

.archive-option.active {
  background: #6fbf9b;
  color: #ffffff;
}

.archive-option:focus-visible {
  outline: 3px solid rgba(31, 122, 224, 0.28);
  outline-offset: 2px;
}

.panel-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 26px 28px 0;
  color: #4f6078;
  font-size: 17px;
  font-weight: 900;
}

.weather-main {
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  justify-content: stretch;
  padding: 26px 28px 18px;
}

.weather-icon {
  display: grid;
  place-items: center;
  justify-self: start;
  width: 132px;
  aspect-ratio: 1;
  opacity: 0.9;
}

.weather-reading {
  justify-self: end;
  min-width: 0;
  text-align: right;
}

.weather-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
  transform-origin: center;
}

.weather-icon .weather-art {
  transform: none;
}

.temperature {
  font-size: clamp(72px, 8vw, 112px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.archive-temperature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: end;
  gap: 18px;
}

.temp-block {
  display: grid;
  gap: 6px;
  text-align: right;
}

.temp-block span {
  color: #5b6e84;
  font-size: 14px;
  font-weight: 900;
}

.temp-block strong {
  color: var(--green);
  font-size: clamp(56px, 6vw, 88px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.current-panel .temperature {
  color: var(--blue);
}

.today-high-low {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  justify-content: end;
  gap: clamp(18px, 3vw, 34px);
}

.today-high-low .temp-block strong {
  color: #dc604f;
}

.today-high-low .temp-block:last-child strong {
  color: var(--blue);
}

.memory-panel .temperature {
  color: var(--green);
}

.condition {
  margin: 8px 0 0;
  color: #3b4859;
  font-size: 21px;
  font-weight: 900;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 20px 22px;
  border: 1px solid #e1ebf2;
  border-radius: 8px;
  background: #f8fbfe;
}

.archive-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-metric {
  min-height: 78px;
  padding: 15px 16px;
  border-right: 1px solid #e1ebf2;
}

.mini-metric:last-child {
  border-right: 0;
}

.mini-metric span,
.metric-card .name,
.day-name,
.hour-time {
  display: block;
  color: #5b6e84;
  font-size: 14px;
  font-weight: 900;
}

.mini-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
}

.section-heading {
  margin: 36px 0 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.2;
  font-weight: 900;
}

.hourly-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 1fr);
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hourly-chart-panel {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hourly-chart-panel:empty {
  display: none;
}

.hourly-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.hourly-chart-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.hourly-chart-head p {
  margin: 5px 0 0;
  color: #586a82;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  color: #586a82;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  display: block;
  width: 24px;
  height: 4px;
  border-radius: 999px;
}

.legend-temp {
  background: #e66d55;
}

.legend-humidity {
  background: #237fca;
}

.legend-pressure {
  background: #3b9f76;
}

.legend-yesterday {
  background: repeating-linear-gradient(
    90deg,
    #7b8ca3 0,
    #7b8ca3 8px,
    transparent 8px,
    transparent 13px
  );
}

.combined-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
}

.combined-chart-main,
.combined-chart-summary article {
  min-width: 0;
  border: 1px solid #e1ebf2;
  border-radius: 8px;
  background: #fbfdff;
}

.combined-chart-main {
  padding: 14px;
  overflow-x: auto;
}

.chart-canvas {
  position: relative;
}

.combined-chart-summary {
  display: grid;
  gap: 12px;
}

.combined-chart-summary article {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 132px;
  padding: 16px;
}

.combined-chart-summary span {
  color: #607189;
  font-size: 14px;
  font-weight: 900;
}

.combined-chart-summary strong {
  color: var(--ink);
  font-size: 32px;
  font-weight: 900;
}

.combined-chart-summary small {
  color: #607189;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0;
}

.chart-hover-line {
  display: none;
  position: absolute;
  top: 22px;
  bottom: 32px;
  width: 2px;
  background: rgba(65, 84, 109, 0.44);
  pointer-events: none;
}

.chart-tooltip {
  display: none;
  position: absolute;
  top: 18px;
  z-index: 2;
  width: 172px;
  padding: 10px 11px;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(31, 52, 78, 0.16);
  color: var(--ink);
  pointer-events: none;
}

.chart-canvas.is-hovering .chart-hover-line,
.chart-canvas.is-hovering .chart-tooltip {
  display: block;
}

.chart-tooltip strong,
.chart-tooltip span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chart-tooltip strong {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 900;
}

.chart-tooltip span {
  min-height: 20px;
  color: #4d6077;
  font-size: 12px;
  font-weight: 900;
}

.chart-tooltip i {
  display: block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.tooltip-temp {
  background: #e66d55;
}

.tooltip-humidity {
  background: #237fca;
}

.tooltip-yesterday {
  border: 2px solid #8fa0b4;
}

.chart-gridline {
  stroke: #dce6ef;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #71829a;
  font-size: 12px;
  font-weight: 800;
}

.chart-hour-label {
  text-anchor: middle;
}

.chart-temp-label {
  fill: #e66d55;
}

.chart-humidity-label {
  fill: #237fca;
}

.chart-line {
  fill: none;
  stroke: var(--line-color);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-today {
  stroke-width: 4;
}

.chart-line-yesterday {
  stroke-width: 3;
  opacity: 0.72;
  stroke-dasharray: 8 8;
}

.chart-dot {
  fill: var(--dot-color);
  stroke: #ffffff;
  stroke-width: 2;
}

.pressure-chart-line {
  stroke: var(--green);
}

.pressure-chart-dot {
  fill: var(--green);
}

.condition-summary-card,
.pressure-status-card,
.pressure-day-pill,
.space-status-card,
.space-category {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.condition-summary-card {
  display: grid;
  gap: 12px;
  min-height: 168px;
  padding: 18px;
}

.condition-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.condition-card-head span,
.pressure-status-copy span,
.space-status-card span {
  color: #607189;
  font-size: 14px;
  font-weight: 900;
}

.condition-card-head strong {
  display: inline-grid;
  min-width: 70px;
  min-height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #eef7fd;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.condition-summary-card p,
.pressure-status-card p,
.space-status-card p {
  margin: 0;
  color: #4d6077;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.condition-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.condition-card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f5f8fb;
  color: #586a82;
  font-size: 13px;
  font-weight: 900;
}

.condition-summary-card a {
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.condition-dashboard {
  display: grid;
  gap: 16px;
}

.condition-overview {
  display: block;
}

.pressure-status-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  border-width: 2px;
}

.condition-icon-frame,
.space-icon-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.condition-icon-frame {
  width: 108px;
  height: 108px;
  padding: 2px;
}

.condition-icon-frame.small {
  width: 50px;
  height: 50px;
  padding: 0;
}

.condition-icon-frame img,
.space-icon-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pressure-status-copy {
  display: grid;
  gap: 6px;
}

.pressure-status-copy strong,
.space-status-card strong {
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
}

.pressure-main-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pressure-main-metrics div {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 11px;
  border: 1px solid #e1ebf2;
  border-radius: 8px;
  background: #fbfdff;
}

.pressure-main-metrics span {
  color: #607189;
  font-size: 12px;
  font-weight: 900;
}

.pressure-main-metrics strong {
  color: var(--ink);
  font-size: 18px;
}

.pressure-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.pressure-day-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 70px;
  padding: 8px 10px;
  border: 2px solid transparent;
  color: #ffffff;
}

.pressure-day-pill.is-today {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: -6px;
  box-shadow:
    var(--shadow),
    0 0 0 3px rgba(35, 127, 202, 0.16);
}

.pressure-day-pill div:last-child {
  display: grid;
  min-width: 0;
}

.pressure-day-pill span,
.pressure-day-pill small {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 900;
}

.pressure-day-pill strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.risk-stable {
  background: #3db1ca;
}

.risk-shift {
  background: #f5b33f;
}

.risk-watch {
  background: #f2793e;
}

.risk-strong {
  background: #ef4a61;
}

.risk-unknown {
  background: #8fa0b4;
}

.condition-chart-panel {
  margin-top: 18px;
}

.pressure-chart-scroll {
  overflow-x: auto;
}

.pressure-line-chart {
  min-width: 640px;
}

.space-weather-section,
.condition-notes {
  margin-top: 28px;
}

.space-weather-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.space-status-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-width: 2px;
  color: #ffffff;
}

.space-status-card span,
.space-status-card p,
.space-status-card small,
.space-status-card strong {
  color: #ffffff;
}

.space-status-card p {
  font-weight: 900;
}

.space-status-card small {
  align-self: start;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.space-icon-frame {
  width: 74px;
  padding: 9px;
}

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

.space-category {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 108px;
  padding: 12px 8px;
  text-align: center;
}

.space-category span {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 999px;
  background: #eef7fd;
  color: var(--blue);
  font-size: 16px;
  font-weight: 900;
}

.space-category strong {
  margin-top: 7px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.space-category small {
  margin-top: 3px;
  color: #607189;
  font-size: 12px;
  font-weight: 900;
}

.space-category.active {
  border-color: #f5b33f;
  background: #fff8df;
}

.condition-note-layout {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.hour-card {
  min-height: 146px;
  padding: 16px 14px;
  border: 0;
  border-right: 1px solid #e1ebf2;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.hour-card:last-child {
  border-right: 0;
}

.hour-card .day-icon {
  margin: 8px 0 4px;
}

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

.day-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 232px;
  padding: 16px;
}

.day-card.today {
  border-color: #f3c24d;
  background: #fffdf7;
}

.day-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: -2px auto 0;
  opacity: 0.88;
  overflow: visible;
}

.hour-card .day-icon {
  width: 42px;
  height: 42px;
  margin: 8px auto 4px;
}

.day-temp {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 900;
}

.day-temp .max {
  color: var(--red);
  font-size: 28px;
}

.day-temp .min {
  color: var(--blue);
  font-size: 22px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #586a82;
  font-size: 13px;
  font-weight: 800;
}

.precip {
  margin-top: auto;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.climate-story {
  margin: -4px 0 14px;
  padding: 18px 20px;
  border: 1px solid #d7e8f4;
  border-radius: 8px;
  background: #eef8ff;
}

.climate-story:empty {
  display: none;
}

.climate-story strong {
  display: block;
  color: #35506b;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.5;
}

.climate-story p {
  margin: 6px 0 0;
  color: #4d6077;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
}

.metric-card {
  min-height: 150px;
  padding: 20px;
}

.metric-card .value {
  margin-top: 12px;
  color: #d96b93;
  font-size: 36px;
  font-weight: 900;
}

.metric-card .note {
  margin: 8px 0 0;
  color: #586a82;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.memory-tool {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.memory-form,
.memory-list,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.memory-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.memory-form label {
  display: grid;
  gap: 8px;
  color: #586a82;
  font-size: 14px;
  font-weight: 900;
}

.memory-form input,
.memory-form select,
.memory-form textarea {
  width: 100%;
  border: 1px solid #d7e4ef;
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
}

.memory-form select {
  min-height: 46px;
  background: #ffffff;
}

.memory-form textarea {
  resize: vertical;
}

.memory-form button,
.memory-note button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.memory-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.memory-note {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e1ebf2;
  border-radius: 8px;
  background: #fbfdff;
}

.memory-note span {
  display: block;
  color: #607189;
  font-size: 13px;
  font-weight: 900;
}

.memory-note p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.memory-note button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  background: #8fa0b4;
  font-size: 13px;
}

.empty-note {
  display: grid;
  min-height: 120px;
  place-items: center;
  color: #607189;
  font-weight: 900;
}

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

.settings-card {
  min-height: 180px;
  padding: 20px;
}

.settings-card span {
  color: #607189;
  font-size: 14px;
  font-weight: 900;
}

.settings-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
}

.settings-card p {
  margin: 10px 0 0;
  color: #586a82;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.loading,
.error {
  display: grid;
  min-height: 300px;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.error {
  color: #a64c3d;
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

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

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

  .combined-chart-layout {
    grid-template-columns: 1fr;
  }

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

  .condition-overview,
  .condition-summary-grid,
  .space-weather-panel,
  .condition-note-layout {
    grid-template-columns: 1fr;
  }

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

  .mini-metric:nth-child(2) {
    border-right: 0;
  }

  .mini-metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .memory-tool,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    display: flex;
    padding: 0 16px;
  }

  .header-actions {
    margin-left: auto;
  }

  .brand {
    font-size: 15px;
    letter-spacing: 0.02em;
  }

  .brand-icon {
    width: 44px;
    padding: 3px;
  }

  .brand-icon img {
    transform: scale(1.12) translateY(-1px);
  }

  .source-pill {
    display: none;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
  }

  .site-menu {
    right: 16px;
  }

  main {
    padding: 20px 16px 44px;
  }

  .archive-toolbar {
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    flex-direction: column;
    margin-bottom: 12px;
  }

  .archive-toolbar-label {
    font-size: 13px;
  }

  .archive-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
  }

  .panel-label {
    padding: 18px 18px 0;
    font-size: 16px;
  }

  .weather-main {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    justify-content: stretch;
    padding: 24px 18px 18px;
  }

  .weather-icon {
    justify-self: start;
    width: 92px;
    font-size: 54px;
  }

  .condition {
    font-size: 18px;
  }

  .metrics,
  .compare-grid,
  .daily-grid {
    grid-template-columns: 1fr;
  }

  .page-intro {
    margin-top: 0;
  }

  .combined-chart-summary {
    grid-template-columns: 1fr;
  }

  .combined-line-chart {
    min-width: 560px;
  }

  .pressure-main-metrics,
  .pressure-timeline {
    grid-template-columns: 1fr;
  }

  .pressure-status-card,
  .space-status-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .condition-icon-frame,
  .space-icon-frame {
    justify-self: center;
  }

  .space-category-grid {
    grid-template-columns: 1fr;
  }

  .condition-summary-card,
  .pressure-status-card,
  .pressure-day-pill {
    min-height: 0;
  }

  .chart-canvas {
    width: 560px;
  }

  .hourly-chart-head {
    display: block;
  }

  .chart-legend {
    margin-top: 12px;
  }

  .mini-metric,
  .mini-metric:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mini-metric:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 640px) {
  #weatherDashboard .daily-grid {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 12px;
    scroll-snap-type: x proximity;
  }

  #weatherDashboard .day-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
  }

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

  #weatherDashboard .mini-metric,
  #weatherDashboard .mini-metric:nth-child(2) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  #weatherDashboard .mini-metric:nth-child(2n) {
    border-right: 0;
  }

  #weatherDashboard .mini-metric:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  #weatherDashboard .space-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#weatherDashboard .hero.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.location-menu {
  right: 44px;
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  z-index: 20;
}

.menu-location-manager {
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}

.today-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

.current-snapshot-card {
  display: grid;
  align-content: start;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.current-snapshot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.current-snapshot-head strong {
  color: #237fca;
}

.current-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 100%;
}

.current-snapshot-grid > div {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 22px 18px;
}

.current-snapshot-grid > div + div {
  border-left: 1px solid var(--line);
}

.current-snapshot-grid span,
.current-snapshot-grid small {
  color: var(--muted);
  font-weight: 800;
}

.current-snapshot-grid strong {
  color: var(--ink);
  font-size: clamp(30px, 3vw, 42px);
}

.current-snapshot-grid small {
  line-height: 1.55;
}

#hourlyCharts .combined-chart-layout {
  grid-template-columns: minmax(0, 1fr);
}

.hourly-forecast-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 2px 10px;
}

.hourly-forecast-heading h3,
.hourly-forecast-heading p {
  margin: 0;
}

.chart-source-note {
  margin-top: 5px !important;
}

.chart-source-note.fallback {
  color: #9a5b3e;
}

.hourly-forecast-heading h3 {
  color: var(--ink);
  font-size: 20px;
}

.hourly-forecast-heading p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.today-first-heading {
  margin: 4px 0 14px;
}

.today-first-heading .eyebrow {
  margin-bottom: 5px;
}

.today-first-heading h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.compact-location-manager {
  margin-bottom: 22px;
  padding: 13px 16px 10px;
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(31, 52, 78, 0.06);
}

.compact-location-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.location-manager-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.compact-location-manager .location-tab-row {
  margin-top: 9px;
}

.compact-location-manager .location-status {
  margin-top: 4px;
}

#weatherDashboard .dashboard-section {
  margin-top: 0;
}

@media (max-width: 640px) {
  .location-menu {
    right: 16px;
  }

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

  .current-snapshot-grid > div {
    padding: 18px 14px;
  }

  .hourly-forecast-heading {
    display: block;
  }

  .hourly-forecast-heading p {
    margin-top: 4px;
  }

  .compact-location-manager {
    padding: 12px;
  }

  .compact-location-top {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .compact-location-manager .location-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-location-manager .location-actions > button {
    min-width: 0;
    padding-inline: 8px;
  }

  .compact-location-manager .location-tab-row {
    gap: 4px;
    margin-top: 8px;
  }
}
