@layer reset, tokens, base, layout, components, utilities, motion;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body, h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
  ul, ol { padding: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; }
  button, a { -webkit-tap-highlight-color: transparent; }
}

@layer tokens {
  :root {
    color-scheme: light dark;
    --bg: #fffdf8;
    --surface: #ffffff;
    --surface-2: #f5e9d8;
    --surface-3: #fffaf3;
    --text: #3e2c23;
    --muted: #6f5b50;
    --faint: #8b7568;
    --brand: #2fa4d7;
    --brand-ink: #176e94;
    --brand-hover: #258dbb;
    --brand-tint: #dff3fb;
    --on-brand: #3e2c23;
    --lime: #e76f2e;
    --alarm: #c62d3f;
    --alarm-tint: #f9e4e6;
    --warning: #a84414;
    --warning-tint: #fbe4d7;
    --blue: #176e94;
    --blue-tint: #dff3fb;
    --violet: #c2541e;
    --violet-tint: #fbe4d7;
    --brown: #3e2c23;
    --brown-tint: #f5e9d8;
    --gray-waste: #4b4b4b;
    --yellow-waste: #e6b900;
    --hairline: rgba(0, 0, 0, .08);
    --shadow-card: 0 0 0 1px rgba(62, 44, 35, .08), 0 1px 2px -1px rgba(62, 44, 35, .08), 0 12px 28px -18px rgba(62, 44, 35, .24);
    --shadow-hover: 0 0 0 1px rgba(62, 44, 35, .12), 0 2px 4px -2px rgba(62, 44, 35, .12), 0 18px 34px -18px rgba(62, 44, 35, .3);
    --shadow-header: 0 1px 0 var(--hairline), 0 8px 30px rgba(30, 38, 30, .05);
    --radius-card: 22px;
    --radius-item: 14px;
    --radius-control: 11px;
    --content: 1160px;
    --gutter: clamp(16px, 4vw, 32px);

    /* Skala odstępów — siatka 4px (jedno źródło spójnego rytmu) */
    --sp-8: 8px; --sp-12: 12px; --sp-16: 16px; --sp-20: 20px;
    --sp-24: 24px; --sp-32: 32px; --sp-40: 40px; --sp-48: 48px; --sp-80: 80px;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #1e1713;
      --surface: #2a201b;
      --surface-2: #392c25;
      --surface-3: #241b17;
      --text: #f5e9d8;
      --muted: #d3c1ad;
      --faint: #ad9787;
      --brand: #52b9e5;
      --brand-ink: #52b9e5;
      --brand-hover: #72c9ed;
      --brand-tint: #173845;
      --on-brand: #281d18;
      --lime: #ff8a4c;
      --alarm: #ff7180;
      --alarm-tint: #472128;
      --warning: #ff9a62;
      --warning-tint: #492718;
      --blue: #52b9e5;
      --blue-tint: #173845;
      --violet: #ff9a62;
      --violet-tint: #492718;
      --brown: #f5e9d8;
      --brown-tint: #443127;
      --gray-waste: #aaa;
      --yellow-waste: #f2c200;
      --hairline: rgba(255, 255, 255, .1);
      --shadow-card: 0 0 0 1px rgba(255, 255, 255, .08);
      --shadow-hover: 0 0 0 1px rgba(255, 255, 255, .14), 0 14px 30px -20px rgba(0, 0, 0, .8);
      --shadow-header: 0 1px 0 var(--hairline);
    }
  }

  html[data-theme="light"] {
    color-scheme: light;
    --bg: #fffdf8;
    --surface: #ffffff;
    --surface-2: #f5e9d8;
    --surface-3: #fffaf3;
    --text: #3e2c23;
    --muted: #6f5b50;
    --faint: #8b7568;
    --brand: #2fa4d7;
    --brand-ink: #176e94;
    --brand-hover: #258dbb;
    --brand-tint: #dff3fb;
    --on-brand: #3e2c23;
    --lime: #e76f2e;
    --alarm: #c62d3f;
    --alarm-tint: #f9e4e6;
    --warning: #a84414;
    --warning-tint: #fbe4d7;
    --blue: #176e94;
    --blue-tint: #dff3fb;
    --violet: #c2541e;
    --violet-tint: #fbe4d7;
    --brown: #3e2c23;
    --brown-tint: #f5e9d8;
    --gray-waste: #4b4b4b;
    --yellow-waste: #e6b900;
    --hairline: rgba(0, 0, 0, .08);
    --shadow-card: 0 0 0 1px rgba(62, 44, 35, .08), 0 1px 2px -1px rgba(62, 44, 35, .08), 0 12px 28px -18px rgba(62, 44, 35, .24);
    --shadow-hover: 0 0 0 1px rgba(62, 44, 35, .12), 0 2px 4px -2px rgba(62, 44, 35, .12), 0 18px 34px -18px rgba(62, 44, 35, .3);
    --shadow-header: 0 1px 0 var(--hairline), 0 8px 30px rgba(30, 38, 30, .05);
  }

  html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1e1713;
    --surface: #2a201b;
    --surface-2: #392c25;
    --surface-3: #241b17;
    --text: #f5e9d8;
    --muted: #d3c1ad;
    --faint: #ad9787;
    --brand: #52b9e5;
    --brand-ink: #52b9e5;
    --brand-hover: #72c9ed;
    --brand-tint: #173845;
    --on-brand: #281d18;
    --lime: #ff8a4c;
    --alarm: #ff7180;
    --alarm-tint: #472128;
    --warning: #ff9a62;
    --warning-tint: #492718;
    --blue: #52b9e5;
    --blue-tint: #173845;
    --violet: #ff9a62;
    --violet-tint: #492718;
    --brown: #f5e9d8;
    --brown-tint: #443127;
    --gray-waste: #aaa;
    --yellow-waste: #f2c200;
    --hairline: rgba(255, 255, 255, .1);
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, .08);
    --shadow-hover: 0 0 0 1px rgba(255, 255, 255, .14), 0 14px 30px -20px rgba(0, 0, 0, .8);
    --shadow-header: 0 1px 0 var(--hairline);
  }

  html[data-theme="contrast"] {
    color-scheme: dark;
    --bg: #000;
    --surface: #090909;
    --surface-2: #171717;
    --surface-3: #000;
    --text: #fff;
    --muted: #f2f2f2;
    --faint: #d8d8d8;
    --brand: #ffe600;
    --brand-ink: #ffe600;
    --brand-hover: #fff16c;
    --brand-tint: #312d00;
    --on-brand: #000;
    --lime: #ffe600;
    --alarm: #ff5c72;
    --alarm-tint: #3d000b;
    --warning: #ffe600;
    --warning-tint: #302b00;
    --blue: #5cd9ff;
    --blue-tint: #002d3b;
    --violet: #e7b9ff;
    --violet-tint: #2a0c38;
    --brown: #ffd09a;
    --brown-tint: #352000;
    --gray-waste: #fff;
    --yellow-waste: #ffe600;
    --hairline: rgba(255, 255, 255, .55);
    --shadow-card: 0 0 0 2px #fff;
    --shadow-hover: 0 0 0 3px #ffe600;
    --shadow-header: 0 2px 0 #fff;
  }

  html[data-font="large"] { font-size: 112.5%; }
  html[data-font="xlarge"] { font-size: 125%; }
}

