/* ==========================================================================
   SKLEPOWA TRASA - ULTRANOVOCZESNY MATERIAL 3 / iOS 18 GLASSMORPHISM THEME
   Stylistyka klasy Premium: fluidne animacje, miękkie cienie, responsywny UX
   ========================================================================== */

/* Czcionka NIE jest importowana tutaj: @import blokuje renderowanie i w sklepie bez zasięgu
   aplikacja czekała na nieudane połączenie z fonts.googleapis.com.
   Krój ładowany jest nieblokująco w index.html, a poniższy stos systemowy jest pełnowartościowy. */

:root {
  /* Paleta barw - Jasny motyw (Clean Vibrant Luxe) */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  
  --bg-app: #F6F8FA;
  --bg-surface: #FFFFFF;
  --bg-surface-translucent: rgba(255, 255, 255, 0.85);
  --bg-surface-glass: rgba(255, 255, 255, 0.96);
  --bg-card: #FFFFFF;
  --bg-subtle: #EEF2F6;
  --bg-input: #F1F5F9;

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dimmed: #64748B;
  --text-white: #FFFFFF;

  /* Akcenty główne */
  --primary: #10B981;
  --primary-dark: #047857;
  --primary-light: #D1FAE5;
  --primary-glow: rgba(16, 185, 129, 0.35);

  --accent-gradient: linear-gradient(135deg, #047857 0%, #065F46 50%, #064E3B 100%);
  --fab-gradient: linear-gradient(135deg, #10B981 0%, #0EA5E9 100%);
  --sparkle-gradient: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);

  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --info: #0EA5E9;

  --border: #E2E8F0;
  --border-subtle: rgba(226, 232, 240, 0.8);
  --divider: #F1F5F9;

  /* Cienie głębi */
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  --shadow-fab: 0 10px 25px rgba(16, 185, 129, 0.4);

  /* Zaokrąglenia */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  /* Safe Area */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-h: 130px;   /* nadpisywane z JS realną wysokością dolnego paska */
}

[data-theme="dark"] {
  --bg-app: #0B0F17;
  --bg-surface: #131A26;
  --bg-surface-translucent: rgba(19, 26, 38, 0.85);
  --bg-surface-glass: rgba(19, 26, 38, 0.96);
  --bg-card: #18202F;
  --bg-subtle: #1F293D;
  --bg-input: #1C2436;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dimmed: #94A3B8;
  --text-white: #FFFFFF;

  --primary: #34D399;
  --primary-dark: #10B981;
  --primary-light: rgba(52, 211, 153, 0.15);
  --primary-glow: rgba(52, 211, 153, 0.25);

  --border: #243044;
  --border-subtle: rgba(36, 48, 68, 0.8);
  --divider: #1E293B;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 10px 25px -3px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  --shadow-fab: 0 10px 25px rgba(52, 211, 153, 0.3);
}

/* ==========================================================================
   Reset & Podstawa
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select, [contenteditable] {
  user-select: text !important;
  -webkit-user-select: text !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  user-select: none;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--dock-h, 96px) + var(--safe-bottom));
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Górny pasek (Header) z efektem Glassmorphism
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 12px 2px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-subtle);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  display: block; /* podtytul MUSI byc widoczny - bez niego nowi mysla, ze to sklep (siostra Adama, 04.09) */
  font-size: 0.7rem; /* >=11px wg kanonu */
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: var(--primary-light);
  color: var(--primary);
  transform: scale(1.05);
}

.icon-btn-danger:hover, .icon-btn-danger:active {
  background: var(--danger-light);
  color: var(--danger);
}

/* Pasek wyboru sklepu (Chips Carousel - ultra-kompaktowy 44px) */
.store-selector-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 0 2px 2px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.store-selector-bar::-webkit-scrollbar {
  display: none;
}

.store-chip {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  min-height: 34px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.store-chip:hover {
  transform: translateY(-1px);
  border-color: var(--text-dimmed);
}

.store-chip.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: scale(1.02);
}

/* Ołówek edycji trasy TYLKO na aktywnym sklepie */
.store-chip:not(.active) .store-chip-edit-btn {
  display: none;
}

.store-chip-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-left: 2px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.store-chip.active .store-chip-edit-btn:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: scale(1.15);
}

