/* ==========================================================================
   Splitly — mobil-első UI
   Identitás: a „kettévágott kör” (indigó + citrom) logó; az egyenleg-kártya
   a karakteres elem, minden más csendes. Fontok: Bricolage Grotesque + Onest.
   ========================================================================== */

:root {
  --ink: #24224A;
  --ink-2: #3A3870;
  --paper: #EEF0F7;
  --surface: #FFFFFF;
  --surface-2: #F6F7FB;
  --line: #E1E2EE;
  --muted: #6E6C8F;
  --lemon: #FFC93C;
  --lemon-deep: #F2B200;
  --lemon-soft: #FFF4D1;
  --plus: #12936F;
  --plus-soft: #DDF3EC;
  --minus: #D64562;
  --minus-soft: #FBE3E8;
  --focus: #5B57E0;

  --text: var(--ink);
  --on-accent: #24224A;
  --btn-primary-bg: var(--ink);
  --btn-primary-fg: #FFFFFF;
  --shadow-lift: 0 1px 0 rgba(36, 34, 74, .04), 0 8px 24px -12px rgba(36, 34, 74, .18);

  --font-display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 16px;
  --content-w: 620px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ECEBFA;
    --ink-2: #C9C7EE;
    --paper: #17162E;
    --surface: #22213F;
    --surface-2: #2A2949;
    --line: #36355A;
    --muted: #A4A2C6;
    --lemon-soft: #3A3420;
    --plus: #3CCB9E;
    --plus-soft: #173A33;
    --minus: #FF7A93;
    --minus-soft: #3D2130;
    --focus: #9C99FF;
    --btn-primary-bg: #ECEBFA;
    --btn-primary-fg: #17162E;
    --shadow-lift: 0 1px 0 rgba(0, 0, 0, .2), 0 10px 28px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ECEBFA;
  --ink-2: #C9C7EE;
  --paper: #17162E;
  --surface: #22213F;
  --surface-2: #2A2949;
  --line: #36355A;
  --muted: #A4A2C6;
  --lemon-soft: #3A3420;
  --plus: #3CCB9E;
  --plus-soft: #173A33;
  --minus: #FF7A93;
  --minus-soft: #3D2130;
  --focus: #9C99FF;
  --btn-primary-bg: #ECEBFA;
  --btn-primary-fg: #17162E;
  --shadow-lift: 0 1px 0 rgba(0, 0, 0, .2), 0 10px 28px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ── Alap ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.display {
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(28px, 7vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
}
.display-sm { font-size: 24px; }
.lead { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.hint a { color: var(--ink); font-weight: 600; }
.link-sm { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration-color: var(--lemon-deep); text-underline-offset: 3px; }

/* ── Logó: kettévágott kör ────────────────────────────────────── */
.logo-dot {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: linear-gradient(90deg, var(--ink) 50%, var(--lemon) 50%);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font: 800 21px/1 var(--font-display); letter-spacing: -0.03em; text-decoration: none;
}
.brand-lg { font-size: 26px; }
.brand-lg .logo-dot { width: 28px; height: 28px; }

/* ── App keret ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar-title { font: 700 18px/1.2 var(--font-display); margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand { flex: 1; }
.flat-switch {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; margin-left: -6px;
  border: 0; background: none; border-radius: var(--r-pill);
  font: 700 18px/1.2 var(--font-display); letter-spacing: -0.02em; text-align: left;
}
.flat-switch:hover { background: var(--surface); }
.flat-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flat-switch .fa-chevron-down { font-size: 12px; color: var(--muted); }
.me-btn { flex: none; border-radius: 50%; text-decoration: none; }

.app-main {
  width: 100%; max-width: var(--content-w); margin: 0 auto;
  padding: 6px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 32px);
}
.page-history .app-main, .page-profile .app-main, .page-flats .app-main { padding-bottom: 48px; }
.plain-main { min-height: 100dvh; }

.page-head { margin: 14px 0 20px; }

/* ── Alsó tab bar ─────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 6px var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.tab i { font-size: 19px; }
.tab.is-active { color: var(--ink); }
.tab.is-active i { color: var(--ink); }
.tab-add { color: var(--ink); }
.tab-add-btn {
  display: grid; place-items: center;
  width: 50px; height: 50px; margin-top: -24px;
  border-radius: 50%;
  background: var(--lemon); color: #24224A;
  box-shadow: 0 0 0 5px var(--surface), 0 8px 18px -6px rgba(242, 178, 0, .7);
  font-size: 20px;
  transition: transform .15s ease;
}
.tab-add:active .tab-add-btn { transform: scale(.94); }

/* Desktop: oldalsó sín */
@media (min-width: 900px) {
  .has-shell { padding-left: 96px; }
  .tabbar {
    top: 0; right: auto; width: 96px; height: auto;
    grid-template-columns: 1fr; grid-auto-rows: 76px; align-content: center;
    border-top: 0; border-right: 1px solid var(--line);
    padding: 0;
  }
  .tab-add { order: -1; margin-bottom: 18px; }
  .tab-add-btn { margin-top: 0; box-shadow: 0 8px 18px -6px rgba(242, 178, 0, .7); }
  .app-main { padding-bottom: 64px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
}

/* ── Gombok ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  font-weight: 650; font-size: 15px; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-accent { background: var(--lemon); color: #24224A; }
.btn-accent:hover { background: var(--lemon-deep); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-text { background: none; color: var(--muted); }
.btn-danger { background: var(--minus); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--minus) 40%, transparent); color: var(--minus); }
.btn-danger-ghost:hover { background: var(--minus-soft); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 54px; font-size: 16px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); text-decoration: none;
  list-style: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn::-webkit-details-marker { display: none; }

/* ── Avatarok ─────────────────────────────────────────────────── */
.avatar {
  --h: 250;
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: hsl(var(--h) 70% 88%); color: hsl(var(--h) 45% 26%);
  font: 700 13px/1 var(--font-body); letter-spacing: .02em;
}
.avatar-sm { width: 34px; height: 34px; font-size: 12.5px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 35% 30%); color: hsl(var(--h) 80% 88%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { background: hsl(var(--h) 35% 30%); color: hsl(var(--h) 80% 88%); }
}
.avatar-pending { background: var(--surface-2); color: var(--muted); }

/* ── Panelek ──────────────────────────────────────────────────── */
.panel {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 18px; margin: 0 0 14px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-title { font: 700 17px/1.3 var(--font-display); letter-spacing: -0.01em; margin: 0 0 12px; }
.sub-title { font-size: 14px; font-weight: 650; color: var(--muted); margin: 18px 0 6px; }
.panel-danger { background: transparent; border: 1.5px dashed var(--line); }

/* ── Egyenleg hős (a karakteres elem) ─────────────────────────── */
.hero-balance {
  position: relative; overflow: hidden;
  margin: 10px 0 14px; padding: 22px 20px 20px;
  border-radius: var(--r-lg);
  background: var(--lemon); color: #24224A;
  isolation: isolate;
}
.hero-balance.is-minus { background: #24224A; color: #FFF8E2; }
.hero-balance.is-even { background: var(--surface); color: var(--ink); }
.hero-split {
  position: absolute; z-index: -1;
  right: -96px; top: 50%; width: 220px; height: 220px; margin-top: -110px; border-radius: 50%;
  background: linear-gradient(90deg, rgba(36, 34, 74, .09) 50%, transparent 50%);
}
.hero-balance.is-minus .hero-split { background: linear-gradient(90deg, rgba(255, 201, 60, .22) 50%, transparent 50%); }
.hero-balance.is-even .hero-split { background: linear-gradient(90deg, var(--lemon) 50%, transparent 50%); opacity: .55; }
.hero-label { margin: 0; font-weight: 650; font-size: 15px; }
.hero-amount {
  margin: 2px 0 10px;
  font: 800 clamp(44px, 13vw, 60px)/1 var(--font-display);
  letter-spacing: -0.045em; font-variant-numeric: tabular-nums;
}
.hero-sub { margin: 0; font-size: 14px; opacity: .78; }

/* ── Utalások ─────────────────────────────────────────────────── */
.transfer-list, .ledger, .feed, .people, .cat-list, .card-list, .flat-pick, .rows, .lines, .hist-lines {
  list-style: none; margin: 0; padding: 0;
}
.transfer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.transfer:first-child { border-top: 0; padding-top: 2px; }
.transfer-who { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.transfer-arrow { color: var(--muted); font-size: 13px; margin: 0 2px; }
.transfer-text { display: flex; flex-direction: column; margin-left: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.transfer-text strong { font: 700 18px/1.2 var(--font-display); color: var(--ink); }
.transfer.is-mine .transfer-text strong { color: var(--ink); text-decoration: underline 3px var(--lemon); text-underline-offset: 4px; }

/* ── Főkönyv: középről széttartó sávok ────────────────────────── */
.ledger-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name amt" "bar bar";
  gap: 6px 12px; align-items: center; padding: 10px 0;
}
.ledger-name { grid-area: name; display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.ledger-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-name small { color: var(--muted); font-weight: 500; }
.ledger-amt { grid-area: amt; font: 700 16px/1 var(--font-display); }
.ledger-amt.is-plus { color: var(--plus); }
.ledger-amt.is-minus { color: var(--minus); }
.ledger-bar {
  grid-area: bar; position: relative; height: 8px; border-radius: 4px;
  background: var(--surface-2);
}
.ledger-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--line); border-radius: 1px; }
.ledger-fill { position: absolute; top: 0; bottom: 0; width: calc(var(--w) / 2); border-radius: 4px; }
.ledger-fill.is-plus { left: 50%; background: var(--plus); }
.ledger-fill.is-minus { right: 50%; background: var(--minus); }

/* ── Lista CTA + feed ─────────────────────────────────────────── */
.list-cta {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin: 0 0 14px;
  border-radius: var(--r-lg); background: var(--surface); text-decoration: none;
}
.list-cta > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.list-cta small { color: var(--muted); font-size: 13.5px; }
.list-cta-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--lemon-soft); color: var(--ink); }
.list-cta > .fa-chevron-right { color: var(--muted); }

.feed-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed-row:first-child { border-top: 0; }
.feed-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 14px; }
.feed-icon.is-settle { background: var(--plus-soft); color: var(--plus); }
.feed-text { flex: 1; min-width: 0; font-size: 14.5px; }
.feed-text small { display: block; color: var(--muted); font-size: 12.5px; }
.feed-amt { font-weight: 650; }

/* ── Üres állapot ─────────────────────────────────────────────── */
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty p { margin: 0 auto 16px; max-width: 38ch; }
.empty-tight { padding: 18px 8px 6px; }
.empty-tight p { margin-bottom: 0; }
.empty-art {
  display: grid; place-items: center; margin: 0 auto 14px;
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(90deg, var(--surface) 50%, var(--lemon-soft) 50%);
  color: var(--ink); font-size: 26px;
}

/* ── Űrlapok ──────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-size: 14px; font-weight: 600; padding: 0; }
.field-hint { font-size: 13px; color: var(--muted); }
fieldset:disabled .segmented { opacity: .55; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-size: 16px; /* iOS: nincs zoom */
  transition: border-color .15s ease;
}
input:focus, select:focus { outline: none; border-color: var(--ink); }
input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 50%; }
.form-row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 9px 8px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 46px; height: 28px; border-radius: 14px; margin: 0;
  background: var(--line); position: relative; cursor: pointer;
  transition: background-color .2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s ease;
}
.switch:checked { background: var(--plus); }
.switch:checked::after { transform: translateX(18px); }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; }
.inline-form .btn { min-height: 48px; }
@media (max-width: 420px) {
  .inline-form { flex-direction: column; }
}

