/* ======================================================================
   PILNOWACZ — wariant A "Spokój"
   Ciepły kremowy bg, terakota akcent, SF Pro, dużo powietrza.
   ====================================================================== */

:root {
  /* Healthcare-inspired palette — cool light gray bg, charcoal ink, soft pastels.
     Akcent zostaje terakota Czuwka (spójny z maskotką). */
  --bg:           #F4F4F6;
  --surface:      #FFFFFF;
  --surface-tint: #EFEFF2;
  --ink:          #2D2E33;
  --ink-2:        #71757C;
  --ink-3:        #A0A3AA;
  --hair:         rgba(45, 46, 51, 0.07);
  --hair-strong:  rgba(45, 46, 51, 0.12);
  --accent:       #D08763;   /* pastelowa terakota / koral — złagodzona */
  --accent-deep:  #BC6F4B;
  --accent-soft:  #F8EAE1;
  --accent-text:  #9A5638;
  --ok:           #7FA06B;
  --ok-soft:      #E4EFDC;
  --warn:         #CCAB63;
  --warn-soft:    #F5EEDB;
  --danger:       #CE6B7E;
  --danger-soft:  #F7E4E8;

  /* Pastelowa paleta kategorii — złagodzone, miętowo-błękitne tony */
  --cat-car:        #6FA0B4;  /* miękki błękit */
  --cat-car-soft:   #E0EDF2;
  --cat-home:       #7FA06B;  /* miękka mięta */
  --cat-home-soft:  #E4EFDC;
  --cat-sub:        #D08763;  /* pastel terakota */
  --cat-sub-soft:   #F8EAE1;
  --cat-health:     #D27D8E;  /* miękki róż */
  --cat-health-soft:#F7E4E8;
  --cat-doc:        #C6A865;  /* miękki złoty */
  --cat-doc-soft:   #F5EEDB;
  --cat-fin:        #9477B6;  /* miękka lawenda */
  --cat-fin-soft:   #ECE2F4;
  --cat-fam:        #BE7C9A;  /* pudrowy róż-fiolet */
  --cat-fam-soft:   #F4E5EE;
  --cat-work:       #5E6975;  /* miękki grafit */
  --cat-work-soft:  #E3E7EB;
  --cat-other:      #979BA3;  /* szary */
  --cat-other-soft: #E9EAEE;

  --r-sm: 12px;
  --r:    14px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-full: 999px;

  /* Soft elevation shadows (healthcare-style diffuse) */
  --shadow-sm: 0 2px 8px rgba(45,46,51,0.05);
  --shadow:    0 8px 24px rgba(45,46,51,0.06);
  --shadow-lg: 0 16px 40px rgba(45,46,51,0.08);

  /* Modern UI fonts — Inter for body (Linear/Vercel/Stripe), Plus Jakarta Sans for display headings.
     Baloo 2 zostaje tylko dla brand wordmark (logo czuwek). */
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-disp: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-brand: "Baloo 2", "DM Sans", var(--font-disp);

  --easing: cubic-bezier(0.2, 0.7, 0.3, 1);
  --bounce: cubic-bezier(0.34, 1.4, 0.5, 1);
}

/* ====================== DARK MODE ====================== */
:root[data-theme="dark"] {
  --bg:           #15130F;
  --surface:      #1F1C18;
  --surface-tint: #2B2620;
  --ink:          #F5EFE3;
  --ink-2:        #B5ACA0;
  --ink-3:        #8A8276;
  --hair:         rgba(255, 245, 227, 0.08);
  --hair-strong:  rgba(255, 245, 227, 0.14);
  --accent:       #FF9F4A;
  --accent-deep:  #C96442;
  --accent-soft:  #3A2618;
  --accent-text:  #FFD4A8;
  --ok:           #8FB388;
  --ok-soft:      #2C3A2C;
  --warn:         #D6A75A;
  --warn-soft:    #3A2F1E;
  --danger:       #E66A50;
  --danger-soft:  #3F231C;

  --cat-car-soft:   #1E2B33;
  --cat-home-soft:  #20281E;
  --cat-sub-soft:   #2F221C;
  --cat-health-soft:#291F1F;
  --cat-doc-soft:   #2A241B;
  --cat-fin-soft:   #1F1B2A;
  --cat-fam-soft:   #2A1F23;
  --cat-work-soft:  #1B2020;
  --cat-other-soft: #221F1B;
}
:root[data-theme="dark"] body {
  color-scheme: dark;
}
:root[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
}
:root[data-theme="dark"] .tabbar {
  background: rgba(31, 28, 24, 0.92);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .splash {
  background: radial-gradient(ellipse at center, #2A2620 0%, #1F1C18 50%, #15130F 100%);
}
:root[data-theme="dark"] .onboarding-overlay {
  background: linear-gradient(180deg, #1F1C18 0%, #15130F 100%);
  color: var(--ink);
}
:root[data-theme="dark"] .auth-overlay {
  background: linear-gradient(180deg, #2A1F18 0%, #15130F 60%);
}
:root[data-theme="dark"] .auth-card {
  background: var(--surface);
  border: 1px solid var(--hair);
}
:root[data-theme="dark"] .auth-card input,
:root[data-theme="dark"] .auth-field input {
  background: var(--surface-tint);
  color: var(--ink);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .auth-card .auth-tab {
  color: var(--ink-2);
}
:root[data-theme="dark"] .auth-card .auth-tab.active {
  color: var(--ink);
}
:root[data-theme="dark"] .auth-divider span {
  background: var(--surface);
  color: var(--ink-3);
}
:root[data-theme="dark"] .auth-guest,
:root[data-theme="dark"] .auth-aux-card {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hair);
}
:root[data-theme="dark"] .onboarding-slide .onboarding-title,
:root[data-theme="dark"] .onboarding-slide h2 {
  color: var(--ink);
}
:root[data-theme="dark"] .onboarding-slide p,
:root[data-theme="dark"] .onboarding-body {
  color: var(--ink-2);
}
:root[data-theme="dark"] .onboarding-foot {
  background: linear-gradient(180deg, transparent, rgba(31, 28, 24, 0.95) 30%, #1F1C18 100%);
}
/* Onboarding feature cards in dark mode - surface bg with light text */
:root[data-theme="dark"] .onboarding-features li {
  background: rgba(43, 38, 32, 0.85);
  border-color: color-mix(in srgb, var(--slide-accent) 35%, transparent);
  color: var(--ink);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .onboarding-feature-icon {
  background: color-mix(in srgb, var(--slide-accent) 28%, transparent);
}
:root[data-theme="dark"] .onboarding-slide-eyebrow {
  background: color-mix(in srgb, var(--slide-accent) 22%, transparent);
}
:root[data-theme="dark"] .onboarding-badge {
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.25), rgba(255, 140, 46, 0.12));
  color: #FFD4A8;
  border-color: rgba(255, 146, 51, 0.5);
}
/* Mascot drop-shadow darker in dark mode */
:root[data-theme="dark"] .onboarding-mascot {
  filter: drop-shadow(0 14px 32px color-mix(in srgb, var(--slide-accent) 50%, transparent));
}
/* Dots */
:root[data-theme="dark"] .onboarding-dots span {
  background: rgba(245, 239, 227, 0.18);
}
/* Skip button */
:root[data-theme="dark"] .onboarding-skip {
  color: var(--ink-3);
}
/* Continue with system theme — keep onboarding orbs subtle */
:root[data-theme="dark"] .onboarding-overlay::before {
  background: #5A3010;
  opacity: 0.4;
}
:root[data-theme="dark"] .onboarding-overlay::after {
  background: #C96442;
  opacity: 0.25;
}
:root[data-theme="dark"] .tour-tooltip {
  background: var(--surface);
  color: var(--ink);
}
:root[data-theme="dark"] .tour-overlay {
  background: rgba(0, 0, 0, 0.72);
}
:root[data-theme="dark"] .ob-czuwek {
  color: var(--ink);
}
:root[data-theme="dark"] .splash-name span {
  color: var(--ink);
}
:root[data-theme="dark"] .splash-tag,
:root[data-theme="dark"] .splash-status {
  color: var(--ink-2);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
html {
  /* Color visible behind safe-area on iOS PWA (notch / dynamic island area). */
  background: var(--bg);
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  min-height: 100vh;
  /* iOS PWA with black-translucent status bar: content goes under status bar,
     these paddings push content below the notch and above the home indicator. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-bottom: 120px;
  letter-spacing: -0.01em;
}
button {
  font-family: inherit; cursor: pointer; border: none; background: none;
  color: inherit; padding: 0;
}
input, textarea, select { font-family: inherit; color: inherit; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--hair-strong); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- LAYOUT ---------- */
.container { max-width: 480px; margin: 0 auto; padding: 0 24px; }

/* ---------- TOP HEADER ---------- */
.topbar {
  padding: 16px 0 8px;
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.topbar { padding: 18px 0 10px; }
.greeting-kicker {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.greeting-name {
  font-family: var(--font-disp);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 3px;
  color: var(--ink);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-weight: 600; font-size: 15px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s var(--easing);
}
.avatar:hover { transform: scale(1.05); }
.avatar.has-img { background: transparent; }
.avatar .avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.avatar svg { stroke: currentColor; }

/* ---------- TABS (top, segmented) ---------- */
.tabs-top {
  display: none; /* hidden on mobile — bottom tab bar used instead */
}

/* ---------- VIEW SWITCH ---------- */
.view { display: none; animation: viewIn 0.3s var(--easing); }
.view.active { display: block; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- HERO (huge thin number) ---------- */
.hero {
  margin: 16px 0 18px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}
.hero-kicker {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: 0;
  font-weight: 500;
}
.hero-number {
  font-family: var(--font-disp);
  font-size: clamp(44px, 13vw, 58px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero-number .currency {
  font-size: 0.42em;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 5px;
  letter-spacing: -0.02em;
}
.hero-meta {
  display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap;
}
.hero-pill {
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px; font-weight: 600;
}
.hero-meta-sub {
  font-size: 12.5px; color: var(--ink-3);
}

/* ---------- PAGE TITLES ---------- */
.page-title {
  font-family: var(--font-disp);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  padding-top: 6px;
}
.page-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ---------- SECTION HEAD ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 26px 4px 14px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--ink);
}
.section-head .link {
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.section-kicker {
  font-size: 12px; font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 6px 8px;
}
.modal-body .section-kicker {
  padding-top: 22px;
}
.modal-body .section-kicker:first-child {
  padding-top: 8px;
}

/* ---------- LIST CARD (white box with hairs) ---------- */
.list-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px;
  cursor: pointer;
  transition: background 0.12s var(--easing);
  position: relative;
}
.list-row + .list-row { border-top: 0.5px solid var(--hair); }
.list-row:hover { background: var(--surface-tint); }
.list-row:active { background: var(--hair); }

/* ---------- BRAND BADGE ---------- */
.badge {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700; font-size: 15px;
  letter-spacing: -0.4px;
  flex-shrink: 0;
  font-family: var(--font-disp);
  transition: transform 0.18s var(--bounce);
}
/* Pastelowy chip (kategorie/własne) — soft tło + kolorowa ikona, jak healthcare */
.badge.soft { color: inherit; }
.badge.brand { color: #fff; }
.badge.sm { width: 34px; height: 34px; font-size: 12px; border-radius: 11px; }
.badge.md { width: 40px; height: 40px; font-size: 14px; border-radius: 13px; }
.badge.lg { width: 58px; height: 58px; font-size: 22px; border-radius: 18px; }
.badge.xl { width: 74px; height: 74px; font-size: 28px; border-radius: 22px; }
.badge svg { display: block; stroke: currentColor; }

/* ---------- EMPTY STATES with mascot ---------- */
.empty-with-mascot {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 30px 24px 40px;
}
.empty-mascot {
  width: 170px;
  height: 140px;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 4px;
  filter: drop-shadow(0 8px 24px rgba(201, 100, 66, 0.18));
  animation: mascotFloat 4s ease-in-out infinite;
}
.empty-with-mascot h3 {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; margin: 4px 0 8px;
  color: var(--ink);
}
.empty-with-mascot p {
  color: var(--ink-2); max-width: 320px;
  margin: 0 auto 20px;
  line-height: 1.5; font-size: 14.5px;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- PAGE HEADER WITH AVATAR (Lista/Nawyki/Kalendarz/Finanse) ---------- */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 4px;
}
.page-header-titles {
  flex: 1; min-width: 0;
}
.page-header-row .page-title { margin: 0; }
.page-header-row .page-sub {
  font-size: 13.5px; color: var(--ink-3);
  margin-top: 4px;
}
.page-header-row .avatar {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- DAY MODAL — quick add inline ---------- */
.day-quick-add {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-top: 0.5px solid var(--hair);
  background: var(--surface-tint);
}
.day-quick-add input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: all 0.18s;
}
.day-quick-add input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.day-quick-add input::placeholder { color: var(--ink-3); }
.btn-quick-add {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  font-size: 22px; font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(201,100,66,0.35);
  transition: all 0.15s var(--easing);
}
.btn-quick-add:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 18px rgba(201,100,66,0.45);
}
.btn-quick-add:active { transform: scale(0.95); }

/* ---------- KALENDARZ — quick action buttons ---------- */
.cal-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.cal-quick-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: 14px;
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s var(--easing);
}
.cal-quick-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 6px 14px rgba(201,100,66,0.1);
}
.cal-quick-btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(201,100,66,0.3);
}
.cal-quick-btn.primary:hover {
  color: #fff;
  box-shadow: 0 8px 18px rgba(201,100,66,0.4);
}
.cal-quick-btn svg { stroke: currentColor; }

/* ---------- HABIT PROGRESS BAR (na karcie i w detail) ---------- */
.habit-card { display: block; }
.habit-card-top {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 12px;
}
.habit-card-top .info { flex: 1; min-width: 0; }
.habit-progress-row {
  margin-top: 4px;
}
.habit-progress-bar {
  width: 100%; height: 6px;
  background: var(--surface-tint);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.habit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-radius: 999px;
  transition: width 0.5s var(--easing);
  box-shadow: 0 0 8px rgba(201,100,66,0.3);
}
.habit-progress-meta {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.habit-progress-meta strong { color: var(--accent); }

/* Detail page progress (more prominent) */
.habit-detail-progress {
  margin-top: 18px;
  padding: 0 24px;
}
.habit-detail-progress-bar {
  width: 100%; height: 8px;
  background: var(--surface-tint);
  border-radius: 999px;
  overflow: hidden;
}
.habit-detail-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-radius: 999px;
  transition: width 0.6s var(--easing);
}
.habit-detail-progress-meta {
  margin-top: 8px;
  font-size: 12.5px; color: var(--ink-2);
  text-align: center;
}

/* ---------- SHARE BUTTON ---------- */
.share-row {
  padding: 14px 0 6px;
  text-align: center;
}
.btn-share {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201,100,66,0.3);
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing);
}
.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,100,66,0.4);
}
.btn-share:active { transform: scale(0.97); }
.btn-share svg { stroke: currentColor; }

/* Goal card share icon next to "edytuj" */
.goal-actions {
  display: flex; align-items: center; gap: 12px;
}
.icon-btn-sm {
  width: 28px; height: 28px;
  background: var(--surface-tint);
  border: none;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  padding: 0;
  transition: all 0.18s var(--easing);
}
.icon-btn-sm:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(1.1);
}
.icon-btn-sm svg { stroke: currentColor; }

/* ---------- TU pill (Towarzystwo Ubezpieczeniowe) ---------- */
.tu-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  color: #fff;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.2px;
}

/* ========================================================================
   GLOBAL SEARCH — full redesign 2026-05-26
   Inspired by Linear command palette / Raycast / Vercel cmd-k.
   Mobile: bottom-sheet with drag handle. Desktop: centered floating card.
   ======================================================================== */
.search-trigger {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: all 0.18s var(--easing);
  flex-shrink: 0;
  padding: 0;
}
.search-trigger:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}
.topbar-actions, .page-header-actions {
  display: flex; align-items: center; gap: 10px;
}

/* --- Backdrop --- */
.search-modal-backdrop {
  background: rgba(28, 27, 25, 0.45) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  backdrop-filter: blur(12px) !important;
}
.search-modal-backdrop.open {
  align-items: flex-start;
  padding-top: 10vh;
}

/* --- Modal card --- */
.search-modal {
  max-width: 600px;
  width: calc(100% - 32px);
  max-height: 72vh;
  display: flex; flex-direction: column;
  padding: 0;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.28),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: searchPop 0.28s var(--easing);
  border: 0.5px solid var(--hair);
}
@keyframes searchPop {
  from { transform: translateY(-18px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.search-drag-handle { display: none; }

/* --- Input bar --- */
.search-input-wrap {
  display: flex; align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 0.5px solid var(--hair);
  background: var(--surface);
  position: sticky; top: 0; z-index: 2;
}
.search-icon {
  width: 22px; height: 22px;
  color: var(--ink-3);
  flex-shrink: 0;
  stroke-width: 2;
}
.search-input-wrap input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  color: var(--ink);
  letter-spacing: -0.2px;
  padding: 2px 0;
}
.search-input-wrap input::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}

.search-clear-btn, .search-close-btn {
  display: none;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-tint);
  border: none;
  cursor: pointer;
  color: var(--ink-2);
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s;
}
.search-clear-btn:hover, .search-close-btn:hover {
  background: var(--hair-strong);
  color: var(--ink);
  transform: scale(1.08);
}
.search-clear-btn svg, .search-close-btn svg {
  width: 14px; height: 14px;
}

.search-kbd {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-tint);
  border: 1px solid var(--hair-strong);
  border-radius: 6px;
  color: var(--ink-3);
  font-family: inherit;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 1px 0 var(--hair-strong);
}

/* --- Results --- */
.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
  -webkit-overflow-scrolling: touch;
  scroll-padding: 50px;
}
.search-section-h {
  padding: 16px 14px 6px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}
.search-section-h .count {
  padding: 2px 7px;
  background: var(--surface-tint);
  color: var(--ink-2);
  border-radius: var(--r-full);
  font-size: 10.5px;
  letter-spacing: 0.3px;
}

.search-result {
  display: flex; align-items: center;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.12s, transform 0.12s;
  margin: 0 0 1px;
}
.search-result:hover { background: var(--surface-tint); }
.search-result.active {
  background: var(--accent-soft);
}
.search-result.active .arrow-hint {
  opacity: 1;
  transform: translateX(0);
}
.search-result .info { flex: 1; min-width: 0; }
.search-result .title {
  font-size: 15px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.search-result .title mark {
  background: rgba(255, 224, 130, 0.55);
  color: inherit;
  padding: 1px 2px;
  border-radius: 3px;
  font-weight: 700;
}
.search-result .meta {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; gap: 6px; align-items: center;
}
.search-result .meta .dot { color: var(--ink-3); opacity: 0.5; }
.search-result .amount-hint {
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  font-feature-settings: 'tnum';
  flex-shrink: 0;
}
.search-result .kind-tag {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  background: var(--surface-tint);
  color: var(--ink-3);
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.search-result.active .kind-tag {
  background: var(--accent);
  color: #fff;
}
.search-result .arrow-hint {
  width: 16px; height: 16px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.18s var(--easing);
  flex-shrink: 0;
}

.search-emoji-badge {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 19px;
  flex-shrink: 0;
}

/* --- Empty state --- */
.search-empty {
  padding: 32px 24px 24px;
  text-align: center;
  color: var(--ink-2);
}
.search-empty .empty-mascot-small {
  width: 96px; height: 96px;
  object-fit: cover;
  object-position: center top;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(201, 100, 66, 0.18));
}
.search-empty p {
  margin: 0 0 20px;
  font-size: 14.5px; line-height: 1.55;
  max-width: 380px;
  margin-left: auto; margin-right: auto;
  color: var(--ink-2);
}
.search-hint-label {
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.search-hint-chips {
  display: flex; flex-wrap: wrap;
  gap: 8px; justify-content: center;
}
.search-hint-chip {
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s var(--easing);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.search-hint-chip:hover, .search-hint-chip:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 100, 66, 0.25);
}

/* Recent searches */
.search-recent-row {
  display: flex; align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.12s;
}
.search-recent-row:hover { background: var(--surface-tint); }
.search-recent-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink-3);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.search-recent-icon svg { width: 14px; height: 14px; }
.search-recent-text {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
}
.search-recent-remove {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  opacity: 0;
  transition: all 0.15s;
}
.search-recent-row:hover .search-recent-remove { opacity: 1; }
.search-recent-remove:hover { background: var(--hair-strong); color: var(--ink); }
.search-recent-remove svg { width: 12px; height: 12px; }

/* --- Footer with hints --- */
.search-footer {
  display: flex; gap: 18px; justify-content: center;
  padding: 11px 18px;
  font-size: 11.5px; color: var(--ink-3);
  border-top: 0.5px solid var(--hair);
  background: linear-gradient(to bottom, var(--surface-tint), var(--surface-tint));
  flex-wrap: wrap;
}
.search-footer span { display: inline-flex; align-items: center; gap: 4px; }
.search-footer kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 10.5px; font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  border-radius: 5px;
  color: var(--ink-2);
  font-family: inherit;
  letter-spacing: 0.4px;
  box-shadow: 0 1px 0 var(--hair-strong);
  margin-right: 4px;
}

