/* =========================================================
   Material Design 3 — tokeny (seed #2E7D32, motyw eko)
   ========================================================= */
:root {
  /* Light scheme */
  --md-sys-color-primary: #2E7D32;
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #ABF2AB;
  --md-sys-color-on-primary-container: #002106;

  --md-sys-color-secondary: #52634F;
  --md-sys-color-on-secondary: #FFFFFF;
  --md-sys-color-secondary-container: #D5E8CF;
  --md-sys-color-on-secondary-container: #111F0F;

  --md-sys-color-tertiary: #386569;
  --md-sys-color-on-tertiary: #FFFFFF;
  --md-sys-color-tertiary-container: #BCEBEF;
  --md-sys-color-on-tertiary-container: #002022;

  --md-sys-color-error: #BA1A1A;
  --md-sys-color-on-error: #FFFFFF;
  --md-sys-color-error-container: #FFDAD6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-color-surface: #FCFDF6;
  --md-sys-color-on-surface: #1A1C18;
  --md-sys-color-on-surface-variant: #43483E;
  --md-sys-color-surface-variant: #DEE5D8;

  --md-sys-color-surface-container-lowest: #FFFFFF;
  --md-sys-color-surface-container-low: #F3F4ED;
  --md-sys-color-surface-container: #EEF1E9;
  --md-sys-color-surface-container-high: #E8EBE3;
  --md-sys-color-surface-container-highest: #E2E5DD;

  --md-sys-color-outline: #73796E;
  --md-sys-color-outline-variant: #C3C8BB;
  --md-sys-color-inverse-surface: #2F312C;
  --md-sys-color-inverse-on-surface: #F1F1EA;
  --md-sys-color-scrim: #000000;

  /* Elevation (tonalne cienie) */
  --md-elev-1: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15);
  --md-elev-2: 0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15);
  --md-elev-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.30);

  /* Kształty */
  --shape-xs: 4px;
  --shape-sm: 8px;
  --shape-md: 12px;
  --shape-lg: 16px;
  --shape-xl: 28px;
  --shape-full: 999px;
}

/* Dark scheme */
[data-theme="dark"] {
  --md-sys-color-primary: #8FD68C;
  --md-sys-color-on-primary: #00390A;
  --md-sys-color-primary-container: #135214;
  --md-sys-color-on-primary-container: #ABF2AB;

  --md-sys-color-secondary: #B9CCB2;
  --md-sys-color-on-secondary: #243421;
  --md-sys-color-secondary-container: #3A4B36;
  --md-sys-color-on-secondary-container: #D5E8CF;

  --md-sys-color-tertiary: #A0CFD3;
  --md-sys-color-on-tertiary: #00363A;
  --md-sys-color-tertiary-container: #1E4D51;
  --md-sys-color-on-tertiary-container: #BCEBEF;

  --md-sys-color-error: #FFB4AB;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000A;
  --md-sys-color-on-error-container: #FFDAD6;

  --md-sys-color-surface: #1A1C18;
  --md-sys-color-on-surface: #E2E3DC;
  --md-sys-color-on-surface-variant: #C3C8BB;
  --md-sys-color-surface-variant: #43483E;

  --md-sys-color-surface-container-lowest: #0F110D;
  --md-sys-color-surface-container-low: #1A1C18;
  --md-sys-color-surface-container: #1E211D;
  --md-sys-color-surface-container-high: #292B27;
  --md-sys-color-surface-container-highest: #333630;

  --md-sys-color-outline: #8D9387;
  --md-sys-color-outline-variant: #43483E;
  --md-sys-color-inverse-surface: #E2E3DC;
  --md-sys-color-inverse-on-surface: #2F312C;
}

/* =========================================================
   Reset / podstawy
   ========================================================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: 'Roboto', system-ui, sans-serif;
}
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #d9e7d6 0%, transparent 60%),
    #c9d2c6;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 0;
}

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Skala typografii M3 */
.display-small { font-size: 36px; line-height: 44px; font-weight: 400; }
.headline-medium { font-size: 28px; line-height: 36px; font-weight: 400; }
.headline-small { font-size: 24px; line-height: 32px; font-weight: 400; }
.title-large { font-size: 22px; line-height: 28px; font-weight: 400; }
.title-medium { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: .15px; }
.title-small { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; }
.body-large { font-size: 16px; line-height: 24px; font-weight: 400; letter-spacing: .5px; }
.body-medium { font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: .25px; }
.body-small { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: .4px; }
.label-large { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px; }
.label-medium { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .5px; }

/* =========================================================
   Ramka telefonu
   ========================================================= */
