:root {
  color-scheme: light dark;
  --bg: #f5f4f0;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #6b6b6b;
  --accent: #2f7d4f;
  --banner-bg: #2f7d4f;
  --banner-text: #ffffff;
  /* One colour per waste type, shared by cards, the calendar's dots/
     legend/marks, and icon badges (set via inline style in JS, so these
     exact names are read directly from app.js/calendar.js). */
  --type-household: #2f7d4f;
  --type-packaging: #2563eb;
  --type-glass: #d97706;

  /* Spacing/radius/shadow scale — used consistently instead of one-off
     pixel values, so rhythm stays even across the whole site. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --card: #21242a;
    --text: #f0f0f0;
    --muted: #9a9a9a;
    --accent: #4fae7c;
    --banner-bg: #4fae7c;
    --banner-text: #0d1410;
    --type-household: #4fae7c;
    --type-packaging: #60a5fa;
    --type-glass: #f0a742;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  padding: var(--sp-5) var(--sp-4) 48px;
}

main {
  width: 100%;
  max-width: 480px;
}

h1 {
  margin: 0 0 var(--sp-1);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

h1 .icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.subtitle {
  margin: 0 0 var(--sp-5);
  color: var(--muted);
  font-size: 0.95rem;
}

.icon {
  width: 20px;
  height: 20px;
}
.icon svg { width: 100%; height: 100%; display: block; }

/* Landing page: section list */
.sections {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.section-link {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--sp-4);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.section-link:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.section-link:active {
  transform: scale(0.98);
}

.section-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.section-icon .icon { width: 22px; height: 22px; }

.section-title {
  display: block;
  font-weight: 600;
}

.section-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Section pages: link back to the landing page */
.back-link {
  display: inline-block;
  margin-bottom: var(--sp-3);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 150ms ease;
}

.back-link:hover { color: var(--text); }

/* Hero: the single most important fact on the schedule page — either an
   urgent "put it out tonight" state, or a calm countdown to the soonest
   upcoming collection. Replaces the old plain banner. */
.hero {
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow);
}

.hero.hero--urgent {
  background: var(--banner-bg);
  color: var(--banner-text);
}

.hero.hero--calm {
  background: var(--card);
  color: var(--text);
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
  margin: 0 0 var(--sp-1);
}

.hero-main {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.hero.hero--calm .hero-main {
  color: var(--hero-color, var(--accent));
}

.hero-count {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-sub {
  font-size: 0.85rem;
  margin-top: var(--sp-2);
  opacity: 0.85;
}

.hero[hidden] { display: none; }

/* Skeleton loading — shown briefly while /api/schedule is in flight,
   instead of plain "Kraunama…" text. */
.skeleton-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.skeleton-bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--muted) 25%, transparent) 25%,
    color-mix(in srgb, var(--muted) 40%, transparent) 37%,
    color-mix(in srgb, var(--muted) 25%, transparent) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--muted) 25%, transparent);
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.card:active {
  transform: scale(0.98);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--card-icon-color, var(--accent)) 18%, transparent);
  color: var(--card-icon-color, var(--accent));
}

.card-icon .icon { width: 20px; height: 20px; }

.card-body { flex: 1; min-width: 0; }

.card .type {
  font-weight: 600;
}

.card .date {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.notify {
  text-align: center;
  margin-bottom: var(--sp-5);
}

#notify-btn {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 13px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

#notify-btn:hover:not(:disabled) {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

#notify-btn:active:not(:disabled) {
  transform: scale(0.97);
}

#notify-btn .icon { width: 18px; height: 18px; }

#notify-btn:disabled {
  cursor: default;
}

#notify-btn.subscribed {
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--accent);
}

#notify-btn.unsupported {
  background: var(--card);
  color: var(--muted);
  border-color: transparent;
  opacity: 0.8;
}

.status {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: var(--sp-2);
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

footer a { color: var(--accent); }

/* Calendar page (public/isvezimo_grafikas/calendar.html) */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-1) 0 var(--sp-4);
}

.cal-nav button {
  background: var(--card);
  border: none;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.cal-nav button:hover {
  box-shadow: var(--shadow-hover);
}

.cal-nav button:active {
  transform: scale(0.93);
}

.cal-nav button .icon { width: 18px; height: 18px; }

.cal-nav .cal-month {
  font-weight: 700;
  font-size: 1.05rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: var(--sp-5);
}

.cal-weekday {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  padding-bottom: var(--sp-1);
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: background 150ms ease;
}

.cal-day.empty { visibility: hidden; }

/* Number + dot-row sit above the today-square overlay (z-index below). */
.cal-day-num, .cal-dots {
  position: relative;
  z-index: 1;
}

.cal-day.marked {
  font-weight: 600;
}

.cal-dots {
  display: flex;
  gap: 3px;
  margin-top: 2px;
  height: 6px;
}

.cal-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Today: a translucent black square behind the number, independent of any
   type colour on the cell so both can show at once. */
.cal-day.today::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  z-index: 0;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.cal-legend .chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px 7px 7px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.cal-legend .chip-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 20%, transparent);
  color: var(--chip-color, var(--accent));
}

.cal-legend .chip-icon .icon { width: 14px; height: 14px; }
