:root {
  --bg: #0b1220;
  --bg2: #0f172a;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e6edf6;
  --muted: #94a3b8;
  --emerald: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --ring: rgba(16, 185, 129, 0.35);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  /* waste type colours (Polish standard) */
  --w-mixed: #334155;
  --w-metals_and_plastics: #eab308;
  --w-paper: #3b82f6;
  --w-glass: #22c55e;
  --w-bio: #a16207;
  --w-bulky: #f97316;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(16, 185, 129, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.app-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(48px + env(safe-area-inset-bottom));
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 4px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.topbar__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.refresh-stamp { color: var(--muted); font-size: 11.5px; line-height: 1.2; white-space: nowrap; }
.brand__logo { border-radius: 12px; box-shadow: var(--shadow); }
.brand__title { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
.brand__sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.card--muted { background: rgba(255, 255, 255, 0.02); }
.card__title { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 12px; font-weight: 700; }

/* ---------- hero ---------- */
.hero {
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(4, 120, 87, 0.12)),
    var(--card);
  border-color: rgba(16, 185, 129, 0.25);
}
.hero__label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.hero__date { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 2px; }
.hero__countdown { color: var(--emerald); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.hero__foot { color: var(--muted); font-size: 12.5px; margin-top: 12px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--card-border);
  white-space: nowrap;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.chips--select .chip { cursor: pointer; user-select: none; transition: transform .06s ease, background .15s ease, border-color .15s ease; }
.chips--select .chip:active { transform: scale(0.96); }
.chip[aria-pressed="false"] { opacity: 0.4; }
.chip[aria-pressed="true"] { border-color: var(--ring); background: rgba(16,185,129,0.12); }

/* ---------- rows / fields ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row__title { font-weight: 700; font-size: 14.5px; }
.field { padding: 4px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sep { border: none; border-top: 1px solid var(--card-border); margin: 16px 0; }

/* ---------- toggles ---------- */
.toggle-grid { display: grid; gap: 10px; margin-top: 12px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.toggle input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--emerald); flex: 0 0 auto; }
.num { width: 64px; background: rgba(255,255,255,0.06); border: 1px solid var(--card-border); color: var(--text);
  border-radius: 8px; padding: 6px 8px; font-size: 14px; }
.num:focus, .btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--card-border); background: rgba(255,255,255,0.05); color: var(--text);
  padding: 10px 15px; border-radius: 12px; font-size: 14px; font-weight: 650; cursor: pointer;
  transition: transform .06s ease, background .15s ease, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: linear-gradient(180deg, var(--emerald), var(--emerald-700)); border-color: transparent; color: #06231a; font-weight: 750; }
.btn--ghost { background: rgba(255,255,255,0.05); }
.btn--danger { color: #fca5a5; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- status ---------- */
.status-bar { margin-top: 14px; font-size: 13px; color: var(--muted); min-height: 18px; }
.status-bar.ok { color: var(--emerald); }
.status-bar.warn { color: #fbbf24; }
.status-bar.err { color: #fca5a5; }

/* ---------- disclosure / diagnostics ---------- */
.disclosure { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none;
  border: none; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px; }
.disclosure__body { margin-top: 12px; }
.chev { transition: transform .2s; }
.disclosure[aria-expanded="true"] .chev { transform: rotate(180deg); }
.diag { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.diag li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.diag .badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.badge.yes { background: rgba(16,185,129,0.18); color: #6ee7b7; }
.badge.no { background: rgba(148,163,184,0.18); color: #cbd5e1; }

/* ---------- segmented ---------- */
.segmented { display: inline-flex; background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); border-radius: 10px; padding: 3px; }
.seg { border: none; background: none; color: var(--muted); font-size: 13px; font-weight: 650; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg.is-active { background: rgba(16,185,129,0.18); color: #a7f3d0; }

/* ---------- collections list ---------- */
.collections { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.coll {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--card-border);
}
.coll--past { opacity: 0.45; }
.coll--next { border-color: var(--ring); background: rgba(16,185,129,0.08); }
.coll__day { text-align: center; }
.coll__dnum { font-size: 20px; font-weight: 800; line-height: 1; }
.coll__mon { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.06em; }
.coll__body { min-width: 0; }
.coll__weekday { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.coll .chips { gap: 6px; }
.coll .chip { padding: 4px 9px; font-size: 11.5px; }

/* per-collection reminder switch (button-based for consistent mobile rendering) */
.switch-btn {
  position: relative;
  width: 44px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.switch-btn::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
}
.switch-btn.is-on { background: var(--emerald); }
.switch-btn.is-on::before { transform: translateX(18px); }
.switch-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #111827; border: 1px solid var(--card-border); color: var(--text); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 13.5px; z-index: 50; max-width: 90vw; }

.foot { margin-top: 8px; line-height: 1.5; }

@media (max-width: 420px) {
  .hero__date { font-size: 25px; }
  .actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