@layer base {
  html {
    min-width: 320px;
    overflow-x: clip;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  body {
    min-height: 100vh;
    max-width: 100%;
    overflow-x: clip;
    color: var(--text);
    background: var(--bg);
    font: 500 17px/1.52 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .18em; }
  h1, h2, h3 {
    color: var(--text);
    font-weight: 820;
    letter-spacing: -.035em;
    line-height: 1.08;
    text-wrap: balance;
  }
  h1 { font-size: clamp(2.3rem, 8vw, 4.8rem); }
  h2 { font-size: clamp(1.65rem, 5vw, 2.45rem); }
  h3 { font-size: 1.15rem; letter-spacing: -.02em; }
  p, li, figcaption, label { text-wrap: pretty; }
  :focus-visible {
    outline: 3px solid var(--brand-ink);
    outline-offset: 3px;
  }
  html[data-theme="contrast"] :focus-visible { outline-color: #ffe600; outline-width: 4px; }
  ::selection { background: var(--brand); color: var(--on-brand); }
}

@layer layout {
  .shell { box-sizing: border-box; width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); min-width: 0; margin-inline: auto; padding-inline: var(--gutter); }
  .site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    box-shadow: var(--shadow-header);
    backdrop-filter: blur(18px) saturate(1.4);
  }
  .header-main { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .brand { display: inline-flex; align-items: center; gap: var(--sp-12); min-height: 44px; color: var(--text); text-decoration: none; }
  .brand img { width: 42px; height: 42px; border-radius: 11px; outline: 1px solid rgba(0,0,0,.1); outline-offset: -1px; }
  .brand-name { display: grid; line-height: 1; }
  .brand-name strong { font-size: 1.06rem; font-weight: 830; letter-spacing: -.025em; }
  .brand-name small { margin-top: 5px; color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .01em; }
  .header-place { display: none; }
  .header-tools { display: flex; align-items: center; gap: 8px; }
  .nav-scroll { overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter) 12px; }
  .nav-scroll::-webkit-scrollbar { display: none; }
  .chip-nav { display: flex; gap: 8px; width: max-content; list-style: none; }
  .chip-nav a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: var(--sp-8);
    border-radius: 999px;
    padding: 0 16px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 30%, transparent), 0 1px 3px rgba(62, 44, 35, .13);
    font-size: .88rem;
    font-weight: 730;
    text-decoration: none;
    transition-property: background-color, color, box-shadow, scale;
    transition-duration: 160ms;
  }
  .chip-nav a .icon { color: var(--brand-ink); }
  .chip-nav a:hover { background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand), 0 2px 6px rgba(62, 44, 35, .12); }
  .chip-nav a:active { scale: .96; }
  .chip-nav a[aria-current="page"] { color: var(--on-brand); background: var(--brand); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 45%, transparent); }
  .chip-nav a[aria-current="page"] .icon { color: #fff; }
  .chip-nav .icon { width: 18px; height: 18px; }
  .access-menu { position: relative; }
  .access-menu summary {
    display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px;
    color: var(--text); background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline);
    cursor: pointer; font-size: .87rem; font-weight: 850; list-style: none;
    transition-property: scale, background-color, box-shadow; transition-duration: 150ms;
  }
  .access-menu summary::-webkit-details-marker { display: none; }
  .access-menu summary:active { scale: .96; }
  .access-menu[open] summary { color: var(--brand-ink); background: var(--brand-tint); }
  .access-panel {
    position: absolute; z-index: 30; top: 52px; right: 0; width: min(310px, calc(100vw - 32px));
    border-radius: 18px; padding: 16px; background: var(--surface); box-shadow: var(--shadow-hover);
  }
  .access-panel h2 { font-size: 1rem; letter-spacing: -.015em; }
  .access-group + .access-group { margin-top: 16px; }
  .access-label { display: block; margin-bottom: var(--sp-8); color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; border-radius: 14px; padding: 4px; background: var(--surface-2); }
  .segmented button {
    min-height: 44px; border: 0; border-radius: 10px; padding: 5px 8px; color: var(--muted); background: transparent;
    cursor: pointer; font-size: .74rem; font-weight: 760;
    transition-property: scale, color, background-color, box-shadow; transition-duration: 150ms;
  }
  .segmented button:hover { color: var(--text); }
  .segmented button:active { scale: .96; }
  .segmented button[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-card); }
  html[data-theme="contrast"] .segmented button[aria-pressed="true"] { color: #000; background: #ffe600; }
  main { padding-block: var(--sp-24) var(--sp-80); }
  .page-head { display: grid; gap: var(--sp-16); padding-block: var(--sp-20) var(--sp-32); }
  .page-head p { max-width: 680px; color: var(--muted); font-size: 1.05rem; }
  .section { margin-top: var(--sp-48); }
  .section-head { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: var(--sp-12); margin-bottom: var(--sp-20); }
  .section-head > * { min-width: 0; }
  .section-kicker { margin-bottom: var(--sp-8); color: var(--brand-ink); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
  .section-link { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; color: var(--brand-ink); font-size: .9rem; font-weight: 760; text-decoration: none; white-space: nowrap; }
  .section-link .icon { width: 18px; height: 18px; }
  .grid { display: grid; gap: var(--sp-16); }
  .priority-grid, .module-grid, .event-grid, .form-layout, .detail-grid { grid-template-columns: 1fr; }
  .site-footer { padding: 0 0 var(--sp-80); }
  .footer-inner {
    display: grid;
    gap: var(--sp-32);
    border-top: 1px solid var(--hairline);
    padding-top: var(--sp-32);
  }
  .footer-links { display: flex; flex-wrap: wrap; gap: var(--sp-12) var(--sp-24); list-style: none; }
  .footer-links a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
  .credit { max-width: 650px; color: var(--muted); font-size: .88rem; }
  .credit a { color: var(--text); font-weight: 780; }
  .version { display: inline-flex; width: fit-content; min-height: 28px; align-items: center; border-radius: 999px; padding: 0 10px; background: var(--surface-2); color: var(--muted); font: 700 .72rem/1 system-ui; }

  @media (min-width: 700px) {
    .header-place { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; font-weight: 700; }
    .header-place .icon { width: 18px; height: 18px; }
    .section-head { flex-direction: row; align-items: end; gap: var(--sp-20); }
    .priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .module-grid { grid-template-columns: repeat(2, 1fr); }
    .event-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-inner { grid-template-columns: 1fr auto; align-items: start; }
  }
  @media (min-width: 980px) {
    main { padding-top: var(--sp-40); }
    .priority-grid { grid-template-columns: 1.25fr .75fr; }
    .module-grid { grid-template-columns: repeat(3, 1fr); }
    .form-layout { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); align-items: start; }
    .detail-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: start; }
  }
}

