:root {
  --bg: #f4efe6;
  --bg-soft: #efe7da;
  --panel: #fffbf5;
  --panel-strong: #fff8ee;
  --line: rgba(72, 56, 33, 0.14);
  --line-strong: rgba(72, 56, 33, 0.22);
  --text: #241a0f;
  --muted: #6c5d48;
  --accent: #2f2112;
  --accent-soft: rgba(47, 33, 18, 0.08);
  --accent-blue: #2f2112;
  --accent-amber: #15803d;
  --shadow: 0 16px 48px rgba(53, 39, 18, 0.08);
  --font: "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 28%),
    linear-gradient(140deg, var(--bg) 0%, #efe7da 46%, #e3d6c1 100%);
}

a,
button,
select {
  font: inherit;
}

.weather-app {
  max-width: 1520px;
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.weather-app.detail-mode {
  max-width: 1460px;
  padding-top: 12px;
}

.weather-app.detail-mode .weather-hero,
.weather-app.detail-mode .weather-toolbar {
  display: none;
}

.weather-hero,
.weather-toolbar,
.overview-panel,
.detail-panel,
.metric-card,
.detail-card,
.toolbar-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.weather-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 0.98;
}

h2 {
  font-size: clamp(22px, 2.2vw, 30px);
}

h3 {
  font-size: 18px;
}

.hero-text,
.section-copy,
.card-head p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.hero-text {
  max-width: 760px;
  margin-top: 14px;
}

.hero-rule-box {
  display: inline-grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.hero-rule-box span {
  color: var(--muted);
  font-size: 12px;
}

.hero-rule-box strong {
  font-size: 13px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.primary-btn,
.ghost-btn,
.back-btn,
.city-link-btn {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

.primary-btn,
.ghost-btn,
.back-btn {
  padding: 10px 16px;
  font-size: 13px;
}

.primary-btn {
  background: var(--accent);
  color: #fff8ef;
  font-weight: 700;
}

.ghost-btn,
.back-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.weather-meta-hidden {
  display: none;
}

.overview-panel,
.detail-panel {
  margin-top: 18px;
  padding: 18px;
}

.section-head,
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.overview-metrics,
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  padding: 14px;
}

.metric-card span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.05;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.overview-table-wrap,
.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: auto;
}

thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  background: rgba(252, 252, 249, 0.92);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

tbody td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}

tbody tr:hover {
  background: rgba(47, 33, 18, 0.03);
}

.city-link-btn {
  padding: 0;
  background: transparent;
  color: var(--accent-blue);
  font-weight: 700;
}

.forecast-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 33, 18, 0.18);
  background: rgba(239, 230, 214, 0.9);
  color: #2f2112;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.forecast-badge.empty {
  background: #f3f4f6;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.detail-grid-full {
  grid-template-columns: 1fr;
}

.detail-grid-wide {
  grid-template-columns: 1fr 1fr;
}

.detail-card {
  padding: 16px;
}

.card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.forecast-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.forecast-summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.forecast-summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 195, 255, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.forecast-summary-card.is-active {
  border-color: rgba(125, 195, 255, 0.34);
  background:
    radial-gradient(circle at top right, rgba(98, 210, 162, 0.08), transparent 28%),
    rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(125, 195, 255, 0.08);
}

.forecast-summary-card span,
.forecast-summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.forecast-summary-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 20px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
}

.detail-links {
  display: grid;
  gap: 12px;
}

.detail-link {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.detail-link span {
  color: var(--muted);
  font-size: 12px;
}

.detail-link strong {
  color: var(--text);
  line-height: 1.5;
  word-break: break-all;
}

.empty-row td {
  color: var(--muted);
}

.combined-transition-row td {
  padding: 14px 18px;
  background: rgba(220, 236, 255, 0.46);
  border-top: 1px solid rgba(70, 108, 179, 0.18);
  border-bottom: 1px solid rgba(70, 108, 179, 0.14);
}

.combined-transition-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dcecff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.combined-transition-meta {
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
}

.combined-row-forecast {
  background: rgba(240, 249, 244, 0.88);
}

.temp-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 68px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.temp-signal strong {
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.temp-signal em {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.temp-signal-cool {
  color: #1d4ed8;
  background: linear-gradient(180deg, #eef5ff, #dbeafe);
  border-color: rgba(59, 130, 246, 0.24);
}

.temp-signal-mild {
  color: #365314;
  background: linear-gradient(180deg, #f2fbe8, #e6f6d5);
  border-color: rgba(101, 163, 13, 0.22);
}

.temp-signal-warm {
  color: #9a3412;
  background: linear-gradient(180deg, #fff3d8, #ffe7b8);
  border-color: rgba(245, 158, 11, 0.24);
}

.temp-signal-hot {
  color: #b45309;
  background: linear-gradient(180deg, #ffe7cf, #ffd6ad);
  border-color: rgba(249, 115, 22, 0.26);
}

.temp-signal-peak {
  color: #fff7ed;
  background: linear-gradient(135deg, #c2410c, #ea580c);
  border-color: rgba(194, 65, 12, 0.38);
  box-shadow:
    0 0 0 1px rgba(194, 65, 12, 0.08),
    0 6px 14px rgba(194, 65, 12, 0.16);
}

.temp-signal-peak em {
  color: #ffedd5;
}

.combined-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.combined-type-pill-actual {
  background: #dcecff;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.18);
}

.combined-type-pill-forecast {
  background: #dcfce7;
  color: #15803d;
  border-color: rgba(34, 197, 94, 0.18);
}

@media (max-width: 1080px) {
  .weather-hero,
  .section-head,
  .detail-header,
  .detail-grid,
  .detail-grid-wide,
  .weather-toolbar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .weather-toolbar,
  .detail-grid,
  .detail-grid-wide {
    display: grid;
  }

  .weather-hero {
    align-items: flex-start;
  }

  .forecast-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .forecast-summary-row {
    grid-template-columns: 1fr;
  }
}