/* ── Flash + toast ────────────────────────────────────────────── */
.flashes { max-width: var(--content-w); margin: 6px auto 0; padding: 0 var(--gutter); }
.flash, .notice {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 8px; border-radius: var(--r-md);
  background: var(--surface); font-size: 14.5px; font-weight: 500;
}
.flash i { margin-top: 3px; }
.flash-success i { color: var(--plus); }
.flash-error { background: var(--minus-soft); }
.flash-error i { color: var(--minus); }
.flash-info i { color: var(--ink); }
.notice { flex-direction: column; background: var(--lemon-soft); margin-bottom: 16px; }
.notice p { margin: 0; }

.toasts {
  position: fixed; z-index: 300; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: min(92vw, 420px); pointer-events: none;
}
.no-shell .toasts { bottom: 24px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r-pill);
  background: #24224A; color: #FFF8E2; font-size: 14.5px; font-weight: 550;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  animation: toast-in .22s ease-out;
}
.toast.is-error { background: var(--minus); color: #fff; }
.toast i { color: var(--lemon); }
.toast.is-error i { color: #fff; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Bottom sheet + dialógus ──────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(23, 22, 46, .45);
}
.sheet-panel {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  padding: 10px 18px calc(22px + var(--safe-b));
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  animation: sheet-up .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-title { font: 700 19px/1.25 var(--font-display); margin: 0 0 14px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { justify-content: flex-start; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: var(--r-lg); padding-bottom: 22px; }
}
.dialog-text { margin: 0 0 18px; font-size: 16px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; }

.flat-pick { margin-bottom: 12px; }
.flat-pick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-radius: var(--r-md); text-decoration: none;
}
.flat-pick-row:hover { background: var(--surface-2); }
.flat-pick-row.is-current { background: var(--lemon-soft); }
.flat-pick-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--ink); flex: none; }
.flat-pick-row.is-current .flat-pick-icon { background: var(--lemon); color: #24224A; }
.flat-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.flat-pick-text small { color: var(--muted); font-size: 13px; }
.flat-pick-row > .fa-chevron-right, .flat-pick-row > .fa-check { color: var(--muted); }
.card-list { background: var(--surface); border-radius: var(--r-lg); padding: 6px; margin: 14px 0; }

/* ── Hozzáadó sáv + javaslatok ────────────────────────────────── */
.adder { background: var(--surface); border-radius: var(--r-lg); padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.adder-input { position: relative; display: block; }
.adder-input > i { position: absolute; left: 15px; top: 24px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.adder-input > input { padding-left: 42px; }
.adder-input-plain > input { padding-left: 14px; }
.adder-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adder-row .btn { flex: 1; min-height: 46px; }
.adder-cat { flex: 1 1 100%; order: -1; }
.adder-inline { flex-direction: row; padding: 10px 0 0; background: none; margin: 0; border-top: 1px dashed var(--line); }
.adder-inline .adder-input { flex: 1; min-width: 0; }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lift);
  max-height: 280px; overflow-y: auto;
}
.suggest li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px; border-radius: var(--r-sm); cursor: pointer; font-weight: 550;
}
.suggest li small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--lemon-soft); }
.suggest mark { background: none; color: inherit; text-decoration: underline 2px var(--lemon-deep); text-underline-offset: 3px; }
.suggest .suggest-new { color: var(--muted); font-weight: 500; }
.suggest .suggest-new strong { color: var(--ink); }