/* --- Mobile bottom-sheet --- */
@media (max-width: 540px) {
  .search-modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .search-modal-backdrop.open { padding-top: 0 !important; }
  .search-modal {
    max-height: 92vh;
    max-width: 100%;
    width: 100%;
    border-radius: 26px 26px 0 0;
    border: none;
    box-shadow:
      0 -12px 48px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: searchSlideUp 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  }
  @keyframes searchSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .search-drag-handle {
    display: block;
    width: 42px; height: 5px;
    background: var(--hair-strong);
    border-radius: 3px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .search-input-wrap {
    padding: 14px 18px 14px 20px;
    gap: 14px;
    border-bottom: 0.5px solid var(--hair);
  }
  .search-icon { width: 22px; height: 22px; }
  .search-input-wrap input {
    font-size: 16px; /* prevents iOS Safari zoom on focus */
  }
  .search-kbd { display: none; }
  .search-close-btn { display: grid; }
  .search-clear-btn { width: 28px; height: 28px; }
  .search-footer { display: none; }

  .search-results { padding: 6px 8px 16px; }
  .search-section-h {
    padding: 16px 14px 8px;
    font-size: 11.5px;
  }
  .search-result {
    padding: 13px 14px;
    gap: 14px;
    border-radius: 14px;
  }
  .search-result:active {
    background: var(--accent-soft);
    transform: scale(0.985);
  }
  .search-result .title { font-size: 15.5px; }
  .search-result .meta { font-size: 13px; margin-top: 4px; }
  .search-result .amount-hint { font-size: 13.5px; }
  .search-result .kind-tag {
    font-size: 10px; padding: 3px 8px;
    letter-spacing: 0.7px;
  }
  .search-emoji-badge {
    width: 42px; height: 42px;
    font-size: 20px;
    border-radius: 12px;
  }
  .search-empty {
    padding: 36px 24px 30px;
  }
  .search-empty .empty-mascot-small {
    width: 120px; height: 120px;
    margin-bottom: 18px;
  }
  .search-empty p { font-size: 15px; margin-bottom: 22px; }
  .search-hint-chip {
    padding: 9px 16px;
    font-size: 13.5px;
  }
  .search-recent-row { padding: 12px 14px; }
  .search-recent-text { font-size: 15px; }
  .search-recent-remove { opacity: 1; }
}

/* ---------- INTERACTIVE TOUR ---------- */
.tour-overlay {
  position: fixed; inset: 0;
  z-index: 9000;
  display: none;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  animation: tourFade 0.25s ease-out;
}
.tour-overlay.open { display: block; }
@keyframes tourFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.tour-spotlight {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(255, 140, 46, 0.9);
  pointer-events: none;
  transition: top 0.35s var(--easing), left 0.35s var(--easing),
              width 0.35s var(--easing), height 0.35s var(--easing);
  background: transparent;
}
.tour-tooltip {
  position: fixed;
  z-index: 9001;
  max-width: min(360px, calc(100vw - 32px));
  background: #fff;
  border-radius: 18px;
  padding: 18px 18px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: default;
  transition: top 0.35s var(--easing), left 0.35s var(--easing), opacity 0.25s;
  animation: tourPop 0.4s var(--bounce);
}
.tour-tooltip.centered {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  bottom: auto !important;
}
@keyframes tourPop {
  from { transform: scale(0.85) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.tour-tooltip.centered { animation: tourPopCentered 0.4s var(--bounce); }
@keyframes tourPopCentered {
  from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.tour-mascot {
  width: 64px; height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(201, 100, 66, 0.25));
}
.tour-content { flex: 1; min-width: 0; }
.tour-eyebrow {
  font-size: 11px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tour-content h4 {
  font-family: var(--font-disp);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
  color: var(--ink);
}
.tour-content p {
  margin: 0 0 14px;
  font-size: 14px; line-height: 1.5;
  color: var(--ink-2);
}
.tour-buttons {
  display: flex; gap: 6px; align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.tour-buttons .btn-primary {
  padding: 8px 16px;
  font-size: 14px;
}
.list-row:hover .badge { transform: scale(1.04); }

/* ---------- LIST ITEM CONTENT ---------- */
.list-row .info { flex: 1; min-width: 0; }
.list-row .name {
  font-size: 15px; font-weight: 500;
  letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--ink);
}
.list-row .meta {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 2px;
}
.list-row .meta.urgent { color: var(--accent); font-weight: 500; }
.list-row .amount {
  text-align: right;
  flex-shrink: 0;
}
.list-row .amount .num {
  font-family: var(--font-disp);
  font-size: 15px; font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.list-row .amount .cycle {
  font-size: 11px; color: var(--ink-3);
  margin-top: 2px;
}

/* ---------- ALERT / INSIGHT (terracotta soft bg) ---------- */
.insight {
  margin-top: 14px;
  padding: 14px 16px 14px 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  position: relative;
  display: flex; flex-direction: column;
  gap: 12px;
  animation: pop 0.4s var(--bounce);
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.97) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.insight.danger { background: var(--danger-soft); }
.insight.warning { background: var(--warn-soft); }
.insight.ok { background: var(--ok-soft); }
.insight-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-right: 28px;
}
.insight .ix {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.insight.danger .ix { background: var(--danger); }
.insight.warning .ix { background: var(--warn); }
.insight.ok .ix { background: var(--ok); }
.insight .txt { flex: 1; min-width: 0; }
.insight .txt .t {
  font-size: 14px; font-weight: 600;
  color: var(--accent-text); letter-spacing: -0.2px;
  line-height: 1.3;
}
.insight.danger .txt .t { color: #6E1E10; }
.insight.warning .txt .t { color: #6A4E1A; }
.insight.ok .txt .t { color: #2E4A26; }
.insight .txt .d {
  font-size: 13px;
  color: #8A4A30;
  margin-top: 3px;
  line-height: 1.4;
}
.insight.danger .txt .d { color: #8A2E1E; }
.insight.warning .txt .d { color: #80622A; }
.insight.ok .txt .d { color: #44603A; }
.insight .ix svg { stroke: currentColor; display: block; }
.insight .cta {
  align-self: flex-start;
  padding: 8px 14px;
  background: var(--accent); color: #fff;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center;
  margin-left: 48px;
  transition: transform 0.15s var(--easing);
  text-decoration: none;
}
.insight.warning .cta { background: var(--warn); }
.insight.danger .cta { background: var(--danger); }
.insight .cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201,100,66,0.3); }
.insight .x {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none;
  display: grid; place-items: center;
  color: var(--ink-3);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}
.insight .x:hover { background: rgba(0,0,0,0.12); color: var(--ink); }
.insight .x svg { stroke: currentColor; display: block; }

/* ---------- INSIGHT CARDS · dark mode contrast fix ---------- */
/* Light-mode text colours above are dark browns tuned for pale soft
   backgrounds. In dark mode the soft backgrounds also go dark, so the
   text blended in. Override with light, readable tints. */
:root[data-theme="dark"] .insight .txt .t { color: var(--accent-text); }
:root[data-theme="dark"] .insight .txt .d { color: var(--ink-2); }
:root[data-theme="dark"] .insight.warning .txt .t { color: #F2D49A; }
:root[data-theme="dark"] .insight.warning .txt .d { color: #CBB088; }
:root[data-theme="dark"] .insight.danger  .txt .t { color: #F6B7A5; }
:root[data-theme="dark"] .insight.danger  .txt .d { color: #DAA192; }
:root[data-theme="dark"] .insight.ok      .txt .t { color: #C3DFB9; }
:root[data-theme="dark"] .insight.ok      .txt .d { color: #A4C59B; }
:root[data-theme="dark"] .insight .x { background: rgba(255,255,255,0.08); color: var(--ink-2); }
:root[data-theme="dark"] .insight .x:hover { background: rgba(255,255,255,0.16); color: var(--ink); }

/* ---------- CATEGORY MINI CARDS (2-col grid) ---------- */
.cat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cat-tile {
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: transform 0.15s var(--easing);
}
.cat-tile:hover { transform: translateY(-1px); }
.cat-tile .dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-bottom: 8px;
}
.cat-tile .label { font-size: 13px; color: var(--ink-2); }
.cat-tile .val {
  font-size: 18px; font-weight: 600;
  font-family: var(--font-disp);
  letter-spacing: -0.4px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ---------- SEARCH BAR ---------- */
.search-row {
  display: flex; gap: 8px; margin: 14px 0 16px;
}
.search-box {
  flex: 1; height: 38px; border-radius: 12px;
  background: rgba(28,27,25,0.06);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  font-size: 14px;
  transition: background 0.12s var(--easing);
}
.search-box:focus-within { background: rgba(28,27,25,0.1); }
.search-box svg { color: var(--ink-3); width: 14px; height: 14px; flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  padding: 0;
}
.search-box input::placeholder { color: var(--ink-3); }

/* ---------- CHIPS (filters) ---------- */
.chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  padding: 8px 14px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--hair-strong);
  display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.18s var(--easing);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.chip:hover:not(.active) {
  background: var(--surface-tint);
  color: var(--ink);
  border-color: var(--ink-3);
}
.chip:active { transform: scale(0.97); }
.chip.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.chip.accent.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chip.accent.active {
  background: var(--accent);
}

/* ---------- QUICK ADD ---------- */
.quick-add {
  display: flex; gap: 8px;
  background: var(--surface);
  padding: 7px 7px 7px 16px;
  border-radius: var(--r-lg);
  margin-bottom: 8px;
  align-items: center;
  transition: box-shadow 0.15s var(--easing);
  box-shadow: var(--shadow-sm);
}
.quick-add:focus-within { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.quick-add svg { color: var(--ink-3); width: 18px; height: 18px; flex-shrink: 0; }
.quick-add input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 9px 0; font-size: 15px; color: var(--ink); font-family: inherit;
}
.quick-add input::placeholder { color: var(--ink-3); }
.quick-add button {
  padding: 10px 16px;
  background: var(--accent); color: #fff;
  border-radius: 13px;
  font-weight: 700; font-size: 13.5px;
  font-family: inherit;
  transition: background 0.15s var(--easing);
}
.quick-add button:hover { background: var(--accent-deep); }
.quick-add button:active { transform: scale(0.95); }

/* ---------- EMPTY STATE ---------- */
.empty {
  text-align: center;
  padding: 50px 24px 30px;
}
.empty .icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 36px;
  margin: 0 auto 18px;
  animation: float 4s ease-in-out infinite;
}
.empty-mascot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-mascot-img {
  width: 110px; height: 110px;
  object-fit: contain;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(255, 140, 46, 0.18));
}
.empty-mascot p { margin: 0; opacity: 0.7; font-size: 14px; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty h3 {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 8px;
}
.empty p {
  color: var(--ink-2); margin: 0 auto;
  max-width: 320px; line-height: 1.5;
  font-size: 14.5px;
}

/* ---------- BOTTOM TAB BAR (floating pill) ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  /* Lift above home indicator on iPhone with safe-area-inset-bottom. */
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 480px;
  height: 64px;
  border-radius: var(--r-xl);
  background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 32px rgba(45,46,51,0.12), 0 2px 8px rgba(45,46,51,0.06);
  display: flex; padding: 8px;
  z-index: 50;
  animation: tabbarIn 0.4s var(--bounce);
}
@keyframes tabbarIn {
  from { transform: translateX(-50%) translateY(80px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer;
  transition: color 0.15s var(--easing);
}
.tab:hover:not(.active) { color: var(--ink-2); }
/* Healthcare-style: aktywna ikona w wypełnionym ciemnym kółku, bez etykiety */
.tab svg {
  width: 22px; height: 22px;
  padding: 10px;
  border-radius: 50%;
  box-sizing: content-box;
  transition: background 0.22s var(--easing), color 0.22s var(--easing), transform 0.18s var(--bounce);
}
.tab.active {
  color: var(--bg);  /* ikona "biała" (= kolor tła, działa też w dark mode) */
}
.tab.active svg {
  background: var(--ink);
}
.tab:active svg { transform: scale(0.9); }
.tab .l { display: none; }  /* czysty look jak w healthcare — same ikony */
.tab-plus-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.tab-plus {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(201,100,66,0.35);
  cursor: pointer;
  transition: transform 0.18s var(--bounce), box-shadow 0.18s var(--easing);
}
.tab-plus:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 10px 22px rgba(201,100,66,0.45);
}
.tab-plus:active { transform: scale(0.95); }
.tab-plus svg { width: 22px; height: 22px; }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(28,27,25,0.5);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: none;
  align-items: flex-end; justify-content: center;
  z-index: 100;
  padding: 0;
  animation: backdropIn 0.2s var(--easing);
}
.modal-backdrop.open { display: flex; }
@media (min-width: 520px) {
  .modal-backdrop { align-items: center; padding: 24px; }
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg);
  width: 100%; max-width: 480px;
  max-height: 92vh;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalUp 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.18),
    0 -2px 8px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
@media (min-width: 520px) {
  .modal { border-radius: 24px; box-shadow: 0 24px 64px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.08); }
}
@keyframes modalUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal.closing { animation: modalDown 0.2s var(--easing) forwards; }
@keyframes modalDown { to { transform: translateY(100%); opacity: 0; } }

.modal-handle {
  width: 38px; height: 4px;
  background: var(--hair-strong);
  border-radius: 3px;
  margin: 10px auto 4px;
  transition: all 0.2s;
  opacity: 0.65;
}
.modal:hover .modal-handle, .modal:active .modal-handle {
  opacity: 1; background: var(--accent);
}

/* ========== MODAL HEAD (new) ==========
   "Anuluj" → okrągły X po lewej, tytuł centered, "Zapisz" → gradient pill po prawej */
.modal-head {
  display: flex; align-items: center;
  gap: 8px;
  padding: 12px 16px 12px;
  background: var(--bg);
  position: sticky; top: 0; z-index: 2;
  border-bottom: 0.5px solid transparent;
  transition: border-color 0.25s;
}
.modal-head h3 {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.4px;
  text-align: center;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.modal-head .text-btn {
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  flex-shrink: 0;
  transition: all 0.15s var(--easing);
}
/* "Anuluj" / "Wróć" — okrągły X button po lewej */
.modal-head .text-btn.muted,
.modal-head .text-btn:first-child {
  width: 34px; height: 34px;
  min-width: 34px;
  border-radius: 50%;
  background: var(--surface-tint);
  color: transparent;
  text-indent: -9999px;
  overflow: hidden;
  padding: 0;
  position: relative;
  border: none;
  display: inline-block;
  vertical-align: middle;
}
.modal-head .text-btn.muted::before,
.modal-head .text-btn:first-child::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A554D' stroke-width='2.5' stroke-linecap='round'><line x1='18' y1='6' x2='6' y2='18'/><line x1='6' y1='6' x2='18' y2='18'/></svg>");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  background-position: center center;
  pointer-events: none;
}
.modal-head .text-btn.muted:hover,
.modal-head .text-btn:first-child:hover {
  background: var(--hair-strong);
  transform: scale(1.05);
}
/* "Zapisz" / "Edytuj" — gradient pill po prawej */
.modal-head .text-btn:last-child {
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  font-weight: 700;
  border-radius: var(--r-full);
  letter-spacing: 0.1px;
  box-shadow: 0 4px 12px rgba(201, 100, 66, 0.3);
}
.modal-head .text-btn:last-child:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201, 100, 66, 0.4);
}
.modal-head .text-btn:last-child:active { transform: scale(0.96); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 28px;
  -webkit-overflow-scrolling: touch;
  scroll-padding: 80px;
}
.modal-foot {
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px;
  background: linear-gradient(to top, var(--bg) 75%, rgba(255,255,255,0));
  position: sticky; bottom: 0;
  border-top: 0.5px solid var(--hair);
}
.modal-foot .btn { flex: 1; }
.modal-foot .btn-primary {
  font-size: 15px; font-weight: 700;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(201, 100, 66, 0.32);
}

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--ink-2);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.12s;
}
.icon-btn:hover { background: rgba(28,27,25,0.06); color: var(--ink); }

/* ---------- BUTTONS ---------- */
.btn {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 16px rgba(201,100,66,0.3);
}
.btn-primary:hover { background: var(--accent-deep); box-shadow: 0 10px 22px rgba(201,100,66,0.4); }
.btn-ghost {
  background: var(--surface); color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-tint); }
.btn-danger {
  background: var(--surface);
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); }
.btn-success {
  background: var(--ok); color: #fff;
}

/* ---------- FORM ---------- */
.form-card {
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--hair);
  transition: all 0.2s var(--easing);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.form-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 4px 14px rgba(201,100,66,0.08);
}
.form-field {
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--hair);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
}
.form-field:last-child { border-bottom: none; }
.form-field .label {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
  letter-spacing: -0.1px;
  text-transform: none;
  flex-shrink: 0;
  width: 92px;
  margin-bottom: 0;
  margin-right: 0;
}
.form-field input, .form-field textarea, .form-field select {
  flex: 1;
  text-align: right;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.form-field input::placeholder, .form-field textarea::placeholder {
  color: var(--ink-3);
  font-weight: 400;
}
.form-field textarea {
  text-align: left;
  font-weight: 500;
  min-height: 60px;
  resize: vertical;
}
.form-field .amount-input {
  flex: 1;
  display: flex; align-items: baseline; justify-content: flex-end;
  gap: 4px;
}
.form-field .amount-input input {
  text-align: right;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  color: var(--ink);
  padding: 0;
}
.form-field .amount-input .suffix {
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
/* When form-field needs vertical layout (e.g. textarea) — override flex */
.form-field.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.form-field.stacked .label {
  width: auto;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-field.stacked input,
.form-field.stacked textarea {
  text-align: left;
}
/* Date/time inputs — leveled to the right but with display-friendly font */
.form-field input[type="date"],
.form-field input[type="time"] {
  text-align: right;
  font-family: var(--font-disp);
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}
/* Single-input form-field bez label (np. data, notatki) — input zajmuje całą szerokość */
.form-field:not(:has(.label)) input,
.form-field:not(:has(.label)) textarea,
.form-field:not(:has(.label)) .amount-input {
  text-align: left;
}
.form-field:not(:has(.label)) input[type="date"] {
  text-align: left;
}
.form-field:not(:has(.label)) textarea {
  width: 100%;
}
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  border: none; outline: none; background: transparent;
  font-size: 17px;
  color: var(--ink);
  padding: 0;
  font-family: inherit;
}
.form-field input::placeholder, .form-field textarea::placeholder {
  color: var(--ink-3);
}
.form-field textarea { resize: vertical; min-height: 60px; font-size: 15px; }
.form-field .amount-input {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.5px;
}
.form-field .amount-input input {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.5px;
  width: auto; flex: 1;
}
.form-field .amount-input .suffix {
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 500;
}
.help {
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 10px 4px 0;
}
.cat-grid-form {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 380px) { .cat-grid-form { grid-template-columns: repeat(3, 1fr); } }
.cat-chip {
  padding: 12px 6px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hair);
  font-size: 11.5px; font-weight: 600;
  color: var(--ink-2);
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.cat-chip:hover:not(.active) {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
.cat-chip .cat-icon {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.cat-chip .cat-icon svg { stroke: currentColor; }
.cat-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.cat-chip.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.cat-chip.active .cat-icon {
  background: rgba(255,255,255,0.22) !important;
}
.cat-chip-label {
  line-height: 1.15;
  font-size: 11.5px;
}
/* "+ Nowa" tile */
.cat-chip-add {
  border-style: dashed;
  border-color: var(--hair-strong);
  color: var(--ink-3);
}
.cat-chip-add .cat-icon {
  background: var(--surface-tint) !important;
  color: var(--ink-3);
}
.cat-chip-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cat-chip-add:hover .cat-icon { background: var(--accent-soft) !important; color: var(--accent); }
.category-card-add { border-style: dashed !important; }

/* ======================================================================
   KREATOR KATEGORII (category wizard)
   ====================================================================== */
.cat-wiz-steps {
  display: flex; gap: 7px; justify-content: center;
  padding: 4px 0 12px;
}
.cat-wiz-dot {
  width: 28px; height: 5px; border-radius: 3px;
  background: var(--hair-strong);
  transition: all 0.25s var(--easing);
}
.cat-wiz-dot.active { background: var(--accent); width: 36px; }
.cat-wiz-dot.done { background: var(--accent); opacity: 0.45; }

.cat-wiz-icon-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 4px 0;
}
@media (max-width: 380px) { .cat-wiz-icon-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-wiz-icon {
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--surface);
  border: 1.5px solid var(--hair);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.cat-wiz-icon:hover { border-color: var(--accent); transform: translateY(-1px); }
.cat-wiz-icon svg { stroke: currentColor; }

.cat-wiz-color-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  padding: 8px 0;
}
@media (max-width: 380px) { .cat-wiz-color-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-wiz-color {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 2px 6px rgba(45,46,51,0.12);
  transition: transform 0.15s var(--easing);
}
.cat-wiz-color:hover { transform: scale(1.12); }
.cat-wiz-color.active { transform: scale(1.1); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px currentColor; }
.cat-wiz-color svg { stroke: #fff; }

.cat-wiz-preview {
  padding: 16px 20px 4px;
  text-align: center;
}
.cat-wiz-preview-label {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.cat-wiz-preview-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center; gap: 10px;
  padding: 10px 18px 10px 12px !important;
  border-radius: var(--r-full) !important;
  color: #fff !important;
  width: auto !important;
}
.cat-wiz-preview-chip .cat-chip-label { font-size: 15px !important; }

/* ---------- TEMPLATES PICKER ---------- */
.template-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  margin-bottom: 4px;
  transition: all 0.15s var(--easing);
}
.template-row:hover {
  background: var(--accent-soft);
  transform: translateX(2px);
}
.template-row .title { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; }
.template-row .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.template-row .chevron { color: var(--ink-3); font-size: 18px; }
.template-row.custom {
  background: var(--surface);
  border: 1.5px dashed var(--accent);
  margin-bottom: 14px;
}
.template-row.custom:hover { background: var(--accent-soft); }

/* ---------- DETAIL ---------- */
.detail-hero {
  text-align: center;
  padding: 24px 0 28px;
}
.detail-hero h2 {
  font-family: var(--font-disp);
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.6px;
  margin: 16px 0 4px;
}
.detail-hero .sub {
  font-size: 13px; color: var(--ink-3); margin-top: 4px;
}
.detail-hero .amount {
  margin-top: 26px;
  font-family: var(--font-disp);
  font-size: 56px; font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.detail-hero .amount .cur {
  font-size: 22px; color: var(--ink-2);
  margin-left: 2px;
}
.detail-hero .amount-sub {
  font-size: 13px; color: var(--ink-3); margin-top: 4px;
}

.next-payment {
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.next-payment .k { font-size: 12px; color: var(--accent-text); }
.next-payment .v { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 2px; }
.next-payment .pill {
  padding: 6px 12px; border-radius: var(--r-full);
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 600;
}

.info-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px;
}
.info-row + .info-row { border-top: 0.5px solid var(--hair); }
.info-row .k { font-size: 14px; color: var(--ink-2); }
.info-row .v {
  font-size: 14px; color: var(--ink); font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.snooze-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 4px;
}

/* ---------- STATS ---------- */
.stats-period {
  display: flex; gap: 6px; margin-top: 12px;
}
.donut-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 24px 20px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.donut-wrap-card {
  display: flex; align-items: center; gap: 22px;
}
.donut-svg { width: 110px; height: 110px; position: relative; flex-shrink: 0; }
.donut-svg svg { width: 110px; height: 110px; transform: rotate(-90deg); }
.donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.donut-center .l { font-size: 10px; color: var(--ink-3); letter-spacing: 0.4px; text-transform: uppercase; font-weight: 600; }
.donut-center .v { font-family: var(--font-disp); font-size: 22px; font-weight: 600; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }
.donut-center .u { font-size: 10px; color: var(--ink-3); }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend .l { flex: 1; color: var(--ink-2); }
.donut-legend .p { font-weight: 600; font-family: var(--font-disp); color: var(--ink); font-variant-numeric: tabular-nums; }

.trend-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.trend-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.trend-card .head .l { font-size: 13px; color: var(--ink-3); }
.trend-card .head .r { font-size: 11px; color: var(--ink-3); }
.trend-card .big {
  font-family: var(--font-disp);
  font-size: 28px; font-weight: 600; letter-spacing: -0.6px;
  margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
}
.bars {
  display: flex; align-items: flex-end; gap: 10px;
  height: 110px;
}
.bars .bar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0;
}
.bars .bar {
  width: 100%; border-radius: 6px;
  animation: barRise 0.6s var(--easing);
  transform-origin: bottom;
}
@keyframes barRise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.bars .bar-label { font-size: 10px; color: var(--ink-3); }

/* ---------- SETTINGS ---------- */
.account-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 22px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}
.account-card .av-wrap {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.account-card .av {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-weight: 600; font-size: 22px;
  font-family: var(--font-disp);
  overflow: hidden;
  transition: transform 0.15s var(--easing);
}
.account-card .av-wrap:hover .av { transform: scale(1.04); }
.account-card .av.has-img { background: transparent; }
.account-card .av .av-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.account-card .av-edit {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 0.15s var(--easing);
}
.account-card .av-edit:hover { transform: scale(1.1); }
.account-card .av-edit svg { display: block; }
.avatar-actions {
  display: flex;
  justify-content: flex-end;
  margin: -12px 0 18px;
  padding: 0 4px;
}
.account-card .name { font-size: 16px; font-weight: 600; letter-spacing: -0.3px; }
.account-card .email { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.account-card .pro {
  padding: 5px 10px; border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
}

.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.set-row + .set-row { border-top: 0.5px solid var(--hair); }
.set-row:hover { background: var(--surface-tint); }
.set-row .si {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.set-row .si svg { display: block; stroke: currentColor; }
.account-card .pro svg { vertical-align: -1px; margin-right: 2px; stroke: currentColor; }
.set-row .si.green { background: var(--ok); }
.set-row .si.blue { background: var(--cat-car); }
.set-row .si.purple { background: var(--cat-fin); }
.set-row .si.gold { background: var(--cat-doc); }
.set-row .si.brown { background: var(--cat-health); }
.set-row .si.dark { background: var(--ink); }
.set-row .label { flex: 1; font-size: 14.5px; font-weight: 500; }
.set-row .detail { font-size: 13px; color: var(--ink-3); }
.set-row .arrow { color: var(--ink-3); width: 7px; height: 12px; }
.set-row.danger .label { color: var(--danger); }
.set-row.danger .si { background: var(--danger); }

/* ---------- CSV DETECTIVE ---------- */
.csv-zone {
  border: 2px dashed var(--hair-strong);
  border-radius: var(--r-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  background: var(--surface);
}
.csv-zone:hover, .csv-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.csv-zone .emoji { font-size: 42px; margin-bottom: 10px; }
.csv-zone .title { font-weight: 600; font-size: 15px; margin-bottom: 4px; letter-spacing: -0.2px; }
.csv-zone .sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.csv-results { margin-top: 18px; }
.csv-finding {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--r);
  margin-bottom: 6px;
  cursor: pointer;
}
.csv-finding .info { flex: 1; }
.csv-finding .info .t { font-weight: 600; font-size: 14px; letter-spacing: -0.2px; }
.csv-finding .info .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.csv-finding input[type="checkbox"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent);
}

/* ---------- TOAST ---------- */
.toast-wrap {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-width: calc(100% - 32px);
}
.toast {
  background: var(--surface); color: var(--ink);
  padding: 11px 16px 11px 11px;
  border-radius: 16px;
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.2px;
  box-shadow: var(--shadow-lg);
  border: 0.5px solid var(--hair);
  animation: toastIn 0.42s var(--bounce);
  display: flex; align-items: center; gap: 11px;
  pointer-events: auto;
  max-width: calc(100vw - 28px);
}
.toast-ic {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--surface-tint);
  color: var(--ink-2);
}
.toast-ic svg { stroke: currentColor; display: block; }
.toast-txt { line-height: 1.35; }
.toast.success .toast-ic { background: var(--ok-soft); color: var(--ok); }
.toast.danger  .toast-ic { background: var(--danger-soft); color: var(--danger); }
.toast.info    .toast-ic { background: var(--accent-soft); color: var(--accent); }
.toast.fade-out { animation: toastOut 0.3s var(--easing) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(16px) scale(0.94); } }

/* ---------- ONBOARDING ---------- */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  color: var(--ink);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.onboarding-overlay::before,
.onboarding-overlay::after {
  content: ''; position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
}
.onboarding-overlay::before {
  width: 460px; height: 460px;
  background: #FFB366;
  top: -120px; left: -120px;
  animation: orbDrift 20s ease-in-out infinite;
}
.onboarding-overlay::after {
  width: 380px; height: 380px;
  background: var(--accent);
  bottom: -90px; right: -80px;
  animation: orbDrift 24s ease-in-out -7s infinite reverse;
}
.onboarding-overlay.open { display: flex; animation: backdropIn 0.4s var(--easing); }
/* ======================================================================
   ONBOARDING SLIDES (single-slide swap, no sliding container)
   ====================================================================== */
.onboarding-slides {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px;
}
.onboarding-slide {
  width: 100%;
  max-width: 440px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 8px 8px 24px;
  --slide-accent: var(--accent);
}
.onboarding-slide.enter {
  animation: slideContentIn 0.45s var(--easing) both;
}
.onboarding-slide.enter .onboarding-mascot {
  animation: czuwekBounce 0.65s var(--bounce);
}
.onboarding-slide.enter .onboarding-features li {
  animation: featureRowIn 0.4s var(--easing) backwards;
}
.onboarding-slide.enter .onboarding-features li:nth-child(1) { animation-delay: 0.20s; }
.onboarding-slide.enter .onboarding-features li:nth-child(2) { animation-delay: 0.30s; }
.onboarding-slide.enter .onboarding-features li:nth-child(3) { animation-delay: 0.40s; }
.onboarding-slide.enter .onboarding-features li:nth-child(4) { animation-delay: 0.50s; }
@keyframes slideContentIn {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes featureRowIn {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Eyebrow label (small accent above title) */
.onboarding-slide-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--slide-accent);
  background: color-mix(in srgb, var(--slide-accent) 12%, transparent);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.onboarding-slide-eyebrow .czuwek-wordmark { font-size: 14px; }

/* Mascot wrapper with floating circle backdrop
   IMPORTANT: wrap is larger than the mascot so ears never get clipped by overflow.
   Sticker source has ears reaching top edges so we add 30px padding above. */
.onboarding-mascot-wrap {
  position: relative;
  width: 260px; height: 240px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  overflow: visible;
}
.onboarding-mascot-wrap::before {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--slide-accent) 22%, transparent) 0%, transparent 70%);
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}
.onboarding-mascot {
  position: relative; z-index: 1;
  width: 220px;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 14px 28px color-mix(in srgb, var(--slide-accent) 40%, transparent));
  animation: czuwekFloat 3.2s ease-in-out infinite;
}

/* Plain styled "Czuwek" used inline in onboarding body (consistent, no font/animation issues) */
.ob-czuwek {
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.ob-czuwek::after {
  content: '';
}

/* Canonical Czuwek logo (squirrel + wordmark, one source of truth) */
.czuwek-logo { display: block; max-width: 100%; }

/* Title + body */
.onboarding-title {
  font-family: var(--font-disp);
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--ink);
}
.onboarding-body {
  font-size: 16px;
  margin: 0 0 22px;
  color: var(--ink-2);
  line-height: 1.5;
  max-width: 380px;
}

/* Feature list with icons */
.onboarding-features {
  list-style: none;
  margin: 0 0 18px; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
  max-width: 380px;
}
.onboarding-features li {
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid color-mix(in srgb, var(--slide-accent) 18%, transparent);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(8px);
}
.onboarding-feature-icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--slide-accent) 14%, transparent);
  display: grid; place-items: center;
  color: var(--slide-accent);
}
.onboarding-feature-icon .lc-icon {
  width: 20px; height: 20px;
  stroke-width: 2.2;
}