.device {
  position: relative;
  width: 412px;
  height: 880px;
  background: #0c0d0c;
  border-radius: 48px;
  padding: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45), inset 0 0 0 2px #2a2c2a;
}
.device-notch {
  position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px;
  background: #0c0d0c;
  border-radius: 0 0 18px 18px;
  z-index: 50;
}
.app {
  position: relative;
  width: 100%; height: 100%;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  border-radius: 38px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.statusbar {
  flex: 0 0 auto;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}
.statusbar-icons { display: flex; gap: 6px; }
.statusbar-icons .material-symbols-rounded { font-size: 18px; }

.screen-root {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
}

/* Każdy ekran */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface);
  animation: screen-in .22s ease;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
.screen-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 16px 96px;
  scrollbar-width: thin;
}
.screen-body::-webkit-scrollbar { width: 6px; }
.screen-body::-webkit-scrollbar-thumb { background: var(--md-sys-color-outline-variant); border-radius: 3px; }

/* =========================================================
   Top app bar
   ========================================================= */
.appbar {
  flex: 0 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 8px 4px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}
.appbar.scrolled { background: var(--md-sys-color-surface-container); box-shadow: var(--md-elev-1); }
.appbar-title { flex: 1 1 auto; padding-left: 8px; }
.appbar.center .appbar-title { text-align: center; }

/* Icon button */
.icon-btn {
  width: 48px; height: 48px;
  border: none; background: transparent;
  color: var(--md-sys-color-on-surface);
  border-radius: var(--shape-full);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}
.icon-btn .material-symbols-rounded { font-size: 24px; z-index: 1; }
.icon-btn::after {
  content: ''; position: absolute; inset: 4px;
  border-radius: var(--shape-full);
  background: currentColor; opacity: 0; transition: opacity .12s;
}
.icon-btn:hover::after { opacity: .08; }
.icon-btn:active::after { opacity: .12; }

/* =========================================================
   Karty
   ========================================================= */
.card {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--shape-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}
.card::after {
  content: ''; position: absolute; inset: 0;
  background: var(--md-sys-color-on-surface); opacity: 0; transition: opacity .12s;
}
.card:hover::after { opacity: .05; }
.card:active::after { opacity: .09; }
.card.elevated { box-shadow: var(--md-elev-1); background: var(--md-sys-color-surface-container-low); }

/* Karta podsumowania */
.summary-card {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-radius: var(--shape-lg);
  padding: 20px;
  margin: 8px 0 16px;
  cursor: default;
}
.summary-card .summary-label { opacity: .85; }
.summary-card .summary-amount { margin-top: 4px; font-weight: 500; }
.summary-card .summary-sub { margin-top: 10px; display: flex; gap: 16px; }
.summary-card .summary-sub div { display: flex; flex-direction: column; }
.summary-card .summary-sub b { font-weight: 500; }

/* Karta bonu */
.voucher-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.voucher-logo {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: var(--shape-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  color: #fff;
}
.voucher-main { flex: 1 1 auto; min-width: 0; z-index: 1; }
.voucher-retailer { display: flex; align-items: center; gap: 8px; }
.voucher-retailer .name { font-weight: 500; }
.voucher-meta { color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.voucher-amount { flex: 0 0 auto; text-align: right; z-index: 1; }
.voucher-amount .amt { font-weight: 500; color: var(--md-sys-color-on-surface); }
.voucher-card.is-soon { box-shadow: inset 0 0 0 1.5px var(--md-sys-color-tertiary); }
.voucher-card.is-expired { opacity: .62; }
.voucher-card.is-used { opacity: .62; }
.voucher-card.is-used .voucher-amount .amt { text-decoration: line-through; }

/* =========================================================
   Chipy
   ========================================================= */
.chip-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
  border-radius: var(--shape-sm);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.chip .material-symbols-rounded { font-size: 18px; }
.chip.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
  padding-left: 8px;
}
.chip.selected .chip-check { display: inline-flex; }
.chip .chip-check { display: none; }

/* Status chip (na karcie/szczegółach) */
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px;
  border-radius: var(--shape-sm);
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
}
.status-chip .material-symbols-rounded { font-size: 14px; }
.status-active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.status-soon { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.status-expired { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.status-used { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); }

/* =========================================================
   FAB
   ========================================================= */
.fab-extended {
  position: absolute;
  right: 16px; bottom: 24px;
  height: 56px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border: none;
  border-radius: var(--shape-lg);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--md-elev-3);
  cursor: pointer;
  z-index: 20;
}
.fab-extended .material-symbols-rounded { font-size: 22px; }
.fab-extended:active { box-shadow: var(--md-elev-1); }

/* =========================================================
   Przyciski
   ========================================================= */