/* ── Léptető [- 1 +] ──────────────────────────────────────────── */
.stepper {
  display: inline-flex; align-items: center; flex: none;
  height: 40px; border-radius: var(--r-pill); background: var(--surface-2);
  border: 1.5px solid var(--line);
}
.stepper button {
  display: grid; place-items: center; width: 38px; height: 100%;
  border: 0; background: none; color: var(--ink); font-size: 13px; border-radius: var(--r-pill);
}
.stepper button:hover { background: var(--line); }
.stepper input {
  width: 36px; min-height: 0; height: 100%; padding: 0; border: 0; background: none;
  text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-lg { height: 48px; align-self: flex-start; }
.stepper-lg button { width: 48px; }
.stepper-lg input { width: 52px; font-size: 18px; }

/* ── Lista sorok ──────────────────────────────────────────────── */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: var(--r-md); background: var(--surface);
}
.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-text strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text small { color: var(--muted); font-size: 12.5px; }
.row.is-new { animation: row-in .3s ease-out; }
@keyframes row-in { from { background: var(--lemon-soft); } to { background: var(--surface); } }

.sticky-cta {
  position: sticky; z-index: 20;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  margin-top: 18px;
}
@media (min-width: 900px) { .sticky-cta { bottom: 20px; } }
.sticky-cta .btn { box-shadow: 0 10px 26px -12px rgba(36, 34, 74, .55); }

