:root {
  color-scheme: dark;
  --bg-primary: #121418;
  --bg-surface: #1a1e24;
  --bg-card: #222730;
  --bg-accent: #2c3340;
  --gold-primary: #e5b342;
  --gold-light: #f7d57f;
  --gold-border: rgba(229, 179, 66, 0.35);
  --text-main: #f0f3f6;
  --text-muted: #9ba7b5;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-serif: 'Cinzel', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
}

.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  background: linear-gradient(180deg, #181d24 0%, #121418 100%);
  border-bottom: 1px solid var(--gold-border);
}

.brand,
.header-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: .9rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 2px solid var(--gold-primary);
  border-radius: 50%;
  background: radial-gradient(circle, #2c3340, #121418 72%);
  box-shadow: 0 0 14px rgba(229, 179, 66, .22);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.brand h1 {
  overflow: hidden;
  margin: 0;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  letter-spacing: .025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand p {
  margin: .15rem 0 0;
  color: var(--text-muted);
  font-size: .78rem;
}

.header-actions {
  flex: 0 0 auto;
  gap: .7rem;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  font-size: .78rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5b342;
  box-shadow: 0 0 8px rgba(229, 179, 66, .55);
}

.status-dot.live {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, .65);
}

.status-dot.error {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, .65);
}

.refresh-button {
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: .48rem .8rem;
  background: var(--bg-card);
  color: var(--text-main);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: .65;
}

.dashboard {
  display: grid;
  width: min(1280px, 100%);
  gap: 1rem;
  margin: 0 auto;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.panel {
  min-width: 0;
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(34, 39, 48, .98), rgba(26, 30, 36, .98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

.current-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  align-items: center;
  gap: 1rem;
  min-height: 190px;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.current-card::after {
  position: absolute;
  top: -110px;
  right: -40px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(229, 179, 66, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(229, 179, 66, .025), 0 0 0 60px rgba(229, 179, 66, .02);
  content: '';
  pointer-events: none;
}

.current-main,
.current-details,
.updated-at {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 .35rem;
  color: var(--gold-primary);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.current-main h2 {
  display: flex;
  align-items: flex-start;
  margin: -.2rem 0 -.3rem;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: clamp(4rem, 9vw, 6rem);
  font-weight: 600;
  line-height: 1;
}

.degree {
  margin: .2rem 0 0 .15rem;
  font-size: .25em;
}

.current-caption {
  margin: .65rem 0 0;
  color: var(--text-muted);
  font-size: .92rem;
}

.current-caption strong {
  color: var(--text-main);
  font-weight: 600;
}

.current-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}

.current-detail {
  display: flex;
  min-height: 75px;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  border-left: 1px solid var(--gold-border);
  padding-left: .85rem;
}

.detail-label {
  color: var(--text-muted);
  font-size: .68rem;
}

.current-detail strong {
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 600;
}

.updated-at {
  grid-column: 1 / -1;
  margin: -.5rem 0 0;
  color: var(--text-muted);
  font-size: .7rem;
}

.sensor-panel {
  padding: 1rem 1.1rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .85rem;
}

.panel-heading .eyebrow {
  margin-bottom: .18rem;
}

.panel-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .015em;
}

.panel-mark {
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: .17rem .48rem;
  background: rgba(229, 179, 66, .1);
  color: var(--gold-light);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .07em;
}

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

.primary-reading {
  display: flex;
  align-items: baseline;
  gap: .38rem;
  margin: .15rem 0 .85rem;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.15;
}

.primary-reading small {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: .7rem;
  font-weight: 500;
}

.reading-list {
  display: grid;
  gap: .42rem;
}

.reading-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: .42rem;
  font-size: .72rem;
}

.reading-list span {
  color: var(--text-muted);
}

.reading-list strong {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
}

.tomorrow-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.tomorrow-condition {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .5rem 0 1rem;
}

.weather-icon {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  overflow: visible;
  color: var(--gold-light);
}

.weather-icon .icon-fill {
  fill: rgba(229, 179, 66, .16);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.weather-icon .icon-line {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 3;
}

.tomorrow-condition p {
  margin: 0;
  color: var(--text-main);
  font-size: .82rem;
  font-weight: 600;
}

.tomorrow-readings {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
}

.tomorrow-readings > div {
  align-items: center;
}

.forecast-attribution {
  align-self: flex-end;
  margin-top: .75rem;
  color: var(--text-muted);
  font-size: .62rem;
  text-decoration: none;
}

.forecast-attribution:hover,
.forecast-attribution:focus-visible {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: .15em;
}

.error-message {
  margin: 0;
  border: 1px solid rgba(239, 68, 68, .45);
  border-radius: var(--radius-md);
  padding: .8rem 1rem;
  background: rgba(239, 68, 68, .08);
  color: #fecaca;
  font-size: .8rem;
}

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: var(--text-muted);
  font-size: .68rem;
}

.dashboard-footer a {
  color: var(--gold-light);
  text-decoration: none;
}

.dashboard-footer a:hover,
.dashboard-footer a:focus-visible {
  text-decoration: underline;
  text-underline-offset: .15em;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
  }

  .header-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: .35rem;
  }

  .current-card {
    grid-template-columns: 1fr;
    gap: .85rem;
  }

  .current-details {
    max-width: 520px;
  }

  .updated-at {
    margin-top: -.25rem;
  }

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

@media (max-width: 520px) {
  .topbar {
    padding: .75rem .85rem;
  }

  .brand {
    gap: .6rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand p {
    font-size: .68rem;
  }

  .live-status {
    font-size: .65rem;
  }

  .refresh-button {
    padding: .35rem .55rem;
    font-size: .7rem;
  }

  .dashboard {
    gap: .75rem;
    padding: .75rem;
  }

  .current-details {
    gap: .35rem;
  }

  .current-detail {
    padding-left: .5rem;
  }

  .detail-label {
    font-size: .61rem;
  }

  .current-detail strong {
    font-size: .98rem;
  }

  .sensor-grid {
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  .sensor-panel {
    padding: .9rem;
  }

  .dashboard-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