/* 18.09.2026: pulsowanie olowka, gdy pokazuje sie dymek onboardingowy (checkAisleHint w app.js) */
@keyframes aisleHintPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 6px var(--primary-glow); }
}
.store-chip-edit-btn.aisle-hint-pulse {
  animation: aisleHintPulse 1.5s ease-in-out 2;
}

.store-chip-btn {
  background: var(--bg-surface);
  border: 1.5px dashed var(--primary);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 38px;
  transition: all 0.2s ease;
}

.store-chip-btn:hover {
  background: var(--primary-light);
}

/* Wskaźnik postępu (Segmented Progress) */
.progress-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-track {
  height: 6px;
  width: 100%;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0%;
  border-radius: var(--radius-pill);
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-pill-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-clear-completed-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulseBadge 2s infinite ease-in-out;
}

.btn-clear-completed-badge:hover, .btn-clear-completed-badge:active {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

.finish-shopping-card {
  margin: 18px 0 10px 0;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-subtle);
  animation: fadeIn 0.3s ease;
}

.btn-finish-shopping {
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}

.btn-finish-shopping:hover, .btn-finish-shopping:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Pasek Gazetki Promocyjnej (Wariant A: Czysty Link do e-Gazetki)
   ========================================================================== */

.promo-banner-wrap {
  display: flex;
  flex-direction: column;
  padding: 2px 0 4px 0;
}

.promo-leaflet-bar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 40px;
  box-shadow: var(--shadow-subtle);
}

.promo-leaflet-bar-link:hover, .promo-leaflet-bar-link:active {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .promo-leaflet-bar-link {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
  color: #34D399;
}

/* --- Live Promo Engine: Hity Tygodnia (Inteligentny Akordeon 2.2 - czytelny CTA) --- */
.promo-deals-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary, #10B981);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.promo-deals-box.is-expanded {
  padding: 8px 10px;
  gap: 8px;
}

.promo-accordion-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-sm);
  padding: 1px 0;
  transition: background 0.15s ease;
}

.promo-accordion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.promo-accordion-row-top {
  min-height: 22px;
}