/* Warning badge (for "Mandat 7800 zł" etc.) */
.onboarding-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #FFE7C9 0%, #FFC889 100%);
  border: 1.5px solid #FF9233;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #8A4500;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(255, 140, 46, 0.25);
}
.onboarding-badge .lc-icon { width: 16px; height: 16px; stroke-width: 2.4; }

/* ======================================================================
   CZUWEK WORDMARK COMPONENT (reusable inline logotype)
   ====================================================================== */
.czuwek-wordmark {
  display: inline-flex;
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -1px;
  color: #2A2A2A;
  text-transform: lowercase;
  vertical-align: baseline;
  line-height: 1;
}
.czuwek-wordmark > span {
  display: inline-block;
}
.czuwek-wordmark .accent {
  color: var(--accent);
}
.czuwek-wordmark.animated > span {
  opacity: 0;
  transform: translateY(8px);
  animation: wordmarkLetterIn 0.45s var(--bounce) forwards;
}
.czuwek-wordmark.animated > span:nth-child(1) { animation-delay: 0.00s; }
.czuwek-wordmark.animated > span:nth-child(2) { animation-delay: 0.06s; }
.czuwek-wordmark.animated > span:nth-child(3) { animation-delay: 0.12s; }
.czuwek-wordmark.animated > span:nth-child(4) { animation-delay: 0.18s; }
.czuwek-wordmark.animated > span:nth-child(5) { animation-delay: 0.24s; }
.czuwek-wordmark.animated > span:nth-child(6) { animation-delay: 0.30s; }
@keyframes wordmarkLetterIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.7); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Continuous gentle wave (subtle, runs every 6s) */
.czuwek-wordmark.wave > span {
  animation: wordmarkWave 3s ease-in-out infinite;
}
.czuwek-wordmark.wave > span:nth-child(1) { animation-delay: 0.0s; }
.czuwek-wordmark.wave > span:nth-child(2) { animation-delay: 0.1s; }
.czuwek-wordmark.wave > span:nth-child(3) { animation-delay: 0.2s; }
.czuwek-wordmark.wave > span:nth-child(4) { animation-delay: 0.3s; }
.czuwek-wordmark.wave > span:nth-child(5) { animation-delay: 0.4s; }
.czuwek-wordmark.wave > span:nth-child(6) { animation-delay: 0.5s; }
@keyframes wordmarkWave {
  0%, 90%, 100% { transform: translateY(0); }
  10%, 20%      { transform: translateY(-3px); }
}

/* Wordmark in onboarding body text (light bg) - use standard colors */
.onboarding-overlay .czuwek-wordmark { color: var(--ink); }
.onboarding-overlay .czuwek-wordmark .accent { color: var(--accent); }

/* Lucide icon base */
.lc-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
/* Legacy h2/p rules superseded by .onboarding-title / .onboarding-body */
.onboarding-foot {
  padding: 18px 24px 28px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  position: relative;
  z-index: 5;
}
.onboarding-dots {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 18px;
}
.onboarding-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(140, 70, 20, 0.2);
  transition: all 0.3s var(--easing);
}
.onboarding-dots span.past {
  background: color-mix(in srgb, var(--accent) 50%, transparent);
}
.onboarding-dots span.active {
  background: var(--accent); width: 28px; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(255, 140, 46, 0.45);
}
.onboarding-btn {
  display: block; width: 100%;
  padding: 16px;
  background: var(--accent); color: #fff;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 16px;
  letter-spacing: -0.2px;
  box-shadow: 0 6px 16px rgba(201,100,66,0.3);
  transition: all 0.15s var(--easing);
}
.onboarding-btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.onboarding-btn:active { transform: translateY(0) scale(0.98); }
.onboarding-skip {
  display: block; margin: 14px auto 0;
  font-size: 14px; color: var(--ink-3);
  cursor: pointer;
}

/* ---------- INSTALL BANNER ---------- */
.install-banner {
  position: fixed; bottom: 96px; left: 16px; right: 16px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: none;
  align-items: center; gap: 12px;
  box-shadow: 0 12px 30px rgba(28,27,25,0.16);
  z-index: 25;
  animation: bannerUp 0.4s var(--bounce);
  max-width: 480px;
  margin: 0 auto;
}
.install-banner.open { display: flex; }
@keyframes bannerUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-banner .ix {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 18px;
}
.install-banner .t-text { flex: 1; }
.install-banner .t-text .t { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }
.install-banner .t-text .s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.install-banner button.btn {
  padding: 8px 14px; font-size: 13px; border-radius: 10px;
}

/* ---------- CONFETTI ---------- */
.confetti-canvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 250;
}

/* ---------- CALENDAR (grid view) ---------- */
.cal-grid-month {
  margin-top: 4px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  box-shadow: var(--shadow);
}
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin-bottom: 6px;
}
.cal-weekdays div {
  text-align: center;
  font-size: 11px; color: var(--ink-3);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.cal-cells {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1 / 1.05;
  border-radius: 10px;
  padding: 6px;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
}
.cal-cell:hover { background: var(--surface) !important; }
.cal-cell.has-items { background: var(--surface-tint); }
.cal-cell.empty { cursor: default; opacity: 0.4; }
.cal-cell.empty:hover { background: transparent !important; }
.cal-cell.today {
  background: var(--accent) !important;
  color: #fff;
}
.cal-cell .d {
  font-size: 13px; font-weight: 500;
}
.cal-cell.today .d { font-weight: 600; }
.cal-cell .dots {
  display: flex; gap: 2px;
}
.cal-cell .dots span {
  width: 5px; height: 5px; border-radius: 50%;
}
.cal-cell.today .dots span { background: #fff !important; }

.cal-day-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.12s var(--easing);
}
.cal-day-row:hover { transform: translateY(-1px); }
.cal-day-row .date {
  width: 44px; text-align: center; flex-shrink: 0;
}
.cal-day-row .date .m {
  font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.4px;
}
.cal-day-row .date .d {
  font-size: 20px; font-weight: 600;
  font-family: var(--font-disp);
  line-height: 1.1; letter-spacing: -0.4px;
}
.cal-day-row .divider {
  width: 1px; height: 30px; background: var(--hair);
}
.cal-day-row .info { flex: 1; min-width: 0; }
.cal-day-row .info .t { font-size: 14px; font-weight: 500; letter-spacing: -0.2px; }
.cal-day-row .info .s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.cal-day-row .amt { font-size: 14px; font-weight: 600; font-family: var(--font-disp); font-variant-numeric: tabular-nums; }

.cal-month-head {
  padding-top: 6px; padding-bottom: 18px;
  display: flex; justify-content: space-between; align-items: center;
}
.cal-month-head .title {
  font-family: var(--font-disp);
  font-size: 30px; font-weight: 700; letter-spacing: -0.8px;
}
.cal-month-head .title .year {
  color: var(--ink-3); font-weight: 500;
}
.cal-month-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.cal-nav-btns { display: flex; gap: 6px; }
.cal-nav-btn {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 18px; color: var(--ink-2); font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s var(--easing);
}
.cal-nav-btn:hover { background: var(--accent-soft); color: var(--accent); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 380px) {
  .container { padding: 0 18px; }
  .hero-number { font-size: 44px; }
  .page-title { font-size: 26px; }
}

/* Accessibility: focus styles */
button:focus-visible, .tab:focus-visible, .chip:focus-visible, .cat-chip:focus-visible, .template-row:focus-visible, .list-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ======================================================================
   HABITS / UZALEŻNIENIA
   ====================================================================== */
.habit-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing);
  display: flex; align-items: center; gap: 14px;
  animation: pop 0.35s var(--bounce);
  box-shadow: var(--shadow);
}
.habit-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.habit-emoji {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  font-size: 28px;
  flex-shrink: 0;
}
.habit-card .info { flex: 1; min-width: 0; }
.habit-card .name {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.habit-card .sub {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 3px;
}
.habit-card .streak {
  text-align: right;
  flex-shrink: 0;
}
.habit-card .streak .num {
  font-family: var(--font-disp);
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.habit-card .streak .lbl {
  font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-top: 4px; font-weight: 600;
}

/* Hero / detail */
.habit-hero {
  text-align: center;
  padding: 30px 20px 24px;
  background: var(--surface);
  border-radius: var(--r-xl);
  margin: 0 0 16px;
  position: relative;
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.habit-hero::before {
  content: ''; position: absolute; top: -60%; right: -25%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.habit-hero > * { position: relative; z-index: 1; }
.habit-hero .emoji {
  font-size: 60px; margin-bottom: 12px;
  display: inline-block;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 6px 14px rgba(45,46,51,0.12));
}
.habit-hero .name {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
  color: var(--ink);
}
.habit-hero .motiv {
  font-size: 14px;
  color: var(--ink-2);
  font-style: italic;
  margin: 6px auto 18px;
  max-width: 280px;
  line-height: 1.4;
}
.habit-hero .streak-big {
  font-family: var(--font-disp);
  font-size: 80px; font-weight: 700;
  letter-spacing: -3px;
  color: var(--accent);  /* terakota lekko — tylko liczba */
  line-height: 0.98;
  font-variant-numeric: tabular-nums;
}
.habit-hero .streak-unit {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

/* Check-in bar (today's buttons) */
.checkin-bar {
  display: flex; gap: 10px;
  margin: 16px 0 18px;
}
.checkin-btn {
  flex: 1;
  padding: 16px;
  border-radius: var(--r-lg);
  font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: all 0.15s var(--easing);
  cursor: pointer;
  letter-spacing: -0.2px;
}
.checkin-btn:hover { transform: translateY(-1px); }
.checkin-btn:active { transform: scale(0.97); }
.checkin-btn.success {
  background: var(--ok); color: #fff;
  box-shadow: 0 6px 14px rgba(93,114,86,0.3);
}
.checkin-btn.success:hover { box-shadow: 0 10px 22px rgba(93,114,86,0.4); }
.checkin-btn.fail {
  background: var(--surface); color: var(--danger);
  border: 1.5px solid var(--danger-soft);
}
.checkin-btn.fail:hover { background: var(--danger-soft); }
.checkin-btn.done {
  background: var(--ok-soft); color: var(--ok);
  border: 1.5px solid var(--ok-soft);
  cursor: default;
  font-weight: 600;
}
.checkin-btn.done:hover { transform: none; }
.checkin-btn .ico { font-size: 18px; }

/* 30-day grid (streak visualization) */
.streak-grid-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.streak-grid-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.streak-grid-card .head .t {
  font-size: 14px; font-weight: 600; letter-spacing: -0.2px;
}
.streak-grid-card .head .r {
  font-size: 12px; color: var(--ink-3);
}
.streak-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.streak-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--surface-tint);
  position: relative;
  transition: transform 0.15s var(--easing);
}
.streak-cell.done {
  background: var(--accent);
}
.streak-cell.failed {
  background: var(--danger-soft);
}
.streak-cell.today {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.streak-cell:hover {
  transform: scale(1.15);
  z-index: 1;
}
.streak-cell .tooltip {
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--ink); color: var(--bg);
  padding: 4px 8px; border-radius: 6px;
  font-size: 10px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.streak-cell:hover .tooltip { opacity: 1; }

/* Habit stats row */
.habit-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; margin-bottom: 14px;
}
.habit-stat {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.habit-stat .v {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.habit-stat .l {
  font-size: 10px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-top: 4px; font-weight: 600;
}

/* Habit form - type picker (2 large cards) */
.habit-type-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.habit-type-card {
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: 16px;
  padding: 20px 14px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--easing);
  position: relative;
}
.habit-type-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201,100,66,0.1);
}
.habit-type-card.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 28px rgba(201,100,66,0.4);
  transform: translateY(-2px);
}
.habit-type-card .e {
  font-size: 34px; margin-bottom: 8px; display: block;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}
.habit-type-card .t {
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.2px;
}
.habit-type-card .d {
  font-size: 11.5px; opacity: 0.7;
  margin-top: 3px;
  font-weight: 500;
}