@layer components {
  .icon {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    overflow: visible;
  }
  .urgent-bar { color: #fff; background: #a91f32; }
  .urgent-inner { min-height: 48px; display: flex; align-items: center; gap: 10px; font-size: .84rem; line-height: 1.3; }
  .urgent-inner strong { font-size: .73rem; letter-spacing: .08em; }
  .urgent-inner a { font-weight: 760; }
  .pulse-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.65); animation: pulse 1.9s infinite; }

  .breadcrumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; list-style: none; }
  .breadcrumbs a { min-height: 44px; display: inline-flex; align-items: center; }
  .breadcrumbs .icon { width: 14px; height: 14px; }

  .hero { position: relative; padding: var(--sp-32) 0 var(--sp-8); }
  .date-line { display: flex; align-items: center; gap: var(--sp-8); margin-bottom: var(--sp-16); color: var(--brand-ink); font-weight: 780; letter-spacing: .01em; }
  .date-line .icon { width: 20px; height: 20px; }
  .hero h1 { max-width: 880px; }
  .hero-lead { max-width: 690px; margin-top: var(--sp-20); color: var(--muted); font-size: clamp(1.02rem, 2.5vw, 1.22rem); }
  .live-line { display: inline-flex; align-items: center; gap: var(--sp-8); margin-top: var(--sp-24); color: var(--muted); font-size: .78rem; font-weight: 700; }
  .live-line i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

  .install-banner {
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
    margin-top: var(--sp-24); border-radius: 20px; padding: var(--sp-16); color: #3e2c23;
    background: linear-gradient(135deg, #258dbb, #2fa4d7); box-shadow: 0 16px 36px -24px #176d92;
  }
  .install-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 12px; color: var(--text); background: #f5e9d8; }
  .install-icon .icon { width: 24px; height: 24px; }
  .install-copy strong { display: block; font-size: .94rem; }
  .install-copy span { display: block; margin-top: 2px; color: rgba(62,44,35,.78); font-size: .74rem; }
  .install-copy { min-width: 0; }

  .btn, .btn-secondary, .btn-quiet, .icon-btn {
    border: 0; cursor: pointer; text-decoration: none;
    transition-property: scale, background-color, color, box-shadow;
    transition-duration: 150ms; transition-timing-function: ease-out;
  }
  .btn:active, .btn-secondary:active, .btn-quiet:active, .icon-btn:active { scale: .96; }
  .btn, .btn-secondary {
    display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: var(--sp-8);
    border-radius: var(--radius-control); padding: 0 var(--sp-16); font-weight: 780;
  }
  .btn { color: var(--on-brand); background: var(--brand); box-shadow: 0 6px 16px -10px var(--brand); }
  .btn:hover { background: var(--brand-hover); }
  .btn-secondary { color: var(--text); background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline); }
  .btn-secondary:hover { background: color-mix(in srgb, var(--surface-2) 82%, var(--brand-tint)); }
  .btn .icon, .btn-secondary .icon { width: 20px; height: 20px; }
  .btn-quiet { min-width: 44px; min-height: 44px; border-radius: 10px; padding: 0 12px; color: inherit; background: transparent; font-weight: 780; }
  .btn-quiet:hover { background: rgba(255,255,255,.1); }
  .icon-btn { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; color: var(--muted); background: var(--surface-2); }

  .card {
    position: relative; min-width: 0; border-radius: var(--radius-card); padding: var(--sp-20); background: var(--surface); box-shadow: var(--shadow-card);
    transition-property: transform, box-shadow; transition-duration: 180ms; transition-timing-function: ease-out;
  }
  a.card { color: inherit; text-decoration: none; }
  a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
  a.card:active { transform: translateY(0) scale(.96); }
  .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-16); }
  .module-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--brand-ink); background: var(--brand-tint); }
  .module-icon.blue { color: var(--blue); background: var(--blue-tint); }
  .module-icon.violet { color: var(--violet); background: var(--violet-tint); }
  .module-icon.brown { color: var(--brown); background: var(--brown-tint); }
  .module-icon.red { color: var(--alarm); background: var(--alarm-tint); }
  .module-icon.yellow { color: var(--warning); background: var(--warning-tint); }
  .module-icon .icon { width: 25px; height: 25px; }
  .status-pill { display: inline-flex; min-height: 28px; align-items: center; gap: 6px; border-radius: 999px; padding: 0 10px; background: var(--surface-2); color: var(--muted); font-size: .68rem; font-weight: 820; letter-spacing: .055em; text-transform: uppercase; }
  .status-pill.red { color: var(--alarm); background: var(--alarm-tint); }
  .status-pill.green { color: var(--text); background: var(--brand-tint); }
  .status-pill.yellow { color: var(--warning); background: var(--warning-tint); }
  .status-pill .pulse-dot { width: 7px; height: 7px; background: currentColor; }
  .eyebrow { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  .card h3 { margin-top: var(--sp-16); }
  .card-copy { margin-top: var(--sp-8); color: var(--muted); font-size: .88rem; }
  .metric { margin-top: var(--sp-20); font-size: clamp(2rem, 8vw, 3rem); font-weight: 850; letter-spacing: -.055em; line-height: .95; font-variant-numeric: tabular-nums; }
  .metric small { color: var(--muted); font-size: .9rem; font-weight: 700; letter-spacing: 0; }
  .card-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); margin-top: var(--sp-20); border-top: 1px solid var(--hairline); padding-top: var(--sp-12); color: var(--muted); font-size: .78rem; }
  .card-footer .section-link { min-height: 32px; font-size: .78rem; }
  .waste-row { display: flex; flex-wrap: wrap; gap: var(--sp-8) var(--sp-16); margin-top: var(--sp-16); }
  .waste-type { display: inline-flex; align-items: center; gap: var(--sp-8); color: var(--muted); font-size: .78rem; font-weight: 680; }
  .waste-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gray-waste); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gray-waste) 18%, transparent); }
  .waste-dot.yellow { background: var(--yellow-waste); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow-waste) 22%, transparent); }
  .waste-dot.brown { background: var(--brown); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brown) 20%, transparent); }
  .ring-date { display: grid; width: 68px; height: 68px; place-items: center; border: 4px solid var(--alarm); border-radius: 50%; color: var(--alarm); font-size: 1.65rem; font-weight: 850; line-height: .8; font-variant-numeric: tabular-nums; }
  .ring-date small { font-size: .55rem; letter-spacing: .05em; text-transform: uppercase; }

  .alert-card { color: #fff; background: linear-gradient(145deg, #c62a3e, #8f1c2f); box-shadow: 0 16px 34px -20px rgba(134,25,43,.7); }
  /* Wszystkie teksty w czerwonej karcie na biało — inaczej ciemne domyślne kolory zlewają się z tłem. */
  .alert-card :is(h1, h2, h3, h4, .metric, .waste-type, .waste-row, .section-link, strong, a) { color: #fff; }
  .alert-card :is(.eyebrow, .section-kicker) { color: rgba(255,255,255,.85); }
  .alert-card :is(.card-copy, .metric small, .card-footer) { color: rgba(255,255,255,.82); }
  .alert-card .card-footer { border-color: rgba(255,255,255,.2); }
  .alert-card .module-icon { color: #fff; background: rgba(255,255,255,.16); }
  .alert-card .status-pill { color: #8f1c2f; background: #fff; }
  .alert-card .status-pill .pulse-dot { background: #cf2d42; }
  .alert-card .ring-date { color: #fff; border-color: rgba(255,255,255,.85); }
  .alert-card .waste-dot { box-shadow: 0 0 0 1px rgba(255,255,255,.6), 0 0 0 3px rgba(255,255,255,.18); }
  .alert-card .btn-secondary { color: #fff; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
  .alert-card .btn-secondary:hover { background: rgba(255,255,255,.26); }
  .alert-card .icon { color: #fff; }

  .event-card { display: grid; grid-template-columns: 62px 1fr; gap: 15px; align-items: start; }
  .date-badge { display: grid; width: 62px; height: 68px; place-items: center; align-content: center; border-radius: 14px; color: var(--brand-ink); background: var(--brand-tint); line-height: 1; font-variant-numeric: tabular-nums; }
  .date-badge strong { font-size: 1.55rem; font-weight: 850; }
  .date-badge span { margin-top: 5px; font-size: .66rem; font-weight: 830; letter-spacing: .08em; text-transform: uppercase; }
  .event-meta { margin-top: 8px; color: var(--muted); font-size: .76rem; }
  .module-card { min-height: 196px; display: flex; flex-direction: column; }
  .module-card .arrow { margin-top: auto; align-self: flex-end; color: var(--brand-ink); }
  .module-card .arrow .icon { width: 22px; height: 22px; transition-property: transform; transition-duration: 160ms; }
  .module-card:hover .arrow .icon { transform: translateX(3px); }
  .cta-card { color: #f5e9d8; background: #3e2c23; }
  .cta-card h3 { color: #fff; }
  .cta-card .card-copy { color: rgba(255,255,255,.72); }
  .cta-card .module-icon { color: #3e2c23; background: #f5e9d8; }

  .route-tabs, .filter-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; }
  .route-tabs::-webkit-scrollbar, .filter-tabs::-webkit-scrollbar { display: none; }
  .route-tabs button, .filter-tabs a {
    min-height: 44px; flex: 0 0 auto; border: 0; border-radius: 999px; padding: 0 15px;
    color: var(--muted); background: var(--surface-2); cursor: pointer; font-weight: 750; text-decoration: none;
    transition-property: color, background-color, scale; transition-duration: 150ms;
  }
  .route-tabs button:active, .filter-tabs a:active { scale: .96; }
  .route-tabs button[aria-selected="true"], .filter-tabs a[aria-current="page"] { color: var(--on-brand); background: var(--brand); }

  .departure-board { overflow: hidden; padding: 0; }
  .departure-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; background: #3e2c23; color: #f5e9d8; }
  .departure-head h2 { color: #fff; font-size: 1.35rem; }
  .current-time { font-size: 1.4rem; font-weight: 820; font-variant-numeric: tabular-nums; }
  .departure-list { list-style: none; }
  .departure-row { display: grid; grid-template-columns: 70px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 78px; padding: 12px 20px; border-bottom: 1px solid var(--hairline); }
  .departure-row:last-child { border-bottom: 0; }
  .departure-time { font-size: 1.45rem; font-weight: 850; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
  .departure-destination strong { display: block; }
  .departure-destination span { color: var(--muted); font-size: .77rem; }
  .delay { color: var(--brand-ink); font-size: .74rem; font-weight: 820; white-space: nowrap; }
  .delay.late { color: var(--alarm); }

  .notice { display: flex; align-items: flex-start; gap: 12px; border-radius: 16px; padding: 15px; color: var(--muted); background: var(--surface-2); font-size: .84rem; }
  .notice .icon { width: 21px; height: 21px; flex: 0 0 auto; color: var(--brand-ink); }
  .notice.warning { color: var(--text); background: var(--warning-tint); }
  .notice.warning .icon { color: var(--warning); }
  .notice.offline { color: var(--text); background: var(--blue-tint); }
  .notice.offline .icon { color: var(--blue); }

  .calendar-card { padding: 14px; }
  .calendar-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); padding: 6px 6px var(--sp-16); }
  .calendar-head h2 { font-size: 1.45rem; }
  .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
  .weekday { min-height: 30px; display: grid; place-items: center; color: var(--muted); font-size: .64rem; font-weight: 820; text-transform: uppercase; }
  .day { position: relative; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 5px; border-radius: 10px; padding: 8px 2px 4px; font-size: .76rem; font-weight: 730; font-variant-numeric: tabular-nums; }
  .day.muted { color: var(--faint); opacity: .55; }
  .day.today { color: var(--on-brand); background: var(--brand); }
  .day.urgent::after { content: ""; position: absolute; inset: 3px; border: 2px solid var(--alarm); border-radius: 9px; pointer-events: none; }
  .day-dots { display: flex; justify-content: center; gap: 3px; }
  .day-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gray-waste); }
  .day-dots i.yellow { background: var(--yellow-waste); }
  .day-dots i.brown { background: var(--brown); }

  .timeline { position: relative; list-style: none; }
  .timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 10px; width: 2px; background: var(--hairline); }
  .timeline-item { position: relative; padding-left: 36px; }
  .timeline-item + .timeline-item { margin-top: 22px; }
  .timeline-dot { position: absolute; left: 3px; top: 8px; width: 16px; height: 16px; border: 4px solid var(--surface); border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 1px var(--hairline); }
  .timeline-dot.live { background: var(--alarm); }
  .timeline-card { border-radius: 18px; padding: var(--sp-20); background: var(--surface); box-shadow: var(--shadow-card); }
  .timeline-card h3 { margin-top: 8px; }
  .street-list { margin-top: 10px; color: var(--muted); font-size: .86rem; }

  .form-card { padding: clamp(var(--sp-20), 4vw, var(--sp-32)); }
  .field-grid { display: grid; gap: var(--sp-20); }
  .field-row { display: grid; gap: var(--sp-20); }
  .field { display: grid; gap: var(--sp-8); }
  .field label, .legend { font-size: .82rem; font-weight: 780; }
  .field small { color: var(--muted); font-size: .72rem; }
  input, select, textarea {
    width: 100%; min-height: 50px; border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
    border-radius: var(--radius-control); padding: var(--sp-12) var(--sp-16); color: var(--text); background: var(--surface-3);
    transition-property: border-color, box-shadow, background-color; transition-duration: 150ms;
  }
  textarea { min-height: 150px; resize: vertical; }
  input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
  input:focus, select:focus, textarea:focus { border-color: var(--brand-ink); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent); background: var(--surface); }
  .choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
  .choice { position: relative; }
  .choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .choice label { min-height: 54px; display: flex; align-items: center; gap: var(--sp-8); border-radius: 13px; padding: var(--sp-8) var(--sp-12); background: var(--surface-2); box-shadow: 0 0 0 1px var(--hairline); cursor: pointer; font-size: .82rem; font-weight: 740; }
  .choice label .icon { width: 21px; height: 21px; color: var(--muted); }
  .choice input:checked + label { color: var(--brand-ink); background: var(--brand-tint); box-shadow: 0 0 0 2px var(--brand-ink); }
  .choice input:focus-visible + label { outline: 3px solid var(--brand-ink); outline-offset: 3px; }
  .form-actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); margin-top: var(--sp-24); }

  .settings-list { overflow: hidden; padding: 0; }
  .setting-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--sp-20); min-height: 78px; padding: var(--sp-16) var(--sp-20); border-bottom: 1px solid var(--hairline); }
  .setting-row:last-child { border-bottom: 0; }
  .setting-copy strong { display: block; font-size: .92rem; }
  .setting-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; }
  .toggle { position: relative; width: 50px; height: 30px; }
  .toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .toggle label { display: block; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline); cursor: pointer; transition-property: background-color; transition-duration: 180ms; }
  .toggle label::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.22); transition-property: transform; transition-duration: 180ms; transition-timing-function: cubic-bezier(.2,0,0,1); }
  .toggle input:checked + label { background: var(--brand); }
  .toggle input:checked + label::after { transform: translateX(20px); }
  .toggle input:focus-visible + label { outline: 3px solid var(--brand-ink); outline-offset: 3px; }

  .empty-state { display: grid; place-items: center; min-height: 300px; padding: 32px; text-align: center; }
  .empty-state .module-icon { margin-bottom: var(--sp-16); }
  .empty-state p { max-width: 420px; margin: var(--sp-8) auto var(--sp-20); color: var(--muted); font-size: .88rem; }

  .phone-list { display: grid; gap: 12px; list-style: none; }
  .phone-card { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: var(--sp-16); }
  .phone-card h3 { margin: 0; }
  .phone-number { display: inline-flex; min-height: 44px; align-items: center; color: var(--brand-ink); font-size: clamp(1.05rem, 4vw, 1.4rem); font-weight: 840; font-variant-numeric: tabular-nums; text-decoration: none; }
  .article-stack { display: grid; gap: var(--sp-20); }
  .article-stack h2 { margin-top: var(--sp-16); font-size: 1.45rem; }
  .article-stack ul { padding-left: 22px; color: var(--muted); }
  .data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
  .data-table th, .data-table td { border-bottom: 1px solid var(--hairline); padding: var(--sp-12); text-align: left; vertical-align: top; }
  .data-table th { color: var(--muted); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
  .air-scale { display: grid; grid-template-columns: repeat(6, 1fr); overflow: hidden; border-radius: 999px; height: 13px; margin-top: var(--sp-20); }
  .air-scale i:nth-child(1) { background:#57b108 }.air-scale i:nth-child(2) { background:#b0dd10 }.air-scale i:nth-child(3) { background:#ffd911 }.air-scale i:nth-child(4) { background:#e58100 }.air-scale i:nth-child(5) { background:#e00000 }.air-scale i:nth-child(6) { background:#990033 }

  .update-toast {
    position: fixed; z-index: 40; right: 16px; bottom: 16px; left: 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    border-radius: 16px; padding: var(--sp-12) var(--sp-12) var(--sp-12) var(--sp-16); color: #f5e9d8; background: #3e2c23;
    box-shadow: 0 18px 48px -20px rgba(0,0,0,.55); transform: translateY(calc(100% + 30px)); opacity: 0;
    transition-property: transform, opacity; transition-duration: 240ms; transition-timing-function: cubic-bezier(.2,0,0,1);
  }
  .update-toast.is-visible { transform: translateY(0); opacity: 1; }
  .update-toast strong { display: block; font-size: .84rem; }
  .update-toast span { display: block; color: rgba(255,255,255,.68); font-size: .7rem; }
  .update-toast .btn-quiet { color: var(--lime); }
  html[data-theme="contrast"] .btn,
  html[data-theme="contrast"] .chip-nav a[aria-current="page"] { color: #000; }
  html[data-theme="contrast"] .chip-nav a[aria-current="page"] .icon { color: #000; }
  html[data-theme="contrast"] .brand img { outline-color: #fff; }
  html[data-theme="contrast"] .urgent-bar { background: #d80022; }

  @media (min-width: 700px) {
    .install-banner { display: none; }
    .card { padding: 22px; }
    .field-row { grid-template-columns: 1fr 1fr; }
    .choice-grid { grid-template-columns: repeat(4, 1fr); }
    .calendar-card { padding: 20px; }
    .day { min-height: 78px; padding-top: 10px; }
    .update-toast { right: 24px; bottom: 24px; left: auto; width: min(420px, calc(100% - 48px)); }
  }
  @media (max-width: 520px) {
    .phone-card { grid-template-columns: 44px 1fr; }
    .phone-card .phone-number { grid-column: 2; }
  }
}

@layer utilities {
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .tabular { font-variant-numeric: tabular-nums; }
  .muted { color: var(--muted); }
  .full-span { grid-column: 1 / -1; }
  .sticky-aside { position: sticky; top: 150px; }
}

@layer motion {
  @keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
  @keyframes reveal { from { opacity: 0; transform: translateY(12px); filter: blur(4px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
  .reveal { opacity: 0; animation: reveal 440ms cubic-bezier(.2,0,0,1) forwards; }
  .reveal:nth-child(2) { animation-delay: 80ms; }
  .reveal:nth-child(3) { animation-delay: 160ms; }
  .reveal:nth-child(4) { animation-delay: 240ms; }
  .reveal:nth-child(5) { animation-delay: 320ms; }
  .reveal:nth-child(6) { animation-delay: 400ms; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; filter: none; }
  }
}

/* ═══ Rozszerzenia systemowe (poza mockiem designera) ═══ */
@layer utilities {
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .air-scale i.is-active { box-shadow: inset 0 0 0 3px var(--text); }
  .card-title-lg { font-size: 1.4rem; margin-top: var(--sp-16); }
  .setting-title { font-size: 1.25rem; }
  .fieldset-plain { border: 0; padding: 0; margin: 0; }
  .check-inline { width: 22px; min-height: 22px; flex: 0 0 auto; }
  .list-disc { padding-left: 20px; list-style: disc; }
  .setstatus { min-height: 1.4rem; font-weight: 650; color: var(--brand-ink); }
  .hour-select { max-width: 9rem; }
  tr.muted td { color: var(--faint); }
  .article-stack table { width: 100%; border-collapse: collapse; }
  .article-stack table th, .article-stack table td { text-align: left; padding: var(--sp-8) var(--sp-12); border-bottom: 1px solid var(--hairline); font-size: .93rem; }
  .article-stack table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
  .article-stack blockquote { border-left: 3px solid var(--warning); padding-left: 14px; color: var(--muted); margin: 0; }
  .day.urgent { z-index: 0; }
  .waste-dot.gray { background: var(--gray-waste); }
}
