/* =====================================================================
   Financie – dizajn systém v2
   Mobile-first, moderný "fintech" vzhľad, svetlý aj tmavý režim.
   ===================================================================== */

:root {
  --brand-1: #5b4bff;
  --brand-2: #8b5cf6;
  --brand-3: #22d3ee;
  --brand: #5b4bff;
  --brand-soft: #eeecff;
  --brand-ink: #3b2fd9;
  --grad: linear-gradient(135deg, #5b4bff 0%, #8b5cf6 55%, #c084fc 100%);
  --grad-hero: radial-gradient(120% 140% at 100% 0%, #c084fc 0%, rgba(192,132,252,0) 45%),
               radial-gradient(90% 120% at 0% 100%, #22d3ee 0%, rgba(34,211,238,0) 50%),
               linear-gradient(135deg, #4338ca 0%, #5b4bff 45%, #7c3aed 100%);

  --success: #10b981;
  --success-soft: #dcfce7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;

  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #eef1f7;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #7a8599;
  --border: #e5e9f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -6px rgba(15, 23, 42, .08);
  --shadow-lg: 0 20px 50px -12px rgba(67, 56, 202, .35);

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --tap: 52px;
  --nav-h: 76px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* Tmavá téma – zapína ju atribút data-bs-theme="dark" na <html>
   (nastavuje ho skript v hlavičke podľa voľby Automaticky / Svetlá / Tmavá) */
:root[data-bs-theme="dark"] {
    --brand: #8b83ff;
    --brand-soft: rgba(139, 131, 255, .14);
    --brand-ink: #b4aeff;
    --success-soft: rgba(16, 185, 129, .15);
    --danger-soft: rgba(239, 68, 68, .15);
    --warning-soft: rgba(245, 158, 11, .15);
    --bg: #0b0e17;
    --surface: #131827;
    --surface-2: #181e30;
    --surface-3: #1f2640;
    --text: #eef1f8;
    --text-2: #c3cad9;
    --muted: #8691a8;
    --border: #252c43;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .55);
    color-scheme: dark;
}

/* ---------- Základ ---------- */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  overflow-x: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-weight: 800; letter-spacing: -0.025em; color: var(--text); }
.text-muted, .muted { color: var(--muted) !important; }
.small, small { font-size: .84rem; }
.tabular { font-variant-numeric: tabular-nums; }
hr { border-color: var(--border); opacity: 1; }
::selection { background: var(--brand-soft); }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100dvh; }
.app-content { flex: 1; min-width: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 8px 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); }
.is-guest .page { padding-bottom: 32px; }
@media (min-width: 992px) {
  .page { padding: 28px 36px 48px; }
}

/* Mobilná hlavička */
.app-header {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.app-header h1 { font-size: 1.35rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .header-actions { display: flex; gap: 8px; }
@media (min-width: 992px) {
  .app-header { padding: 26px 36px 6px; background: transparent; backdrop-filter: none; position: static; max-width: 1120px; margin: 0 auto; }
  .app-header h1 { font-size: 1.9rem; }
}

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  font-size: 1.2rem; flex-shrink: 0; cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- Bočný panel (desktop) ---------- */
.sidebar { display: none; }
@media (min-width: 992px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    width: 264px; flex-shrink: 0; padding: 26px 18px;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border);
  }
}
.brand-mark { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 13px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.25rem;
  box-shadow: 0 8px 20px -6px rgba(91, 75, 255, .6);
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 14px;
  color: var(--text-2); font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.side-link i { font-size: 1.2rem; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--brand-soft); color: var(--brand); }
.sidebar .side-cta { margin-top: 14px; }
.sidebar .side-bottom { margin-top: auto; }

/* ---------- Spodná navigácia (mobil) ---------- */
.bottom-nav {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: 66px; z-index: 1030;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px -12px rgba(15, 23, 42, .25);
}
@media (min-width: 992px) { .bottom-nav { display: none; } }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: .68rem; font-weight: 700; padding: 6px 0;
  background: none; border: 0;
}
.nav-item i { font-size: 1.35rem; line-height: 1; transition: transform .15s ease; }
.nav-item.active { color: var(--brand); }
.nav-item.active i { transform: translateY(-1px); }
.nav-fab {
  flex: 0 0 auto; width: 58px; height: 58px; margin: -30px 6px 0;
  border-radius: 20px; border: 0; color: #fff; font-size: 1.7rem;
  background: var(--grad); box-shadow: var(--shadow-lg);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.nav-fab:active { transform: scale(.92) rotate(45deg); }

/* ---------- Karty ---------- */
.card, .surface {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { margin-bottom: 16px; }
.card-body { padding: 20px; }
.card-title { font-size: 1.02rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .link { font-size: .85rem; font-weight: 700; }
.section-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 10px; }

/* ---------- Tlačidlá ---------- */
.btn {
  min-height: var(--tap); border-radius: 16px; font-weight: 700; font-size: 1rem;
  padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-width: 1px; letter-spacing: -0.01em;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 40px; border-radius: 12px; font-size: .88rem; padding: 0 14px; }
.btn-lg { min-height: 58px; font-size: 1.06rem; border-radius: 18px; }
.btn-primary, .btn-success {
  background: var(--grad); border: 0; color: #fff;
  box-shadow: 0 10px 24px -10px rgba(91, 75, 255, .7);
}
.btn-primary:hover, .btn-success:hover, .btn-primary:focus, .btn-success:focus { color: #fff; filter: brightness(1.05); background: var(--grad); }
.btn-soft { background: var(--brand-soft); color: var(--brand); border: 0; }
.btn-soft:hover { background: var(--brand-soft); color: var(--brand-ink); }
.btn-ghost, .btn-outline-success, .btn-outline-secondary {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.btn-ghost:hover, .btn-outline-success:hover, .btn-outline-secondary:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-danger-soft, .btn-outline-danger { background: var(--danger-soft); color: var(--danger); border: 0; }
.btn-danger-soft:hover, .btn-outline-danger:hover { background: var(--danger-soft); color: var(--danger); filter: brightness(.97); }
.btn-dashed {
  background: transparent; border: 2px dashed var(--border); color: var(--muted);
}
.btn-dashed:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-passkey {
  background: var(--text); color: var(--bg); border: 0;
}
.btn-passkey:hover { background: var(--text); color: var(--bg); filter: brightness(1.15); }
.btn-passkey i { font-size: 1.35rem; }

/* ---------- Formuláre ---------- */
.form-label { font-weight: 700; font-size: .85rem; color: var(--text-2); margin-bottom: 6px; }
.form-control, .form-select {
  min-height: var(--tap); border-radius: 14px; font-size: 1rem; font-weight: 500;
  background-color: var(--surface-2); color: var(--text);
  border: 1.5px solid transparent;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-control:focus, .form-select:focus {
  background-color: var(--surface); color: var(--text);
  border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.form-control:disabled { background: var(--surface-3); color: var(--muted); }
.form-control-color { padding: 6px; min-height: var(--tap); }
[data-bs-theme="dark"] .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23aab' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
[data-bs-theme="dark"] .btn-close { filter: invert(1); }

.field { position: relative; }
.field > i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 1.1rem; pointer-events: none;
}
.field > .form-control, .field > .form-select { padding-left: 46px; }
.field .suffix {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 700; pointer-events: none;
}
.field .suffix + .form-control, .field .form-control.has-suffix { padding-right: 38px; }

/* ---------- Alerty / bannery ---------- */
.alert {
  border: 0; border-radius: 16px; padding: 14px 16px; font-weight: 600; font-size: .94rem;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-success { background: var(--success-soft); color: #047857; }
.alert-danger { background: var(--danger-soft); color: #b91c1c; }
.alert-warning { background: var(--warning-soft); color: #92400e; }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); }
[data-bs-theme="dark"] .alert-success { color: #6ee7b7; }
[data-bs-theme="dark"] .alert-danger { color: #fca5a5; }
[data-bs-theme="dark"] .alert-warning { color: #fcd34d; }
.alert .btn-close { margin-left: auto; padding: 6px; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
@media (min-width: 992px) { .toast-wrap { bottom: 32px; } }
.app-toast {
  display: flex; align-items: center; gap: 10px;
  background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 16px;
  font-weight: 600; font-size: .95rem; box-shadow: 0 16px 40px -12px rgba(0,0,0,.45);
  animation: toast-in .28s cubic-bezier(.2, .9, .3, 1.2);
}
.app-toast.error { background: #b91c1c; }
.app-toast i { font-size: 1.2rem; }
.app-toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Auth obrazovky ---------- */
.auth-bg {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 32px 16px; position: relative; overflow: hidden;
  background: var(--grad-hero);
}
.auth-bg::before, .auth-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.auth-bg::before { width: 340px; height: 340px; background: #22d3ee; top: -120px; left: -80px; }
.auth-bg::after { width: 380px; height: 380px; background: #f0abfc; bottom: -160px; right: -100px; }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 32px 24px 28px; box-shadow: 0 30px 80px -20px rgba(30, 20, 90, .55);
}
@media (min-width: 576px) { .auth-card { padding: 40px 36px 34px; } }
.auth-logo {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 18px;
  background: var(--grad); color: #fff; font-size: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -10px rgba(91, 75, 255, .7);
}
.auth-title { text-align: center; font-size: 1.6rem; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 26px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; font-weight: 700; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { text-align: center; margin-top: 22px; color: var(--muted); font-weight: 500; }
.auth-foot a { font-weight: 700; }

/* ---------- Hero karta (dashboard) ---------- */
.hello { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 2px 16px; }
.hello .avatar { width: 46px; height: 46px; }
.hello-text { flex: 1; min-width: 0; }
.hello-text .hi { font-size: .85rem; color: var(--muted); font-weight: 600; }
.hello-text .name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }

.avatar {
  width: 40px; height: 40px; border-radius: 14px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; background: var(--grad); font-size: 1rem;
}

.hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: var(--radius-lg); padding: 22px 22px 20px;
  background: var(--grad-hero); box-shadow: var(--shadow-lg);
  margin-bottom: 18px;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ccircle cx='170' cy='30' r='90' fill='none' stroke='white' stroke-opacity='.10' stroke-width='1.5'/%3E%3Ccircle cx='170' cy='30' r='60' fill='none' stroke='white' stroke-opacity='.10' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right top / 260px;
  pointer-events: none;
}
.hero-label { font-size: .85rem; font-weight: 600; opacity: .85; display: flex; align-items: center; gap: 8px; }
.hero-amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.045em; line-height: 1.1; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.hero-amount .cur { font-size: 1.5rem; opacity: .8; margin-left: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
}
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stat { background: rgba(255,255,255,.12); border-radius: 16px; padding: 10px 12px; }
.hero-stat .v { font-weight: 800; font-size: 1.02rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stat .l { font-size: .7rem; opacity: .8; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Segmentový prepínač */
.segmented {
  display: flex; gap: 4px; padding: 4px; border-radius: 16px;
  background: var(--surface-3); overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a, .segmented button {
  flex: 1; white-space: nowrap; text-align: center; border: 0; background: none;
  padding: 9px 12px; border-radius: 12px; font-weight: 700; font-size: .88rem; color: var(--muted);
}
.segmented .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: .82rem; font-weight: 700; border: 0;
}
.chip.neutral { background: var(--surface-3); color: var(--text-2); }
.chip .x { opacity: .7; }

/* ---------- Rýchly zápis ---------- */
.quick-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.quick-strip::-webkit-scrollbar { display: none; }
@media (min-width: 992px) { .quick-strip { margin: 0; padding-left: 2px; padding-right: 2px; } }
.quick-chip {
  scroll-snap-align: start; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 8px 14px 8px 8px; box-shadow: var(--shadow-sm);
  cursor: pointer; user-select: none; transition: transform .12s ease;
}
.quick-chip:active { transform: scale(.95); }
.quick-chip .qi { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.quick-chip .ql { font-weight: 700; font-size: .88rem; line-height: 1.15; }
.quick-chip .qa { font-size: .78rem; color: var(--muted); font-weight: 600; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 576px) { .quick-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }
.quick-tile {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 16px; box-shadow: var(--shadow);
  cursor: pointer; user-select: none; overflow: hidden;
  transition: transform .14s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; gap: 14px; min-height: 142px;
}
.quick-tile:active { transform: scale(.96); }
.quick-tile .qi { width: 50px; height: 50px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.quick-tile .ql { font-weight: 800; font-size: 1rem; line-height: 1.2; letter-spacing: -0.02em; }
.quick-tile .qa { color: var(--muted); font-weight: 700; font-size: .88rem; margin-top: 2px; }
.quick-tile .qp { color: var(--brand); font-weight: 700; font-size: .74rem; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-tile .qplus {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.quick-tile.saved { animation: pop .45s ease; }
@keyframes pop { 40% { transform: scale(.93); } 70% { transform: scale(1.03); } }
.quick-tile .ripple { position: absolute; border-radius: 50%; background: var(--brand); opacity: .18; transform: scale(0); animation: ripple .55s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.quick-tile-add {
  border: 2px dashed var(--border); background: transparent; box-shadow: none;
  align-items: center; justify-content: center; color: var(--muted); font-weight: 700; gap: 6px;
}
.quick-tile-add i { font-size: 1.8rem; }
.editing .quick-tile:not(.quick-tile-add) { animation: wiggle .35s ease-in-out infinite alternate; }
.editing .quick-tile .qplus { background: var(--surface-3); color: var(--text-2); }
@keyframes wiggle { from { transform: rotate(-.8deg); } to { transform: rotate(.8deg); } }
.tile-del {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: none;
  width: 32px; height: 32px; border-radius: 11px; border: 0;
  background: var(--danger); color: #fff; font-size: 1rem;
}
.editing .tile-del { display: inline-flex; align-items: center; justify-content: center; }
.editing .quick-tile .qplus { display: none; }

/* ---------- Zoznamy (transakcie, kategórie, nastavenia) ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 4px;
  color: var(--text); border-radius: 14px; cursor: pointer;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t1 { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .t2 { font-size: .82rem; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.list-row .amt small { display: block; font-weight: 600; color: var(--muted); font-size: .74rem; }
.list-row .chev { color: var(--muted); }

.cat-icon {
  width: 46px; height: 46px; border-radius: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
  background: var(--surface-3);
}

.day-head { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 16px 4px 4px; }
.day-head:first-child { padding-top: 0; }

/* nákup, ku ktorému sa appka vrátila po úprave – chvíľu svieti */
.tx-found { border-radius: 18px; animation: tx-found 2.6s ease; }
@keyframes tx-found {
  0%, 60% { background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand) inset; }
  100% { background: transparent; box-shadow: 0 0 0 2px transparent inset; }
}
@media (prefers-reduced-motion: reduce) {
  .tx-found { animation: none; background: var(--brand-soft); }
}
.tx-detail { display: none; padding: 4px 4px 14px 64px; }
.tx.open .tx-detail { display: block; }
.tx.open .chev { transform: rotate(180deg); }
.tx-item { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .9rem; color: var(--text-2); }
.tx-item .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* položka s názvom kategórie pod ňou (detail nákupu na Prehľade) */
.tx-item.has-cat { align-items: flex-start; padding: 7px 0; }
.tx-item.has-cat .n { display: flex; flex-direction: column; gap: 1px; white-space: normal; overflow: visible; }
.tx-item.has-cat .n .ln { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-item .cat { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); font-weight: 600; }
.tx-item .cat .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
/* ---------- Produkty a kategórie ---------- */
.prod-rule { gap: 10px; }
.prod-rule .form-select.cat { max-width: 44%; flex-shrink: 0; font-size: .85rem; padding-top: 8px; padding-bottom: 8px; }
.prod-rule.is-set .t1 { color: var(--brand); }
.prod-rule .rule-tag { color: var(--brand); font-weight: 700; margin-left: 4px; }
@media (max-width: 430px) {
  .prod-rule { flex-wrap: wrap; }
  .prod-rule .form-select.cat { max-width: none; width: 100%; margin-top: 4px; }
}
.tx-item .a { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-actions { display: flex; gap: 8px; margin-top: 10px; }

.progress-thin { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 7px; }
.progress-thin > span { display: block; height: 100%; border-radius: 99px; }

.settings-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.settings-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--text); width: 100%; background: none; border: 0; text-align: left; }
.settings-row + .settings-row, .settings-row + .settings-panel, .settings-panel + .settings-row { border-top: 1px solid var(--border); }
.settings-row .si { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex-shrink: 0; }
.settings-row .grow { flex: 1; min-width: 0; font-weight: 700; }
.settings-row .grow small { display: block; color: var(--muted); font-weight: 500; }
.settings-panel { padding: 4px 18px 18px; }

.si.violet { background: var(--brand-soft); color: var(--brand); }
.si.green { background: var(--success-soft); color: var(--success); }
.si.amber { background: var(--warning-soft); color: var(--warning); }
.si.red { background: var(--danger-soft); color: var(--danger); }
.si.cyan { background: rgba(34, 211, 238, .15); color: #0891b2; }

/* ---------- Grafy ---------- */
.chart-box { position: relative; height: 230px; }
.donut-wrap { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center .v { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; }
.donut-center .l { font-size: .75rem; color: var(--muted); font-weight: 600; }

/* ---------- Prázdny stav ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ei { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 14px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.empty h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 4px; }

/* ---------- Formulár nákupu ---------- */
.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); animation: slide-in .25s ease; }
@keyframes slide-in { from { opacity: 0; transform: translateY(8px); } }
.item-card .item-top { display: flex; gap: 6px; align-items: center; }
.item-card .item-top .form-control { min-width: 0; flex: 1; }
@media (max-width: 430px) { .item-card .item-top .icon-btn { width: 38px; height: 38px; font-size: .95rem; } }
.item-card .item-top .form-control { font-weight: 700; }
.item-card .item-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; margin-top: 8px; }
.item-card .item-grid .cat { grid-column: 1 / -1; }
@media (min-width: 576px) { .item-card .item-grid { grid-template-columns: 110px 150px 1fr; } .item-card .item-grid .cat { grid-column: auto; } }
.item-card.negative .amount-input { color: var(--success); }

.save-bar {
  position: fixed; left: 12px; right: 12px; z-index: 1025;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 20px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border); box-shadow: 0 12px 40px -12px rgba(15, 23, 42, .3);
}
.save-bar .total-l { font-size: .74rem; color: var(--muted); font-weight: 700; }
.save-bar .total-v { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.save-bar .btn { margin-left: auto; }
@media (min-width: 992px) { .save-bar { left: calc(264px + 36px); right: 36px; max-width: 1048px; } }
.has-save-bar .bottom-nav { display: none; }

/* ---------- Akcie pri položkách ---------- */
.item-top .btn-sale-item { color: var(--muted); }
.item-top .btn-sale-item.on { background: var(--warning-soft); color: var(--warning); }
.item-card.is-sale { box-shadow: inset 3px 0 0 var(--warning); }
.item-sale { font-size: .72rem; color: var(--warning); font-weight: 700; margin: -2px 0 6px 4px; }
.item-top .btn-warranty-item { color: var(--muted); }
.item-top .btn-warranty-item.on { background: var(--success-soft); color: var(--success); }
.item-warranty { font-size: .72rem; color: var(--success); font-weight: 700; margin: -2px 0 6px 4px; }
.warranty-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.warranty-opts .btn { justify-content: center; }
.sale-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px;
  background: var(--warning-soft); color: var(--warning); font-size: .68rem; font-weight: 800;
  vertical-align: middle;
}
.sale-badge i { font-size: .72rem; }
.warranty-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px;
  background: var(--success-soft); color: var(--success); font-size: .68rem; font-weight: 800;
  vertical-align: middle;
}
.warranty-badge i { font-size: .72rem; }
.warranty-badge.off { background: var(--border); color: var(--muted); }
.sale-card .si { flex-shrink: 0; }
.sale-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.sale-list .row-i { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .88rem; }
.sale-list .row-i + .row-i { border-top: 1px solid var(--border); }
.sale-list .row-i .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sale-list .row-i .s { color: var(--success); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Našepkávanie obchodu ---------- */
.place-suggest { position: relative; }
.place-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.place-chips .chip { border: 0; cursor: pointer; font-size: .78rem; padding: 6px 11px; }
.place-drop {
  position: absolute; left: 0; right: 0; top: 4px; z-index: 1060;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 46vh; overflow-y: auto;
}
.place-drop button {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none;
  padding: 11px 14px; color: var(--text); font-weight: 700; font-size: .92rem; text-align: left;
}
.place-drop button + button { border-top: 1px solid var(--border); }
.place-drop button:hover, .place-drop button:focus { background: var(--surface-2); }
.place-drop button i { color: var(--brand); }
.place-drop button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-drop button small { color: var(--muted); font-weight: 600; }

/* ---------- Offline lišta ---------- */
.offline-bar {
  position: fixed; left: 12px; right: 12px; z-index: 1035;
  bottom: calc(86px + env(safe-area-inset-bottom));
  display: none; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; border: 0; border-radius: 18px;
  background: #334155; color: #fff; font-weight: 700; font-size: .84rem;
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .55);
}
.offline-bar.show { display: flex; }
.offline-bar.pending { background: var(--grad); }
.offline-bar i { font-size: 1.05rem; }
.has-save-bar .offline-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 992px) {
  .offline-bar { left: auto; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom)); width: auto; }
}
@media print { .offline-bar { display: none !important; } }

/* ---------- Skener ---------- */
.scanner {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: #0b0e17; aspect-ratio: 1 / 1; max-height: 62vh; margin: 0 auto 16px; width: 100%;
  box-shadow: var(--shadow);
}
.scanner #qr-reader { position: absolute; inset: 0; }
.scanner #qr-reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scanner #qr-reader img, .scanner #qr-reader__dashboard, .scanner #qr-reader__header_message { display: none !important; }
.scanner #qr-shaded-region { border-color: rgba(11, 14, 23, .45) !important; }
.scanner #qr-shaded-region > div { display: none !important; }
.scan-frame { position: absolute; inset: 18%; pointer-events: none; z-index: 2; }
.scan-frame span { position: absolute; width: 38px; height: 38px; border: 4px solid #fff; }
.scan-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.scan-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.scan-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.scan-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.scan-line { position: absolute; left: 6%; right: 6%; height: 3px; top: 10%; border-radius: 3px; background: linear-gradient(90deg, transparent, #22d3ee, transparent); box-shadow: 0 0 18px #22d3ee; animation: scan 2.2s ease-in-out infinite alternate; }
@keyframes scan { to { top: 90%; } }
.scanner-idle {
  position: absolute; inset: 0; z-index: 3; color: #fff; text-align: center; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--grad-hero);
}
.scanner-idle .big { width: 84px; height: 84px; border-radius: 28px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 2.6rem; }
.scanner-idle p { opacity: .85; margin: 0; max-width: 260px; font-weight: 500; }
.scanner.running .scanner-idle { display: none; }
.scanner:not(.running) .scan-frame { display: none; }

.receipt-card { position: relative; background: var(--surface); border-radius: 22px 22px 8px 8px; padding: 22px 20px 26px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.receipt-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 12px;
  background: radial-gradient(circle at 10px -2px, transparent 10px, var(--surface) 10.5px) repeat-x;
  background-size: 20px 12px;
}
.receipt-card .r-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px dashed var(--border); padding-top: 12px; margin-top: 8px; font-weight: 800; font-size: 1.2rem; }

/* ---------- Action sheet / bottom sheet ---------- */
.sheet .modal-dialog { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .9, .3, 1); }
.sheet.show .modal-dialog { transform: none; }
.sheet .modal-content { border: 0; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--text); padding-bottom: env(safe-area-inset-bottom); }
.sheet .modal-content::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--border); margin: 10px auto 0; }
@media (min-width: 576px) {
  .sheet .modal-dialog { position: relative; margin: 1.75rem auto; max-width: 480px; transform: translateY(20px); }
  .sheet .modal-content { border-radius: 28px; }
  .sheet .modal-content::before { display: none; }
}
.modal-header { border: 0; padding: 18px 22px 6px; }
.modal-title { font-weight: 800; letter-spacing: -0.02em; }
.modal-body { padding: 10px 22px 12px; }
.modal-footer { border: 0; padding: 6px 22px 22px; }
.modal-content { background: var(--surface); color: var(--text); border-radius: 28px; border: 0; }
.modal-backdrop.show { opacity: .45; }

.action-grid { display: grid; gap: 10px; }
.action-btn {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  font-weight: 700; text-align: left;
}
.action-btn:active { transform: scale(.98); }
.action-btn .ai { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.action-btn small { display: block; color: var(--muted); font-weight: 500; }
.action-btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: var(--shadow-lg); }
.action-btn.primary small { color: rgba(255,255,255,.8); }
.action-btn.primary .ai { background: rgba(255,255,255,.18); color: #fff; }

/* dlaždice vedľa seba – napr. výber PDF zostavy */
.action-grid.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.action-btn.tile { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 18px; font-size: .9rem; }
.action-btn.tile .ai { width: 38px; height: 38px; border-radius: 13px; font-size: 1.1rem; }
.action-btn.tile small { font-size: .72rem; line-height: 1.25; margin-top: 2px; }

/* výber papiera pre tlač */
.paper-pick { display: flex; gap: 8px; position: relative; }
.paper-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.paper-pick label {
  flex: 1; margin: 0; text-align: center; padding: 10px 8px; border-radius: 16px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 700; font-size: .88rem;
}
.paper-pick input:checked + label { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.paper-pick input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: 3px solid transparent; cursor: pointer; }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--surface-2); font-size: 1.3rem; }
.emoji-pick button.active { background: var(--brand-soft); box-shadow: 0 0 0 2px var(--brand) inset; }

/* ---------- Pomocné ---------- */
.gap-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.gap-grid > * { min-width: 0; }
@media (min-width: 992px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-dash { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}
.fw-800 { font-weight: 800; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-up { animation: slide-in .35s ease both; }
details.debug summary { cursor: pointer; font-size: .8rem; color: var(--muted); font-weight: 600; }
details.debug code { display: block; margin-top: 6px; font-size: .75rem; white-space: pre-wrap; word-break: break-all; color: var(--text-2); }

/* ---------- Tlač ---------- */
@media print {
  .sidebar, .bottom-nav, .app-header, .no-print, .save-bar { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- Mini stĺpcový graf (vyhľadávanie) ---------- */
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 70px; margin-top: 16px; position: relative; z-index: 1; }
.mini-bars .mb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.mini-bars .mb span { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: rgba(255,255,255,.75); }
.mini-bars .mb small { font-size: .6rem; opacity: .8; font-weight: 700; }

/* ---------- Rozpočty ---------- */
.budget-row { padding: 12px 2px; }
.budget-row + .budget-row { border-top: 1px solid var(--border); }
.budget-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: visible; margin: 8px 0 4px; }
.budget-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--success); max-width: 100%; transition: width .4s ease; }
.budget-bar.warn > span { background: var(--warning); }
.budget-bar.over > span { background: var(--danger); }
.budget-bar .pace { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--text); opacity: .35; }
.budget-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-weight: 600; }
.budget-meta .left.over { color: var(--danger); }
.budget-input { width: 118px; flex-shrink: 0; }
.budget-input .form-control { padding-left: 10px; padding-right: 30px; }
.budget-input .suffix { right: 12px; }
.hero-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; margin: 12px 0 6px; position: relative; z-index: 1; }
.hero-bar > span { display: block; height: 100%; border-radius: 99px; background: #fff; }
.hero-bar.over > span { background: #fecaca; }

/* ---------- Príjmy / pravidelné ---------- */
.amt.plus { color: var(--success); }
.badge-soft { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 8px; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.badge-soft.green { background: var(--success-soft); color: var(--success); }
.badge-soft.violet { background: var(--brand-soft); color: var(--brand); }
.badge-soft.muted { opacity: .7; }
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.type-toggle input { display: none; }
.type-toggle label { text-align: center; padding: 12px; border-radius: 14px; background: var(--surface-2); font-weight: 700; cursor: pointer; border: 2px solid transparent; }
.type-toggle input:checked + label { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- Menu "Viac" ---------- */
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 576px) { .more-grid { grid-template-columns: repeat(3, 1fr); } }
.more-tile {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
  transition: transform .12s ease;
}
.more-tile:active { transform: scale(.97); }
.more-tile .si { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.more-tile b { font-size: 1rem; letter-spacing: -.02em; }
.more-tile small { color: var(--muted); font-weight: 600; display: block; margin-top: 2px; }

.form-switch .form-check-input { width: 3em; height: 1.6em; cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.copy-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: .78rem; word-break: break-all; }
.copy-box code { flex: 1; color: var(--text-2); }

/* ---------- Domácnosť ---------- */
.cat-icon { position: relative; }
.member-dot {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%; color: #fff;
  font-size: .62rem; font-weight: 800; letter-spacing: 0; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}
.member-dot.all { background: var(--grad); font-size: .75rem; }
.member-dot.corner { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; font-size: .55rem; }
.member-dot.lg { width: 36px; height: 36px; font-size: .8rem; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.member-dot.xl { width: 46px; height: 46px; font-size: .95rem; border-radius: 15px; box-shadow: none; }
.avatar-stack { display: flex; align-items: center; position: relative; z-index: 1; }
.avatar-stack .member-dot + .member-dot { margin-left: -8px; }

.member-switch { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.member-switch::-webkit-scrollbar { display: none; }
.member-switch a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 6px 14px 6px 6px; border-radius: 99px; font-weight: 700; font-size: .9rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.member-switch a.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.member-switch .member-dot { width: 28px; height: 28px; box-shadow: none; }

.hh-illustration {
  width: 76px; height: 76px; border-radius: 26px; font-size: 2.2rem; position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px);
}
.invite-house { background: var(--surface-2); border-radius: 20px; padding: 18px; }
.invite-card { border: 2px dashed var(--brand) !important; }
.invite-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 800;
  font-size: 2rem; letter-spacing: .12em; color: var(--brand); cursor: pointer;
}
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hh-how { list-style: none; padding: 0; display: grid; gap: 10px; color: var(--text-2); }
.hh-how li { display: flex; gap: 10px; }
.hh-how i { color: var(--brand); font-size: 1.05rem; }
.icon-btn.glass { background: rgba(255,255,255,.18); color: #fff; border-color: transparent; box-shadow: none; }

/* ---------- Prepínač vzhľadu ---------- */
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-switch button {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 6px 12px; border-radius: 16px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text-2); font-weight: 700; font-size: .85rem;
}
.theme-switch button.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.theme-preview { width: 100%; max-width: 88px; height: 56px; border-radius: 10px; overflow: hidden; display: flex; border: 1px solid var(--border); }
.theme-preview .tp { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.theme-preview .tp i { display: block; height: 7px; border-radius: 4px; }
.tp.light { background: #f3f5fb; } .tp.light i { background: #fff; } .tp.light i:first-child { background: #5b4bff; }
.tp.dark { background: #0b0e17; } .tp.dark i { background: #1f2640; } .tp.dark i:first-child { background: #8b83ff; }

.theme-fab {
  position: fixed; top: calc(14px + env(safe-area-inset-top)); right: 14px; z-index: 5;
  background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.25); backdrop-filter: blur(8px);
}
.side-theme { display: flex; gap: 4px; margin: 0 4px 10px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.side-theme button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 6px 0; color: var(--muted); font-size: 1rem; }
.side-theme button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* plynulý prechod pri prepnutí témy */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .3s ease, border-color .3s ease, color .2s ease !important;
}

/* ---------- Detail bločku ---------- */
.receipt-card .tx-item.discount .a { color: var(--success); }
.receipt-card .r-vat { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-weight: 600; padding-top: 2px; }
.receipt-card .r-total + .r-vat { margin-top: 6px; }
.receipt-dl dt { color: var(--muted); font-weight: 600; }
.receipt-dl dd { font-weight: 700; margin-bottom: 6px; word-break: break-word; }
.receipt-meta { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .8rem; color: var(--text-2); }
.receipt-meta b { color: var(--text); }
#add-form > .receipt-meta { margin: 0 0 16px; }
.activity-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.activity-row + .activity-row { border-top: 1px solid var(--border); }
.activity-row .si { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-row .grow { flex: 1; min-width: 0; font-size: .9rem; }
.activity-row small { display: block; color: var(--muted); }

/* ---------- Ceny ---------- */
.chg { display: inline-flex; align-items: center; gap: 2px; font-size: .74rem; font-weight: 800; border-radius: 8px; padding: 2px 6px; white-space: nowrap; }
.chg.up { color: var(--danger); background: var(--danger-soft); }
.chg.down { color: var(--success); background: var(--success-soft); }
.chg.flat { color: var(--muted); background: var(--surface-3); }
.list-row .amt small .chg { margin-top: 3px; }
.spark-wrap { color: var(--muted); flex-shrink: 0; display: none; }
.spark-wrap.up { color: var(--danger); }
.spark-wrap.down { color: var(--success); }
@media (min-width: 400px) { .spark-wrap { display: inline-flex; } }
.spark { display: block; }

/* ---------- Nákupný zoznam ---------- */
.add-bar { display: flex; gap: 8px; margin-bottom: 16px; position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 5; }
@media (min-width: 992px) { .add-bar { top: 12px; } }
.add-bar .qty-input { width: 64px; flex-shrink: 0; text-align: center; font-weight: 700; padding-left: 6px; padding-right: 6px; }
.add-bar .btn { width: var(--tap); flex-shrink: 0; padding: 0; }
.shop-hero { padding: 20px 22px; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; transition: opacity .25s ease, transform .25s ease; }
.shop-row + .shop-row { border-top: 1px solid var(--border); }
.shop-row .grow { flex: 1; min-width: 0; }
.shop-row .t1 { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.shop-row .t2 { font-size: .8rem; color: var(--muted); font-weight: 500; }
.shop-row .qty { color: var(--brand); font-weight: 800; }
.shop-row .check {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--border);
  background: var(--surface); color: transparent; display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.shop-row .check:active { transform: scale(.9); }
.shop-row .check.checked { background: var(--success); border-color: var(--success); color: #fff; }
.shop-row.done .t1 { text-decoration: line-through; color: var(--muted); }
.shop-row.leaving { opacity: .35; transform: translateX(12px); }
.shop-row .qty-ctrl { display: flex; gap: 4px; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; font-size: .95rem; box-shadow: none; }
@media (max-width: 380px) { .shop-row .qty-ctrl { display: none; } }
.suggest-chips .chip { border: 0; cursor: pointer; }

/* ---------- Režim „som v obchode“ ---------- */
.shop-actions { display: flex; gap: 8px; margin: 12px 0 4px; }
.shop-actions .btn { padding-top: 13px; padding-bottom: 13px; }
.shop-row.big { padding: 14px 2px; gap: 14px; }
.shop-row.big .check { width: 46px; height: 46px; font-size: 1.35rem; color: var(--muted); }
.shop-row.big .check.checked { color: #fff; }
.shop-row.big .t1 { font-size: 1.02rem; }
.shop-row.big .price {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  border-radius: 13px; padding: 9px 12px; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 78px; text-align: right; flex-shrink: 0;
}
.shop-row.big.in-cart { background: var(--success-soft); border-radius: 14px; }
.shop-row.big.in-cart + .shop-row.big { border-top-color: transparent; }
.shop-row.big.in-cart .price { border-color: var(--success); }

/* ---------- Sporiace ciele ---------- */
.goal-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .goal-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.goal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.goal-ring {
  --pct: 0; width: 62px; height: 62px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(var(--goal) calc(var(--pct) * 1%), var(--surface-3) 0);
  display: flex; align-items: center; justify-content: center;
}
.goal-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.goal-ring span { position: relative; font-size: 1.6rem; }
.goal-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); margin: 14px 0 6px; }
.goal-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--goal); max-width: 100%; transition: width .5s ease; }
.goal-bar .pace { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--text); opacity: .35; }
.goal-meta { font-size: .82rem; color: var(--muted); font-weight: 600; }
.goal-meta b { color: var(--text); }
.goal-history { border-top: 1px dashed var(--border); margin-top: 12px; }
.badge-soft.red { background: var(--danger-soft); color: var(--danger); }
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; }
/* pozor: .emoji-pick je inde kontajner na dlaždice (kategórie, rýchly zápis),
   tu je to jedno tlačidlo – preto musí byť pravidlo viazané na .emoji-row */
.emoji-row .emoji-pick { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 1.25rem; }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-dot input { display: none; }
.color-dot span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 2px transparent; transition: box-shadow .15s; }
.color-dot input:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }

/* ---------- Trendy ---------- */
.insight { display: flex; align-items: center; gap: 12px; padding: 12px 2px; color: var(--text); font-weight: 600; font-size: .93rem; }
.insight + .insight { border-top: 1px solid var(--border); }
.insight .ii { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; background: var(--surface-3); }
.insight.bad .ii { background: var(--danger-soft); }
.insight.good .ii { background: var(--success-soft); }
.trend-table { --bs-table-bg: transparent; --bs-table-color: var(--text); font-size: .88rem; }
.trend-table th { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; border-color: var(--border); }
.trend-table td { border-color: var(--border); vertical-align: middle; padding-top: 8px; padding-bottom: 8px; }
.insight-card { display: block; }
.icon-badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Priestory (domácnosti) ---------- */
.space-row + .space-row { border-top: 1px solid var(--border); }
.space-row .settings-row:disabled { opacity: 1; cursor: default; }
.space-row.active .settings-row { background: var(--brand-soft); }
.mode-pick { display: grid; gap: 8px; }
.mode-pick label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--border); cursor: pointer; background: var(--surface); }
.mode-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mode-pick label.disabled { opacity: .5; cursor: not-allowed; }
.mode-pick input { margin-top: 4px; accent-color: var(--brand); }
.mode-pick small { display: block; color: var(--muted); font-weight: 500; }
.space-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 99px; margin-top: 2px; }
.space-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-space { display: flex; align-items: center; gap: 10px; width: calc(100% - 8px); margin: 0 4px 14px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: left; }
.side-space .ss-name { font-weight: 800; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-space small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; }
.sheet-space { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 16px; border: 2px solid transparent; background: var(--surface-2); color: var(--text); text-align: left; margin-bottom: 8px; }
.sheet-space.active { border-color: var(--brand); background: var(--brand-soft); }
.sheet-space .si { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.sheet-space small { display: block; color: var(--muted); font-weight: 600; }

/* ---------- Fotky k nákupu ---------- */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.photo-others { display: contents; }
.photo-slot { position: relative; display: flex; }
.photo-thumb, .photo-add {
  position: relative; width: 92px; height: 92px; border-radius: var(--radius-sm);
  overflow: hidden; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb.is-receipt { outline: 2px solid var(--brand); outline-offset: -2px; }
.photo-thumb.loading { color: var(--muted); font-size: 1.3rem; }
.photo-thumb.busy { opacity: .45; pointer-events: none; }
.photo-thumb .pk {
  position: absolute; left: 5px; bottom: 5px; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; display: flex; align-items: center; justify-content: center;
}
.photo-add {
  flex-direction: column; gap: 2px; cursor: pointer; border-style: dashed; color: var(--muted);
  font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.15; padding: 6px;
}
.photo-add i { font-size: 1.35rem; color: var(--brand); }
.photo-add small { font-weight: 600; font-size: .66rem; }
.photo-add:hover { background: var(--surface-3); }
.receipt-slot.filled .photo-add { display: none; }
.photo-del {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .72rem;
  display: flex; align-items: center; justify-content: center;
}
.photo-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.photo-strip::-webkit-scrollbar { display: none; }
.photo-strip .photo-thumb { width: 64px; height: 64px; border-radius: 10px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; background: rgba(6, 8, 16, .94);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.lightbox[hidden] { display: none; }
body.lb-open { overflow: hidden; }
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 64px 12px 48px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lb-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px; z-index: 2;
}
.lb-count { flex: 1; font-weight: 700; font-size: .9rem; opacity: .85; }
.lb-btn, .lb-nav {
  width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; text-decoration: none;
}
.lb-btn:hover, .lb-nav:hover { background: rgba(255,255,255,.26); color: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }
.lightbox.single .lb-nav { display: none; }
.lb-caption { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: .85rem; opacity: .8; }
@media (max-width: 575px) { .lb-nav { width: 36px; height: 36px; opacity: .8; } .lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; } }

/* ---------- Kde lacnejšie ---------- */
.plan-card .badge-save {
  background: var(--success-soft); color: #047857; font-weight: 800; border-radius: 999px;
  padding: 4px 10px; font-size: .85rem; white-space: nowrap;
}
[data-bs-theme="dark"] .plan-card .badge-save { color: #6ee7b7; background: rgba(16,185,129,.16); }
.plan-groups { display: grid; gap: 8px; }
.plan-group { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.deal-row .amt small { display: block; font-weight: 700; font-size: .72rem; opacity: .85; }
.deal-row .t2 { white-space: normal; overflow: visible; }
.deals-hero .hero-stat .l { white-space: normal; line-height: 1.2; }
.deals-link { display: block; color: inherit; margin-bottom: 14px; }
.deals-link .si { width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: 0 0 auto; }
.deals-link .grow { flex: 1; min-width: 0; }
.insight.info .ii { background: var(--brand-soft); }
.nw { white-space: nowrap; }

/* ---------- Kto platil / delenie ---------- */
.payer-pick, .split-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.payer-opt input, .split-modes input { position: absolute; opacity: 0; pointer-events: none; }
.payer-opt > span, .split-modes span {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1.5px solid var(--border); font-weight: 700; font-size: .9rem; cursor: pointer;
}
.split-modes > label > span { padding: 8px 14px; }
.payer-opt input:checked + span, .split-modes input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
[data-bs-theme="dark"] .payer-opt input:checked + span, [data-bs-theme="dark"] .split-modes input:checked + span { color: #c7c2ff; }
.payer-opt input:focus-visible + span, .split-modes input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.split-custom { display: none; margin-bottom: 8px; }
.split-custom.show { display: grid; gap: 8px; }
.split-row { display: flex; align-items: center; gap: 10px; }
.split-row .grow { flex: 1; font-weight: 700; }
.split-info { font-size: .8rem; color: var(--muted); margin-top: 4px; }

/* ---------- Vyrovnanie ---------- */
.balance-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.balance-row + .balance-row { border-top: 1px solid var(--border); }
.balance-row .grow { flex: 1; min-width: 0; }
.balance-row .bv { font-weight: 800; font-variant-numeric: tabular-nums; }
.balance-row .bv.pos { color: var(--success); }
.balance-row .bv.neg { color: var(--danger); }
.bal-bar { height: 6px; border-radius: 99px; background: var(--surface-3); position: relative; margin-top: 6px; overflow: hidden; }
.bal-bar span { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.transfer {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.transfer + .transfer { margin-top: 8px; }
.transfer .arrow { color: var(--muted); }
.transfer .amt { margin-left: auto; font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.settle-hero .who { font-size: 1.05rem; opacity: .92; position: relative; z-index: 1; }

/* ---------- Import z banky ---------- */
.bank-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 12px 0; }
.bank-row + .bank-row { border-top: 1px solid var(--border); }
.bank-row .amt { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bank-row .amt.in { color: var(--success); }
.bank-row .t1 { font-weight: 700; }
.bank-row .t2 { font-size: .8rem; color: var(--muted); word-break: break-word; }
.bank-row .edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.bank-row .edit .form-control, .bank-row .edit .form-select { min-height: 40px; font-size: .9rem; padding: 6px 10px; }
.bank-row.skip .t1, .bank-row.skip .amt { opacity: .55; }
.bank-row.skip .edit { display: none; }
.act-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.act-pick input { position: absolute; opacity: 0; pointer-events: none; }
.act-pick span { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); cursor: pointer; border: 1.5px solid transparent; }
.act-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
[data-bs-theme="dark"] .act-pick input:checked + span { color: #c7c2ff; }
.act-pick input:focus-visible + span { outline: 2px solid var(--brand); }
.bank-reason { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.map-table { font-size: .8rem; }
.map-table th, .map-table td { white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sticky-apply { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; }
@media (min-width: 992px) { .sticky-apply { bottom: 16px; } }
.transfer { flex-wrap: wrap; }
.transfer .who { white-space: nowrap; }
@media (max-width: 420px) { .transfer .btn { flex: 1 0 100%; } }
.balance-row .bv { white-space: nowrap; }
#bank-summary { font-size: 1rem; line-height: 1.25; }
.map-table select { min-width: 140px; }

/* ---------- Nápoveda ---------- */
.help-toc { gap: 6px; }
.help-chapter { scroll-margin-top: 80px; }
.help-sec { border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.help-intro + .help-sec, .card-body > .help-sec:first-child { border-top: 0; }
.help-sec > summary {
  list-style: none; cursor: pointer; padding: 14px 28px 14px 0; font-weight: 700; position: relative;
}
.help-sec > summary::-webkit-details-marker { display: none; }
.help-sec > summary::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.help-sec[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.help-body, .help-intro { padding: 2px 0 12px; color: var(--text-2); line-height: 1.6; font-size: .95rem; }
.help-intro { padding-top: 12px; }
.help-body p, .help-intro p { margin-bottom: .6rem; }
.help-body ul, .help-body ol, .help-intro ul { padding-left: 1.2rem; margin-bottom: .7rem; }
.help-body li, .help-intro li { margin-bottom: .3rem; }
.help-note { background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 12px; margin: .6rem 0; font-size: .9rem; }
.help-note.warn { background: var(--danger-soft); border-left-color: var(--danger); }
.help-code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: .8rem; white-space: pre-wrap; word-break: break-word; color: var(--text); }
.help-table { display: grid; gap: 8px; margin: .6rem 0; }
.ht-row { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.ht-q { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.ht-a { font-size: .9rem; }
.help-admin > summary { cursor: pointer; list-style: none; }
.help-admin > summary::-webkit-details-marker { display: none; }
.help-admin > summary::before { content: '▸ '; }
.help-admin[open] > summary::before { content: '▾ '; }
mark.hl { background: #fde68a; color: inherit; padding: 0 1px; border-radius: 3px; }
[data-bs-theme="dark"] mark.hl { background: rgba(250, 204, 21, .35); }
.help-link { color: var(--muted); }

/* ---------- AJAX: stav načítavania ---------- */
.app-toast.warning { background: #b45309; }
.app-toast { cursor: pointer; }
html.is-busy::before {
  content: ''; position: fixed; top: 0; left: 0; height: 3px; width: 40%; z-index: 3000;
  background: var(--grad); border-radius: 0 3px 3px 0; animation: busy-bar 1s ease-in-out infinite;
}
@keyframes busy-bar { 0% { left: -40%; } 100% { left: 100%; } }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid currentColor; border-color: var(--brand) transparent var(--brand) transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-primary.is-loading::after { border-color: #fff transparent #fff transparent; }
@media (prefers-reduced-motion: reduce) { html.is-busy::before, .btn.is-loading::after { animation-duration: 3s; } }

/* ---------- Čiarové kódy (EAN) ---------- */
.item-top .btn-scan-item { color: var(--brand); }
.item-ean { font-size: .72rem; color: var(--muted); margin: -2px 0 6px 4px; font-variant-numeric: tabular-nums; }
.item-ean .src { color: var(--success); font-weight: 700; }
.item-ean .src:not(:empty)::before { content: '· '; color: var(--muted); font-weight: 400; }
.item-card.ean-missing [name="item_name[]"] { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.item-card.flash-in { animation: ean-flash .9s ease; }
@keyframes ean-flash { 0% { box-shadow: 0 0 0 0 rgba(91, 75, 255, .45); } 100% { box-shadow: 0 0 0 14px rgba(91, 75, 255, 0); } }
.amount-input.suggested { color: var(--muted); font-style: italic; }
.ean-scanner {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #0b0d17;
  aspect-ratio: 4 / 3; max-height: 46vh; width: 100%;
}
.ean-scanner video, .ean-scanner .qr-reader, .ean-scanner .qr-reader video { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: cover; }
.ean-scanner .qr-reader { border: 0 !important; }
.ean-scanner .qr-reader img, .ean-scanner .qr-reader [id$="__dashboard_section"], .ean-scanner #qr-shaded-region { display: none !important; }
.ean-frame {
  position: absolute; left: 7%; right: 7%; top: 30%; bottom: 30%; border: 2px solid rgba(255,255,255,.85);
  border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; display: none;
}
.ean-scanner.running .ean-frame { display: block; }
.ean-line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ef4444; box-shadow: 0 0 8px #ef4444; animation: ean-scan 1.6s ease-in-out infinite; }
@keyframes ean-scan { 0%, 100% { transform: translateY(-18px); } 50% { transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) { .ean-line { animation: none; } }
.ean-idle {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #fff; text-align: center; padding: 20px; font-weight: 600;
}
.ean-idle i { font-size: 2.6rem; opacity: .85; }
/* ovládanie kamery – otočenie a svetlo (EAN aj QR skener) */
.cam-ctl { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: none; flex-direction: column; gap: 8px; }
.ean-scanner.running .cam-ctl, .scanner.running .cam-ctl { display: flex; }
.cam-ctl button {
  width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 15, 28, .62); color: #fff; backdrop-filter: blur(8px);
}
.cam-ctl button:active { transform: scale(.94); }
.cam-ctl button.on { background: #fbbf24; color: #1b1400; }
.cam-ctl button[hidden] { display: none; }

.ean-last {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--success-soft); color: var(--text);
}
.ean-last i { color: var(--success); font-size: 1.2rem; }
.ean-last span { display: flex; flex-direction: column; min-width: 0; }
.ean-last b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ean-last small { color: var(--muted); }
.item-card.ean-partial [name="item_name[]"] { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); font-style: italic; }
.item-card.ean-partial .item-ean .src { color: #b45309; }

/* =====================================================================
   Stav systému
   ===================================================================== */
.status-hero.is-warn { background: linear-gradient(135deg, #b45309, #d97706); }
.status-hero.is-error { background: linear-gradient(135deg, #b91c1c, #e11d48); }
.status-counts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .9rem; }
.status-counts .sc { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.status-row .st-ic { font-size: 1.15rem; line-height: 1.3; flex: none; }
.status-row .grow { min-width: 0; flex: 1; }
.status-row .st-l { font-weight: 600; }
.status-row .st-d { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.status-row .st-fix { margin-top: 5px; font-size: .84rem; padding: 6px 9px; border-radius: var(--radius-sm); background: var(--warning-soft); overflow-wrap: anywhere; }
.status-row.is-error .st-fix { background: var(--danger-soft); }
.status-row.is-ok .st-ic { color: var(--success); }
.status-row.is-warn .st-ic { color: var(--warning); }
.status-row.is-error .st-ic { color: var(--danger); }
.status-row.is-info .st-ic, .status-row.is-loading .st-ic { color: var(--muted); }
.status-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.status-action {
  width: 100%; height: 100%; display: flex; gap: 10px; align-items: center; text-align: left;
  padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
}
.status-action:disabled { opacity: .5; }
.status-action > i { font-size: 1.3rem; color: var(--brand); flex: none; }
.status-action span { display: flex; flex-direction: column; min-width: 0; }
.status-action small { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.log-tail {
  margin: 0; max-height: 320px; overflow: auto; font-size: .74rem; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word; color: var(--text);
}
.log-tail span { display: block; padding: 2px 0; border-bottom: 1px dashed var(--border); }
.log-tail .lv-err { color: var(--danger); }
.log-tail .lv-warn { color: #b45309; }

/* =====================================================================
   Zápis hlasom
   ===================================================================== */
.item-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item-actions .btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding-left: 6px; padding-right: 6px; min-width: 0; }
.item-actions .btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .item-actions .btn { flex-direction: column; gap: 2px; font-size: .8rem; padding-top: 8px; padding-bottom: 8px; }
  .item-actions .btn i { font-size: 1.15rem; }
}
.voice-stage { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 6px 0 2px; }
.voice-mic {
  position: relative; width: 84px; height: 84px; border-radius: 50%; border: 0;
  background: var(--grad); color: #fff; font-size: 2.1rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; transition: transform .15s;
}
.voice-mic:active { transform: scale(.94); }
.voice-mic.off { background: var(--border); color: var(--muted); box-shadow: none; }
.voice-mic.on { background: linear-gradient(135deg, #dc2626, #f43f5e); }
.voice-mic .ring { position: absolute; inset: -6px; border-radius: 50%; border: 3px solid #f43f5e; opacity: 0; pointer-events: none; }
.voice-mic.on .ring { animation: voice-pulse 1.4s ease-out infinite; }
@keyframes voice-pulse { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .voice-mic.on .ring { animation: none; opacity: .6; } }
.voice-state { font-weight: 600; min-height: 1.5em; }
.voice-example { font-size: .82rem; color: var(--muted); max-width: 360px; }
.voice-hint { font-size: .76rem; color: var(--muted); max-width: 360px; margin-top: 6px; opacity: .85; }
.voice-example b { font-weight: 600; color: var(--text); }
.voice-text-wrap { position: relative; }
.voice-interim { margin-top: 4px; font-size: .88rem; color: var(--muted); font-style: italic; min-height: 0; }
.voice-interim:empty { display: none; }
.voice-preview { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--brand-soft); transition: opacity .15s; }
.voice-preview.busy { opacity: .55; }
.vp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.vp-meta:empty { display: none; }
.vp-meta .pill { background: var(--surface); color: var(--text); }
.vp-row { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.vp-row .grow { flex: 1; min-width: 0; }
.vp-row .n { font-weight: 600; overflow-wrap: anywhere; }
.vp-row .q { color: var(--brand); }
.vp-row .s { font-size: .78rem; color: var(--muted); }
.vp-row .s .guess { color: #b45309; }
.vp-row .a { font-weight: 700; white-space: nowrap; }
.vp-row.missing .a { color: var(--muted); font-weight: 500; font-style: italic; }
.vp-row.total { border-bottom: 0; font-weight: 700; }
.vp-warn { font-size: .84rem; margin-top: 6px; }
.add-bar .btn-mic { flex: none; }
.add-bar .btn-mic.on { background: #e11d48; color: #fff; border-color: #e11d48; }
.voice-buttons { display: grid; gap: 8px; }
.voice-buttons .btn { width: 100%; }
.quick-tile-voice { text-decoration: none; color: var(--brand); border-color: var(--brand-soft); }
.editing .quick-tile-voice { display: none; }
button.photo-add { font-family: inherit; background: var(--surface-2); appearance: none; }
button.photo-add:active { transform: scale(.97); }
.code-list { display: flex; flex-direction: column; gap: 4px; }
.code-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.code-row:last-child { border-bottom: 0; }
.code-row > i { font-size: 1.3rem; color: var(--brand); }
.code-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.code-row b { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.code-row small { color: var(--muted); }