/* Emoji picker (in habit form) - większe, ładniejsze */
.emoji-picker {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 10px;
  background: var(--surface);
  border-radius: 14px;
  max-height: 220px;
  overflow-y: auto;
  border: 0.5px solid var(--hair);
}
.emoji-pick {
  aspect-ratio: 1;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.emoji-pick:hover {
  background: var(--surface-tint);
  transform: scale(1.18);
}
.emoji-pick.active {
  background: linear-gradient(135deg, #FFE6C2 0%, #FFD0A0 100%);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(201,100,66,0.2);
}

/* Habit suggestion chips */
.habit-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.habit-suggestion {
  padding: 8px 12px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  display: inline-flex; align-items: center; gap: 5px;
}
.habit-suggestion:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Day modal (calendar click) */
.day-modal-head {
  text-align: center;
  padding: 20px 20px 6px;
}
.day-modal-head .weekday {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.6px;
  font-weight: 600;
}
.day-modal-head .date {
  font-family: var(--font-disp);
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 4px;
}
.day-modal-head .count {
  font-size: 12.5px; color: var(--ink-3);
  margin-top: 4px;
}
.day-modal-empty {
  text-align: center;
  padding: 24px 20px;
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

/* Calendar cells - make clickable look */
.cal-cell {
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.cal-cell:not(.empty):hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(28,27,25,0.1);
  z-index: 1;
}
.cal-cell:not(.empty):active { transform: scale(0.95); }

/* Settings: reminder time picker */
.time-picker-row {
  display: flex; align-items: center; gap: 12px;
}
.time-picker-row input[type="time"] {
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 16px;
  font-family: var(--font-disp);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  color: var(--ink);
}

/* Empty habits state */
.empty-habits {
  text-align: center; padding: 60px 24px 30px;
}
.empty-habits .icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: 36px;
  margin: 0 auto 18px;
  animation: float 4s ease-in-out infinite;
}
.empty-habits h3 {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; margin: 0 0 8px;
}
.empty-habits p {
  color: var(--ink-2); max-width: 320px;
  margin: 0 auto 20px;
  line-height: 1.5; font-size: 14.5px;
}

/* Long-press feedback for streak grid (mobile journal) */
.streak-grid-card .legend {
  display: flex; gap: 14px; margin-top: 10px;
  font-size: 11px; color: var(--ink-3);
}
.streak-grid-card .legend .item {
  display: flex; align-items: center; gap: 5px;
}
.streak-grid-card .legend .dot {
  width: 10px; height: 10px; border-radius: 3px;
}

/* ======================================================================
   FINANCE MODULE — incomes / goals / calculator / cash flow
   ====================================================================== */

/* Cash flow hero (dual hero) */
.cashflow-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.cashflow-card .row {
  display: flex; gap: 14px;
}
.cashflow-card .col {
  flex: 1; min-width: 0;
}
.cashflow-card .lbl {
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.cashflow-card .val {
  font-family: var(--font-disp);
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.6px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.cashflow-card .val.in { color: var(--ok); }
.cashflow-card .val.out { color: var(--danger); }
.cashflow-card .divider-v {
  width: 1px;
  background: var(--hair);
  margin: 4px 0;
}
.cashflow-card .saldo {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
  text-align: center;
}
.cashflow-card .saldo .l {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.cashflow-card .saldo .v {
  font-family: var(--font-disp);
  font-size: 40px; font-weight: 300;
  letter-spacing: -1.5px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.cashflow-card .saldo .v .cur {
  font-size: 17px; color: var(--ink-2);
  margin-left: 4px;
  letter-spacing: -0.4px;
}
.cashflow-card .saldo .v.positive { color: var(--ok); }
.cashflow-card .saldo .v.negative { color: var(--danger); }
.cashflow-card .saldo .v.neutral { color: var(--ink); }

/* Mini cashflow card on Dziś (compact) */
.mini-cashflow {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s var(--easing);
}
.mini-cashflow:active { transform: scale(0.99); }
.mini-cashflow .left .l {
  font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.6px;
  font-weight: 600;
}
.mini-cashflow .left .v {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.mini-cashflow .left .v.positive { color: var(--ok); }
.mini-cashflow .left .v.negative { color: var(--danger); }
.mini-cashflow .right {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 11.5px;
  color: var(--ink-3);
}
.mini-cashflow .right .in { color: var(--ok); font-weight: 600; }
.mini-cashflow .right .out { color: var(--danger); font-weight: 600; }

/* Income card */
.income-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 15px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing);
  box-shadow: var(--shadow-sm);
}
.income-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.income-emoji {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--ok-soft);
  color: var(--ok);
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.income-emoji svg { stroke: currentColor; }
.income-card .info { flex: 1; min-width: 0; }
.income-card .name {
  font-size: 14.5px; font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.income-card .meta {
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.income-card .amount {
  text-align: right;
  flex-shrink: 0;
}
.income-card .amount .num {
  font-family: var(--font-disp);
  font-size: 15px; font-weight: 700;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}
.income-card .amount .cycle {
  font-size: 11px; color: var(--ink-3);
  margin-top: 2px;
}

/* Goal card with progress bar */
.goal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing);
  box-shadow: var(--shadow);
}
.goal-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.goal-card .top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.goal-card .emoji {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}
.goal-card .name {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.3px;
  flex: 1; min-width: 0;
}
.goal-card .pct {
  font-family: var(--font-disp);
  font-size: 18px; font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.goal-progress-bar {
  height: 10px;
  background: var(--surface-tint);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}
.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #E89A6B 100%);
  border-radius: 5px;
  transition: width 0.6s var(--easing);
  animation: barRise 0.6s var(--easing);
}
.goal-progress-fill.complete {
  background: linear-gradient(90deg, var(--ok) 0%, #7FBF9A 100%);
}
.goal-card .progress-text {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--ink-3);
}
.goal-card .progress-text .current {
  font-family: var(--font-disp);
  font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.goal-card .progress-text .target {
  font-family: var(--font-disp);
  font-variant-numeric: tabular-nums;
}
.goal-card .deadline-info {
  font-size: 11px; color: var(--ink-3);
  margin-top: 6px;
  text-align: right;
  letter-spacing: 0.2px;
}
.goal-card.complete .pct { color: var(--ok); }

/* Calculator card */
.calc-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.calc-card .head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.calc-card .head .ico {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cat-fin-soft);
  color: var(--cat-fin);
  display: grid; place-items: center;
  font-size: 18px;
}
.calc-card .head h3 {
  margin: 0;
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.2px;
}

/* Calculator: scheme picker */
.calc-scheme-row {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.calc-scheme {
  padding: 8px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--hair-strong);
  background: var(--surface);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  color: var(--ink-2);
}
.calc-scheme:hover:not(.active) { background: var(--surface-tint); }
.calc-scheme.active {
  background: var(--ink);
  color: #fff;
  border-color: transparent;
}

/* Calc input + output */
.calc-input-row {
  display: flex; flex-direction: column;
  background: var(--surface-tint);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1.5px solid transparent;
  transition: border-color 0.15s var(--easing);
}
.calc-input-row:focus-within { border-color: var(--accent); }
.calc-input-row .l {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  font-weight: 600; margin-bottom: 4px;
}
.calc-input-row .input-line {
  display: flex; align-items: baseline; gap: 4px;
}
.calc-input-row input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-family: var(--font-disp);
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.calc-input-row input::placeholder { color: var(--ink-3); }
.calc-input-row .suffix {
  font-size: 14px; color: var(--ink-3);
  font-weight: 500;
}

.calc-result {
  background: linear-gradient(135deg, var(--ok-soft) 0%, transparent 100%);
  border: 1.5px solid var(--ok);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-top: 10px;
}
.calc-result .l {
  font-size: 11px; color: #44603A;
  text-transform: uppercase; letter-spacing: 0.4px;
  font-weight: 600;
}
.calc-result .v {
  font-family: var(--font-disp);
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--ok);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.calc-result .v .cur {
  font-size: 16px; color: #44603A;
  margin-left: 2px;
}
.calc-result .breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(93,114,86,0.2);
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px;
}
.calc-result .breakdown .row {
  display: flex; justify-content: space-between;
  color: var(--ink-2);
}
.calc-result .breakdown .row .k { font-weight: 500; }
.calc-result .breakdown .row .v {
  font-family: var(--font-disp);
  font-weight: 600;
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.calc-toggle-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface-tint);
  border-radius: var(--r);
  margin-top: 8px;
}
.calc-toggle-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.calc-toggle-row label {
  font-size: 13px; color: var(--ink);
  cursor: pointer;
  flex: 1;
}

/* Section action button (small + in section header) */
.section-action {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  transition: background 0.15s;
}
.section-action:hover { background: #E5C7B5; }

/* Add contribution to goal modal */
.contribute-input {
  display: flex; align-items: baseline; gap: 6px;
  background: var(--surface-tint);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.contribute-input input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-disp);
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.contribute-input .suffix {
  font-size: 16px; color: var(--ink-3);
}

/* ======================================================================
   PAYMENT METHODS — credit-card style
   ====================================================================== */
.pay-card {
  position: relative;
  border-radius: 14px;
  padding: 14px 16px;
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s var(--easing), box-shadow 0.2s var(--easing);
  min-width: 220px;
  background: linear-gradient(135deg, #4F46E5 0%, #3730A3 100%);
  box-shadow: 0 4px 12px rgba(28,27,25,0.12);
}
.pay-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(28,27,25,0.18);
}
.pay-card::before {
  content: ''; position: absolute; top: -60%; right: -30%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  pointer-events: none;
}
.pay-card::after {
  content: ''; position: absolute; bottom: -50%; left: -20%;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.pay-card .ico {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  z-index: 1;
}
.pay-card .info {
  flex: 1; min-width: 0; z-index: 1;
}
.pay-card .name {
  font-weight: 700; font-size: 14px;
  letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pay-card .num {
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.pay-card .default-badge {
  position: absolute; top: 8px; right: 10px;
  font-size: 9px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(255,255,255,0.25);
  padding: 3px 7px; border-radius: 999px;
  z-index: 1;
}
.pay-card.placeholder {
  background: var(--surface);
  color: var(--ink-3);
  border: 2px dashed var(--hair-strong);
  box-shadow: none;
}
.pay-card.placeholder::before, .pay-card.placeholder::after { display: none; }
.pay-card.placeholder .ico {
  background: var(--accent-soft);
  color: var(--accent);
}
.pay-card.placeholder:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* Horizontal scrolling row of payment cards */
.pay-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.pay-row::-webkit-scrollbar { display: none; }
.pay-row .pay-card {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Settings list version (compact, vertical) */
.pay-list-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: background 0.12s var(--easing);
}
.pay-list-card:hover { background: var(--surface-tint); }
.pay-list-card .pay-icon {
  width: 44px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 14px; color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.pay-list-card .info { flex: 1; min-width: 0; }
.pay-list-card .info .n {
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pay-list-card .info .s {
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.pay-list-card .star {
  font-size: 16px; color: var(--accent);
  margin-right: 4px;
}

/* Picker: select within form */
.pay-picker {
  margin-bottom: 16px;
}
.pay-picker .scroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.pay-picker .scroll::-webkit-scrollbar { display: none; }
.pay-picker .pay-chip {
  flex-shrink: 0;
  min-width: 60px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  scroll-snap-align: start;
}
.pay-picker .pay-chip .dot {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
  color: #fff;
}
.pay-picker .pay-chip .l {
  font-size: 11px; font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.1px;
  white-space: nowrap; max-width: 80px;
  overflow: hidden; text-overflow: ellipsis;
}
.pay-picker .pay-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pay-picker .pay-chip.active .l { color: var(--accent); font-weight: 700; }
.pay-picker .pay-chip.add {
  border-style: dashed;
  color: var(--accent);
  border-color: var(--accent);
}
.pay-picker .pay-chip.add .dot {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ======================================================================
   CUSTOM CONTROLS — checkbox, radio, toggle
   ====================================================================== */

/* iOS-style toggle switch */
.toggle {
  position: relative;
  width: 50px; height: 30px;
  background: var(--hair-strong);
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.25s var(--easing);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.toggle.on {
  background: var(--ok);
}
.toggle.on.accent { background: var(--accent); }
.toggle .knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 26px; height: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(28,27,25,0.2), 0 0 0 0.5px rgba(28,27,25,0.04);
  transition: transform 0.25s var(--bounce);
}
.toggle.on .knob {
  transform: translateX(20px);
}
.toggle:active .knob {
  width: 30px;
}
.toggle:active.on .knob {
  transform: translateX(16px);
}

/* Custom checkbox */
.cb {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.cb input {
  position: absolute;
  opacity: 0; pointer-events: none;
  width: 0; height: 0;
}
.cb .box {
  width: 22px; height: 22px;
  border: 2px solid var(--hair-strong);
  border-radius: 7px;
  background: var(--surface);
  display: grid; place-items: center;
  transition: all 0.2s var(--easing);
  flex-shrink: 0;
}
.cb:hover .box { border-color: var(--accent); }
.cb input:checked + .box {
  background: var(--accent);
  border-color: var(--accent);
}
.cb .box svg {
  width: 14px; height: 14px;
  stroke: #fff; stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.4);
  transition: all 0.25s var(--bounce);
}
.cb input:checked + .box svg {
  opacity: 1;
  transform: scale(1);
}
.cb .label {
  font-size: 14px; color: var(--ink);
  letter-spacing: -0.1px;
}
.cb input:disabled ~ .label { color: var(--ink-3); }
.cb input:disabled + .box { background: var(--surface-tint); }

/* Custom radio */
.rb {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  user-select: none;
}
.rb input { position: absolute; opacity: 0; pointer-events: none; }
.rb .circle {
  width: 22px; height: 22px;
  border: 2px solid var(--hair-strong);
  border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  transition: all 0.2s var(--easing);
  flex-shrink: 0;
}
.rb .circle::after {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.25s var(--bounce);
}
.rb:hover .circle { border-color: var(--accent); }
.rb input:checked + .circle {
  border-color: var(--accent);
}
.rb input:checked + .circle::after {
  transform: scale(1);
}

/* Stylized number stepper */
.stepper {
  display: inline-flex; align-items: center;
  background: var(--surface-tint);
  border-radius: var(--r);
  padding: 4px;
}
.stepper button {
  width: 32px; height: 32px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 18px; font-weight: 700;
  color: var(--ink);
  transition: all 0.12s;
}
.stepper button:hover { background: var(--accent-soft); color: var(--accent); }
.stepper button:active { transform: scale(0.94); }
.stepper .val {
  min-width: 40px; text-align: center;
  font-family: var(--font-disp);
  font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* Settings row with toggle (replaces simple set-row when boolean) */
.set-row.with-toggle .arrow { display: none; }
.set-row.with-toggle { cursor: default; }
.set-row.with-toggle:hover { background: transparent; }
.set-row.with-toggle .toggle { cursor: pointer; }

/* Bank/card type selection grid */
/* PM TYPE CHIPS (in payment method modal) - larger, with glyph + label stacked */
#pmTypeChips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.pm-type-chip {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 14px 10px 10px;
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  font-family: inherit;
  color: var(--ink-2);
  text-align: center;
}
.pm-type-chip:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(201,100,66,0.12);
}
.pm-type-glyph {
  font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.pm-type-chip.active .pm-type-glyph { color: #fff; }
.pm-type-glyph svg { stroke: currentColor; }
.cat-chip svg, .chip svg, .search-emoji-badge svg { stroke: currentColor; }
.cat-chip-label { line-height: 1.2; }
.pm-type-label {
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.1px;
  line-height: 1.15;
}
.pm-type-chip.active {
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(201,100,66,0.25);
  transform: translateY(-1px);
}
.pm-type-chip.active .pm-type-label { color: #fff; }

.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.bank-tile {
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: 12px;
  padding: 12px 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s var(--easing);
}
.bank-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(201,100,66,0.12);
}
.bank-tile .swatch {
  width: 100%; height: 36px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: grid; place-items: center;
  overflow: hidden;
}
.bank-tile .swatch img {
  max-width: 80%; max-height: 80%;
  object-fit: contain;
}
.bank-tile .l {
  font-size: 11.5px; font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.bank-tile.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 6px 18px rgba(201,100,66,0.18);
}
.bank-tile.active .l { color: var(--accent); }

/* Color picker dots */
.color-picker {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px;
}
.color-dot {
  width: 42px; height: 42px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.18s var(--easing), box-shadow 0.18s var(--easing);
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.color-dot:hover {
  transform: scale(1.12) translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}
.color-dot.active {
  transform: scale(1.08);
}
.color-dot.active::after {
  content: '✓';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff;
  font-size: 20px; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.color-dot.active::before {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  pointer-events: none;
}

/* PM preview spacing */
#pmPreview {
  padding: 6px 0 18px;
}

/* Polished form field — floating label feel */
.form-card .form-field {
  position: relative;
}
.form-card .form-field input:not([type="date"]):not([type="time"]):not([type="number"]):focus,
.form-card .form-field textarea:focus {
  /* subtle highlight, already styled */
}
.form-card .form-field input[type="date"], .form-card .form-field input[type="time"] {
  font-family: var(--font-disp);
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* Pretty success state pulse for confirmations */
@keyframes pulseGreen {
  0%, 100% { background: var(--ok-soft); }
  50% { background: var(--ok); color: #fff; }
}

/* Last-4 digits formatter */
.card-num-display {
  font-family: var(--font-disp);
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

/* Tooltip / info chip */
.info-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  letter-spacing: -0.1px;
}

/* Better focus on text-btn */
.text-btn:focus-visible {
  outline: none;
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 4px 8px;
  margin: -4px -8px;
}

/* ======================================================================
   LOGO IMAGES (banks + payment methods)
   ====================================================================== */
.logo-img {
  display: block;
  object-fit: contain;
}
.logo-img.tint-white {
  filter: brightness(0) invert(1);
}

/* Pay card with logo at top right - white pill like Apple Wallet */
.pay-card .bank-mark-wrap {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 5px;
  padding: 4px 8px;
  height: 26px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  max-width: 80px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.pay-card .bank-mark-wrap img {
  height: 18px; max-width: 60px;
  object-fit: contain;
  display: block;
}
.pay-card .bank-mark-wrap.with-default {
  right: 100px;
}

/* Larger payment cards on settings page show logo bigger */
.pay-card.preview-large {
  min-height: 100px;
  padding: 20px 18px 18px;
}
.pay-card.preview-large .bank-mark-wrap {
  height: 30px;
  padding: 5px 10px;
}
.pay-card.preview-large .bank-mark-wrap img {
  height: 20px; max-width: 80px;
}

/* Bank tile with logo */
.bank-tile {
  background: #fff;
  border: 1.5px solid var(--hair-strong);
  border-radius: var(--r);
  padding: 10px 8px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  position: relative;
  overflow: hidden;
}
.bank-tile .swatch {
  width: 100%; height: 30px;
  border-radius: 6px;
  margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-tint);
  overflow: hidden;
  padding: 2px 6px;
}
.bank-tile .swatch img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
}
.bank-tile .swatch.colored-bg {
  /* When using fallback SVG (bank color background) */
  padding: 0;
}
.bank-tile.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(201, 100, 66, 0.15);
}
.bank-tile .l {
  font-size: 11px; font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.bank-tile.active .l { color: var(--accent); }

/* Pay chip in picker with logo */
.pay-picker .pay-chip .logo {
  width: 32px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  padding: 1px 3px;
}
.pay-picker .pay-chip .logo img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.pay-picker .pay-chip .logo.colored {
  background: var(--bg-color, var(--accent));
}

/* List card payment icon (smaller) */
.pm-icon-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 20px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--hair);
  overflow: hidden;
  padding: 1px 2px;
  vertical-align: middle;
  flex-shrink: 0;
}
.pm-icon-mini img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}
.pm-icon-mini.solid {
  border: none;
}

/* Pay list card (in settings) with proper logo box */
.pay-list-card .pay-icon {
  width: 48px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid var(--hair);
  overflow: hidden;
  padding: 2px 4px;
  flex-shrink: 0;
}
.pay-list-card .pay-icon img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}

/* Inline brand logo (e.g. in income/reminder meta text) */
.brand-inline {
  display: inline-flex; align-items: center; gap: 4px;
}
.brand-inline img {
  height: 12px; max-width: 24px;
  object-fit: contain;
  vertical-align: middle;
  border-radius: 2px;
}

/* ======================================================================
   SPLASH SCREEN (cinematic intro)
   ====================================================================== */
.splash {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, #FFF3DD 0%, #FFE6C2 40%, #FFD79A 80%, #FFC078 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 500;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
  animation: splashFadeIn 0.4s ease;
}

/* Background mesh - 3 large floating orbs with blur */
.splash-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  pointer-events: none;
  will-change: transform;
}
.splash-bg-orb-1 {
  width: 460px; height: 460px;
  background: var(--accent);
  top: -100px; left: -100px;
  animation: orbDrift 18s ease-in-out infinite;
}
.splash-bg-orb-2 {
  width: 380px; height: 380px;
  background: #FFB366;
  bottom: -80px; right: -80px;
  animation: orbDrift 22s ease-in-out -7s infinite reverse;
}
.splash-bg-orb-3 {
  width: 320px; height: 320px;
  background: #FFD79A;
  top: 30%; right: 10%;
  animation: orbDrift 15s ease-in-out -3s infinite;
}
@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.1); }
  66%      { transform: translate(-30px, 40px) scale(0.9); }
}

/* Particles container */
.splash-particles {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 1;
}
.splash-particle {
  position: absolute;
  font-size: var(--size, 22px);
  opacity: 0;
  animation:
    particleFadeIn 0.4s ease forwards var(--in-delay, 0s),
    particleFloat var(--float-dur, 8s) ease-in-out var(--in-delay, 0s) infinite;
  filter: drop-shadow(0 2px 6px rgba(120, 60, 0, 0.2));
}
@keyframes particleFadeIn { to { opacity: var(--opacity, 0.85); } }
@keyframes particleFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(var(--dx1, 30px), var(--dy1, -40px)) rotate(15deg); }
  50%      { transform: translate(var(--dx2, -20px), var(--dy2, -60px)) rotate(-10deg); }
  75%      { transform: translate(var(--dx3, 40px), var(--dy3, -30px)) rotate(20deg); }
}

/* Main icon wrap with halos */
.splash-icon-wrap {
  position: relative;
  width: 200px; height: 200px;
  z-index: 2;
}

.splash-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(253, 125, 2, 0.5);
  opacity: 0;
  animation: haloExpand 2.8s ease-out infinite;
  pointer-events: none;
}
.splash-halo-1 { animation-delay: 0s; }
.splash-halo-2 { animation-delay: 0.7s; border-color: rgba(255, 215, 154, 0.7); }
.splash-halo-3 { animation-delay: 1.4s; border-color: rgba(255, 255, 255, 0.6); }
@keyframes haloExpand {
  0%   { transform: scale(0.85); opacity: 0; }
  20%  { opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

.splash-icon-shadow {
  position: absolute;
  bottom: -8px;
  left: 10%; right: 10%;
  height: 18px;
  background: rgba(120, 60, 0, 0.25);
  border-radius: 50%;
  filter: blur(10px);
  animation: shadowPulse 2.2s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: scale(1);   opacity: 0.4; }
  50%      { transform: scale(0.7); opacity: 0.2; }
}

.splash-mascot {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 44px;
  position: relative;
  z-index: 2;
  animation:
    czuwekBounce 1.0s var(--bounce) 0.1s backwards,
    czuwekFloat 2.2s ease-in-out 1.2s infinite,
    czuwekShine 5s ease-in-out infinite;
  filter: drop-shadow(0 14px 28px rgba(253, 125, 2, 0.45))
          drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1));
}
.splash-icon { border-radius: 44px; }

/* Glint sweep over icon */
.splash-icon-glint {
  position: absolute;
  inset: 0;
  border-radius: 44px;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%);
  z-index: 3;
  opacity: 0;
  animation: glintSweep 4s ease-in-out 1.8s infinite;
  pointer-events: none;
}
@keyframes glintSweep {
  0%   { transform: translateX(-100%); opacity: 0; }
  10%  { opacity: 1; }
  30%  { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(100%); opacity: 0; }
}

@keyframes czuwekBounce {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(8deg); opacity: 1; }
  80%  { transform: scale(0.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes czuwekFloat {
  0%, 100% { transform: translateY(0)   rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(2deg); }
}
@keyframes czuwekShine {
  0%, 90%, 100% { filter: drop-shadow(0 14px 28px rgba(253, 125, 2, 0.45)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1)); }
  45%           { filter: drop-shadow(0 14px 36px rgba(253, 125, 2, 0.75)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.1)) brightness(1.08); }
}

/* Name letters reveal (one by one with bounce) - planru style */
.splash-name {
  font-family: var(--font-brand);
  font-size: 64px; font-weight: 700;
  letter-spacing: -2px;
  color: #2A2A2A;       /* "czuw" dark gray */
  margin-top: 10px;
  display: flex;
  gap: 0;
  z-index: 2;
  line-height: 1;
  text-transform: lowercase;
}
.splash-name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px) scale(0.7);
  animation: letterReveal 0.6s var(--bounce) forwards;
}
.splash-name span.accent {
  color: var(--accent);       /* "ek" orange like in planru */
}
@keyframes letterReveal {
  0%   { opacity: 0; transform: translateY(20px) scale(0.7); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.1); }
  100% { opacity: 1; transform: translateY(0)   scale(1);   }
}

