/* DailyDashboard — Main CSS entry point */
/* PostCSS bundles these @imports into a single dist/styles.css */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #141517;
  --bg-widget: #1c1e22;
  --bg-skeleton: #2a2d33;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #d0d4da;
  --text-body: #b8bcc2;
  --text-secondary: #a8adb5;
  --text-muted: #7c828c;
  --text-dim: #5e6470;
  --text-faint: #555a63;
  --text-subtlest: #4d525a;
  --accent-blue: #8badc8;
  --accent-green: #5d9e6b;
  --accent-red: #c75050;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  color: var(--text-body);
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1600px;
  width: 100%;
  text-align: center;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: auto;
  grid-auto-flow: row dense;
  align-items: start;
  gap: 0.75rem;
  padding-bottom: 3rem;
}

.container > * {
  min-width: 0;
  overflow: hidden;
}

.container > [data-widget-key] {
  min-height: 240px;
}

.hero {
  grid-column: 1 / -1;
  margin-bottom: 0.5rem;
  text-align: left;
}

.hero-date {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-week {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-greeting {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* Proverb widget */
.proverb-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 2;
  text-align: center;
}

.proverb-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.proverb-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.proverb-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.proverb-body {
  position: relative;
  padding: 2rem 2rem;
  margin: 0 auto 1rem;
}

.quote-mark {
  font-size: 3.5rem;
  color: var(--text-subtlest);
  line-height: 1;
  position: absolute;
  top: 0.3rem;
  left: 1rem;
  opacity: 0.6;
}

.quote-mark.closing {
  top: auto;
  left: auto;
  bottom: 0.3rem;
  right: 1rem;
}

.proverb-text {
  font-size: 1.35rem;
  line-height: 1.8;
  font-style: italic;
  color: var(--text-body);
  padding: 0 1rem;
  transition: opacity 0.4s ease;
}

.proverb-text.fade {
  opacity: 0;
}

.btn {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.7rem 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Eurojackpot widget */
.eurojackpot-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  grid-column: span 3;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.eurojackpot-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #d4a843, #f0d060, #d4a843);
  opacity: 0.7;
}

.eurojackpot-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.eurojackpot-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.eurojackpot-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eurojackpot-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding: 0.5rem 0;
}

.ej-draw-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: capitalize;
  line-height: 1.5;
}

.ej-draw-day {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.ej-timer {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.ej-timer-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.6rem;
  background: linear-gradient(180deg, rgba(212, 168, 67, 0.08) 0%, rgba(212, 168, 67, 0.02) 100%);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 8px;
  padding: 0.5rem 0.4rem 0.35rem;
}

.ej-timer-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f0d060;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(240, 208, 96, 0.2);
}

.ej-timer-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

.ej-timer-sep {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(212, 168, 67, 0.4);
  padding-top: 0.4rem;
  line-height: 1;
}

.ej-jackpot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.ej-jackpot-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ej-jackpot-amount {
  font-size: 1.4rem;
  font-weight: 700;
  color: #d4a843;
  line-height: 1;
}