.promo-accordion-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap; /* przy długiej nazwie (Biedronka, POLOmarket) data schodzi pod nazwę zamiast być ucięta — 11.09.2026 */
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.promo-accordion-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.promo-accordion-store {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

.promo-accordion-row-bottom {
  min-height: 26px;
}

.promo-accordion-summary {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

/* Zielona pigułka CTA zachęcająca do kliknięcia (min 38-44px, wysoki kontrast AAA) */
.promo-accordion-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #10B981; /* szmaragd marki w OBU motywach - decyzja Adama (dark --primary #34D399 swiecil na duzym przycisku) */
  color: #08321F; /* Ciemnozielony tekst o kontraście > 7.5:1 (AAA) */
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  min-height: 44px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.promo-accordion-header:hover .promo-accordion-cta-btn,
.promo-accordion-header:active .promo-accordion-cta-btn {
  background: #34D399;
  color: #08321F;
  transform: translateY(-1px);
}

.promo-deals-box.is-expanded .promo-accordion-cta-btn {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 700;
  padding: 6px 14px;
  min-height: 38px;
}

.promo-deals-box.is-expanded .promo-accordion-header:hover .promo-accordion-cta-btn {
  color: var(--primary);
  border-color: var(--primary);
}

.promo-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.promo-fire-icon {
  font-size: 1rem;
}

.promo-deals-dates {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

[data-theme="dark"] .promo-deals-dates {
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
}

.promo-deals-more-link {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  transition: all 0.2s ease;
}

.promo-deals-more-link:hover, .promo-deals-more-link:active {
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.promo-deals-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.promo-deals-scroll::-webkit-scrollbar {
  display: none;
}

.deal-card {
  flex: 0 0 148px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  user-select: none;
}

.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: var(--border-focus);
}

.deal-card.on-list {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.deal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.deal-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* 14.09.2026: wlasna ikona grzyba (SVG) zamiast emoji 🍄 (muchomor) - patrz app.js dealIconHtml() */
.deal-icon-svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
}

.deal-badge-discount {
  font-size: 0.72rem;
  font-weight: 800;
  background: #DC2626;
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.deal-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 30px;
}

.deal-pricing {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 5px;
  row-gap: 1px;
  margin-bottom: 4px;
}

.deal-price {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
}

[data-theme="dark"] .deal-price {
  color: var(--primary);
}

.deal-old-price {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
  white-space: nowrap;
}

.deal-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.deal-condition {
  font-size: 0.64rem;
  color: #d97706;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 14px;
}

.deal-btn-add {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  min-height: 36px;
}

.deal-btn-add:hover, .deal-btn-add:active {
  background: var(--primary);
  color: #FFFFFF;
  transform: scale(1.02);
}

.deal-btn-add.btn-on-list {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.promo-deals-footer-note {
  /* Pasek wyjaśnień jedzie w kółko jak w telegazecie (11.09.2026, prośba Adama) */
  overflow: hidden;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.promo-note-track {
  display: flex;
  width: max-content;
  /* 8 komunikatow po analizie prawnej Codexa; 62 s utrzymuje to samo tempo czytania co 42 s przy 6 */
  animation: promo-note-scroll 62s linear infinite;
}

.promo-note-run {
  white-space: pre;
  padding-right: 0;
}

@keyframes promo-note-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Zatrzymanie na dotknięcie - da się przeczytać w spokoju */
.promo-deals-footer-note:hover .promo-note-track,
.promo-deals-footer-note:active .promo-note-track {
  animation-play-state: paused;
}

/* Kto ma wyłączone animacje w telefonie, widzi tekst nieruchomo */
@media (prefers-reduced-motion: reduce) {
  .promo-note-track { animation: none; }
  .promo-deals-footer-note { text-overflow: ellipsis; white-space: nowrap; }
}

/* ==========================================================================
   Główny kontener
   ========================================================================== */

.main-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 12px;
}

/* Nowoczesny stan pusty - ultra-kompaktowy (mieści się w całości na 360px/412px) */
.empty-state {
  text-align: center;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.empty-illustration-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: none;
}

.empty-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin: 0;
}

.empty-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.3;
  margin: 0 0 2px 0;
}

.quick-action-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin-top: 2px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.action-card:active {
  transform: scale(0.97);
}

.action-card-hero-compact {
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}

.action-card-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.hero-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  color: #0284C7;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.action-card-title {
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: -0.2px;
}

.action-card-badge {
  font-size: 0.7rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.action-card-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.2;
}

/* Siatka 2 kart kompaktowych */
.action-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.action-card-compact {
  padding: 10px 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 80px;
}

.action-card-compact:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.compact-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Przycisk wsparcia twórcy na stronie głównej
   ========================================================================== */

.main-support-banner {
  width: 100%;
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.main-support-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-support-link:hover, .main-support-link:active {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-2px);
  color: var(--primary-dark);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.support-milk-icon {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-block;
  animation: pulse-milk 2.8s infinite ease-in-out;
}

@keyframes pulse-milk {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.22); }
}

.support-milk-text {
  letter-spacing: -0.2px;
}

.support-milk-pill {
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .main-support-link {
  background: var(--bg-card);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--text-main);
}

[data-theme="dark"] .main-support-link:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
}

/* ==========================================================================
   Grupy Alejek i Produkty
   ========================================================================== */

.aisle-group {
  margin-bottom: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.2s ease;
}

.aisle-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--divider);
}

.aisle-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aisle-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: var(--shadow-subtle);
}

.aisle-title {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.aisle-badge {
  font-size: 0.775rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  border: 1px solid var(--border);
}

.aisle-items-list {
  display: flex;
  flex-direction: column;
}

/* Pojedynczy wiersz produktu */
.product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-card);
  transition: all 0.2s ease;
  cursor: pointer;
}

.product-item:last-child {
  border-bottom: none;
}

.product-item:active {
  background: var(--bg-subtle);
}

.product-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

/* Customowy nowoczesny checkbox */
.custom-checkbox {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
  background: var(--bg-surface);
}