/* ── Blokk (vásárlás) ─────────────────────────────────────────── */
.receipt {
  position: relative; background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 6px 6px;
  padding: 14px 16px 18px;
}
/* fogazott alsó él, mint egy blokkon */
.receipt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px;
  background:
    linear-gradient(-45deg, transparent 6px, var(--surface) 6px) 0 0 / 14px 10px repeat-x,
    linear-gradient(45deg, transparent 6px, var(--surface) 6px) 0 0 / 14px 10px repeat-x;
}
.receipt-top { padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.receipt-store { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.receipt-store input { border-color: transparent; background: var(--surface-2); min-height: 44px; }

.line { padding: 14px 0; border-bottom: 1px dashed var(--line); display: grid; gap: 10px; }
.line-top { display: flex; align-items: flex-start; gap: 10px; }
.line-name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; }
.line-name small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.line-total { font: 700 16px/1.4 var(--font-display); }
.line-x { width: 34px; height: 34px; margin: -4px -6px 0 0; }
.line-x:hover { color: var(--minus); background: var(--minus-soft); }
.line-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.price {
  display: flex; align-items: center; flex: 1; min-width: 120px; height: 40px;
  border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  padding: 0 14px; gap: 6px;
}
.price:focus-within { border-color: var(--ink); }
.price input { border: 0; min-height: 0; height: 100%; padding: 0; background: none; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.price input:focus { border: 0; }
.price span { color: var(--muted); font-size: 14px; }
.price input::-webkit-outer-spin-button, .price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.share-toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 10px;
  border-radius: var(--r-pill); border: 1.5px solid transparent;
  background: var(--plus-soft); color: var(--plus); font-weight: 650; font-size: 14px;
}
.share-toggle[aria-pressed="false"] { background: transparent; border-color: var(--line); color: var(--muted); }
.line.is-personal .line-name { color: var(--muted); }
.line.is-personal .line-total { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }

.receipt-sum { padding-top: 14px; display: grid; gap: 6px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.sum-row strong { font: 750 20px/1.2 var(--font-display); }
.sum-muted { color: var(--muted); font-size: 14px; }
.sum-each { margin-top: 6px; padding: 12px 14px; border-radius: var(--r-md); background: var(--lemon-soft); }
.sum-each strong { font-size: 24px; }

/* ── Készlet ──────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.search { position: relative; flex: 1; min-width: 0; }
.search i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px; }
.toolbar .btn { min-height: 48px; }
.chips { display: flex; gap: 6px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.chip {
  flex: none; min-height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line); background: transparent; font-size: 14px; font-weight: 600; color: var(--muted);
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.inv-group { margin-bottom: 12px; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.inv-group > summary {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none;
  font: 700 16px/1.2 var(--font-display);
}
.inv-group > summary::-webkit-details-marker { display: none; }
.inv-group > summary .count { margin-left: auto; color: var(--muted); font: 600 13px/1 var(--font-body); }
.inv-group > summary .fa-chevron-down { color: var(--muted); font-size: 12px; transition: transform .2s ease; }
.inv-group[open] > summary .fa-chevron-down { transform: rotate(180deg); }
.cat-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 14px; }
.inv-items { list-style: none; margin: 0; padding: 0 8px 8px; }
.inv-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-top: 1px solid var(--line); }
.inv-item-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-item-name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-item.is-out .inv-item-name strong { color: var(--muted); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.5;
}
.tag-out { background: var(--minus-soft); color: var(--minus); }
.tag-list { background: var(--lemon-soft); color: var(--ink); }
.inv-item .badges { display: flex; gap: 4px; margin-top: 2px; }
.inv-item .badges { align-items: center; flex-wrap: wrap; }
.to-list-link { border: 0; background: none; padding: 2px 4px; font-size: 12.5px; font-weight: 700; color: var(--ink); text-decoration: underline 2px var(--lemon-deep); text-underline-offset: 3px; }

/* ── Lakás oldal ──────────────────────────────────────────────── */
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.person-text small { color: var(--muted); font-size: 13px; }
.person-text strong small { color: var(--muted); font-weight: 500; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 230px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 6px;
  box-shadow: var(--shadow-lift);
}
.menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: 14.5px; font-weight: 550;
}
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.is-danger { color: var(--minus); }

.cat-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.cat-row:first-child { border-top: 0; }
.cat-name { flex: 1; font-weight: 600; }
.cat-add { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 12px; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.icon-pick button {
  display: grid; place-items: center; height: 42px; border-radius: 12px;
  border: 1.5px solid transparent; background: var(--surface-2); color: var(--muted);
}
.icon-pick button[aria-checked="true"] { background: var(--lemon); color: #24224A; }

/* ── Előzmények ───────────────────────────────────────────────── */
.day-head { font: 650 13px/1 var(--font-body); color: var(--muted); margin: 22px 4px 8px; }
.day-head:first-of-type { margin-top: 10px; }
.hist { background: var(--surface); border-radius: var(--r-md); margin-bottom: 8px; }
.hist > summary, .hist-summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; list-style: none; }
.hist > summary { cursor: pointer; }
.hist > summary::-webkit-details-marker { display: none; }
.hist-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14.5px; }
.hist-text strong { font-weight: 600; }
.hist-text small { color: var(--muted); font-size: 12.5px; }
.hist-amt { font: 700 16px/1 var(--font-display); }
.hist-lines { padding: 0 14px 10px 62px; }
.hist-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.hist-lines li.is-personal { color: var(--muted); }
.hist-lines .tag { margin-left: 4px; }
.hist-actions { padding: 0 14px 14px 62px; }
.pager { display: flex; justify-content: center; gap: 10px; margin: 20px 0; }

/* ── Profil ───────────────────────────────────────────────────── */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 16px 0 20px; }
.profile-head p { margin: 2px 0 0; }

