:root {
  --bg: #ffffff;
  --card: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #2563eb;
  --alert: #ef4444;
  --watch: #f59e0b;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #1f2937;
  --accent: #60a5fa;
  --alert: #f87171;
  --watch: #fbbf24;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.widget {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
} /* widened */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  /* box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08); */
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.title {
  font-size: 18px;
  margin: 0;
}
.sub {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.headings {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.spacer {
  flex: 1;
}
.ghost {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

/* More breathing room + responsive columns */
.grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}
@media (min-width: 520px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 820px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1100px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.day {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  cursor: pointer;
}
.day h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}
.temp-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.hilo {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-left: 28px;
}
.temp {
  font-size: 22px;
  font-weight: 800;
}
.hilo {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.feels {
  font-size: 12px;
  color: var(--muted);
}
.detail {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.sun {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.small {
  font-size: 11px;
}
.pill {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.hidden {
  display: none;
}
.error {
  color: var(--alert);
  font-size: 13px;
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
}
.tab {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}
.tab.active {
  color: var(--text);
  border-color: var(--accent);
}
.panel {
}

/* Hourly list */
.hourly-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.hours {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 4px;
}
.hour {
  min-width: 110px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.hour .time {
  font-weight: 700;
  font-size: 12px;
}
.hour .temp {
  font-size: 18px;
}
.hour .detail {
  font-size: 12px;
  color: var(--muted);
}

/* Alerts */
.alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.alert {
  border-left: 4px solid var(--alert);
  background: color-mix(in oklab, var(--alert) 8%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.alert .aline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.alert .aname {
  font-weight: 800;
}
.alert .atype {
  font-size: 11px;
  color: var(--muted);
}
.alert .adesc {
  font-size: 12px;
  margin-top: 4px;
  color: var(--text);
}
.alert .alink {
  font-size: 11px;
  color: var(--muted);
}

.sun span {
  display: block;
}
.sun .moon {
  color: var(--muted);
  opacity: 0.9;
}

/* === Neo‑Brutalist Dark Mode (Notion-friendly) ========================= */
[data-theme="dark"] body {
  background: transparent; /* inherit Notion's dark canvas */
  color: #e8e8e8;
}

:root {
  --accent: #ffd166;
} /* warm brutalist accent */
[data-theme="dark"] :root {
  --accent: #ffd166;
}

/* Card container: thick border, offset hard shadow */
[data-theme="dark"] .card {
  background: #191919;
  border: 2px solid #333;
  border-radius: 8px;
  /* box-shadow: 8px 8px 0 #000; */
  padding: 18px;
}

/* Daily cards */
[data-theme="dark"] .day {
  background: #191919;
  border: 2px solid #333;
  border-radius: 8px;
  box-shadow: 6px 6px 0 #000;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
[data-theme="dark"] .day:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 #000;
}

/* Tabs / Pills / Badges = outlined blocks */
[data-theme="dark"] .tab,
[data-theme="dark"] .pill,
[data-theme="dark"] .badge,
[data-theme="dark"] .badge.small {
  background: #191919;
  border: 2px solid #333;
  border-radius: 8px;
  color: #cfcfcf;
  box-shadow: 4px 4px 0 #000;
}
[data-theme="dark"] .tab.active {
  border-color: var(--accent);
  color: #fff;
}
[data-theme="dark"] .pill:hover,
[data-theme="dark"] .tab:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 #000;
}

/* Headers and labels: bold, clear */
[data-theme="dark"] .title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
[data-theme="dark"] h4 {
  font-weight: 900;
}

/* Sub/muted text tuned for contrast on #191919 */
[data-theme="dark"] .muted,
[data-theme="dark"] .sub,
[data-theme="dark"] .detail,
[data-theme="dark"] .sun,
[data-theme="dark"] .hilo {
  color: #a9a9a9;
}

/* Temperature styling: chunky weights */
[data-theme="dark"] .temp {
  font-weight: 900;
}
[data-theme="dark"] .hilo {
  font-weight: 800;
}

/* Alerts block: loud but flat */
[data-theme="dark"] .alert {
  background: #191919;
  border: 2px solid #613232; /* deep red-brown */
  box-shadow: 6px 6px 0 #000;
}
[data-theme="dark"] .alert .aname {
  color: #ffd1d1;
}
[data-theme="dark"] .error {
  color: #ff6b6b;
}

/* Header dot = accent */
[data-theme="dark"] .dot {
  background: var(--accent);
}

/* Controls */
[data-theme="dark"] .ghost {
  color: #f0f0f0;
}
[data-theme="dark"] .ghost:hover {
  transform: translate(-1px, -1px);
}

/* Grid spacing slightly opened for clarity */
[data-theme="dark"] .grid {
  gap: 14px;
}
[data-theme="dark"] .day {
  padding: 12px;
  min-height: 150px;
}

/* Hourly cards keep same brutalist treatment */
[data-theme="dark"] .hour {
  background: #191919;
  border: 2px solid #333;
  border-radius: 8px;
  box-shadow: 4px 4px 0 #000;
}

/* === Neo-Brutalist Light Mode ========================= */
[data-theme="light"] body {
  background: #ffffff;
  color: #111;
}

[data-theme="light"] .card {
  background: #ffffff;
  border: 2px solid #222;
  border-radius: 8px;
  /* box-shadow: 8px 8px 0 #222; */
  padding: 18px;
}

[data-theme="light"] .day {
  background: #ffffff;
  border: 2px solid #222;
  border-radius: 8px;
  box-shadow: 6px 6px 0 #222;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
[data-theme="light"] .day:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0 #222;
}

[data-theme="light"] .tab,
[data-theme="light"] .pill,
[data-theme="light"] .badge,
[data-theme="light"] .badge.small {
  background: #ffffff;
  border: 2px solid #222;
  border-radius: 8px;
  color: #222;
  box-shadow: 4px 4px 0 #222;
}
[data-theme="light"] .tab.active {
  border-color: var(--accent);
  color: #000;
}
[data-theme="light"] .pill:hover,
[data-theme="light"] .tab:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 #222;
}

/* Text and headers */
[data-theme="light"] .title {
  font-weight: 900;
  letter-spacing: 0.2px;
}
[data-theme="light"] h4 {
  font-weight: 900;
}
[data-theme="light"] .muted,
[data-theme="light"] .sub,
[data-theme="light"] .detail,
[data-theme="light"] .sun,
[data-theme="light"] .hilo {
  color: #3b3b3b;
}

/* Alerts block: border + shadow match */
[data-theme="light"] .alert {
  background: #ffffff;
  border: 2px solid #7a2b2b;
  border-left-width: 4px;
  box-shadow: 6px 6px 0 #7a2b2b; /* matches border color */
}
[data-theme="light"] .alert .aname {
  color: #7a2b2b;
}

/* Shared tweaks */
[data-theme="light"] .grid {
  gap: 14px;
}
[data-theme="light"] .day {
  padding: 12px;
  min-height: 150px;
}
[data-theme="light"] .dot {
  background: var(--accent);
}

/* === Icons ============================================================= */
.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: -3px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Light theme colors */
:root {
  --ico-sun: #f59e0b; /* amber-500 */
  --ico-moon: #7c3aed; /* violet-600 */
  --ico-cloud: #6b7280; /* gray-500 */
  --ico-rain: #3b82f6; /* blue-500 */
  --ico-snow: #0ea5e9; /* sky-500 */
  --ico-fog: #9ca3af; /* gray-400 */
  --ico-thunder: #f97316; /* orange-500 */
  --ico-wind: #10b981; /* emerald-500 */
  --ico-precip: #60a5fa; /* blue-400 */
}

/* Dark theme colors (slightly brighter) */
[data-theme="dark"] {
  --ico-sun: #fbbf24; /* amber-400 */
  --ico-moon: #a78bfa; /* violet-300 */
  --ico-cloud: #9ca3af; /* gray-400 */
  --ico-rain: #60a5fa; /* blue-400 */
  --ico-snow: #93c5fd; /* blue-300 */
  --ico-fog: #cbd5e1; /* slate-300 */
  --ico-thunder: #fb923c; /* orange-400 */
  --ico-wind: #34d399; /* emerald-400 */
  --ico-precip: #93c5fd; /* blue-300 */
}

/* Per-condition color utility classes */
.ico-sun {
  color: var(--ico-sun);
}
.ico-moon {
  color: var(--ico-moon);
}
.ico-cloud {
  color: var(--ico-cloud);
}
.ico-rain {
  color: var(--ico-rain);
}
.ico-snow {
  color: var(--ico-snow);
}
.ico-fog {
  color: var(--ico-fog);
}
.ico-thunder {
  color: var(--ico-thunder);
}
.ico-wind {
  color: var(--ico-wind);
}
.ico-precip {
  color: var(--ico-precip);
}

/* Slight spacing helper for inline icon+text rows */
.irow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* Start date controls */
.start-tools { display: inline-flex; gap: 8px; align-items: center; margin-right: 8px; }
.date {
  appearance: none;
  background: #fff;
  color: #111;
  border: 2px solid #222;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  box-shadow: 4px 4px 0 #000;
}
[data-theme="dark"] .date {
  background: #191919;
  color: #e8e8e8;
  border: 2px solid #333;
  box-shadow: 4px 4px 0 #000;
}
.date:focus { outline: none; border-color: var(--accent); }