.splash-tag {
  font-size: 14px;
  color: #8A4A1A;
  letter-spacing: 0.3px;
  font-weight: 500;
  opacity: 0;
  animation: splashFadeUp 0.6s ease 1.4s forwards;
  z-index: 2;
}
@keyframes splashFadeUp {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Progress bar with shimmer */
.splash-progress {
  position: relative;
  width: 180px; height: 4px;
  background: rgba(140, 70, 20, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 18px;
  opacity: 0;
  animation: splashFadeUp 0.5s ease 1.6s forwards;
  z-index: 2;
}
.splash-progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #FFB366, var(--accent));
  border-radius: 2px;
  animation: progressFill 1.5s ease-out 1.7s forwards;
}
@keyframes progressFill {
  0%   { width: 0%;   }
  50%  { width: 65%;  }
  100% { width: 100%; }
}
.splash-progress-shine {
  position: absolute;
  top: 0; left: -40%;
  height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), transparent);
  animation: progressShimmer 1.5s ease-in-out 1.8s infinite;
}
@keyframes progressShimmer {
  0%   { left: -40%; }
  100% { left: 110%; }
}

.splash-status {
  font-size: 12.5px;
  color: rgba(90, 50, 20, 0.7);
  letter-spacing: 0.4px;
  font-weight: 600;
  margin-top: -2px;
  min-height: 16px;
  opacity: 0;
  animation: splashFadeUp 0.4s ease 1.8s forwards;
  z-index: 2;
}
.splash-status.changing {
  animation: statusFlip 0.3s ease;
}
@keyframes statusFlip {
  0%   { opacity: 1; transform: translateY(0); }
  50%  { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Final fade-out enhanced */
.splash.hide {
  animation: splashFadeOutFancy 0.6s var(--easing) forwards;
}
@keyframes splashFadeOutFancy {
  0%   { opacity: 1; transform: scale(1); }
  20%  { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1.15); visibility: hidden; pointer-events: none; }
}
.splash.hide {
  animation: splashFadeOut 0.5s ease forwards;
}
@keyframes splashFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
@keyframes splashOrbitRotate {
  to { transform: rotate(360deg); }
}
@keyframes splashFloatIn {
  0% { transform: scale(0.92) translateY(8px); opacity: 0; }
  60% { transform: scale(1.02) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.splash-orbit {
  position: relative;
  width: 240px; height: 240px;
  pointer-events: none;
}
.splash-orbit-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px dashed rgba(201, 100, 66, 0.25);
  animation: splashOrbitRotate 12s linear infinite;
}
.splash-orbit-ring.slow {
  inset: 20px;
  border-color: rgba(61, 111, 138, 0.18);
  border-style: solid;
  border-width: 1px;
  animation-duration: 20s;
  animation-direction: reverse;
}
.splash-orbit-ring.slowest {
  inset: 40px;
  border-color: rgba(93, 114, 86, 0.15);
  border-style: dotted;
  animation-duration: 30s;
}
.splash-orbit-ring::after {
  content: '';
  position: absolute;
  top: -5px; left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(201, 100, 66, 0.6);
}
.splash-orbit-ring.slow::after {
  background: var(--cat-car);
  box-shadow: 0 0 12px rgba(61, 111, 138, 0.6);
}
.splash-orbit-ring.slowest::after {
  background: var(--cat-home);
  box-shadow: 0 0 12px rgba(93, 114, 86, 0.6);
}

.splash-logo {
  position: absolute;
  max-width: 220px;
  width: 50vw;
  max-height: 90px;
  object-fit: contain;
  animation: splashFloatIn 0.7s var(--bounce) backwards,
             splashPulse 4s ease-in-out 0.7s infinite;
}

.splash-progress {
  width: 140px; height: 3px;
  background: rgba(201, 100, 66, 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 60px;
}
.splash-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  border-radius: 2px;
  animation: splashProgress 1.8s ease-in-out infinite;
}
@keyframes splashProgress {
  0% { width: 0%; margin-left: 0%; }
  50% { width: 70%; margin-left: 15%; }
  100% { width: 0%; margin-left: 100%; }
}
.splash-tag {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.5px;
  font-weight: 500;
  text-transform: lowercase;
  animation: splashFloatIn 0.6s var(--bounce) 0.4s backwards;
}

/* Auth logo with Czuwek mascot */
.auth-mascot {
  width: 110px; height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  filter: drop-shadow(0 6px 14px rgba(255, 140, 46, 0.25));
  animation: czuwekBounce 0.8s var(--bounce);
  border-radius: 28px;
}
.auth-name {
  font-family: var(--font-brand);
  font-size: 42px; font-weight: 700;
  letter-spacing: -1.4px;
  margin: 0 0 4px;
  text-align: center;
  color: #2A2A2A;
  line-height: 1;
  text-transform: lowercase;
}
.auth-name .accent {
  color: var(--accent);
}

/* ======================================================================
   AUTH OVERLAY (login + register screens)
   ====================================================================== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 50%);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.auth-overlay.open { display: flex; animation: backdropIn 0.3s var(--easing); }

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(28, 27, 25, 0.12);
  animation: pop 0.4s var(--bounce);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-bg {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  display: inline-grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-primary);
  margin-bottom: 14px;
}
.auth-logo-bg svg { width: 28px; height: 28px; }
.auth-logo h1 {
  font-family: var(--font-disp);
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.6px;
  margin: 0;
}
.auth-logo p {
  font-size: 13px; color: var(--ink-3);
  margin: 4px 0 0;
}

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--surface-tint);
  padding: 4px;
  border-radius: var(--r);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 9px;
  border-radius: 9px;
  font-weight: 600; font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s var(--easing);
  letter-spacing: -0.1px;
}
.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(28,27,25,0.08);
}

.auth-form {
  display: flex; flex-direction: column;
  gap: 14px;
}
.auth-field label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 15px;
  color: var(--ink);
  transition: all 0.15s var(--easing);
  font-family: inherit;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.auth-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  animation: pop 0.25s var(--bounce);
}
.auth-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-radius: var(--r);
  font-weight: 700; font-size: 15.5px;
  letter-spacing: -0.2px;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: var(--shadow-primary);
  transition: all 0.18s var(--easing);
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(201,100,66,0.4); }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled {
  opacity: 0.6; cursor: not-allowed;
  transform: none;
}

/* "Zapomniałem hasła" link pod przyciskiem logowania */
.auth-forgot-link {
  display: block;
  width: 100%;
  padding: 10px 0 2px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: color 0.15s;
  margin-top: 4px;
}
.auth-forgot-link:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.auth-success {
  background: var(--ok-soft);
  color: var(--ok);
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 13.5px; line-height: 1.5;
  margin: 4px 0;
  border-left: 3px solid var(--ok);
}

/* Auxiliary auth modals (forgot password, reset password) */
.auth-aux-modal { z-index: 8000; }
.auth-aux-modal.open { display: flex; }
.auth-aux-card {
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: 90vh;
  background: var(--surface);
  border-radius: 22px;
  padding: 28px 26px 24px;
  text-align: center;
  display: flex; flex-direction: column;
  gap: 0;
  animation: searchPop 0.28s var(--easing);
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.auth-aux-mascot {
  width: 100px; height: 90px;
  object-fit: cover;
  object-position: center top;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(201,100,66,0.18));
}
.auth-aux-card h3 {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
  color: var(--ink);
}
.auth-aux-card > p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 18px;
  max-width: 320px;
  margin-left: auto; margin-right: auto;
}
.auth-aux-card form {
  text-align: left;
}
.auth-aux-card .auth-field { margin-bottom: 14px; }
.auth-aux-card .auth-forgot-link { margin-top: 8px; }

@media (max-width: 540px) {
  .auth-aux-modal {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .auth-aux-card {
    max-width: 100%;
    width: 100%;
    border-radius: 26px 26px 0 0;
    padding: 24px 22px calc(28px + env(safe-area-inset-bottom, 0px));
    animation: searchSlideUp 0.36s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .auth-aux-card::before {
    content: '';
    display: block;
    width: 42px; height: 5px;
    background: var(--hair-strong);
    border-radius: 3px;
    margin: -6px auto 12px;
  }
}

.auth-divider {
  position: relative;
  text-align: center;
  margin: 22px 0 14px;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: var(--hair);
}
.auth-divider span {
  position: relative;
  background: var(--surface);
  padding: 0 14px;
  font-size: 12px; color: var(--ink-3);
  font-weight: 600;
}

.auth-guest {
  width: 100%;
  padding: 13px 14px;
  background: var(--surface-tint);
  color: var(--ink);
  border-radius: var(--r);
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}
.auth-guest:hover { background: var(--hair-strong); }
.auth-guest-hint {
  font-size: 11px; color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.1px;
}

.auth-foot {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.5;
}

/* SYNC INDICATOR */
.sync-indicator {
  position: fixed;
  top: 12px; right: 12px;
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  border-radius: var(--r-full);
  padding: 5px 11px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-2);
  display: none;
  align-items: center; gap: 5px;
  z-index: 40;
  box-shadow: 0 2px 6px rgba(28,27,25,0.05);
  animation: pop 0.2s var(--bounce);
}
.sync-indicator.visible { display: inline-flex; }
.sync-indicator .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
}
.sync-indicator.syncing .dot {
  background: var(--warn);
  animation: pulse-sync 1s infinite;
}
.sync-indicator.error .dot { background: var(--danger); }
@keyframes pulse-sync {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Account row in settings */
.account-card.clickable { cursor: pointer; }
.account-card .pro.synced { background: var(--ok-soft); color: var(--ok); }
.account-card .pro.guest { background: var(--surface-tint); color: var(--ink-2); }

/* ======================================================================
   QUOTE CARD (daily motivation on home)
   ====================================================================== */
.quote-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px 18px 16px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid rgba(201, 100, 66, 0.15);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
  cursor: pointer;
  overflow: hidden;
  animation: pop 0.4s var(--bounce);
}
.quote-card::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(201,100,66,0.12), transparent 70%);
  pointer-events: none;
}
.quote-card .quote-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(201,100,66,0.3);
  position: relative; z-index: 1;
}
.quote-card .quote-body {
  flex: 1; min-width: 0;
  position: relative; z-index: 1;
  padding-right: 28px;
}
.quote-card .quote-icon svg { stroke: currentColor; display: block; }
.quote-card .quote-text {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--accent-text);
  font-weight: 500;
  letter-spacing: -0.15px;
  font-style: italic;
}
.quote-card .quote-author {
  font-size: 12px;
  color: #8A4A30;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.2px;
}
.quote-card .quote-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-text);
  cursor: pointer;
  z-index: 3;
  padding: 0;
  transition: all 0.15s var(--easing);
}
.quote-card .quote-close svg { stroke: currentColor; display: block; }
.quote-card .quote-close:hover {
  background: #fff;
  transform: scale(1.1);
}
.quote-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(201,100,66,0.15);
}
.quote-card:active { transform: scale(0.99); }

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-8px); margin-bottom: -100px; padding: 0; }
}

/* ======================================================================
   MONTH NAV (Finanse picker) + 12-MONTH TREND CHART
   ====================================================================== */
.month-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  margin: 14px 0 20px;
}
.month-nav-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.month-nav-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.month-nav-btn:active { transform: scale(0.95); }
.month-nav-label {
  text-align: center;
  min-width: 160px;
}
.month-nav-label .m {
  font-family: var(--font-disp);
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1;
}
.month-nav-label .y {
  font-size: 13px; color: var(--ink-3);
  margin-top: 4px; font-weight: 600;
}

/* Real 12-month trend with paired bars */
.trend-bars {
  display: flex; gap: 6px;
  height: 110px;
  align-items: flex-end;
  margin: 14px 0 8px;
}
.trend-col {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  height: 100%;
  cursor: pointer;
  min-width: 0;
  gap: 6px;
  position: relative;
  border-radius: 6px;
  padding: 4px 2px;
  transition: background 0.15s var(--easing);
}
.trend-col:hover { background: var(--surface-tint); }
.trend-col.active { background: var(--accent-soft); }
.trend-bars-pair {
  display: flex; gap: 2px;
  align-items: flex-end;
  height: 86px;
  width: 100%;
  justify-content: center;
}
.trend-bar {
  width: 6px;
  border-radius: 3px 3px 0 0;
  transition: height 0.4s var(--easing), opacity 0.15s;
  min-height: 2px;
}
.trend-bar-in {
  background: var(--ok);
}
.trend-bar-out {
  background: var(--danger);
  opacity: 0.85;
}
.trend-col.active .trend-bar-in {
  background: linear-gradient(to top, var(--ok), #7FBF9A);
  box-shadow: 0 0 0 1px var(--ok);
}
.trend-col.active .trend-bar-out {
  background: linear-gradient(to top, var(--danger), #E37A6B);
  box-shadow: 0 0 0 1px var(--danger);
}
.trend-col:hover .trend-bar { opacity: 1; }
.trend-label {
  font-size: 10px; color: var(--ink-3);
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.2px;
}
.trend-col.active .trend-label {
  color: var(--accent);
  font-weight: 700;
}
.trend-legend {
  display: flex; gap: 16px; justify-content: center;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
  margin-top: 6px;
}
.trend-legend .item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ink-3);
}
.trend-legend .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.trend-legend .dot.in  { background: var(--ok); }
.trend-legend .dot.out { background: var(--danger); }

/* Refined select dropdown */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A938A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
  cursor: pointer;
}
select:focus { outline: none; }

/* ============================================================================
   HYBRID ADD MODAL — modern, AI-first
   ============================================================================ */
.add-modal-backdrop.open { display: flex; }
.add-modal {
  max-width: 540px;
  width: 100%;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  display: flex; flex-direction: column;
  max-height: 92vh;
  overflow: visible; /* allow corner mascot to peek out */
  box-shadow: 0 -20px 60px rgba(45,46,51,0.18);
  position: relative;
}
.add-modal > .modal-body,
.add-modal > .add-modal-body {
  overflow-y: auto; /* scroll happens here, not on modal itself */
  border-radius: inherit;
}
@media (min-width: 720px) {
  .add-modal { border-radius: 22px; max-height: 88vh; margin: auto; }
}

/* CORNER MASCOT — peeking out of top-right corner */
.add-modal-corner-mascot {
  position: absolute;
  top: -36px;
  right: 18px;
  width: 86px;
  height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(255, 140, 46, 0.35));
  z-index: 10;
  pointer-events: none;
  animation: cornerMascotFloat 3.6s ease-in-out infinite;
  transition: transform 0.4s var(--bounce);
}
.add-modal-corner-mascot.swap {
  animation: cornerMascotSwap 0.55s var(--bounce), cornerMascotFloat 3.6s ease-in-out 0.55s infinite;
}
@keyframes cornerMascotFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-4px) rotate(3deg); }
}
@keyframes cornerMascotSwap {
  0%   { transform: scale(0.6) rotate(-25deg); opacity: 0.4; }
  60%  { transform: scale(1.15) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(-3deg); opacity: 1; }
}

.add-topbar {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 16px 110px 10px 16px; /* right padding makes room for corner mascot */
  position: relative;
}
.add-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: all 0.15s var(--easing);
  flex-shrink: 0;
  margin-top: 2px;
}
.add-close:hover { background: rgba(0,0,0,0.08); transform: rotate(90deg); }
.add-close svg { width: 18px; height: 18px; }
.add-title-wrap {
  flex: 1; min-width: 0;
  text-align: left;
}
.add-title-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
  transition: opacity 0.25s var(--easing);
}
.add-title {
  margin: 0;
  font-family: var(--font-disp);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.15;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.2s var(--easing);
}
.add-title.morph { animation: titleMorph 0.4s var(--easing); }
@keyframes titleMorph {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.add-topbar-spacer { display: none; }

/* RECOGNITION PILLS - small chips below input showing what was parsed */
.recognition-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 0 0;
  min-height: 0;
}
.recognition-pills:empty { padding: 0; }
.recognition-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px;
  background: rgba(255, 140, 46, 0.1);
  color: var(--accent-deep);
  border: 1px solid rgba(255, 140, 46, 0.25);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  animation: recPillIn 0.35s var(--easing);
}
.recognition-pill svg { width: 13px; height: 13px; stroke-width: 2.4; opacity: 0.85; }
.recognition-pill.amount  { background: rgba(38, 180, 126, 0.13); color: #19805A; border-color: rgba(38, 180, 126, 0.3); }
.recognition-pill.date    { background: rgba(60, 130, 240, 0.13); color: #2563DC; border-color: rgba(60, 130, 240, 0.3); }
.recognition-pill.recur   { background: rgba(155, 80, 200, 0.13); color: #7C3AB0; border-color: rgba(155, 80, 200, 0.3); }
@keyframes recPillIn {
  0%   { opacity: 0; transform: scale(0.85) translateY(4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.add-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

/* AI INPUT */
.ai-input-wrap {
  position: relative;
  display: flex; align-items: center;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 18px;
  padding: 4px 4px 4px 16px;
  box-shadow: 0 6px 24px rgba(255, 140, 46, 0.18);
  transition: all 0.2s var(--easing);
}
.ai-input-wrap:focus-within {
  border-color: var(--accent-deep);
  box-shadow: 0 8px 32px rgba(255, 140, 46, 0.28);
  transform: translateY(-1px);
}
.ai-input-sparkle {
  width: 24px; height: 24px;
  color: var(--accent);
  display: grid; place-items: center;
  margin-right: 10px;
  animation: aiSparkle 2.4s ease-in-out infinite;
}
.ai-input-sparkle svg { width: 22px; height: 22px; }
@keyframes aiSparkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50%      { transform: scale(1.15) rotate(8deg); opacity: 0.85; }
}
.ai-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 4px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}
.ai-input::placeholder { color: var(--ink-3); }
.ai-input-mic {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(255, 140, 46, 0.3);
  transition: all 0.2s var(--easing);
}
.ai-input-mic:hover { transform: scale(1.05); }
.ai-input-mic.recording { animation: micPulse 1.2s ease-in-out infinite; background: linear-gradient(135deg, #E63946 0%, #B22330 100%); }
.ai-input-mic svg { width: 20px; height: 20px; }
@keyframes micPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4), 0 0 0 0 rgba(230, 57, 70, 0.5); }
  50%      { box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4), 0 0 0 12px rgba(230, 57, 70, 0); }
}

.ai-input-hint {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 6px 0;
  font-size: 12.5px;
  color: var(--ink-3);
}
.ai-hint-pill {
  padding: 4px 10px;
  background: rgba(255, 140, 46, 0.1);
  border: 1px solid rgba(255, 140, 46, 0.25);
  border-radius: 999px;
  font-size: 12px;
  color: var(--accent-deep);
  font-weight: 500;
  transition: all 0.15s var(--easing);
}
.ai-hint-pill:hover { background: rgba(255, 140, 46, 0.18); transform: translateY(-1px); }

/* PREVIEW CARD */
.preview-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 20px;
  padding: 16px 16px 16px 12px;
  display: flex; gap: 14px; align-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  transition: all 0.35s var(--easing);
  position: relative;
  overflow: hidden;
}
.preview-card.recognized {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 100%);
  box-shadow: 0 8px 24px rgba(208, 135, 99, 0.16);
}
.preview-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 140, 46, 0.08), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--easing);
}
.preview-card.recognized::before { opacity: 1; }
.preview-mascot {
  width: 64px; height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(255, 140, 46, 0.25));
  transition: all 0.3s var(--easing);
}
.preview-card.recognized .preview-mascot {
  animation: previewMascotBounce 0.55s var(--bounce);
}
@keyframes previewMascotBounce {
  0%   { transform: scale(0.5) rotate(-10deg); }
  60%  { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.preview-content { flex: 1; min-width: 0; }
.preview-title {
  font-family: var(--font-disp);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
  letter-spacing: -0.3px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-meta {
  font-size: 13.5px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.preview-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.preview-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-deep);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  animation: pillIn 0.35s var(--easing);
}
@keyframes pillIn {
  0%   { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}
.preview-pill.amount  { background: rgba(38, 180, 126, 0.13); color: #19805A; }
.preview-pill.date    { background: rgba(60, 130, 240, 0.13); color: #2563DC; }
.preview-pill.recur   { background: rgba(155, 80, 200, 0.13); color: #7C3AB0; }
.preview-pill.cat     { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-deep); }

/* QUICK TEMPLATES */
.quick-templates { margin-top: 18px; }
.quick-templates-label {
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.quick-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.quick-template {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  text-align: center;
}
.quick-template:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(255, 140, 46, 0.18);
}
.quick-template:active { transform: translateY(0) scale(0.98); }
.quick-template-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  display: grid; place-items: center;
  color: var(--accent);
  font-size: 20px;
}
.quick-template-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.quick-template-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink); line-height: 1.2;
}
.quick-template-meta {
  font-size: 10.5px; color: var(--ink-3);
}

/* DETAILS TOGGLE */
.details-toggle {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 14px 16px;
  margin-top: 18px;
  background: rgba(0,0,0,0.025);
  border: 1px dashed rgba(0,0,0,0.12);
  border-radius: 14px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s var(--easing);
}
.details-toggle:hover {
  background: rgba(0,0,0,0.04);
  border-color: var(--accent);
  color: var(--ink);
}
.details-chev {
  width: 18px; height: 18px;
  transition: transform 0.3s var(--easing);
}
.details-toggle.open .details-chev { transform: rotate(180deg); }
.details-toggle-hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}

.details-pane {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--easing);
}
.details-pane.open {
  max-height: 4000px;
  padding-top: 8px;
}
.detail-row-pair {
  display: flex; gap: 12px; padding-top: 12px;
}
.detail-field { flex: 1; }
.detail-field-narrow { max-width: 120px; }
.detail-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.detail-input {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: all 0.15s var(--easing);
}
.detail-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 140, 46, 0.12);
}
.detail-amount { position: relative; display: flex; align-items: center; }
.detail-amount input { padding-right: 36px; }
.detail-amount-suffix {
  position: absolute;
  right: 14px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-3);
}
.detail-textarea { min-height: 80px; resize: vertical; }
.detail-section { margin-top: 16px; }
.detail-section-label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.detail-date-row {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}
.detail-date-row > input[type="date"] { flex: 1; min-width: 160px; }
.detail-date-quick {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.date-quick {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.date-quick:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 46, 0.06);
}
.date-quick:active { transform: scale(0.95); }

