/* Rintcount: stíluslap – a budget-minta alapján, lebutítva a saját elemkészletre. */
@font-face { font-family: "Manrope"; font-weight: 200 800; font-style: normal; font-display: swap;
  src: url("/static/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-style: normal; font-display: swap;
  src: url("/static/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --page: #edf0f5; --surface: #ffffff; --surface-2: #f6f8fb; --line: #e1e5ec;
  --ink: #0f1e3d; --ink-2: #3a4863; --muted: #6b778c;
  --accent: #0e8f7e; --accent-ink: #ffffff; --accent-soft: #e0f3f0;
  --btn: #0f1e3d; --btn-ink: #ffffff;
  --warn: #b86a14; --warn-soft: #fdf1e0; --danger: #c8412f; --danger-soft: #fbe8e4; --ok: #148a62;
  --focus: #0e8f7e; --rail: #0f1e3d; --rail-ink: #c9d3e6; --rail-active: #ffffff; --rail-soft: rgba(255,255,255,.1);
  --hero: #0f1e3d;
  --r-card: 18px; --r-ctl: 12px; --r-chip: 8px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
    --page: #0a111f; --surface: #121b2d; --surface-2: #17223a; --line: #243250;
    --ink: #e8edf7; --ink-2: #b9c4da; --muted: #8b98b2;
    --accent: #35c7b4; --accent-ink: #06201c; --accent-soft: #123a3a;
    --btn: #e8edf7; --btn-ink: #0f1e3d;
    --warn: #e8a24f; --warn-soft: #3a2c18; --danger: #f08577; --danger-soft: #3b2220; --ok: #5ad1a0;
    --focus: #35c7b4; --rail: #0d1526; --rail-ink: #9fb0cc; --rail-active: #ffffff; --rail-soft: rgba(255,255,255,.07);
    --hero: #16233f;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0a111f; --surface: #121b2d; --surface-2: #17223a; --line: #243250;
    --ink: #e8edf7; --ink-2: #b9c4da; --muted: #8b98b2;
    --accent: #35c7b4; --accent-ink: #06201c; --accent-soft: #123a3a;
    --btn: #e8edf7; --btn-ink: #0f1e3d;
    --warn: #e8a24f; --warn-soft: #3a2c18; --danger: #f08577; --danger-soft: #3b2220; --ok: #5ad1a0;
    --focus: #35c7b4; --rail: #0d1526; --rail-ink: #9fb0cc; --rail-active: #ffffff; --rail-soft: rgba(255,255,255,.07);
    --hero: #16233f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.5 var(--font); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .nowrap { white-space: nowrap; }
.r { text-align: right; } .pos { color: var(--ok); } .bad-text { color: var(--danger); } .ok { color: var(--ok); } .warn { color: var(--warn); }
.lead { color: var(--ink-2); max-width: 64ch; margin: .35rem 0 1.25rem; }
.ic { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------- váz ---------- */
.shell { display: grid; grid-template-columns: 15rem 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; padding: 1.25rem .9rem; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -.03em; color: var(--rail-active); text-decoration: none; padding: 0 .5rem; }
.brand-mark { width: 1.5rem; height: 1.5rem; border-radius: 6px; background: url(/static/icons/logo-light.svg) center / contain no-repeat; display: inline-block; }
.nav { display: flex; flex-direction: column; gap: .15rem; }
.nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: var(--r-ctl); color: var(--rail-ink); text-decoration: none; font-weight: 600; }
.nav a:hover { background: var(--rail-soft); color: var(--rail-active); }
.nav a[aria-current="page"] { background: var(--rail-soft); color: var(--rail-active); box-shadow: inset 3px 0 0 var(--accent); }
.nav-sep { height: 1px; background: var(--rail-soft); margin: .6rem .5rem; }
.rail-foot { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--rail-soft); }
.rail-user { padding: 0 .8rem; font-weight: 700; color: var(--rail-active); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-version { padding: 0 .8rem; color: var(--rail-ink); font-size: .78rem; margin: .1rem 0 .4rem; opacity: .75; }
.rail-foot button, button.ghost { background: transparent; color: var(--rail-ink); border: 0; display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: var(--r-ctl); font-weight: 600; cursor: pointer; width: 100%; min-height: 0; font: inherit; font-weight: 600; }
.rail-foot button:hover { background: var(--rail-soft); color: var(--rail-active); }
.content { min-width: 0; }
.mobilebar { display: none; }
.main { max-width: 64rem; margin: 0 auto; padding: 2rem 2rem 4rem; }

/* ---------- elrendezés ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-7 { grid-column: span 7; } .c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; min-width: 0; color: var(--ink); text-decoration: none; }
a.card:hover { border-color: var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem .75rem; flex-wrap: wrap; }
.card-head h2 { font-size: 1rem; }
.section { font-size: 1.05rem; font-weight: 700; margin: 1.75rem 0 .75rem; color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.1rem 1.25rem; margin: 0 0 1rem; }
.stack { display: grid; gap: .65rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.actions form { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .85rem; margin: 1rem 0; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.cards .card { gap: .25rem; }
.num { font-size: clamp(1.35rem, 1rem + 1.2vw, 1.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.eyebrow { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.card-accent { background: var(--accent-soft); border-color: transparent; }

/* ---------- űrlapok és gombok ---------- */
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .25rem; color: var(--ink-2); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .65rem .85rem; width: 100%; max-width: 100%; min-height: 2.75rem; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: .7; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input.money { text-align: right; }
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; text-align: left; }
button, .btn { font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; text-align: center; text-decoration: none; background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); border-radius: var(--r-ctl); padding: .65rem 1.1rem; min-height: 2.75rem; }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--ink-2); }
button.link { background: none; border: 0; color: var(--muted); padding: .25rem .4rem; min-height: 0; font-weight: 600; text-decoration: underline; }
button.danger, .btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.small-btn { padding: .4rem .8rem; min-height: 2.2rem; font-size: .88rem; }
.msg { font-size: .95rem; } .msg-error { color: var(--danger); } .msg-warn { color: var(--warn); }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; margin: 0; color: var(--ink); }
form.inline { display: inline-flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0; }
.seg { display: flex; gap: .5rem; }
.seg label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .6rem; margin: 0; cursor: pointer; font-weight: 700; background: var(--surface); color: var(--ink); }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }

/* ---------- tájékoztató sávok ---------- */
.notice { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r-ctl); padding: .8rem 1rem; margin: 0 0 .6rem; text-decoration: none; color: var(--ink); }
.notice span:first-of-type { flex: 1; }
.notice-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice-info { border-left-color: var(--accent); }

/* ---------- mutatók ---------- */
.meter { height: .55rem; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--accent)); }

/* ---------- főoldal / egyenleg hero ---------- */
.hero { grid-column: span 12; background: var(--hero); color: #fff; border-radius: 22px; padding: 1.5rem; display: grid; gap: 1.1rem; align-content: start; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.hero .when { font-weight: 700; font-size: 1.05rem; }
.hero .sub { color: #b9c4da; font-size: .9rem; }
.hero-value { font-size: clamp(2rem, 1.3rem + 2.4vw, 2.9rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.hero-stats div { background: rgba(255,255,255,.07); border-radius: 14px; padding: .65rem .85rem; }
.hero-stats .k { color: #b9c4da; font-size: .82rem; display: block; }
.hero-stats .v { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }

/* ---------- lista: kiadások, rendezések ---------- */
.rowlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.rowlist li + li { border-top: 1px solid var(--line); }
.rowlist li.is-settlement { background: var(--accent-soft); }
.row { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.1rem; color: inherit; text-decoration: none; }
.row:hover { background: var(--surface-2); }
.row-main { display: grid; gap: .1rem; min-width: 0; flex: 1; }
.row-title { font-weight: 700; overflow-wrap: anywhere; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.row-sub { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.row-amt { font-weight: 800; white-space: nowrap; letter-spacing: -.01em; text-align: right; }
.avatar { flex: 0 0 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-content: center; font-weight: 800; color: #fff; background: var(--accent); font-size: 1rem; }

/* ---------- útmutató oldal ---------- */
.guide-kicker { color: var(--accent); font-weight: 700; font-size: .82rem; letter-spacing: .03em; text-transform: uppercase; margin-bottom: .25rem; }
.guide-toc a { display: flex; gap: .7rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; }
.guide-toc a:last-child { border-bottom: none; }
.guide-toc .num { color: var(--accent); font-weight: 800; width: 1.7rem; flex: none; white-space: nowrap; }
.guide-shot { max-width: 320px; width: 100%; display: block; margin: 1.1rem auto 0; border-radius: 14px; border: 1px solid var(--line); }

/* ---------- jelzések ---------- */
.badge { display: inline-block; font-size: .72rem; padding: .05rem .5rem; border: 1px solid var(--line); border-radius: var(--r-chip); color: var(--muted); font-weight: 600; }
.badge-warn { border-color: transparent; color: var(--warn); background: var(--warn-soft); }
.badge-ok { border-color: transparent; color: var(--ok); background: var(--accent-soft); }
.chip { display: inline-block; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; text-decoration: none; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chip-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- táblázatok ---------- */
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 700; background: var(--surface-2); }
th.r, td.r { text-align: right; }
tr:last-child td { border-bottom: 0; }

/* ---------- résztvevő-választó egyedi összeggel ---------- */
.sharelist { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.sharerow { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .6rem .85rem; }
.sharerow .check { flex: 1; min-width: 0; }
.sharerow input.money { width: 8.5rem; flex: 0 0 auto; }
.sharerow.is-off { opacity: .5; }
.sumline { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .2rem 0; font-weight: 700; }
.sumline.mismatch { color: var(--warn); }

/* ---------- belépő oldalak (login/regisztráció) ---------- */
.gate { max-width: 23rem; margin: 0 auto; padding: 16vh 1.25rem 2rem; }
.wordmark { font-size: 2.6rem; font-weight: 800; letter-spacing: -.045em; margin: 0 0 1rem; color: var(--ink); }
.gate .card { margin-top: 1rem; }
.gate .lead { margin-top: 0; }

.newtx { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); width: 100%; justify-content: center; }
.newtx:hover { filter: brightness(1.07); }

/* ---------- napló ---------- */
.logitem { display: grid; gap: .15rem; padding: .75rem 1rem; }
.logitem .when { color: var(--muted); font-size: .8rem; }

/* ---------- reszponzív ---------- */
@media (max-width: 1100px) {
  .c-8, .c-7, .c-6, .c-5, .c-4 { grid-column: span 12; }
  .c-3 { grid-column: span 6; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .rail { position: fixed; inset: auto 0 0 0; height: auto; z-index: 40; flex-direction: row; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom, 0)); border-top: 1px solid var(--rail-soft); }
  .rail .brand, .rail-foot, .desk { display: none !important; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .nav a { flex: 1; flex-direction: column; gap: .15rem; padding: .45rem .1rem; font-size: .72rem; text-align: center; border-radius: 10px; box-shadow: none !important; }
  .mobilebar { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; }
  :root[data-theme="dark"] .mobilebar { background: #0d1526; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mobilebar { background: #0d1526; } }
  .mobilebar .brand { padding: 0; font-size: 1.15rem; }
  .mobilebar button.ghost { color: #c9d3e6; width: auto; }
  .main { padding: 1.1rem 1rem 8rem; }
  .newtx { display: none !important; }
  h1 { font-size: 1.45rem; }
  .hero { padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* egy hosszú szám/szó se tolja szét az oldalt */
.stack > *, .grid > *, .grid2 > *, .cards > * { min-width: 0; }
.row-main > *, .main, .content { min-width: 0; }
.row-main { overflow-wrap: anywhere; }
canvas, svg:not(.ic) { max-width: 100%; }