.product-item.completed .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
  transform: scale(0.95);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.product-qty {
  font-size: 0.825rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.product-item.completed {
  opacity: 0.5;
  background: rgba(0, 0, 0, 0.015);
}

.product-item.completed .product-name {
  text-decoration: line-through;
  color: var(--text-dimmed);
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-item-action {
  background: none;
  border: none;
  color: var(--text-dimmed);
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-item-action:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-del-item:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ==========================================================================
   Pływający Dolny Dock (Bottom Navigation & Quick Add)
   ========================================================================== */

.bottom-app-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 4px 10px calc(6px + var(--safe-bottom)) 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 90;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.dock-image-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.dock-preview-thumb {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.dock-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quick-pills-carousel {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 2px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-pills-carousel::-webkit-scrollbar {
  display: none;
}

.quick-product-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  min-height: 44px;
}

.quick-product-pill:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.quick-product-pill:active {
  transform: scale(0.94);
}

.quick-product-pill.on-list {
  background: rgba(16, 185, 129, 0.14);
  border-color: var(--primary);
  color: var(--primary-dark, var(--primary));
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.quick-product-pill.on-list .pill-status-icon {
  color: var(--primary);
  font-weight: 900;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-glass, var(--bg-surface));
  border: 1.5px solid var(--border);
  border-radius: 32px;
  padding: 4px 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chat-input-bar:focus-within {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 8px 30px var(--primary-glow), 0 0 0 3px var(--primary-light);
}

.chat-tool-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.chat-tool-camera {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(16, 185, 129, 0.06) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--primary);
}

.chat-tool-camera:hover, .chat-tool-camera:active {
  background: var(--primary);
  color: white;
  transform: scale(1.06);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.chat-tool-paste {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}

.chat-tool-paste:hover, .chat-tool-paste:active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.06);
}

.chat-tool-mic {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
  position: relative;
}

.chat-tool-mic:hover, .chat-tool-mic:active {
  color: #DC2626;
  border-color: #DC2626;
  background: rgba(220, 38, 38, 0.1);
  transform: scale(1.06);
}

.chat-tool-mic.is-listening {
  background: #DC2626 !important;
  border-color: #DC2626 !important;
  color: #FFFFFF !important;
  animation: pulseMic 1.4s infinite ease-in-out;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.3);
}

@keyframes pulseMic {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.chat-input-textarea {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 6px;
  resize: none;
  max-height: 120px;
  line-height: 1.35;
  user-select: text !important;
}

.chat-send-btn {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

.chat-send-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Modale & Bottom Sheets
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: calc(20px + var(--safe-bottom));
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}

.modal-backdrop.active .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-pill);
  margin: 12px auto 4px auto;
  flex-shrink: 0;
}

.sheet-header {
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
}

.sheet-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sheet-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Przyciski i elementy formularzy */
.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* ==========================================================================
   Edytor kolejności alejek (Drag & Drop)
   ========================================================================== */

.aisle-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: grab;
  user-select: none;
  transition: all 0.2s ease;
}

.reorder-item.dragging {
  opacity: 0.4;
  background: var(--primary-light);
  border-color: var(--primary);
}

.reorder-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reorder-handle {
  color: var(--text-dimmed);
  font-size: 1.2rem;
}

.reorder-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.reorder-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-move {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s ease;
}