/* STICKY FOOT */
.add-modal-foot {
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 78%, transparent);
  border-top: 0.5px solid var(--hair);
  flex-shrink: 0;
}
.add-save-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-radius: 16px;
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: 0 6px 20px rgba(255, 140, 46, 0.35);
  transition: all 0.2s var(--easing);
  cursor: pointer;
}
.add-save-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255, 140, 46, 0.42); }
.add-save-btn:active { transform: translateY(0) scale(0.98); }
.add-save-btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none !important;
  background: rgba(0,0,0,0.08); color: var(--ink-3);
  box-shadow: none;
}
.add-save-btn svg { width: 20px; height: 20px; }
.add-save-btn.ready { animation: saveBtnReady 0.5s var(--easing); }
@keyframes saveBtnReady {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); box-shadow: 0 12px 32px rgba(255, 140, 46, 0.55); }
  100% { transform: scale(1); }
}

/* ============================================================================
   PICKER-FIRST ADD MODAL — v51 states
   ============================================================================ */

/* Top-bar AI shortcut button */
.add-ai-shortcut {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.15), rgba(255, 140, 46, 0.05));
  border: 1.5px solid rgba(255, 140, 46, 0.3);
  display: grid; place-items: center;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s var(--easing);
  flex-shrink: 0;
  margin-top: 2px;
}
.add-ai-shortcut:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}
.add-ai-shortcut svg { width: 18px; height: 18px; }

/* State machine - only one visible at a time */
.add-state {
  animation: addStateIn 0.35s var(--easing);
}
@keyframes addStateIn {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.picker-section { margin-top: 8px; }
.picker-section + .picker-section { margin-top: 22px; }
.picker-section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
  padding-left: 2px;
}

/* POPULAR — large 4-col grid */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 480px) {
  .popular-grid { grid-template-columns: repeat(2, 1fr); }
}
.popular-card {
  display: flex; flex-direction: column;
  align-items: flex-start;
  padding: 14px 12px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--easing);
  position: relative;
  overflow: hidden;
  min-height: 96px;
}
.popular-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 140, 46, 0.18);
}
.popular-card:active { transform: translateY(0) scale(0.98); }
.popular-card-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 15%, transparent);
  color: var(--card-accent, var(--accent));
  display: grid; place-items: center;
  margin-bottom: 10px;
  transition: all 0.2s var(--easing);
}
.popular-card:hover .popular-card-icon {
  background: var(--card-accent, var(--accent));
  color: #fff;
  transform: rotate(-6deg) scale(1.1);
}
.popular-card-icon svg { width: 20px; height: 20px; stroke-width: 2.2; }
.popular-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 2px;
}
.popular-card-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}

/* CATEGORY row - horizontal pills */
.category-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .category-row { grid-template-columns: repeat(4, 1fr); }
}
.category-card {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 12px 6px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s var(--easing);
}
.category-card:hover {
  border-color: var(--cat-color, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}
.category-card-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--cat-color, var(--accent));
  color: #fff;
  display: grid; place-items: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.category-card-icon svg { width: 22px; height: 22px; stroke-width: 2; }
.category-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.1;
}

/* CATEGORY DRILL-DOWN - list of items in a category */
.category-drill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.drill-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  text-align: left;
  width: 100%;
}
.drill-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(255, 140, 46, 0.15);
}
.drill-item-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.drill-item-icon svg { width: 20px; height: 20px; stroke-width: 2.2; }
.drill-item-content { flex: 1; min-width: 0; }
.drill-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1px;
}
.drill-item-meta {
  font-size: 12px;
  color: var(--ink-3);
}
.drill-item-arrow {
  color: var(--ink-3);
  flex-shrink: 0;
}
.drill-item-arrow svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* "Inne / wpisz własne" button */
.picker-other-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 14px 16px;
  margin-top: 18px;
  background: rgba(0,0,0,0.03);
  border: 1.5px dashed rgba(0,0,0,0.15);
  border-radius: 14px;
  font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s var(--easing);
  justify-content: center;
}
.picker-other-btn:hover {
  background: rgba(255, 140, 46, 0.06);
  border-color: var(--accent);
  color: var(--accent-deep);
}
.picker-other-btn svg { width: 18px; height: 18px; }

/* REFINE state */
.refine-summary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 140, 46, 0.1);
  border: 1px solid rgba(255, 140, 46, 0.2);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 16px;
}
.refine-summary-icon {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.refine-summary-icon svg { width: 13px; height: 13px; stroke-width: 2.4; }

.refine-block { margin-bottom: 18px; }
.refine-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.refine-label-opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink-3);
  opacity: 0.7;
}
.refine-amount {
  position: relative;
  display: flex; align-items: center;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 4px 16px 4px 18px;
  transition: all 0.15s var(--easing);
}
.refine-amount:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 140, 46, 0.12);
}
.refine-amount-input {
  flex: 1;
  border: none; background: transparent;
  font-family: var(--font-disp);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  padding: 12px 0;
  outline: none;
}
.refine-amount-input::placeholder { color: var(--ink-3); opacity: 0.4; }
.refine-amount-suffix {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-3);
}
.refine-date-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px;
}
.refine-date-input {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: all 0.15s var(--easing);
}
.refine-date-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 140, 46, 0.12);
}

/* AI POPUP overlay */
.ai-popup {
  position: absolute;
  inset: 0;
  background: rgba(255, 252, 246, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px 20px;
  z-index: 20;
  border-radius: inherit;
  animation: aiPopupBackdropIn 0.25s var(--easing);
}
.ai-popup.open { display: flex; }
@keyframes aiPopupBackdropIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
.ai-popup-card {
  width: 100%; max-width: 460px;
  background: #fff;
  border-radius: 22px;
  padding: 24px 22px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 0 0 1px rgba(255, 140, 46, 0.15);
  position: relative;
  animation: aiPopupCardIn 0.4s var(--bounce);
}
@keyframes aiPopupCardIn {
  0%   { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.ai-popup-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.04);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: all 0.15s var(--easing);
}
.ai-popup-close:hover { background: rgba(0,0,0,0.08); transform: rotate(90deg); }
.ai-popup-close svg { width: 16px; height: 16px; }
.ai-popup-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 14px;
}
.ai-popup-label svg { width: 18px; height: 18px; color: var(--accent); }
.ai-input-wrap-popup { border-radius: 16px; }
.ai-popup-save {
  margin-top: 18px;
}

/* ============================================================================
   STEP MODALS - habit + income (extends .add-modal pattern)
   ============================================================================ */

/* Habit type cards (step 1 - 2 big cards for habit vs addiction) */
.habit-type-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 8px;
}
@media (min-width: 540px) {
  .habit-type-cards { grid-template-columns: 1fr 1fr; }
}
.habit-type-card-new {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 22px 18px 18px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s var(--easing);
  overflow: hidden;
}
.habit-type-card-new:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(255, 140, 46, 0.2);
}
.habit-type-card-new:active { transform: translateY(-1px) scale(0.98); }
.habit-type-card-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid; place-items: center;
  margin-bottom: 8px;
  box-shadow: 0 6px 16px rgba(255, 140, 46, 0.25);
  transition: transform 0.3s var(--easing);
}
.habit-type-card-new:hover .habit-type-card-icon {
  transform: rotate(-8deg) scale(1.08);
}
.habit-type-card-icon svg { width: 26px; height: 26px; stroke-width: 2.2; }
.habit-type-card-emoji {
  font-size: 28px;
  margin-bottom: 6px;
  animation: bobUp 2.4s ease-in-out infinite;
}
.habit-type-card-new:nth-child(2) .habit-type-card-emoji { animation-delay: 0.5s; }
@keyframes bobUp {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.habit-type-card-title {
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.habit-type-card-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.35;
  max-width: 200px;
}

/* Time picker row (refine state) */
.time-picker-row {
  display: flex; align-items: center; gap: 12px;
}
.time-picker-row input[type="time"] {
  font-family: var(--font-disp);
  font-size: 18px;
  font-weight: 700;
}

/* Suggestion grid uses .popular-grid but each card shows emoji prominently */
.popular-grid .habit-sugg-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 14px 8px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  min-height: 100px;
}
.popular-grid .habit-sugg-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 140, 46, 0.18);
}
.habit-sugg-emoji {
  font-size: 30px;
  margin-bottom: 8px;
  line-height: 1;
}
.habit-sugg-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
}

/* Income type card uses .popular-card but with emoji bar */
.popular-grid .income-type-card {
  display: flex; flex-direction: column;
  align-items: flex-start;
  padding: 14px 12px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s var(--easing);
  min-height: 90px;
}
.popular-grid .income-type-card:hover {
  border-color: var(--inc-color, var(--accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.income-type-icon {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--inc-color, var(--accent));
  color: #fff;
  display: grid; place-items: center;
  margin-bottom: 8px;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.income-type-icon svg { width: 18px; height: 18px; stroke-width: 2.2; }
.income-type-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

/* Emoji picker (reuse existing but slight refresh) */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 4px;
  background: rgba(0,0,0,0.025);
  border-radius: 14px;
  max-height: 200px;
  overflow-y: auto;
}
.emoji-pick {
  display: grid; place-items: center;
  aspect-ratio: 1;
  font-size: 22px;
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  transition: all 0.12s var(--easing);
}
.emoji-pick:hover { background: #fff; transform: scale(1.15); }
.emoji-pick.active {
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(255, 140, 46, 0.3);
  transform: scale(1.1);
}

/* ============================================================================
   DETAIL MODAL — v53 polish (matches .add-modal pattern)
   ============================================================================ */

/* Edit pill in top-right corner of detail modal */
.detail-edit-btn {
  height: 36px;
  padding: 0 14px 0 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: 0 4px 12px rgba(255, 140, 46, 0.32);
  transition: all 0.2s var(--easing);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.detail-edit-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 140, 46, 0.42); }
.detail-edit-btn:active { transform: translateY(0) scale(0.97); }
.detail-edit-btn svg { width: 15px; height: 15px; }
.detail-edit-btn::after { content: 'Edytuj'; }
@media (max-width: 480px) {
  .detail-edit-btn::after { content: ''; }
  .detail-edit-btn { padding: 0 10px; }
}

/* Hero v2 — centered, no big asymmetric badge */
.detail-hero-v2 {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 4px 0 18px;
}
.detail-hero-badge {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
  width: 100%;
}
.detail-hero-badge .badge.xl,
.detail-hero-badge > div.badge {
  width: 72px !important;
  height: 72px !important;
  border-radius: 22px;
  font-size: 32px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  margin: 0;
  flex-shrink: 0;
}
.detail-hero-meta {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 4px;
  text-transform: lowercase;
  letter-spacing: 0.1px;
}
.detail-hero-amount {
  font-family: var(--font-disp);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  color: var(--ink);
  margin-top: 8px;
}
.detail-hero-amount .cur {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-3);
  margin-left: 4px;
}
.detail-hero-amount-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 4px;
}

/* Next-payment card with status colors */
.next-payment {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.1), rgba(255, 140, 46, 0.04));
  border: 1px solid rgba(255, 140, 46, 0.18);
  border-radius: 14px;
  margin-bottom: 16px;
}
.next-payment.today {
  background: linear-gradient(135deg, rgba(255, 100, 20, 0.15), rgba(255, 100, 20, 0.06));
  border-color: rgba(255, 100, 20, 0.3);
}
.next-payment.overdue {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.12), rgba(230, 57, 70, 0.04));
  border-color: rgba(230, 57, 70, 0.28);
}
.next-payment .k {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.next-payment.overdue .k { color: #C8102E; }
.next-payment .v {
  font-family: var(--font-disp);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.next-payment .pill {
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.next-payment.today .pill { background: #FF6414; }
.next-payment.overdue .pill { background: #C8102E; }

/* Snooze chips - smaller, pill-shaped */
.snooze-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}
.snooze-chip {
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s var(--easing);
}
.snooze-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 46, 0.06);
  transform: translateY(-1px);
}
.snooze-chip:active { transform: translateY(0) scale(0.95); }

/* Detail footer - 2 buttons side by side (flex with explicit overrides) */
.detail-foot {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px;
  padding: 14px 20px 24px;
  align-items: stretch;
}
.detail-foot .detail-delete-btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 0 18px;
  height: 52px;
  background: #fff;
  border: 1.5px solid rgba(230, 57, 70, 0.25);
  color: #C8102E;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
  min-width: 100px;
  white-space: nowrap;
}
.detail-foot .detail-delete-btn:hover {
  background: rgba(230, 57, 70, 0.06);
  border-color: rgba(230, 57, 70, 0.4);
}
.detail-foot .detail-delete-btn:active { transform: scale(0.97); }
.detail-foot .detail-delete-btn svg { width: 18px; height: 18px; }

/* Override .add-save-btn width:100% inside detail footer flex */
.detail-foot .detail-done-btn,
.detail-foot .add-save-btn {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0;
  padding: 0 24px;
  height: 52px;
}
.detail-foot .detail-done-btn svg { width: 18px; height: 18px; }

/* Info card refined */
.info-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 18px;
}
.info-card .info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.info-card .info-row:last-child { border-bottom: none; }
.info-card .info-row .k {
  font-size: 13.5px;
  color: var(--ink-3);
  font-weight: 500;
}
.info-card .info-row .v {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

/* Section label inside detail */
.detail-section-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Google Sign-In wrapper */
.google-signin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 12px 0 14px;
}
#googleSignInBtn {
  width: 100%;
  display: flex;
  justify-content: center;
  min-height: 44px;
}
#googleSignInBtn > div { width: 100% !important; max-width: 360px; }
.google-signin-fallback {
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
  padding: 4px 8px;
}

/* ============================================================================
   DARK MODE — All step-based modals (.add-modal, detail, habit, income)
   ============================================================================ */

:root[data-theme="dark"] .add-modal {
  background: linear-gradient(180deg, #1F1C18 0%, #15130F 100%);
  color: var(--ink);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
}
:root[data-theme="dark"] .add-modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Top bar */
:root[data-theme="dark"] .add-close {
  background: rgba(245, 239, 227, 0.06);
  color: var(--ink-2);
}
:root[data-theme="dark"] .add-close:hover {
  background: rgba(245, 239, 227, 0.12);
}
:root[data-theme="dark"] .add-title {
  color: var(--ink);
}
:root[data-theme="dark"] .add-title-eyebrow {
  color: var(--accent);
}
:root[data-theme="dark"] .add-ai-shortcut {
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.18), rgba(255, 140, 46, 0.06));
  border-color: rgba(255, 140, 46, 0.35);
  color: var(--accent);
}
:root[data-theme="dark"] .add-ai-shortcut:hover {
  background: var(--accent);
  color: #fff;
}

/* AI INPUT */
:root[data-theme="dark"] .ai-input-wrap {
  background: var(--surface-tint);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(255, 140, 46, 0.25);
}
:root[data-theme="dark"] .ai-input {
  color: var(--ink);
}
:root[data-theme="dark"] .ai-input::placeholder { color: var(--ink-3); }
:root[data-theme="dark"] .ai-hint-pill {
  background: rgba(255, 140, 46, 0.18);
  border-color: rgba(255, 140, 46, 0.35);
  color: var(--accent-text);
}
:root[data-theme="dark"] .ai-input-hint { color: var(--ink-3); }

/* PICKER STATE — popular cards */
:root[data-theme="dark"] .popular-card {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
  color: var(--ink);
}
:root[data-theme="dark"] .popular-card-title { color: var(--ink); }
:root[data-theme="dark"] .popular-card-meta { color: var(--ink-3); }
:root[data-theme="dark"] .picker-section-label { color: var(--ink-3); }

/* Category cards */
:root[data-theme="dark"] .category-card {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .category-card-label { color: var(--ink); }

/* Drill items (category drill-down list) */
:root[data-theme="dark"] .drill-item {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .drill-item-title { color: var(--ink); }
:root[data-theme="dark"] .drill-item-meta { color: var(--ink-3); }
:root[data-theme="dark"] .drill-item-icon {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* "Inne / wpisz własne" fallback button */
:root[data-theme="dark"] .picker-other-btn {
  background: rgba(245, 239, 227, 0.04);
  border-color: rgba(245, 239, 227, 0.18);
  color: var(--ink-2);
}
:root[data-theme="dark"] .picker-other-btn:hover {
  background: rgba(255, 140, 46, 0.08);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* REFINE state */
:root[data-theme="dark"] .refine-summary {
  background: rgba(255, 140, 46, 0.15);
  border-color: rgba(255, 140, 46, 0.3);
  color: var(--accent-text);
}
:root[data-theme="dark"] .refine-label { color: var(--ink-3); }
:root[data-theme="dark"] .refine-amount {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .refine-amount-input { color: var(--ink); }
:root[data-theme="dark"] .refine-amount-input::placeholder { color: var(--ink-3); }
:root[data-theme="dark"] .refine-amount-suffix { color: var(--ink-3); }
:root[data-theme="dark"] .refine-date-input {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
  color: var(--ink);
}
:root[data-theme="dark"] .date-quick {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
  color: var(--ink-2);
}
:root[data-theme="dark"] .date-quick:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 46, 0.1);
}

/* Details toggle (rozwijane więcej opcji) */
:root[data-theme="dark"] .details-toggle {
  background: rgba(245, 239, 227, 0.04);
  border-color: rgba(245, 239, 227, 0.15);
  color: var(--ink-2);
}
:root[data-theme="dark"] .details-toggle:hover {
  background: rgba(245, 239, 227, 0.08);
  border-color: var(--accent);
  color: var(--ink);
}
:root[data-theme="dark"] .details-section-label,
:root[data-theme="dark"] .detail-section-label { color: var(--ink-3); }

/* Detail inputs (textarea, name) */
:root[data-theme="dark"] .detail-input {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
  color: var(--ink);
}
:root[data-theme="dark"] .detail-input::placeholder { color: var(--ink-3); }
:root[data-theme="dark"] .detail-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 140, 46, 0.18);
}
:root[data-theme="dark"] .detail-label { color: var(--ink-3); }
:root[data-theme="dark"] .detail-amount-suffix { color: var(--ink-3); }

/* Sticky save footer gradient */
:root[data-theme="dark"] .add-modal-foot {
  background: linear-gradient(180deg, transparent 0%, rgba(31, 28, 24, 0.95) 30%, #1F1C18 100%);
  border-top-color: rgba(245, 239, 227, 0.06);
}

/* Recognition pills (after AI parse) */
:root[data-theme="dark"] .recognition-pill {
  background: rgba(255, 140, 46, 0.18);
  border-color: rgba(255, 140, 46, 0.35);
  color: var(--accent-text);
}
:root[data-theme="dark"] .recognition-pill.amount {
  background: rgba(38, 180, 126, 0.2);
  color: #5FD9A5;
  border-color: rgba(38, 180, 126, 0.4);
}
:root[data-theme="dark"] .recognition-pill.date {
  background: rgba(60, 130, 240, 0.2);
  color: #82B0FF;
  border-color: rgba(60, 130, 240, 0.4);
}
:root[data-theme="dark"] .recognition-pill.recur {
  background: rgba(180, 120, 230, 0.2);
  color: #C99CE3;
  border-color: rgba(180, 120, 230, 0.4);
}

/* AI POPUP overlay */
:root[data-theme="dark"] .ai-popup {
  background: rgba(31, 28, 24, 0.92);
}
:root[data-theme="dark"] .ai-popup-card {
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 140, 46, 0.25);
}
:root[data-theme="dark"] .ai-popup-close {
  background: rgba(245, 239, 227, 0.06);
  color: var(--ink-2);
}
:root[data-theme="dark"] .ai-popup-label { color: var(--accent-text); }

/* HABIT type cards */
:root[data-theme="dark"] .habit-type-card-new {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .habit-type-card-title { color: var(--ink); }
:root[data-theme="dark"] .habit-type-card-desc { color: var(--ink-3); }

/* Habit suggestion cards */
:root[data-theme="dark"] .habit-sugg-card {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .habit-sugg-name { color: var(--ink); }

/* Emoji picker */
:root[data-theme="dark"] .emoji-picker {
  background: rgba(245, 239, 227, 0.04);
}
:root[data-theme="dark"] .emoji-pick:hover { background: var(--surface); }

/* INCOME type cards */
:root[data-theme="dark"] .income-type-card {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
}
:root[data-theme="dark"] .income-type-label { color: var(--ink); }

/* DETAIL modal specifics */
:root[data-theme="dark"] .detail-hero-meta { color: var(--ink-3); }
:root[data-theme="dark"] .detail-hero-amount { color: var(--ink); }
:root[data-theme="dark"] .detail-hero-amount .cur { color: var(--ink-3); }
:root[data-theme="dark"] .detail-hero-amount-sub { color: var(--ink-3); }

:root[data-theme="dark"] .next-payment {
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.15), rgba(255, 140, 46, 0.06));
  border-color: rgba(255, 140, 46, 0.3);
}
:root[data-theme="dark"] .next-payment.today {
  background: linear-gradient(135deg, rgba(255, 100, 20, 0.22), rgba(255, 100, 20, 0.1));
  border-color: rgba(255, 100, 20, 0.4);
}
:root[data-theme="dark"] .next-payment.overdue {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.2), rgba(230, 57, 70, 0.08));
  border-color: rgba(230, 57, 70, 0.4);
}
:root[data-theme="dark"] .next-payment .k { color: var(--ink-3); }
:root[data-theme="dark"] .next-payment .v { color: var(--ink); }

