:root {
  --waste-bio: #963634;
  --waste-komunal: #22c55e;
  --waste-komunal-zc: linear-gradient(90deg, #22c55e 0%, #16a34a 35%, #dc2626 100%);

  --brand-green: #16a34a;
  --brand-green-light: #dcfce7;
  --brand-teal: #0d9488;

  --fee-voda: #0284c7;
  --fee-vodomer: #ea580c;

  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --page-pad: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
}

/* ── Header ── */
.app-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: calc(8px + env(safe-area-inset-top, 0)) var(--page-pad) 10px;
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1;
}

.location-icon {
  font-size: 0.8rem;
}

.chevron {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 2px;
}

/* ── Brand ── */
.brand-block {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px var(--page-pad) 14px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.brand-text {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.3125rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.brand-tagline {
  margin: 3px 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--muted);
}

/* ── Main ── */
.container {
  padding: 12px var(--page-pad) 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card-tappable {
  cursor: pointer;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-head-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-icon-green {
  background: var(--brand-green-light);
}

.card-icon-teal {
  background: #ccfbf1;
}

.card-title {
  flex: 1;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.card-chevron {
  font-size: 1.25rem;
  color: #cbd5e1;
  font-weight: 300;
  line-height: 1;
}

/* ── Pickups ── */
.pickup-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pickup-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.9375rem;
}

.pickup-list li + li {
  border-top: 1px solid #f1f5f9;
}

.pickup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pickup-dot.bio {
  background: var(--waste-bio);
}

.pickup-dot.komunal-28 {
  background: var(--waste-komunal);
}

.pickup-dot.komunal-14 {
  background: var(--waste-komunal-zc);
}

/* ── Fees ── */
.fee-ok {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fee-ok-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-green-light);
  color: var(--brand-green);
  font-weight: 800;
  font-size: 0.875rem;
}

.fee-ok-title {
  display: block;
  font-size: 0.9375rem;
  color: var(--text);
}

.fee-ok-sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.fee-upcoming {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}

.fee-upcoming-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.fee-upcoming-text {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.fee-upcoming-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.fee-card {
  border-left: 4px solid var(--fee-voda);
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.fee-card:last-child {
  margin-bottom: 0;
}

.fee-card.deadline {
  border-left-color: var(--fee-vodomer);
  background: #fff7ed;
}

.fee-progress-wrap {
  margin-bottom: 8px;
}

.fee-progress-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.fee-progress {
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.fee-progress-fill {
  height: 100%;
  background: var(--brand-green);
  border-radius: 999px;
}

.fee-title {
  font-weight: 700;
  font-size: 0.9375rem;
  margin: 0 0 4px;
}

.fee-period {
  font-size: 0.8125rem;
  color: var(--muted);
}

.fee-note {
  font-size: 0.8125rem;
  color: #334155;
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 8px;
}

.empty-state {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Calendar ── */
.profile-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.profile-select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8125rem;
  background: #f8fafc;
  color: var(--text);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calendar-month-title {
  font-size: 1rem;
  font-weight: 700;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text);
  cursor: pointer;
}

.btn-icon {
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.calendar-head {
  margin-bottom: 4px;
}

.calendar-weekday {
  font-size: 0.625rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 2px 0;
}

.calendar-day {
  aspect-ratio: 1;
  width: 100%;
  max-width: 42px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 10px;
  min-height: 34px;
}

.calendar-day.other-month {
  color: #cbd5e1;
}

.calendar-day.bio {
  background: var(--waste-bio);
  color: #fff;
}

.calendar-day.komunal-28 {
  background: var(--waste-komunal);
  color: #fff;
}

.calendar-day.komunal-14 {
  background: var(--waste-komunal-zc);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.calendar-day.split-komunal-28-bio {
  background: linear-gradient(135deg, var(--waste-komunal) 50%, var(--waste-bio) 50%);
  color: #fff;
}

.calendar-day.split-komunal-14-bio {
  background:
    linear-gradient(135deg, var(--waste-bio) 50%, transparent 50%),
    var(--waste-komunal-zc);
  color: #fff;
}

.calendar-legend {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.6875rem;
  color: var(--muted);
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-swatch.bio {
  background: var(--waste-bio);
}

.legend-swatch.komunal-28 {
  background: var(--waste-komunal);
}

.legend-swatch.komunal-14 {
  background: var(--waste-komunal-zc);
}

/* ── Footer ── */
.site-footer {
  padding: 8px var(--page-pad) 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-disclaimer {
  margin: 4px 0 0;
  font-size: 0.6875rem;
}

.footer-links {
  margin: 8px 0 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-links a:hover {
  color: var(--text);
}

/* ── Legal page ── */
.legal-page {
  padding-bottom: 24px;
}

.legal-header {
  padding: calc(12px + env(safe-area-inset-top, 0)) var(--page-pad) 8px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.legal-back {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-green);
  text-decoration: none;
}

.legal-header h1 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.legal-meta {
  margin: 6px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.legal-content {
  padding: 12px var(--page-pad) 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-content h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.legal-content p,
.legal-content ul {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #334155;
}

.legal-content ul {
  padding-left: 1.25rem;
}

.legal-content p:last-child,
.legal-content ul:last-child {
  margin-bottom: 0;
}

.legal-content a {
  color: var(--brand-green);
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0));
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  z-index: 100;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.bottom-nav-item.is-active {
  color: var(--brand-green);
}

.bottom-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

@media (min-width: 481px) {
  .app-shell {
    box-shadow: 0 0 0 1px var(--border);
  }
}

.reminder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.reminder-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reminder-row-sub {
  font-size: 0.8125rem;
  color: var(--muted);
}

.reminder-switch {
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  cursor: pointer;
  accent-color: var(--brand-green);
}

.reminder-status {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.btn-secondary {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  font-weight: 600;
  background: var(--brand-green-light);
  color: var(--brand-green);
  border: 1px solid transparent;
}

.btn-secondary:active {
  background: #bbf7d0;
}