.btn-move:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ==========================================================================
   Loading & Toast
   ========================================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  bottom: calc(var(--dock-h, 130px) + 12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast {
  background: #1E293B;
  color: #F8FAFC;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideUp 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-success {
  border-left: 4px solid var(--primary);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toast-undo-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.toast-undo-btn:hover {
  background: var(--primary-dark);
}

.toast-undo-btn:active {
  transform: scale(0.92);
}


/* ==========================================================================
   POPRAWKI MOBILNE (dotyk, dostępność, stany)
   ========================================================================== */

/* Cele dotykowe - przyciski przy produkcie były 32x32, poniżej progu trafialności */
.btn-item-action {
  min-width: 42px;
  min-height: 42px;
}
.product-actions { gap: 8px; }

.chat-tool-btn,
.chat-send-btn,
.icon-btn {
  min-width: 44px;
  min-height: 44px;
}

.btn-move { min-width: 40px; min-height: 40px; }
.btn-add-promo { min-height: 44px; min-width: 44px; padding-inline: 12px; }
.touch44 { min-width: 44px !important; min-height: 44px !important; }
.store-chip, .store-chip-btn { min-height: 40px; }
#btn-reset-store-order { min-height: 40px; padding: 0 10px; }
#toggle-keep-screen,
#toggle-haptic,
#toggle-move-bottom,
#checkbox-replace-list { width: 26px; height: 26px; }

/* Ukryte modale nie mogą przechwytywać dotyku ani być czytane przez TalkBack */
.modal-backdrop:not(.active) { visibility: hidden; }
.modal-backdrop.active { visibility: visible; }

/* Na telefonie :hover "przykleja się" po dotknięciu - wyłączamy przesunięcia */
@media (hover: none) {
  .action-card:hover,
  .icon-btn:hover,
  .store-chip:hover,
  .product-item:hover,
  .btn-primary:hover,
  .btn-secondary:hover { transform: none; }
}

/* Nagłówek nie może się rozpychać na wąskim ekranie */
.brand-text { min-width: 0; }
.brand-name, .brand-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-actions { flex-shrink: 0; }

/* Pole wpisywania: dwie linie placeholdera muszą się mieścić */
.chat-input-textarea {
  min-height: 44px;
  line-height: 1.35;
}

/* Zwinięta alejka - wskazanie strzałką */
.aisle-header::after {
  content: '▾';
  margin-left: 8px;
  font-size: 0.8rem;
  opacity: 0.55;
  transition: transform 0.2s ease;
}
.aisle-collapsed .aisle-header::after { transform: rotate(-90deg); }

/* Toast z akcją "Cofnij" po usunięciu produktu */
.toast-with-action {
  display: flex;
  align-items: center;
  gap: 14px;
}
.toast-undo-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: inherit;
  font: inherit;
  font-weight: 800;
  padding: 6px 14px;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Stan synchronizacji rodzinnej - kolor musi odpowiadać prawdzie */
.sync-ok    { color: var(--primary) !important; }
.sync-fail  { color: var(--danger) !important; }
.sync-local { color: var(--text-muted) !important; }


/* ==========================================================================
   POPRAWKA v16: naglowek nie miesci sie na 393px
   Po powiekszeniu przyciskow do 44px cztery ikony + nazwa rozpychaly .header-top
   do 426px przy szerokosci ekranu 393px - przycisk Ustawien byl czesciowo poza
   ekranem i nie dalo sie w niego trafic. Bez Ustawien nie ma jak wpisac klucza API.
   ========================================================================== */

.header-top {
  gap: 8px;
}

/* Kontener nazwy musi moc sie kurczyc - bez min-width:0 flex go nie zwezi */
.brand-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
}

.brand-name,
.brand-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.header-actions {
  flex: 0 0 auto;
  gap: 4px;
}

/* Logo nie moze sie kurczyc ani rozpychac */
.brand-logo-badge {
  flex-shrink: 0;
}

/* Na waskich telefonach podtytul ustepuje miejsca przyciskom */
@media (max-width: 400px) {
  .brand-name { font-size: 1.1rem; }
  .brand-sub { font-size: 0.7rem; }
}

/* Pole wpisywania: jedna linia placeholdera ma sie miescic w calosci */
.chat-input-textarea {
  font-size: 0.9rem;
}
.chat-input-textarea::placeholder {
  font-size: 0.88rem;
}

/* Przyciski akcji w modalach mialy 32px wysokosci - ponizej progu trafialnosci */
#btn-share-native,
#btn-copy-keep-format,
#btn-copy-full-text,
#btn-clear-completed,
#btn-clear-all,
#btn-paste-clipboard,
#btn-reset-store-order {
  min-height: 44px;
}

/* Przelaczniki w Ustawieniach: sam kwadracik jest maly, ale caly wiersz (label)
   jest klikalny - powiekszamy jeszcze kwadracik dla pewnosci trafienia */
#toggle-keep-screen,
#toggle-haptic,
#toggle-move-bottom,
#checkbox-replace-list {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* Badge BETA w Ustawieniach */
.badge-beta {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
  display: inline-block;
  vertical-align: middle;
}

/* Karta wsparcia tworcy (Postaw mleko) */
.settings-support-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 10px 0;
  text-align: center;
}