.ej-jackpot-meter {
  width: 100%;
  max-width: 160px;
  height: 4px;
  background: rgba(212, 168, 67, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.ej-jackpot-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a843, #f0d060);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.ej-play-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #d4a843;
  text-decoration: none;
  padding: 0.45rem 1.2rem;
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ej-play-link:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: rgba(212, 168, 67, 0.4);
  color: #f0d060;
  transform: translateY(-1px);
}

.ej-loading {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* Bus widget */
.bus-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 3;
  text-align: left;
}

.bus-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.bus-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.bus-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bus-departures {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bus-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.bus-route {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 2.5rem;
}

.bus-headsign {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bus-time {
  font-variant-numeric: tabular-nums;
  color: var(--accent-blue);
  white-space: nowrap;
}

.bus-rt {
  color: var(--accent-green);
  font-size: 0.6rem;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.bus-error {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-style: italic;
}

.bus-alerts {
  margin-bottom: 0.5rem;
}

.bus-alert {
  font-size: 0.8rem;
  color: #f5a623;
  padding: 0.25rem 0;
  line-height: 1.3;
}

.bus-alert-icon {
  margin-right: 0.25rem;
}

/* Train widget */
.train-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 4;
  text-align: left;
}

.train-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.train-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.train-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.train-departures {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.train-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.train-route {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 2.5rem;
}

.train-headsign {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-time {
  font-variant-numeric: tabular-nums;
  color: var(--accent-blue);
  white-space: nowrap;
}

.train-rt {
  color: var(--accent-green);
  font-size: 0.6rem;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.train-error {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-style: italic;
}

.train-alerts {
  margin-bottom: 0.5rem;
}

.train-alert {
  font-size: 0.8rem;
  color: #f5a623;
  padding: 0.25rem 0;
  line-height: 1.3;
}

.train-alert-icon {
  margin-right: 0.25rem;
}

/* Weather widget */
.weather-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 5;
  text-align: left;
}

.weather-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.weather-icon {
  font-size: 1.2rem;
  opacity: 0.7;
}

.weather-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.weather-data {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.weather-condition {
  font-size: 1.6rem;
  color: var(--text-secondary);
  line-height: 1;
}

.weather-condition-icon {
  font-size: 2rem;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.weather-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.95rem;
  color: #8b919a;
}

.weather-detail-label {
  color: var(--text-dim);
  margin-right: 0.35rem;
}

.weather-detail-value {
  color: var(--text-secondary);
}

.weather-error {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-style: italic;
}

.weather-rain {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--accent-blue);
  padding: 0.35rem 0.6rem;
  background: rgba(96, 165, 250, 0.08);
  border-radius: 6px;
  display: inline-block;
}

.weather-rain-none {
  color: var(--text-muted);
  background: transparent;
}

.weather-sun {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #f5c542;
  padding: 0.35rem 0.6rem;
  background: rgba(245, 197, 66, 0.08);
  border-radius: 6px;
  display: inline-block;
}

.weather-title-link {
  text-decoration: none;
  color: var(--text-muted);
  transition: opacity 0.2s;
}
.weather-title-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

.weather-forecast {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
}

.weather-forecast-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.weather-forecast-time {
  color: var(--text-dim);
  font-weight: 600;
  min-width: 2.5rem;
}

.weather-forecast-icon {
  font-size: 1rem;
}

.weather-forecast-temp {
  font-weight: 600;
  color: var(--text-secondary);
}

.weather-forecast-desc {
  color: var(--text-dim);
}

/* News widget */
.news-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 8;
  text-align: left;
}

.news-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.news-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.news-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-stories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.5rem;
}

.news-story {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.news-story:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.news-story-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.news-story-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-story-title a:hover {
  color: var(--accent-blue);
}

.news-story-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.3rem;
}

.news-latest-update {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--accent-blue);
  line-height: 1.4;
}

.news-latest-label {
  font-weight: 600;
  color: var(--accent-blue);
  position: relative;
  cursor: help;
}

.news-latest-label[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 6px;
  background: var(--bg-card, #23262b);
  color: var(--text-main, #e8ecf0);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  max-width: 320px;
  width: max-content;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.news-story-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.news-story-sources {
  font-size: 0.75rem;
  color: var(--text-subtlest);
}

.news-story-time {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.news-topic-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  background: rgba(139, 173, 200, 0.15);
  color: var(--accent-blue);
}

.news-topic-conflict { background: rgba(220, 80, 80, 0.15); color: #e06060; }
.news-topic-politics { background: rgba(180, 130, 220, 0.15); color: #b88ade; }
.news-topic-diplomacy { background: rgba(100, 180, 220, 0.15); color: #6cb8e0; }
.news-topic-economy { background: rgba(100, 200, 130, 0.15); color: #6cc880; }
.news-topic-climate { background: rgba(80, 180, 120, 0.15); color: #50b878; }
.news-topic-disaster { background: rgba(240, 150, 60, 0.15); color: #e8a040; }
.news-topic-technology { background: rgba(100, 140, 240, 0.15); color: #7090e8; }
.news-topic-health { background: rgba(220, 100, 160, 0.15); color: #d870a0; }
.news-topic-science { background: rgba(160, 120, 240, 0.15); color: #a080e8; }

.news-blowing-up {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  background: rgba(255, 80, 40, 0.2);
  color: #ff6030;
  margin-right: 0.4em;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.news-error {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-style: italic;
}

.news-independent-section {
  grid-column: 1 / -1;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.25rem;
}

.news-independent-header {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 0.7rem;
}

/* Markets widget */
.markets-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 7;
  text-align: left;
  min-height: 320px;
}

.markets-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.markets-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.markets-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.markets-toggle-selector {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}

.markets-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.markets-toggle-btn:hover {
  border-color: #8badc8;
  color: var(--text-primary);
}

.markets-toggle-btn.active {
  background: rgba(139, 173, 200, 0.15);
  border-color: #8badc8;
  color: #8badc8;
}

.markets-period-selector {
  display: flex;
  gap: 0.25rem;
}

.markets-period-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.markets-period-btn:hover {
  border-color: #8badc8;
  color: var(--text-primary);
}

.markets-period-btn.active {
  background: rgba(139, 173, 200, 0.15);
  border-color: #8badc8;
  color: #8badc8;
}

.markets-data {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.markets-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.markets-change {
  font-size: 1rem;
  font-weight: 600;
}

.markets-change-up {
  color: var(--accent-green);
}

.markets-change-down {
  color: var(--accent-red);
}

.markets-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.markets-chart {
  width: 100%;
  height: 180px;
  margin-top: 0.75rem;
  display: block;
}

.markets-error {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-style: italic;
}

/* Loading overlay for tab/period switches */
.markets-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 21, 23, 0.6);
  border-radius: 6px;
  z-index: 5;
}

.markets-loading.hidden {
  display: none;
}

.markets-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(139, 173, 200, 0.2);
  border-top-color: #8badc8;
  border-radius: 50%;
  animation: markets-spin 0.7s linear infinite;
}

@keyframes markets-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Electricity widget */
.electricity-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 5;
  text-align: left;
  min-height: 320px;
}

.electricity-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.electricity-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.electricity-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.electricity-data {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.electricity-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.electricity-unit {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.electricity-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

.electricity-stat-label {
  color: var(--text-dim);
  margin-right: 0.3rem;
}

.electricity-stat-value {
  color: var(--text-secondary);
}

.electricity-stat-value.price-low {
  color: var(--accent-green);
}

.electricity-stat-value.price-high {
  color: var(--accent-red);
}

.electricity-chart {
  width: 100%;
  height: 180px;
  margin-top: 0.75rem;
  display: block;
}

.electricity-chart-wrap {
  position: relative;
}

.electricity-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-skeleton);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.electricity-tooltip.visible {
  opacity: 1;
}

.electricity-error {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-style: italic;
}

.electricity-source {
  font-size: 0.68rem;
  color: var(--text-subtlest);
  margin-left: auto;
}

.electricity-source a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.electricity-source a:hover {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.2);
}

.electricity-cheapest {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(93, 158, 107, 0.08);
  border: 1px solid rgba(93, 158, 107, 0.2);
  border-radius: 6px;
  margin-top: 0.3rem;
}

.electricity-cheapest-label {
  font-size: 0.72rem;
  color: #5d9e6b;
  font-weight: 600;
  white-space: nowrap;
}

.electricity-cheapest-value {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.electricity-cheapest-avg {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* History widget */
.history-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 3;
  text-align: left;
}

.history-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.history-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.history-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-source {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-subtlest);
}

.history-events {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-event {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-date-badge {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-blue);
  line-height: 1;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.history-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.history-text a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.history-text a:hover {
  color: var(--accent-blue);
}

.history-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.history-error {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-style: italic;
}

/* Hockey widget */
.hockey-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 4;
  text-align: left;
}

.hockey-clickable {
  cursor: pointer;
}

.hockey-summary {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.hockey-today {
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(80, 180, 100, 0.1);
  border: 1px solid rgba(80, 180, 100, 0.25);
  font-size: 0.75rem;
  font-weight: 600;
  color: #8cd49c;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hockey-live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8cd49c;
  animation: hockey-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(80, 180, 100, 0.6);
}

@keyframes hockey-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.hockey-elimination-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: #e8a040;
  background: rgba(232, 160, 64, 0.12);
  border: 1px solid rgba(232, 160, 64, 0.3);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.3rem;
  white-space: nowrap;
}

.hockey-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hockey-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.hockey-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hockey-games {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hockey-empty {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.hockey-game {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.02);
}

.hockey-game-upcoming {
  opacity: 0.7;
  border: 1px dashed var(--border-subtle);
}

.hockey-date {
  color: var(--text-dim);
  font-size: 0.72rem;
  min-width: 4rem;
  white-space: nowrap;
}

.hockey-time {
  color: var(--text-dim);
  font-size: 0.72rem;
  white-space: nowrap;
}

.hockey-opponent {
  flex: 1;
  color: var(--text-muted);
}

.hockey-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: center;
}

.hockey-win {
  color: #8cd49c;
}

.hockey-loss {
  color: #e08080;
}

.hockey-pending {
  color: var(--text-dim);
}

.hockey-upcoming-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: rgba(139, 173, 200, 0.15);
  border-radius: 4px;
  color: #8badc8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hockey-stage-badge {
  font-size: 0.6rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border: 1px solid transparent;
}

.hockey-stage-quarterfinal {
  background: rgba(139, 173, 200, 0.12);
  color: #8badc8;
  border-color: rgba(139, 173, 200, 0.3);
}

.hockey-stage-semifinal {
  background: rgba(163, 217, 119, 0.12);
  color: #a3d977;
  border-color: rgba(163, 217, 119, 0.3);
}

.hockey-stage-final {
  background: rgba(255, 200, 90, 0.15);
  color: #ffc85a;
  border-color: rgba(255, 200, 90, 0.4);
}

.hockey-stage-bronze {
  background: rgba(205, 127, 50, 0.15);
  color: #cd7f32;
  border-color: rgba(205, 127, 50, 0.4);
}

.hockey-game-playoff {
  border-left: 2px solid rgba(255, 200, 90, 0.35);
  padding-left: 0.4rem;
}

.hockey-tbd {
  color: var(--text-dim);
  font-style: italic;
}

/* Hockey modal */
.hockey-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.hockey-modal {
  background: var(--bg-widget);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.hockey-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hockey-modal-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hockey-modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.hockey-modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.hockey-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.hockey-modal-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.hockey-stat {
  font-weight: 600;
}

.hockey-stat-sep {
  color: var(--text-dim);
}

.hockey-modal-summary {
  padding: 0.5rem 1.25rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.hockey-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Festivals widget */
.festivals-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 7;
  text-align: left;
}

.festivals-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.festivals-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.festivals-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.festivals-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.festivals-empty {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-style: italic;
}

.festivals-month {
  margin-bottom: 0.5rem;
}

.festivals-month-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: capitalize;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.festivals-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.festivals-item:last-child {
  border-bottom: none;
}

.festivals-item-ongoing {
  background: rgba(139, 173, 200, 0.06);
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
}

.festivals-item-local {
  border-left: 2px solid rgba(139, 173, 200, 0.35);
  padding-left: 0.5rem;
}

.festivals-item-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  min-width: 5.5rem;
  white-space: nowrap;
}

.festivals-ongoing-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-green);
  margin-left: 0.3rem;
  text-transform: uppercase;
}

.festivals-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.festivals-item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.festivals-item-name a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.festivals-item-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.festivals-item-name a:hover {
  color: var(--accent-blue);
}

.festivals-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.festivals-location {
  color: var(--text-muted);
}

.festivals-price {
  color: var(--text-dim);
}

.festivals-genre-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.festivals-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.6rem;
  font-style: normal;
  color: var(--text-faint);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: help;
  position: relative;
  flex-shrink: 0;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.festivals-info:hover {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.25);
}

.festivals-info::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background: #1e2024;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: normal;
  width: max-content;
  max-width: 280px;
  max-height: 200px;
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.festivals-info:hover::after {
  opacity: 1;
  visibility: visible;
}

.festivals-clickable {
  cursor: pointer;
}

.festivals-show-all {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: rgba(139, 173, 200, 0.1);
  border: 1px solid rgba(139, 173, 200, 0.3);
  border-radius: 8px;
  color: #8badc8;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.festivals-show-all:hover {
  background: rgba(139, 173, 200, 0.2);
  border-color: #8badc8;
}

.festivals-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.festivals-modal {
  background: var(--bg-widget);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.festivals-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.festivals-modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.festivals-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.festivals-modal-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 480px) {
  .proverb-text {
    font-size: 1.1rem;
  }
}

/* AI Bubble Index widget */
.aibubble-widget {
  background: var(--bg-widget);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  grid-column: span 5;
  text-align: left;
  min-height: 320px;
}

.aibubble-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.aibubble-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.aibubble-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.aibubble-source {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-decoration: none;
}

.aibubble-source:hover {
  color: var(--text-secondary);
}

.aibubble-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

/* Without the P/E panel the score reclaims the full width. */
.aibubble-score-block:only-child {
  grid-column: 1 / -1;
}

.aibubble-score-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.aibubble-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.aibubble-scale {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.aibubble-band {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
}

.aibubble-meter {
  margin-top: 0.6rem;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.aibubble-meter-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.aibubble-changes {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.aibubble-delta {
  font-size: 0.75rem;
  font-weight: 600;
}

.aibubble-delta-up {
  color: var(--accent-red);
}

.aibubble-delta-down {
  color: var(--accent-green);
}

.aibubble-delta-flat {
  color: var(--text-dim);
}

.aibubble-pe {
  border-left: 1px solid var(--border-subtle);
  padding-left: 1rem;
}

.aibubble-pe-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.aibubble-pe-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.aibubble-pe-source {
  margin-left: auto;
  font-size: 0.62rem;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
}

.aibubble-pe-source:hover {
  color: var(--text-secondary);
}

.aibubble-pe-body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.aibubble-pe-current {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.aibubble-pe-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.aibubble-pe-meta {
  font-size: 0.62rem;
  color: var(--text-dim);
}

.aibubble-pe-highs {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  text-align: right;
}

.aibubble-pe-highs-title {
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.aibubble-pe-high {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.aibubble-pe-high-label {
  color: var(--text-muted);
}

.aibubble-pe-high-value {
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.aibubble-pe-high-date {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.aibubble-pe-note {
  margin: 0.55rem 0 0;
  font-size: 0.65rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.aibubble-pe-updated {
  margin: 0.25rem 0 0;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.aibubble-chart-wrap {
  position: relative;
  margin-top: 0.75rem;
  height: 130px;
}

.aibubble-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.aibubble-tooltip {
  position: absolute;
  background: #23262b;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  white-space: nowrap;
}

.aibubble-tooltip.visible {
  opacity: 1;
}

.aibubble-components {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.aibubble-component {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aibubble-component-label {
  flex: 0 0 11.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aibubble-component-note {
  margin-left: 0.35rem;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border-hover);
  border-radius: 3px;
  padding: 0.05rem 0.25rem;
  cursor: help;
}

.aibubble-component-bar {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.aibubble-component-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
}

.aibubble-component-score {
  flex: 0 0 1.75rem;
  text-align: right;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.aibubble-error {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Large tablet / small desktop: 8 columns */
@media (max-width: 1200px) {
  .container {
    grid-template-columns: repeat(8, 1fr);
    gap: 0.6rem;
  }
  .weather-widget {
    grid-column: span 4;
  }
  .bus-widget,
  .train-widget {
    grid-column: span 4;
  }
  .markets-widget {
    grid-column: span 4;
  }
  .electricity-widget {
    grid-column: span 4;
  }
  .news-widget {
    grid-column: span 8;
  }
  .history-widget,
  .hockey-widget {
    grid-column: span 4;
  }
  .festivals-widget {
    grid-column: span 4;
  }
  .aibubble-widget {
    grid-column: span 4;
  }
  .eurojackpot-widget {
    grid-column: span 2;
  }
  .proverb-widget {
    grid-column: span 2;
  }
}

/* Tablet: 4 columns */
@media (max-width: 900px) {
  body {
    padding: 0.75rem;
  }
  .container {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
  }
  .hero-date {
    font-size: 1.8rem;
  }
  .weather-widget,
  .news-widget,
  .markets-widget,
  .electricity-widget,
  .history-widget,
  .hockey-widget,
  .aibubble-widget,
  .festivals-widget {
    grid-column: span 4;
  }
  .bus-widget,
  .train-widget,
  .eurojackpot-widget,
  .proverb-widget {
    grid-column: span 2;
  }
  .news-stories {
    grid-template-columns: 1fr;
  }
  .news-independent-section {
    grid-template-columns: 1fr;
  }
}

/* Mobile: single column */
@media (max-width: 640px) {
  body {
    padding: 0.5rem;
  }
  .container {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .hero-date {
    font-size: 1.5rem;
  }
  .hero-week {
    font-size: 0.75rem;
  }
  .bus-widget,
  .train-widget,
  .weather-widget,
  .news-widget,
  .markets-widget,
  .electricity-widget,
  .history-widget,
  .hockey-widget,
  .festivals-widget,
  .aibubble-widget,
  .eurojackpot-widget,
  .proverb-widget {
    grid-column: span 1;
  }
  .news-stories {
    grid-template-columns: 1fr;
  }
  .news-independent-section {
    grid-template-columns: 1fr;
  }
  .aibubble-top {
    grid-template-columns: 1fr;
  }
  .aibubble-pe {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding-left: 0;
    padding-top: 0.6rem;
  }
}
/* Markets chart tooltip */
.markets-chart-wrap {
  position: relative;
}

.markets-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-skeleton);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.markets-tooltip.visible {
  opacity: 1;
}

/* Stale content — last known data kept visible during a connectivity outage */
.is-stale {
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

/* Skeleton loaders */
@keyframes skeleton-pulse {
  0% {
    opacity: 0.3;
  }

  50% {
    opacity: 0.6;
  }

  100% {
    opacity: 0.3;
  }
}

.skeleton {
  display: inline-block;
  background: var(--bg-skeleton);
  border-radius: 4px;
  height: 1em;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-sm {
  width: 3rem;
}

.skeleton-md {
  width: 6rem;
}

.skeleton-lg {
  width: 10rem;
}

.skeleton-xl {
  width: 4rem;
  height: 2rem;
  border-radius: 6px;
}

.skeleton-full {
  width: 100%;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.skeleton-story {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.skeleton-story:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.skeleton-forecast {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-subtle);
}

/* Settings gear dropdown */
.settings-menu {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  max-width: calc(54px * 2 + 0.5rem);
  align-items: center;
}

.reorder-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  font-size: 1.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.reorder-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.reorder-btn.active {
  background: rgba(139, 173, 200, 0.15);
  border-color: #8badc8;
  color: #8badc8;
}

.reorder-actions {
  display: none;
  gap: 0.4rem;
  width: 100%;
}

.reorder-actions.visible {
  display: flex;
}

.reorder-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
  padding: 0;
  flex: 1;
}

.reorder-ok-btn {
  background: rgba(93, 158, 107, 0.12);
  border-color: rgba(93, 158, 107, 0.4);
  color: #8cd49c;
}

.reorder-ok-btn:hover {
  background: rgba(93, 158, 107, 0.25);
  border-color: #8cd49c;
  color: #a8e4b4;
}

.reorder-cancel-btn {
  background: rgba(199, 80, 80, 0.1);
  border-color: rgba(199, 80, 80, 0.35);
  color: #e08080;
}

.reorder-cancel-btn:hover {
  background: rgba(199, 80, 80, 0.22);
  border-color: #e08080;
  color: #f0a0a0;
}

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-faint);
  font-size: 1.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.12);
}

.settings-dropdown {
  display: none;
  width: 100%;
  background: var(--bg-widget);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  flex-direction: column;
  gap: 0.5rem;
}

.settings-dropdown.open {
  display: flex;
}

.dev-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 0.65rem;
  width: 100%;
  overflow: hidden;
}

.dev-panel a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  width: 100%;
  text-align: center;
  padding: 0.25rem 0;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-panel a:hover {
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.05);
}

/* Hidden until the pipeline status endpoint reports a state. */
.pipeline-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

.pipeline-dot-running,
.pipeline-dot-succeeded,
.pipeline-dot-failed,
.pipeline-dot-unknown {
  display: inline-block;
}

.pipeline-dot-running {
  background: #e8b97a;
  animation: pipeline-pulse 1.2s ease-in-out infinite;
}

.pipeline-dot-succeeded {
  background: var(--accent-green);
}

.pipeline-dot-failed {
  background: var(--accent-red);
}

.pipeline-dot-unknown {
  background: var(--text-dim);
}

@keyframes pipeline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.dev-panel .dev-panel-badge {
  display: flex;
  justify-content: center;
}

.dev-panel img {
  height: 14px;
  max-width: 100%;
}

.dev-version {
  font-size: 0.65rem;
  color: var(--accent-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
  text-align: center;
}

.widget-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-faint);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.widget-toggle:hover {
  color: var(--text-muted);
}

/* Widget drag-and-drop reorder mode */
body.reorder-active {
  align-items: flex-start;
  overflow-y: auto;
}

.container.reorder-mode [data-widget-key] {
  cursor: grab;
  outline: 2px dashed rgba(139, 173, 200, 0.25);
  outline-offset: -2px;
  transition: outline-color 0.2s ease, opacity 0.2s ease;
  position: relative;
}

.container.reorder-mode [data-widget-key]:hover {
  outline-color: rgba(139, 173, 200, 0.5);
}

/* Update toast */
.update-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-widget);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 200;
  pointer-events: none;
}

.update-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.update-toast-btn {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent-blue);
  color: var(--bg-primary);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.update-toast-btn:hover {
  opacity: 0.85;
}

.widget-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 14px;
  background: var(--bg-skeleton);
  border-radius: 7px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.widget-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: var(--text-faint);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.widget-toggle input[type="checkbox"]:checked {
  background: #2d3a47;
}

.widget-toggle input[type="checkbox"]:checked::after {
  left: 16px;
  background: var(--accent-blue);
}