.btn {
  height: 40px;
  padding: 0 24px;
  border-radius: var(--shape-full);
  border: none;
  font-size: 14px; font-weight: 500; letter-spacing: .1px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
}
.btn .material-symbols-rounded { font-size: 18px; }
.btn::after { content:''; position:absolute; inset:0; background: currentColor; opacity:0; transition: opacity .12s; }
.btn:hover::after { opacity: .08; }
.btn:active::after { opacity: .12; }
.btn-filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn-tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn-text { background: transparent; color: var(--md-sys-color-primary); padding: 0 12px; }
.btn-outlined { background: transparent; color: var(--md-sys-color-primary); border: 1px solid var(--md-sys-color-outline); }
.btn-error { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .38; cursor: default; }

/* =========================================================
   Pola tekstowe (outlined)
   ========================================================= */
.field {
  position: relative;
  margin: 18px 0 6px;
}
.field input, .field select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  font-size: 16px; font-family: inherit;
  color: var(--md-sys-color-on-surface);
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--shape-xs);
  outline: none;
  appearance: none;
}
.field select { cursor: pointer; padding-right: 40px; }
.field input:focus, .field select:focus {
  border: 2px solid var(--md-sys-color-primary);
  padding: 0 15px;
}
.field label {
  position: absolute;
  left: 12px; top: -8px;
  padding: 0 4px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}
.field input:focus + label, .field select:focus + label {
  color: var(--md-sys-color-primary);
}
.field .field-icon {
  position: absolute; right: 12px; top: 18px;
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
  font-size: 22px;
}
.field-help { color: var(--md-sys-color-on-surface-variant); padding: 0 16px; margin-top: 2px; }

/* =========================================================
   Banner / ostrzeżenia
   ========================================================= */
.banner {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--shape-md);
  margin: 10px 0;
}
.banner .material-symbols-rounded { font-size: 22px; flex: 0 0 auto; }
.banner-warn { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.banner-info { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.banner-error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }

/* =========================================================
   Pusty stan
   ========================================================= */
.empty-state {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 40px 32px;
  gap: 8px;
}
.empty-state .empty-ill {
  width: 120px; height: 120px;
  border-radius: var(--shape-full);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.empty-state .empty-ill .material-symbols-rounded { font-size: 64px; }
.empty-state h2 { margin: 0; }
.empty-state p { margin: 0; color: var(--md-sys-color-on-surface-variant); max-width: 260px; }

/* =========================================================
   Skaner
   ========================================================= */
.scanner {
  background: #000;
  color: #fff;
}
.scanner .appbar { background: transparent; color: #fff; }
.scanner .icon-btn { color: #fff; }
.scanner-viewport {
  flex: 1;
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 30%, #20302a 0%, #0a0d0b 70%);
  overflow: hidden;
}
.scanner-camera-noise {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,.02) 0 2px, transparent 2px 6px);
  animation: noise-pan 6s linear infinite;
}
@keyframes noise-pan { to { background-position: 200px 0; } }
.scanner-reticle {
  position: absolute;
  top: 38%; left: 50%; transform: translate(-50%,-50%);
  width: 250px; height: 150px;
  border-radius: 16px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.45);
}
.scanner-reticle .corner {
  position: absolute; width: 28px; height: 28px;
  border: 3px solid var(--md-sys-color-primary);
}
.corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 12px 0 0 0; }
.corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-radius: 0 12px 0 0; }
.corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-radius: 0 0 0 12px; }
.corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 12px 0; }
.scanner-line {
  position: absolute; left: 8px; right: 8px; top: 8px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--md-sys-color-primary), transparent);
  box-shadow: 0 0 12px 2px rgba(143,214,140,.8);
  border-radius: 2px;
  animation: scan-move 1.6s ease-in-out infinite alternate;
}
@keyframes scan-move { to { top: calc(100% - 11px); } }
.scanner-hint {
  position: absolute; bottom: 120px; left: 0; right: 0;
  text-align: center; color: rgba(255,255,255,.9);
  padding: 0 32px;
}
.scanner-manual {
  position: absolute; bottom: 40px; left: 0; right: 0;
  display: flex; justify-content: center;
}
.scanner-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0;
  pointer-events: none;
}
.scanner-flash.flash { animation: flash .4s ease; }
@keyframes flash { 0%{opacity:0;} 30%{opacity:.85;} 100%{opacity:0;} }
.scanner-detected {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #fff;
}
.scanner-detected .material-symbols-rounded {
  font-size: 64px; color: var(--md-sys-color-primary);
}

/* =========================================================
   Szczegóły / kod kreskowy
   ========================================================= */