.btn-support-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  min-height: 40px;
  min-width: 64px;
  transition: all 0.15s ease;
}

.btn-support-pill.highlighted {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-support-pill:active {
  transform: scale(0.94);
}

/* ==========================================================================
   Baner i Modal Instalacji PWA na telefonie
   ========================================================================== */

.install-banner {
  position: fixed;
  bottom: calc(76px + var(--safe-bottom));
  left: 12px;
  right: 12px;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 0 16px var(--primary-glow);
  z-index: 150; /* pod modalami (200), nad dockiem (90) — 11.09.2026 */
  animation: slideUpFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.install-banner-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  flex: 1;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Szybkie pigułki wag i ilości w edycji produktu */
.btn-qty-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.btn-qty-pill:hover, .btn-qty-pill:active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.04);
}

.btn-qty-pill-clear {
  color: var(--text-muted);
  border-style: dashed;
}

/* ProstaLista (11 liter) + plakietka BETA nie mieszcza sie obok siebie na 320 px — plakietka w naglowku znika,
   w Ustawieniach zostaje (pomiar arbitra 04.09: nazwa 93 px, miejsce z plakietka 58 px). */
@media (max-width: 340px) {
  #header-beta-badge { display: none; }
}

/* --- Informacja o wersji testowej (05.09.2026) --- */
.beta-notice {
  margin: 12px 12px 4px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}
.beta-notice-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.beta-notice-text { font-size: 14px; line-height: 1.45; margin: 0 0 10px; color: var(--text-secondary, inherit); }
.beta-notice-text a { color: var(--primary); }
.beta-notice-btn {
  display: block; width: 100%; min-height: 44px;
  background: #10B981; color: #08321F; font-weight: 700; font-size: 15px;
  border: 0; border-radius: var(--radius-md); cursor: pointer;
}

/* ==========================================================================
   Ikony produktów (17.09.2026): jedna funkcja productIconHtml() dla listy i kafli hitów.
   Tło = kolor działu; monogram, gdy słownik nie zna produktu; docelowo <img> z icons/products/*.svg
   ========================================================================== */
.pi { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; border-radius:50%; line-height:1; font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif; }
.pi-sm { width:28px; height:28px; font-size:16px; margin-right:10px; }
.pi-md { width:36px; height:36px; font-size:20px; }
.pi-emoji { display:block; transform:translateY(0.5px); }
.pi-img { width:92%; height:92%; object-fit:contain; display:block; }
.pi-svg { width:70%; height:70%; display:block; }
.pi-mono .pi-mono-txt { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; font-weight:700; font-size:0.62em; letter-spacing:0.02em; color:#f8fafc; }
.pi:not(.pi-mono) { background:transparent; } /* tło tylko pod monogramem (decyzja Adama 17.09) */
.pi-cat-produce   { background:rgba(34,197,94,0.22); }
.pi-cat-bakery    { background:rgba(245,158,11,0.22); }
.pi-cat-dairy     { background:rgba(96,165,250,0.22); }
.pi-cat-meat      { background:rgba(244,63,94,0.22); }
.pi-cat-pantry    { background:rgba(234,179,8,0.20); }
.pi-cat-frozen    { background:rgba(56,189,248,0.22); }
.pi-cat-sweets    { background:rgba(236,72,153,0.22); }
.pi-cat-drinks    { background:rgba(20,184,166,0.22); }
.pi-cat-household { background:rgba(148,163,184,0.22); }
.pi-cat-other     { background:rgba(148,163,184,0.16); }
.pi-mono.pi-cat-produce   { background:#16a34a; } .pi-mono.pi-cat-bakery { background:#d97706; } .pi-mono.pi-cat-dairy { background:#2563eb; }
.pi-mono.pi-cat-meat      { background:#e11d48; } .pi-mono.pi-cat-pantry { background:#ca8a04; } .pi-mono.pi-cat-frozen { background:#0284c7; }
.pi-mono.pi-cat-sweets    { background:#db2777; } .pi-mono.pi-cat-drinks { background:#0d9488; } .pi-mono.pi-cat-household { background:#64748b; }
.pi-mono.pi-cat-other     { background:#475569; }
.deal-icon .pi { margin-right:0; }