/* ── Üdvözlő (nincs még lakás) ────────────────────────────────── */
.welcome { padding: 26px 4px 18px; }
.welcome-mark { position: relative; width: 84px; height: 84px; margin-bottom: 18px; }
.welcome-mark span { position: absolute; top: 0; width: 42px; height: 84px; }
.welcome-mark span:first-child { left: 0; border-radius: 42px 0 0 42px; background: var(--ink); }
.welcome-mark span:last-child { right: 0; border-radius: 0 42px 42px 0; background: var(--lemon); animation: split-open .9s .2s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes split-open { from { transform: translateX(-6px); } to { transform: translateX(8px); } }

/* ── Hitelesítő oldalak ───────────────────────────────────────── */
.auth {
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top, 0px)) var(--gutter) 40px;
  min-height: 100dvh; display: flex; flex-direction: column;
}
.auth-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.lang-switch { display: flex; gap: 2px; padding: 3px; background: var(--surface); border-radius: var(--r-pill); }
.lang-switch a { padding: 6px 11px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; text-decoration: none; color: var(--muted); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.auth-card { background: var(--surface); border-radius: var(--r-lg); padding: 24px 20px; }
.auth-title { font: 750 30px/1.1 var(--font-display); letter-spacing: -0.03em; margin: 0 0 8px; }
.auth-lead { color: var(--muted); margin: 0 0 22px; }
.auth-switch { text-align: center; margin: 20px 0 0; font-size: 15px; color: var(--muted); }
.auth-switch a { color: var(--ink); font-weight: 700; }
.auth-foot { margin-top: auto; padding-top: 28px; text-align: center; color: var(--muted); font-size: 13.5px; }
.inbox-art {
  display: grid; place-items: center; margin: 4px auto 16px;
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(90deg, var(--surface-2) 50%, var(--lemon) 50%); font-size: 28px; color: var(--ink);
}
.auth-card > p.center { margin: 0 0 22px; }

/* ── Mozgás csökkentése ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