.detail-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px 0 4px;
}
.detail-hero .voucher-logo { width: 56px; height: 56px; font-size: 20px; }
.detail-amount { font-weight: 500; }
.barcode-card {
  background: #FFFFFF;
  border-radius: var(--shape-md);
  padding: 18px 12px 10px;
  margin: 16px 0;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--md-elev-1);
}
.barcode-card svg { width: 100%; height: auto; max-height: 130px; }
.detail-info-row {
  display: flex; justify-content: space-between;
  padding: 12px 4px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.detail-info-row .k { color: var(--md-sys-color-on-surface-variant); }
.detail-info-row .v { font-weight: 500; }

/* Tryb jasności (kasa) */
.brightness-mode #app { background: #fff; }
.brightness-mode .screen { background: #fff; }
.brightness-overlay {
  position: absolute; inset: 0;
  background: #fff; opacity: 0; pointer-events: none;
  transition: opacity .35s; z-index: 5;
}
.brightness-mode .brightness-overlay { opacity: .55; }

/* =========================================================
   Snackbar
   ========================================================= */
.snackbar {
  position: absolute;
  left: 16px; right: 16px; bottom: 24px;
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  border-radius: var(--shape-xs);
  padding: 14px 16px;
  font-size: 14px;
  box-shadow: var(--md-elev-3);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transform: translateY(120px);
  opacity: 0;
  transition: transform .25s, opacity .25s;
  z-index: 60;
}
.snackbar.show { transform: translateY(0); opacity: 1; }
.snackbar .snack-action {
  color: var(--md-sys-color-primary-container);
  font-weight: 600; cursor: pointer; background: none; border: none; font-size: 14px;
}
[data-theme="dark"] .snackbar .snack-action { color: var(--md-sys-color-primary); }

/* =========================================================
   Scrim / Dialog / Bottom sheet
   ========================================================= */
.scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 70;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.dialog {
  position: absolute;
  left: 24px; right: 24px; top: 50%;
  transform: translateY(-50%);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--shape-xl);
  padding: 24px;
  z-index: 80;
  box-shadow: var(--md-elev-3);
  animation: dialog-in .2s ease;
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(-50%) scale(.9); } }
.dialog .dialog-icon { text-align: center; color: var(--md-sys-color-secondary); margin-bottom: 12px; }
.dialog .dialog-icon .material-symbols-rounded { font-size: 24px; }
.dialog h3 { margin: 0 0 12px; }
.dialog p { margin: 0 0 24px; color: var(--md-sys-color-on-surface-variant); }
.dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.bottom-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--shape-xl) var(--shape-xl) 0 0;
  z-index: 80;
  padding: 12px 8px 24px;
  box-shadow: var(--md-elev-3);
  animation: sheet-in .25s ease;
}
@keyframes sheet-in { from { transform: translateY(100%); } }
.sheet-handle {
  width: 32px; height: 4px; border-radius: 2px;
  background: var(--md-sys-color-outline-variant);
  margin: 0 auto 12px;
}
.sheet-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: var(--shape-md);
  cursor: pointer;
  position: relative;
}
.sheet-item::after { content:''; position:absolute; inset:0; background: var(--md-sys-color-on-surface); opacity:0; border-radius: var(--shape-md); }
.sheet-item:hover::after { opacity:.06; }
.sheet-item:active::after { opacity:.1; }
.sheet-item .material-symbols-rounded { color: var(--md-sys-color-on-surface-variant); }
.sheet-item.danger { color: var(--md-sys-color-error); }
.sheet-item.danger .material-symbols-rounded { color: var(--md-sys-color-error); }

/* =========================================================
   Ustawienia
   ========================================================= */
.settings-section-title {
  color: var(--md-sys-color-primary);
  padding: 18px 16px 6px;
}
.list-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
}
.list-row .row-text { flex: 1; }
.list-row .row-text small { display: block; color: var(--md-sys-color-on-surface-variant); }

/* Switch M3 */
.switch { position: relative; width: 52px; height: 32px; flex: 0 0 auto; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  position: absolute; inset: 0;
  background: var(--md-sys-color-surface-variant);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--shape-full);
  transition: .2s;
}
.switch .thumb {
  position: absolute; top: 8px; left: 8px;
  width: 16px; height: 16px;
  background: var(--md-sys-color-outline);
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .track { background: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }
.switch input:checked + .track + .thumb {
  left: 24px; top: 6px; width: 20px; height: 20px;
  background: var(--md-sys-color-on-primary);
}

/* Segmented buttons */
.segmented {
  display: flex;
  border-radius: var(--shape-full);
  overflow: hidden;
  border: 1px solid var(--md-sys-color-outline);
  margin: 8px 16px;
}
.segmented button {
  flex: 1; height: 40px;
  border: none; background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  border-right: 1px solid var(--md-sys-color-outline);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented button:last-child { border-right: none; }
.segmented button.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.segmented button .material-symbols-rounded { font-size: 18px; }

.section-label { color: var(--md-sys-color-on-surface-variant); padding: 10px 4px 4px; }