:root[data-theme="dark"] .info-card {
  background: var(--surface-tint);
  border-color: var(--hair);
}
:root[data-theme="dark"] .info-card .info-row {
  border-bottom-color: var(--hair);
}
:root[data-theme="dark"] .info-card .info-row .k { color: var(--ink-3); }
:root[data-theme="dark"] .info-card .info-row .v { color: var(--ink); }

:root[data-theme="dark"] .snooze-chip {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
  color: var(--ink-2);
}
:root[data-theme="dark"] .snooze-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 140, 46, 0.08);
}

:root[data-theme="dark"] .detail-delete-btn {
  background: rgba(230, 57, 70, 0.08);
  border-color: rgba(230, 57, 70, 0.35);
  color: #FF8896;
}
:root[data-theme="dark"] .detail-delete-btn:hover {
  background: rgba(230, 57, 70, 0.15);
  border-color: rgba(230, 57, 70, 0.55);
}

/* Modal handle */
:root[data-theme="dark"] .modal-handle {
  background: rgba(245, 239, 227, 0.18);
}

/* Refresh recognition pills wrapper if outside ai-popup gets dark too */
:root[data-theme="dark"] .recognition-pills .recognition-pill { color: inherit; }

/* Time picker row in habit form */
:root[data-theme="dark"] .time-picker-row input[type="time"] {
  background: var(--surface-tint);
  border-color: var(--hair-strong);
  color: var(--ink);
}

/* Mobile date input styling */
:root[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
}

/* Family invite link box */
.invite-link-box {
  margin: 14px 0 8px;
  background: var(--surface-tint, rgba(0,0,0,0.04));
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
}
.invite-link-box input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-family: monospace;
  word-break: break-all;
  cursor: pointer;
  outline: none;
}
:root[data-theme="dark"] .invite-link-box {
  background: rgba(43, 38, 32, 0.6);
}

/* ============================================================================
   ADMIN PANEL — full-screen overlay
   ============================================================================ */
.admin-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: var(--bg);
  color: var(--ink);
  display: none;
  flex-direction: column;
  font-family: var(--font);
}
.admin-overlay.open { display: flex; animation: backdropIn 0.3s var(--easing); }

.admin-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hair);
  background: var(--surface);
}
.admin-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 10px;
  background: var(--surface-tint);
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.admin-back:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-back svg { width: 16px; height: 16px; }
.admin-title {
  margin: 0; flex: 1;
  font-family: var(--font-disp);
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 10px;
}
.admin-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: linear-gradient(135deg, #C8102E, #8E0820);
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.4);
}
.admin-tab-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-tint);
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s var(--easing);
}
.admin-tab-btn:hover { background: var(--accent); color: #fff; transform: rotate(180deg); }
.admin-tab-btn svg { width: 16px; height: 16px; }

.admin-tabs {
  display: flex; gap: 4px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--hair);
  background: var(--surface);
  overflow-x: auto;
}
.admin-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s var(--easing);
}
.admin-tab:hover { background: var(--surface-tint); color: var(--ink); }
.admin-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.admin-content {
  flex: 1; overflow-y: auto;
  padding: 24px 20px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}
.admin-loading { text-align: center; padding: 60px; color: var(--ink-3); }
.admin-error { color: var(--danger); padding: 20px; border: 1px solid var(--danger); border-radius: 10px; text-align: center; }
.admin-empty { text-align: center; color: var(--ink-3); padding: 30px; font-style: italic; }

.admin-section-title {
  font-family: var(--font-disp);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 24px 0 12px;
}
.admin-section-title:first-child { margin-top: 0; }

/* Stat grid */
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
}
.admin-stat-card.accent::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.12), transparent 60%);
  pointer-events: none;
}
.admin-stat-num {
  font-family: var(--font-disp);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  line-height: 1.1;
}
.admin-stat-card.accent .admin-stat-num { color: var(--accent); }
.admin-stat-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.admin-chart-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 20px;
}

/* Toolbar */
.admin-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.admin-search {
  flex: 1; min-width: 200px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: all 0.15s var(--easing);
}
.admin-search:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 140, 46, 0.12); }
.admin-result-count {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
}

/* Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hair);
}
.admin-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-3);
  padding: 12px 14px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--hair);
}
.admin-table td {
  padding: 12px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--hair);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-user-row { cursor: pointer; transition: background 0.12s var(--easing); }
.admin-user-row:hover { background: var(--surface-tint); }
.admin-user-cell {}
.admin-user-name { font-weight: 600; color: var(--ink); }
.admin-user-email { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.admin-num { font-family: var(--font-disp); font-weight: 600; color: var(--ink-2); }
.admin-date { font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.admin-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-radius: 999px;
  margin-right: 4px;
}
.admin-pill.admin  { background: linear-gradient(135deg, #C8102E, #8E0820); color: #fff; }
.admin-pill.google { background: rgba(60, 130, 240, 0.18); color: #2563DC; }
.admin-pill.family { background: rgba(180, 122, 138, 0.18); color: #8E5566; }

.admin-pagination {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 18px 0 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.admin-page-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--hair-strong);
  color: var(--ink);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.admin-page-btn:hover:not(:disabled) { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.admin-help { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }

@media (max-width: 600px) {
  .admin-tabs { padding: 10px 12px; }
  .admin-content { padding: 18px 12px; }
  .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 10px 8px; }
  .admin-date { font-size: 11px; }
}

/* ============================================================================
   SOCIAL MEDIA ICONS
   ============================================================================ */
.social-icons-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-left: 50px; /* align with label */
}
.social-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand, var(--accent));
  color: #fff;
  transition: all 0.2s var(--easing);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.social-icon:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 50%, transparent);
}
.social-icon svg { width: 20px; height: 20px; }
.social-icon--sm { width: 34px; height: 34px; border-radius: 10px; }
.social-icon--sm svg { width: 17px; height: 17px; }

/* Auth overlay footer social row */
.auth-social-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 18px;
  margin-top: 12px;
  border-top: 1px solid var(--hair);
}

/* Dark mode tweaks */
:root[data-theme="dark"] .social-icon { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4); }
:root[data-theme="dark"] .admin-table tr:hover { background: rgba(245, 239, 227, 0.04); }

/* ============================================================================
   CUSTOM CONFIRM MODAL — replaces window.confirm()
   ============================================================================ */
.confirm-modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: backdropIn 0.25s var(--easing);
}
.confirm-modal-backdrop.open { display: flex; }

.confirm-modal {
  background: var(--surface);
  border-radius: 22px;
  padding: 28px 24px 22px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 140, 46, 0.1);
  animation: confirmModalIn 0.4s var(--bounce);
}
@keyframes confirmModalIn {
  0%   { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-modal-mascot {
  width: 88px; height: 88px;
  object-fit: contain;
  margin: -52px auto 8px;
  display: block;
  filter: drop-shadow(0 12px 22px rgba(255, 140, 46, 0.35));
  animation: confirmMascotBounce 0.55s var(--bounce) 0.1s backwards;
}
@keyframes confirmMascotBounce {
  0%   { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.confirm-modal-title {
  font-family: var(--font-disp);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.2;
}
.confirm-modal-msg {
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0 0 22px;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
}
.confirm-btn-cancel,
.confirm-btn-confirm {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--easing);
  border: none;
  font-family: inherit;
}
.confirm-btn-cancel {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-2);
}
.confirm-btn-cancel:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--ink);
}
.confirm-btn-confirm {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 140, 46, 0.35);
}
.confirm-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 140, 46, 0.45);
}
.confirm-btn-confirm:active { transform: translateY(0) scale(0.97); }
.confirm-btn-confirm.danger {
  background: linear-gradient(135deg, #E63946, #B8242E);
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
}
.confirm-btn-confirm.danger:hover {
  box-shadow: 0 8px 22px rgba(230, 57, 70, 0.5);
}

/* Dark mode */
:root[data-theme="dark"] .confirm-modal {
  background: linear-gradient(180deg, #2B2620 0%, #1F1C18 100%);
  color: var(--ink);
}
:root[data-theme="dark"] .confirm-modal-title { color: var(--ink); }
:root[data-theme="dark"] .confirm-modal-msg { color: var(--ink-2); }
:root[data-theme="dark"] .confirm-btn-cancel {
  background: rgba(245, 239, 227, 0.08);
  color: var(--ink-2);
}
:root[data-theme="dark"] .confirm-btn-cancel:hover {
  background: rgba(245, 239, 227, 0.14);
  color: var(--ink);
}

/* ============================================================================
   FAMILY BUTTONS — modern pill design
   ============================================================================ */

/* Big "Zaproś członka" CTA (in settings) */
.set-row.family-invite-btn {
  background: linear-gradient(135deg, rgba(38, 180, 126, 0.12), rgba(255, 140, 46, 0.08));
  border-radius: 14px;
  margin: 8px 4px;
  padding: 14px 16px !important;
  transition: all 0.2s var(--easing);
  cursor: pointer;
}
.set-row.family-invite-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(38, 180, 126, 0.18);
}
.set-row.family-invite-btn .si {
  background: linear-gradient(135deg, #26B47E, #19805A) !important;
  box-shadow: 0 4px 10px rgba(38, 180, 126, 0.3);
}

/* Member rows polish */
.family-member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  margin: 4px 0;
  transition: background 0.15s var(--easing);
}
.family-member-row:hover { background: rgba(255, 140, 46, 0.05); }

.family-member-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 140, 46, 0.25);
}

.family-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.family-pill.me {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
}
.family-pill.owner {
  background: linear-gradient(135deg, #FFD700, #FF9800);
  color: #5C3A00;
}

.family-remove-btn {
  background: transparent;
  border: 1.5px solid rgba(230, 57, 70, 0.3);
  color: var(--danger);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.family-remove-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* Improve invite-link-box copy/share buttons */
.invite-link-box {
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.1), rgba(38, 180, 126, 0.08));
}

/* ============================================================================
   CZUWEK BRAND LOGO — auto light/dark switch (canonical horizontal logo)
   ============================================================================ */
.czuwek-brand-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.czuwek-brand-logo img {
  max-width: 100%;
  height: auto;
  display: block;
}
.czuwek-brand-logo-dark { display: none !important; }
.czuwek-brand-logo-light { display: block !important; }

:root[data-theme="dark"] .czuwek-brand-logo-light { display: none !important; }
:root[data-theme="dark"] .czuwek-brand-logo-dark  { display: block !important; }

/* Auth modal hero — bigger, prominent */
.auth-logo .czuwek-brand-logo {
  height: 64px;
  margin-bottom: 8px;
}
.auth-logo .czuwek-brand-logo img {
  height: 64px;
  width: auto;
}
@media (max-width: 480px) {
  .auth-logo .czuwek-brand-logo,
  .auth-logo .czuwek-brand-logo img { height: 52px; }
}

/* Hide old mascot/wordmark if both styles present somewhere */
.auth-logo .auth-mascot,
.auth-logo .auth-name { display: none; }

/* ============================================================================
   CUSTOM DATE PICKER — polski kalendarz z mascotem
   ============================================================================ */
.datepicker-backdrop {
  position: fixed; inset: 0; z-index: 510;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: backdropIn 0.25s var(--easing);
}
.datepicker-backdrop.open { display: flex; }

.datepicker-modal {
  background: var(--surface);
  border-radius: 22px;
  padding: 22px 22px 20px;
  max-width: 380px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(255, 140, 46, 0.12);
  animation: confirmModalIn 0.4s var(--bounce);
  overflow: hidden;
}

.datepicker-mascot {
  position: absolute;
  top: 10px; right: 12px;
  width: 64px; height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(255, 140, 46, 0.35));
  animation: cornerMascotFloat 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 5;
}

.datepicker-header {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
  padding-right: 90px; /* room for mascot */
}
.datepicker-nav {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-2);
  font-size: 17px;
  font-weight: 700;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.15s var(--easing);
  border: none;
  font-family: inherit;
}
.datepicker-nav:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.06);
}
.datepicker-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-disp);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.datepicker-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 6px;
  padding-right: 0;
}
.datepicker-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}
.datepicker-weekdays span.weekend { color: var(--accent); }

.datepicker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 16px;
}
.datepicker-day {
  aspect-ratio: 1;
  border-radius: 10px;
  background: transparent;
  border: 1.5px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  font-family: inherit;
  transition: all 0.15s var(--easing);
  position: relative;
}
.datepicker-day:not(:disabled):hover {
  background: rgba(255, 140, 46, 0.12);
  border-color: rgba(255, 140, 46, 0.35);
  transform: scale(1.05);
}
.datepicker-day.weekend { color: var(--accent); }
.datepicker-day.today {
  background: rgba(255, 140, 46, 0.15);
  border-color: var(--accent);
  font-weight: 800;
}
.datepicker-day.today::after {
  content: '';
  position: absolute;
  bottom: 5px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.datepicker-day.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-color: var(--accent-deep);
  box-shadow: 0 4px 12px rgba(255, 140, 46, 0.35);
  font-weight: 800;
  transform: scale(1.05);
}
.datepicker-day.selected.weekend { color: #fff; }
.datepicker-day.selected.today::after { background: #fff; }
.datepicker-day.outside {
  color: var(--ink-3);
  opacity: 0.35;
  cursor: default;
}

.datepicker-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px;
  background: rgba(255, 140, 46, 0.06);
  border-radius: 12px;
}
.datepicker-quick-btn {
  flex: 1;
  min-width: 50px;
  padding: 8px 10px;
  background: #fff;
  border: 1.5px solid rgba(255, 140, 46, 0.25);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-deep);
  cursor: pointer;
  transition: all 0.15s var(--easing);
  font-family: inherit;
  white-space: nowrap;
}
.datepicker-quick-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.datepicker-actions {
  display: flex;
  gap: 10px;
}
.datepicker-btn-cancel,
.datepicker-btn-confirm {
  flex: 1;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s var(--easing);
  border: none;
  font-family: inherit;
}
.datepicker-btn-cancel {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-2);
}
.datepicker-btn-cancel:hover { background: rgba(0, 0, 0, 0.1); color: var(--ink); }
.datepicker-btn-confirm {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 140, 46, 0.35);
  flex: 2;
}
.datepicker-btn-confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 140, 46, 0.45);
}
.datepicker-btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Make date inputs look like nice "click-to-pick" fields, not text inputs */
.date-picker-input {
  cursor: pointer;
  caret-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FF8C2E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px !important;
}
.date-picker-input:hover { border-color: var(--accent) !important; }

/* Dark mode */
:root[data-theme="dark"] .datepicker-modal {
  background: linear-gradient(180deg, #2B2620 0%, #1F1C18 100%);
  color: var(--ink);
}
:root[data-theme="dark"] .datepicker-nav {
  background: rgba(245, 239, 227, 0.06);
  color: var(--ink-2);
}
:root[data-theme="dark"] .datepicker-title { color: var(--ink); }
:root[data-theme="dark"] .datepicker-day { color: var(--ink); }
:root[data-theme="dark"] .datepicker-day.outside { color: var(--ink-3); opacity: 0.3; }
:root[data-theme="dark"] .datepicker-quick {
  background: rgba(255, 140, 46, 0.1);
}
:root[data-theme="dark"] .datepicker-quick-btn {
  background: var(--surface-tint);
  color: var(--accent-text);
  border-color: rgba(255, 140, 46, 0.35);
}
:root[data-theme="dark"] .datepicker-btn-cancel {
  background: rgba(245, 239, 227, 0.08);
  color: var(--ink-2);
}

/* ============================================================================
   QUOTE CARD — Dark mode fix + better home spacing
   ============================================================================ */
:root[data-theme="dark"] .quote-card {
  background: linear-gradient(135deg, rgba(255, 140, 46, 0.16) 0%, rgba(201, 100, 66, 0.10) 100%);
  border-color: rgba(255, 140, 46, 0.3);
}
:root[data-theme="dark"] .quote-card::before {
  background: radial-gradient(circle, rgba(255, 140, 46, 0.2), transparent 70%);
}
:root[data-theme="dark"] .quote-card .quote-text {
  color: #FFE3C2;
  font-weight: 500;
}
:root[data-theme="dark"] .quote-card .quote-author {
  color: #FFB87A;
}
:root[data-theme="dark"] .quote-card .quote-close {
  background: rgba(245, 239, 227, 0.1);
  color: #FFE3C2;
}
:root[data-theme="dark"] .quote-card .quote-close:hover {
  background: rgba(245, 239, 227, 0.18);
}

/* More breathing room between home cards (insights + quote stack) */
.quote-card { margin-bottom: 16px; }
.insight { margin-bottom: 14px !important; }
#homeContent .quick-add-row { margin-bottom: 18px; }
#homeContent .next-list-card { margin-top: 8px; }

/* ============================================================================
   TOPBAR BELL + ACORN CHIP
   ============================================================================ */
.bell-trigger, .acorn-chip {
  position: relative;
  display: inline-flex; align-items: center;
  background: rgba(255, 140, 46, 0.08);
  border: 1px solid rgba(255, 140, 46, 0.18);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s var(--easing);
  font-family: inherit;
}
.bell-trigger {
  width: 38px; height: 38px;
  border-radius: 50%;
  justify-content: center;
}
.bell-trigger:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(1.06);
}
.bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: #E63946;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  display: grid; place-items: center;
  border: 2px solid var(--bg, #FFF8EE);
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.4);
}

.acorn-chip {
  gap: 4px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
}
.acorn-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}
.acorn-emoji { font-size: 16px; line-height: 1; }
.acorn-count { font-family: var(--font-disp); }

/* Floating "+N orzeszków" toast when earned */
.acorn-gain-toast {
  position: fixed;
  top: 80px; right: 20px;
  background: linear-gradient(135deg, #A0653B, #5C3A1F);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  z-index: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 28px rgba(160, 101, 59, 0.45);
  transform: translateX(120%);
  transition: transform 0.4s var(--bounce);
}
.acorn-gain-toast.show { transform: translateX(0); }
.acorn-gain-emoji { font-size: 22px; }

/* ============================================================================
   NOTIFICATION DRAWER
   ============================================================================ */
.notif-drawer-backdrop {
  position: fixed; inset: 0; z-index: 480;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: flex-end;
  animation: backdropIn 0.25s var(--easing);
}
.notif-drawer-backdrop.open { display: flex; }

.notif-drawer {
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--hair);
  display: flex; flex-direction: column;
  animation: drawerSlideIn 0.35s var(--easing);
  overflow: hidden;
}
@keyframes drawerSlideIn {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(0); }
}
.notif-drawer-head {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--hair);
}
.notif-drawer-head h3 {
  flex: 1;
  margin: 0;
  font-family: var(--font-disp);
  font-size: 20px;
  font-weight: 800;
}
.notif-action-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 14px;
  border: none;
  transition: all 0.15s var(--easing);
}
.notif-action-btn:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
.notif-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-2);
  cursor: pointer;
  display: grid; place-items: center;
  border: none;
}
.notif-close:hover { background: rgba(0, 0, 0, 0.08); transform: rotate(90deg); }
.notif-close svg { width: 16px; height: 16px; }

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.notif-row {
  display: flex; gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s var(--easing);
  border-bottom: 1px solid var(--hair);
}
.notif-row:hover { background: var(--surface-tint); }
.notif-row.unread {
  background: rgba(255, 140, 46, 0.05);
}
.notif-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.notif-icon svg { width: 18px; height: 18px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 3px;
}
.notif-body {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.4;
  margin-bottom: 3px;
}
.notif-time {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}
.notif-dot {
  position: absolute;
  top: 50%; right: 14px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-50%);
}

.notif-empty {
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
}
.notif-empty img {
  width: 120px; height: 120px;
  object-fit: contain;
  opacity: 0.7;
  margin-bottom: 16px;
}
.notif-empty h4 {
  font-family: var(--font-disp);
  font-size: 18px;
  margin: 0 0 8px;
}
.notif-empty p {
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 280px;
}

/* ============================================================================
   ACORN SHOP MODAL
   ============================================================================ */
.acorn-shop-backdrop {
  position: fixed; inset: 0; z-index: 490;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: backdropIn 0.25s var(--easing);
}
.acorn-shop-backdrop.open { display: flex; }

.acorn-shop {
  background: var(--surface);
  border-radius: 22px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  animation: confirmModalIn 0.4s var(--bounce);
}

.acorn-shop-head {
  padding: 24px 22px 18px;
  text-align: center;
  background: linear-gradient(180deg, rgba(160, 101, 59, 0.12) 0%, transparent 100%);
  position: relative;
}
.acorn-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  border: none;
  transition: all 0.15s var(--easing);
}
.acorn-close:hover { background: rgba(0, 0, 0, 0.12); transform: rotate(90deg); }
.acorn-close svg { width: 16px; height: 16px; }

.acorn-balance-card {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #A0653B, #5C3A1F);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(160, 101, 59, 0.35);
}
.acorn-balance-emoji { font-size: 26px; }
.acorn-balance-num {
  font-family: var(--font-disp);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}
.acorn-balance-lbl {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.acorn-shop-tagline {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  max-width: 340px;
  margin-left: auto; margin-right: auto;
  line-height: 1.4;
}

.acorn-shop-tabs {
  display: flex;
  padding: 0 16px;
  border-bottom: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.5);
}
.acorn-tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s var(--easing);
}
.acorn-tab.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}

.acorn-shop-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
}

.acorn-rewards-grid {
  display: flex; flex-direction: column;
  gap: 10px;
}
.acorn-reward-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--hair);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s var(--easing);
}
.acorn-reward-card.available:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  box-shadow: 0 6px 16px rgba(255, 140, 46, 0.18);
}
.acorn-reward-card.locked {
  opacity: 0.55;
}
.acorn-reward-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.acorn-reward-info { flex: 1; min-width: 0; }
.acorn-reward-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 2px;
}
.acorn-reward-desc {
  font-size: 12px;
  color: var(--ink-3);
}
.acorn-reward-cost {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #A0653B, #5C3A1F);
  color: #fff;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.acorn-reward-card.locked .acorn-reward-cost {
  background: rgba(0,0,0,0.15);
  color: var(--ink-3);
}

.acorn-history-list { display: flex; flex-direction: column; gap: 6px; }
.acorn-history-row {
  display: flex; align-items: center;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--hair);
}
.acorn-history-info { flex: 1; min-width: 0; }
.acorn-history-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.acorn-history-time {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}
.acorn-history-pts {
  font-family: var(--font-disp);
  font-size: 15px;
  font-weight: 800;
}
.acorn-history-row.earned .acorn-history-pts { color: #19805A; }
.acorn-history-row.spent .acorn-history-pts { color: #C8102E; }

.acorn-rules { display: flex; flex-direction: column; gap: 10px; }
.acorn-rule {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--hair);
  font-size: 13.5px;
  color: var(--ink-2);
}
.acorn-rule > span:first-child { font-size: 22px; flex-shrink: 0; }
.acorn-rule strong { color: var(--accent-deep); font-weight: 800; }

/* Dark mode */
:root[data-theme="dark"] .notif-drawer {
  background: var(--surface);
  border-left-color: var(--hair);
}
:root[data-theme="dark"] .notif-row.unread { background: rgba(255, 140, 46, 0.08); }
:root[data-theme="dark"] .notif-action-btn,
:root[data-theme="dark"] .notif-close {
  background: rgba(245, 239, 227, 0.06);
}
:root[data-theme="dark"] .acorn-shop {
  background: linear-gradient(180deg, #2B2620 0%, #1F1C18 100%);
}
:root[data-theme="dark"] .acorn-shop-tabs { background: rgba(245, 239, 227, 0.03); }
:root[data-theme="dark"] .acorn-reward-card,
:root[data-theme="dark"] .acorn-history-row,
:root[data-theme="dark"] .acorn-rule { background: var(--surface-tint); }
:root[data-theme="dark"] .bell-trigger { background: rgba(245, 239, 227, 0.05); border-color: rgba(245, 239, 227, 0.12); }
:root[data-theme="dark"] .acorn-chip { background: rgba(255, 140, 46, 0.12); color: var(--accent-text); }

/* ============================================================
   SPLASH / LOADER v2 — minimal healthcare style
   (override; stare .splash-orb/halo/particle to martwy CSS)
   ============================================================ */
.splash {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  animation: none;
}
.splash-inner {
  display: flex; flex-direction: column; align-items: center;
}
.splash .splash-icon-wrap {
  position: relative;
  width: 128px; height: 128px;
  display: grid; place-items: center;
  margin-bottom: 26px;
}
/* Miękkie pastelowe kółko (puls) + cienki obracający się łuk akcentu */
.splash .splash-icon-wrap::before {
  content: '';
  position: absolute; inset: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  animation: splashRingPulse 2.4s ease-in-out infinite;
}
.splash .splash-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: transparent;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: splashSpin 1s cubic-bezier(0.5,0.1,0.4,0.9) infinite;
}
@keyframes splashSpin { to { transform: rotate(360deg); } }
@keyframes splashRingPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.35; }
  50%      { transform: scale(1.04); opacity: 0.6; }
}
.splash .splash-mascot {
  position: relative; z-index: 1;
  width: 76px; height: 76px;
  object-fit: contain;
  border-radius: 0;
  animation: splashMascotFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px rgba(208,135,99,0.25));
}
@keyframes splashMascotFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.splash .splash-name {
  font-family: var(--font-brand);
  font-size: 34px; font-weight: 800;
  letter-spacing: -1px;
  color: var(--ink);
  display: flex; gap: 0;
  margin: 0 0 6px;
  animation: none;
  text-transform: lowercase;
}
.splash .splash-name span {
  animation: none; opacity: 1; transform: none;
  color: var(--ink);
}
.splash .splash-name span.accent { color: var(--accent); }
.splash .splash-tag {
  font-size: 14px; color: var(--ink-3);
  margin: 0 0 28px;
  animation: none; opacity: 1;
  font-weight: 500;
}
/* obracający się pierścień wokół maskotki jest wskaźnikiem ładowania — kropki ukryte */
.splash .splash-spinner { display: none; }
.splash.hide { animation: splashOutV2 0.5s var(--easing) forwards; }
@keyframes splashOutV2 {
  to { opacity: 0; transform: scale(1.04); visibility: hidden; }
}

/* ============ KATEGORIE: zdjęcia jako ikony + edycja w kreatorze ============ */
.cat-icon.has-img, .si.has-img, .category-card-icon.has-img { overflow: hidden; padding: 0; }
.cat-icon-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.cat-wiz-photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--surface);
  border: 1.5px dashed var(--hair-strong);
  border-radius: 14px;
  color: var(--ink-2);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--easing);
}
.cat-wiz-photo-btn:hover { border-color: var(--accent); color: var(--accent); }
.cat-wiz-photo-btn svg { stroke: currentColor; }
.cat-wiz-photo-thumb {
  width: 32px; height: 32px; border-radius: 9px; object-fit: cover;
}
.cat-wiz-photo-clear {
  display: block; margin: 8px auto 0;
  background: none; border: none;
  color: var(--ink-3); font-size: 12.5px; font-family: inherit;
  cursor: pointer; text-decoration: underline;
}
.cat-wiz-or {
  text-align: center;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--ink-3);
  margin: 16px 0 12px;
}

/* ============ Drawer powiadomień jako bottom-sheet na telefonie ============ */
@media (max-width: 540px) {
  .notif-drawer-backdrop { justify-content: center; align-items: flex-end; }
  .notif-drawer {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 85vh;
    border-left: none;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -12px 48px rgba(45,46,51,0.28);
    animation: notifSheetUp 0.36s cubic-bezier(0.32,0.72,0,1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @keyframes notifSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .notif-drawer::before {
    content: '';
    display: block;
    width: 42px; height: 5px;
    background: var(--hair-strong);
    border-radius: 3px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .notif-drawer-head { padding-top: 12px; }
  .notif-list { max-height: 64vh; }
}

/* ============ Klikalny insight (np. zaległe → lista) + chip Zaległe ============ */
.insight.clickable { cursor: pointer; transition: transform 0.12s var(--easing), box-shadow 0.15s; }
.insight.clickable:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.insight.clickable:active { transform: scale(0.99); }
.insight-chevron {
  margin-left: auto; align-self: center;
  color: var(--danger);
  opacity: 0.6;
  flex-shrink: 0;
  display: inline-flex;
  transform: scaleX(-1); /* strzałka w prawo */
}
.insight.clickable:hover .insight-chevron { opacity: 1; }
.insight-chevron svg { stroke: currentColor; }
.chip.chip-overdue {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip.chip-overdue svg { stroke: currentColor; }
.chip.chip-overdue.active { background: var(--danger); color: #fff; }

/* ============================================================
   LANDING / MARKETING PAGE (#landingOverlay)
   Full-screen entry for first-time visitors. Token-based, so it
   follows light/dark automatically.
   ============================================================ */
.lp {
  position: fixed; inset: 0; z-index: 4000;
  background: var(--bg); color: var(--ink);
  font-family: var(--font);
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--easing);
}
.lp.open { opacity: 1; pointer-events: auto; }
.lp::before {
  content: ''; position: fixed; top: -140px; right: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,140,46,0.20), transparent 70%);
  pointer-events: none; z-index: 0;
}

/* buttons */
.lp-btn {
  font-family: var(--font-disp); font-weight: 700;
  border: none; border-radius: 999px; cursor: pointer;
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing), background 0.15s;
  white-space: nowrap; line-height: 1;
}
.lp-btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(255,140,46,0.35); }
.lp-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(255,140,46,0.45); }
.lp-btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--hair-strong); }
.lp-btn-ghost:hover { background: var(--surface-tint); }
.lp-btn-sm { padding: 9px 16px; font-size: 14px; }
.lp-btn-lg { padding: 15px 26px; font-size: 16px; }
.lp-btn:not(.lp-btn-sm):not(.lp-btn-lg) { padding: 11px 18px; font-size: 14px; }

/* nav */
.lp-nav {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.lp-nav-logo img { height: 30px; width: auto; display: block; }
.lp-nav-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 520px) { .lp-nav-actions .lp-btn-ghost { display: none; } }

/* hero */
.lp-hero {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 50px 22px 34px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
}
@media (max-width: 880px) {
  .lp-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; text-align: center; }
}
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--accent-text);
  background: var(--accent-soft); padding: 6px 13px; border-radius: 999px;
}
.lp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.lp-h1 {
  font-family: var(--font-disp); font-size: clamp(32px, 5vw, 50px);
  font-weight: 800; line-height: 1.05; letter-spacing: -1.5px; margin: 18px 0 0;
}
.lp-hl { color: var(--accent); }
.lp-sub {
  font-size: clamp(16px, 2vw, 19px); color: var(--ink-2);
  line-height: 1.5; margin: 18px 0 26px; max-width: 520px;
}
@media (max-width: 880px) { .lp-sub { margin-left: auto; margin-right: auto; } }
.lp-cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 880px) { .lp-cta-row { justify-content: center; } }
.lp-trust { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 22px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
@media (max-width: 880px) { .lp-trust { justify-content: center; } }

/* phone mockup */
.lp-hero-phone { display: flex; justify-content: center; position: relative; }
.lp-phone {
  width: 300px; max-width: 82vw; aspect-ratio: 9 / 19;
  background: var(--surface); border-radius: 42px; padding: 14px 12px;
  position: relative; overflow: hidden;
  box-shadow: 0 0 0 10px #1C1B19, 0 28px 70px rgba(0,0,0,0.28);
}
.lp-phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 24px; background: #1C1B19; border-radius: 0 0 16px 16px; z-index: 3;
}
.lp-phone-screen { height: 100%; overflow: hidden; border-radius: 30px; background: var(--bg); padding: 32px 13px 14px; }
.lp-app-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.lp-app-kicker { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--ink-3); }
.lp-app-hi { font-family: var(--font-disp); font-size: 17px; font-weight: 800; letter-spacing: -0.4px; margin-top: 2px; }
.lp-app-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.lp-app-hero { background: linear-gradient(135deg, #FF8C2E, #C96442); color: #fff; border-radius: 18px; padding: 14px; margin-bottom: 10px; }
.lp-app-hero-k { font-size: 10px; opacity: 0.9; font-weight: 600; }
.lp-app-hero-n { font-family: var(--font-disp); font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; margin-top: 3px; }
.lp-app-hero-n span { font-size: 14px; margin-left: 3px; opacity: 0.9; }
.lp-app-hero-pills { display: flex; gap: 6px; margin-top: 10px; }
.lp-app-hero-pills span { font-size: 9px; font-weight: 600; background: rgba(255,255,255,0.22); padding: 3px 8px; border-radius: 999px; }
.lp-app-quick { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; padding: 9px 11px; margin-bottom: 12px; color: var(--ink-3); font-size: 11px; }
.lp-app-quick svg { width: 13px; height: 13px; color: var(--accent); flex-shrink: 0; }
.lp-app-section { font-family: var(--font-disp); font-size: 12px; font-weight: 700; margin: 0 2px 8px; }
.lp-app-card { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--hair); border-radius: 14px; padding: 9px 11px; margin-bottom: 7px; }
.lp-app-badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.lp-app-badge svg { width: 15px; height: 15px; }
.lp-app-info { flex: 1; min-width: 0; }
.lp-app-name { font-size: 12px; font-weight: 700; letter-spacing: -0.2px; }
.lp-app-meta { font-size: 10px; color: var(--ink-3); margin-top: 1px; }
.lp-app-meta.lp-urgent { color: #C9543A; font-weight: 700; }
.lp-app-amt { font-family: var(--font-disp); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.lp-phone-sticker { position: absolute; bottom: -12px; right: -4px; width: 92px; height: auto; filter: drop-shadow(0 12px 22px rgba(0,0,0,0.22)); pointer-events: none; }
@media (max-width: 880px) { .lp-phone-sticker { width: 74px; right: 6px; } }

/* features */
.lp-features { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 50px 22px; }
.lp-section-head { text-align: center; max-width: 580px; margin: 0 auto 34px; }
.lp-section-head h2 { font-family: var(--font-disp); font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -1px; }
.lp-section-head p { color: var(--ink-2); font-size: 16px; margin-top: 10px; line-height: 1.5; }
.lp-feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 820px) { .lp-feat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .lp-feat-grid { grid-template-columns: 1fr; } }
.lp-feat { background: var(--surface); border: 1px solid var(--hair); border-radius: 20px; padding: 22px; }
.lp-feat-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--c); margin-bottom: 14px; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 40%, transparent); }
.lp-feat-ico svg { width: 23px; height: 23px; }
.lp-feat h3 { font-family: var(--font-disp); font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.lp-feat p { color: var(--ink-2); font-size: 14px; line-height: 1.5; margin-top: 7px; }

/* founder */
.lp-founder { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 30px 22px; }
.lp-founder-card { display: flex; gap: 30px; align-items: center; background: var(--surface); border: 1px solid var(--hair); border-radius: 28px; padding: 32px; }
@media (max-width: 680px) { .lp-founder-card { flex-direction: column; text-align: center; padding: 26px; } }
.lp-founder-photo { position: relative; width: 150px; height: 150px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 46%, #FF8C2E 0%, #FF8C2E 62%, transparent 63%); }
.lp-founder-photo img { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.lp-founder-initials { display: none; font-family: var(--font-disp); font-size: 54px; font-weight: 800; color: #fff; }
.lp-founder-photo.is-fallback { background: linear-gradient(135deg, #FF8C2E, #C96442); }
.lp-founder-photo.is-fallback .lp-founder-initials { display: block; }
.lp-founder-quote { font-size: clamp(17px, 2.4vw, 21px); line-height: 1.5; font-weight: 500; letter-spacing: -0.3px; margin: 14px 0 16px; }
.lp-founder-sign strong { font-family: var(--font-disp); font-size: 16px; }
.lp-founder-sign span { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }

/* final CTA */
.lp-final { position: relative; z-index: 1; max-width: 680px; margin: 18px auto 0; padding: 44px 22px; text-align: center; }
.lp-final-mascot { width: 78px; height: auto; margin-bottom: 6px; }
.lp-final h2 { font-family: var(--font-disp); font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -1px; }
.lp-final p { color: var(--ink-2); font-size: 16px; margin: 10px 0 22px; }

/* footer */
.lp-foot { position: relative; z-index: 1; border-top: 1px solid var(--hair); padding: 30px 22px 42px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.lp-foot-logo img { height: 26px; width: auto; opacity: 0.9; }
.lp-foot-social { display: flex; gap: 10px; }
.lp-foot-copy { color: var(--ink-3); font-size: 13px; }

/* ============================================================
   AUTH SCREEN — 1:1 wg mockupu (dwie karty, dekoracyjne tło, maskotka)
   ============================================================ */
/* ciepłe kremowe tło + miękkie bąbelki */
.auth-overlay {
  background: radial-gradient(120% 100% at 50% 0%, #FFF4EC 0%, #FCEADE 55%, #F8E2D2 100%) !important;
}
:root[data-theme="dark"] .auth-overlay {
  background: linear-gradient(180deg, #251a12 0%, #15110d 72%) !important;
}
.auth-decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.auth-bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFB877, #FF8C2E); filter: blur(1px); }
.auth-bubble.b1 { width: 200px; height: 200px; top: 7%;  left: 5%;  opacity: 0.16; }
.auth-bubble.b2 { width: 90px;  height: 90px;  top: 16%; left: 31%; opacity: 0.10; }
.auth-bubble.b3 { width: 130px; height: 130px; top: 5%;  right: 15%; opacity: 0.13; }
.auth-bubble.b4 { width: 260px; height: 260px; bottom: -6%; right: 3%; opacity: 0.15; }
.auth-bubble.b5 { width: 70px;  height: 70px;  bottom: 24%; right: 30%; opacity: 0.12; }
.auth-dots {
  position: absolute; left: 4%; top: 44%; width: 130px; height: 95px;
  background-image: radial-gradient(rgba(255,140,46,0.55) 2px, transparent 2.4px);
  background-size: 18px 18px; opacity: 0.55;
}
.auth-mascot {
  position: absolute; left: calc(50% - 480px); bottom: 0;
  width: 200px; height: auto; z-index: 2;
  filter: drop-shadow(0 16px 28px rgba(196,100,66,0.30));
}
:root[data-theme="dark"] .auth-dots { opacity: 0.3; }
@media (max-width: 1040px) { .auth-mascot { left: 1%; width: 150px; } }
@media (max-width: 760px)  { .auth-mascot, .auth-dots { display: none; } }

.auth-layout {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: stretch; gap: 22px;
  width: 100%; max-width: 920px;
  background: transparent;
  animation: pop 0.4s var(--bounce);
}
/* obie karty: czysta biel, miękkie zaokrąglenie i cień */
.auth-layout > .auth-card,
.auth-aside {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.045);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(196, 100, 66, 0.16);
}
.auth-layout > .auth-card {
  max-width: none !important; width: auto !important;
  padding: 38px 34px; animation: none;
}
:root[data-theme="dark"] .auth-layout > .auth-card,
:root[data-theme="dark"] .auth-aside { border-color: var(--hair); box-shadow: 0 24px 60px rgba(0,0,0,0.4); }

/* etykiety wielkimi literami + prawdziwe ikony SVG w polach (nie tło) */
.auth-layout .auth-field label { text-transform: uppercase; letter-spacing: 0.6px; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.auth-input-wrap { position: relative; }
.auth-input-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; z-index: 1;
}
.auth-layout .auth-input-wrap input { padding-left: 42px; }

/* prawa karta — kontakt twórcy */
.auth-aside {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 4px; padding: 42px 30px 36px;
}
.auth-aside-badge {
  position: absolute; top: 16px; right: 18px;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: 5px 10px; border-radius: 8px;
}
/* okrągłe zdjęcie w pomarańczowym kole + małe bąbelki */
.auth-aside-photo {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 16px;
  background: radial-gradient(circle at 50% 48%, #FF8C2E, #F4781C);
  box-shadow: 0 14px 34px rgba(255,140,46,0.34);
}
.auth-aside-photo img {
  width: 138px; height: 138px; border-radius: 50%; object-fit: cover; object-position: center 28%;
  position: relative; z-index: 1;
}
.auth-aside-photo::before, .auth-aside-photo::after { content: ''; position: absolute; border-radius: 50%; background: var(--accent); z-index: 0; }
.auth-aside-photo::before { width: 20px; height: 20px; top: 2px; right: -6px; opacity: 0.45; }
.auth-aside-photo::after  { width: 12px; height: 12px; bottom: 10px; left: -10px; opacity: 0.4; }
.auth-aside-initials { display: none; font-family: var(--font-disp); font-size: 58px; font-weight: 800; color: #fff; }
.auth-aside-photo.is-fallback { background: linear-gradient(135deg, #FF8C2E, #C96442); }
.auth-aside-photo.is-fallback .auth-aside-initials { display: block; }
.auth-aside-title { font-family: var(--font-disp); font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--ink); margin-top: 2px; }
.auth-aside-role { font-size: 12px; font-weight: 800; color: var(--accent-text); text-transform: uppercase; letter-spacing: 1.2px; margin-top: 4px; }
.auth-aside-text { font-size: 14px; color: var(--ink-2); line-height: 1.6; max-width: 300px; margin-top: 12px; }
/* LinkedIn — biały przycisk z niebieską ikoną (jak w mockupie) */
.auth-aside-linkedin {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 18px; padding: 12px 24px; border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px;
  border: 1px solid var(--hair-strong);
  text-decoration: none; box-shadow: 0 8px 18px rgba(0,0,0,0.08);
  transition: transform 0.15s var(--easing), box-shadow 0.15s var(--easing);
}
.auth-aside-linkedin:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.auth-aside-linkedin svg { width: 22px; height: 22px; color: #0A66C2; }
.auth-aside-contact { margin-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.auth-aside-contact-label { color: var(--ink-3); font-size: 13px; }
.auth-aside-contact a { color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; word-break: break-all; }
.auth-aside-contact a:hover { color: var(--accent-deep); }
/* social jako pełne kolorowe kółka */
.auth-aside-social { display: flex; gap: 11px; margin-top: 20px; }
.auth-aside-social .social-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; border: none;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform 0.15s var(--easing);
}
.auth-aside-social .social-icon:hover { transform: translateY(-3px); }
.auth-aside-social .social-icon svg { width: 19px; height: 19px; fill: #fff; }
.auth-social-row:empty { display: none; }

/* przycisk Google — wyśrodkuj, nie rozciągaj iframe na 100% */
.google-signin-wrap { margin: 14px 0 16px; }
#googleSignInBtn { min-height: 44px; }
#googleSignInBtn > div { width: auto !important; max-width: 100%; margin: 0 auto; }

/* przycisk gościa — wiersz z ikoną (jak w mockupie) */
.auth-guest {
  flex-direction: row !important; align-items: center; gap: 12px;
  text-align: left; padding: 12px 16px;
  border: 1px solid var(--hair); border-radius: 14px;
}
.auth-guest-ico {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--hair); color: var(--ink-2);
  display: grid; place-items: center;
}
.auth-guest-ico svg { width: 19px; height: 19px; stroke: currentColor; }
.auth-guest-txt { display: flex; flex-direction: column; gap: 1px; }
.auth-guest-title { font-weight: 700; font-size: 14px; color: var(--ink); }

@media (max-width: 760px) {
  .auth-layout { grid-template-columns: 1fr; max-width: 440px; gap: 16px; }
  .auth-layout > .auth-card { padding: 30px 24px; }
  .auth-aside { padding: 32px 24px; }
}
