:root {
    --bg: #1e242c;
    --bg-sidebar: #171c22;
    --surface: #272e38;
    --surface-2: #2e3640;
    --hover: #343c48;
    --border: #3a4350;
    --border-strong: #4d5868;
    --text: #eef0f3;
    --muted: #9aa3ae;
    --muted-2: #7f8894;
    --accent: #6d8fd4;
    --accent-fill: #4d6cb0;
    --accent-hover: #5b7bc0;
    --income: #73c197;
    --income-bg: #2f4a3b;
    --expense: #d49191;
    --expense-bg: #5a3a3a;
    --warning: #d4a574;
    --error: #d08989;
    --ok: #73c197;
    --nav-h: 80px;
    --nav-extra: 16px;
    --nav-fab: 44px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-max-width: 520px;
    --max: var(--app-max-width);
    --tap: 48px;
    --page-pad-x: 16px;
    --kb: 0px;
}

* { box-sizing: border-box; }
html {
    height: 100%;
    color-scheme: dark;
    overflow-x: hidden;
}
html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
}
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100%;
}
body.is-guest { padding: var(--safe-top) 16px max(16px, var(--safe-bottom)); }
body.sheet-open { overflow: hidden; }

button {
    font: inherit;
    color: inherit;
    touch-action: manipulation;
}
a { color: var(--accent); }

input, select, textarea {
    font: inherit;
    color: var(--text);
    color-scheme: dark;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-height: var(--tap);
    padding: 10px 12px;
    width: 100%;
    font-size: 16px;
    line-height: 1.35;
    max-width: 100%;
    -webkit-appearance: none;
    appearance: none;
}
input::placeholder, textarea::placeholder {
    color: var(--muted-2);
    opacity: 1;
}
input:focus, select:focus, textarea:focus,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
    opacity: 0.85;
}
input[type="checkbox"],
input[type="radio"] {
    width: 22px;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    appearance: auto;
    -webkit-appearance: checkbox;
    justify-self: end;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa3ae' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.app, .guest-shell, .app-root { max-width: var(--app-max-width); margin: 0 auto; width: 100%; }
.guest-shell { padding-bottom: 24px; }
.top { padding: 12px 0 8px; }
.brand { margin: 0; font-weight: 700; font-size: 1.05rem; }
h1 { font-size: 1.55rem; margin: 8px 0 12px; font-weight: 700; }
h2 {
    font-size: 0.82rem;
    margin: 0 0 10px;
    font-weight: 650;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hero p { color: var(--muted); line-height: 1.45; }

.banner {
    padding: 12px 14px;
    border-radius: 12px;
    margin: 12px 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.banner.error { background: var(--expense-bg); color: #f3d4d4; }
.banner.warn { background: #4a3a28; color: #f3e0c8; }
.banner.ok { background: var(--income-bg); color: #d4f0e0; }

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    border: 0;
    width: 100%;
    cursor: pointer;
    gap: 8px;
    touch-action: manipulation;
}
.btn.primary { background: var(--accent-fill); color: #fff; }
.btn.primary:active { background: var(--accent-hover); }
.btn.ghost {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn.ghost:active { background: var(--hover); }
.btn.danger { background: var(--expense-bg); color: #f3d4d4; }
.btn.danger:active { filter: brightness(1.08); }
.btn.income { background: var(--income-bg); color: var(--income); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.btn.icon {
    width: var(--tap);
    min-width: var(--tap);
    padding: 0;
}
.bottom-actions {
    position: sticky;
    bottom: 0;
    padding: 12px 0 calc(12px + var(--safe-bottom));
    background: var(--bg);
}

.app-root {
    min-height: 100dvh;
    padding: calc(12px + var(--safe-top)) var(--page-pad-x) calc(var(--nav-h) + var(--nav-extra) + var(--safe-bottom));
    position: relative;
    overflow-x: hidden;
}
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--tap);
    margin-bottom: 10px;
}
.app-header h1 {
    margin: 0;
    font-size: 1.25rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.cloud-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 72%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cloud-dot .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    flex-shrink: 0;
}
.cloud-dot.busy .dot { background: var(--warning); }
.cloud-dot.off .dot { background: var(--error); }
.cloud-dot:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin: 0 0 12px;
    overflow: hidden;
    max-width: 100%;
}
.dash-section { margin-bottom: 4px; }
.kpi-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 100%;
}
.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 6px 14px;
    text-align: center;
    min-height: 80px;
    min-width: 0;
    overflow: hidden;
}
.kpi .lbl { color: var(--muted); font-size: 0.72rem; margin-bottom: 6px; letter-spacing: 0.02em; }
.kpi .val {
    font-size: 0.9rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.kpi.income .val { color: var(--income); }
.kpi.expense .val { color: var(--expense); }
.avg-val {
    font-weight: 750;
    margin-top: 6px;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.tx-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: var(--tap);
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.tx-row:last-child { border-bottom: 0; }
.tx-row:active { opacity: 0.88; }
.tx-main { flex: 1 1 0; min-width: 0; }
.tx-cat {
    font-weight: 600;
    overflow-wrap: anywhere;
    line-height: 1.3;
}
.tx-note {
    font-size: 0.82rem;
    margin-top: 3px;
    overflow-wrap: anywhere;
    line-height: 1.35;
    color: var(--muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.tx-sub {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 3px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.scope-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    padding: 0 8px;
    min-height: 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    vertical-align: middle;
}
.cat-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
    margin-top: 2px;
}
.kpi.tap {
    cursor: pointer;
}
.matrix-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    min-width: 0;
}
.matrix-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}
.matrix-table th, .matrix-table td {
    padding: 8px 6px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.matrix-table th:first-child, .matrix-table td:first-child {
    text-align: left;
}
.report-month-stack,
.report-budget-stack,
.report-kpi-extra {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
}
.report-month-card,
.report-budget-card {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.report-month-card h3,
.report-budget-card h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}
.report-kpi-extra .sum-line,
.report-month-card .sum-line,
.report-budget-card .sum-line {
    min-width: 0;
    max-width: 100%;
}
@media (max-width: 430px) {
    .report-month-stack,
    .report-budget-stack,
    .report-kpi-extra,
    .report-month-card,
    .report-budget-card {
        min-width: 0;
        max-width: 100%;
    }
}
.scope-bars .bar-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 88px;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
    font-size: 0.8rem;
}
.scope-bars .bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden;
}
.scope-bars .bar-track i {
    display: block;
    height: 100%;
    background: var(--accent-fill);
    max-width: 100%;
}
.tx-amt {
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
    max-width: 42%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    padding-top: 1px;
}
.tx-amt.income { color: var(--income); }
.tx-amt.expense { color: var(--expense); }

.nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--nav-fab) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: 3px;
    row-gap: 0;
    align-items: stretch;
    width: 100%;
    max-width: min(100%, var(--app-max-width));
    margin: 0 auto;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    padding: 6px max(4px, env(safe-area-inset-left, 0px)) calc(6px + var(--safe-bottom)) max(4px, env(safe-area-inset-right, 0px));
    z-index: 20;
    overscroll-behavior: none;
    overflow-x: hidden;
    min-width: 0;
}
.nav button {
    background: none;
    border: 0;
    color: var(--muted);
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 2px;
    border-radius: 12px;
    line-height: 1.12;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.nav button:not(.fab) {
    background: #222830;
    border: 1px solid #3a4350;
    overflow: hidden;
}
.nav button:not(.fab):active,
.nav button:not(.fab).pressed { background: var(--hover); color: var(--text); }
.nav button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.nav button:not(.fab).active {
    color: var(--text);
    background: #3a4452;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}
.nav .fab {
    width: var(--nav-fab);
    height: var(--nav-fab);
    min-width: var(--nav-fab);
    max-width: var(--nav-fab);
    min-height: var(--nav-fab);
    justify-self: center;
    align-self: center;
    position: static;
    z-index: 1;
    border-radius: 50%;
    background: var(--accent-fill);
    color: #fff;
    font-size: 1.55rem;
    line-height: 1;
    margin: 0;
    padding: 0;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
}
.nav .fab.active { background: var(--accent-hover); }
.nav .fab:active { background: var(--accent-hover); transform: scale(0.96); }
.nav .fab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
@media (max-width: 359px) {
    .nav { column-gap: 2px; }
    .nav button:not(.fab) { font-size: 0.56rem; padding: 3px 1px; }
}

.field { margin: 0 0 14px; }
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid .seg {
    outline: 2px solid var(--error);
    outline-offset: 2px;
}
.field-error {
    color: var(--error);
    font-size: 0.85rem;
    margin: 6px 0 0;
}
.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}
.amount-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.amount-wrap .amount-input,
.amount-wrap input {
    width: 100%;
    padding-right: 3.1rem;
}
.amount-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--muted);
    pointer-events: none;
    user-select: none;
}
.amount-input {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.03em;
    min-height: 64px !important;
    font-variant-numeric: tabular-nums;
}
.amount-wrap .amount-input + .amount-suffix {
    font-size: 1.25rem;
    color: var(--text);
}
.seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.seg button {
    min-height: var(--tap);
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.seg button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.seg button.is-active {
    background: var(--accent-fill);
    border-color: var(--accent);
    color: #fff;
    font-weight: 750;
    box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(109, 143, 212, 0.35);
}
.seg button .type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}
.seg button .type-dot.expense { background: var(--expense); }
.seg button .type-dot.income { background: var(--income); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 100%;
}
.chip {
    min-height: var(--tap);
    min-width: var(--tap);
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip.on { background: var(--accent-fill); border-color: transparent; color: #fff; }
.chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.chip .star {
    width: var(--tap);
    min-width: var(--tap);
    height: var(--tap);
    margin: 0 -10px 0 -8px;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    color: var(--warning);
    cursor: pointer;
    font-size: 1.15rem;
}

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 30;
}
.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: min(var(--app-max-width), 100%);
    margin: 0 auto;
    background: var(--surface);
    border-radius: 18px 18px 0 0;
    padding: 12px 16px calc(16px + var(--safe-bottom));
    z-index: 31;
    max-height: min(88dvh, calc(100dvh - var(--safe-top)));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.sheet h2 { color: var(--text); text-transform: none; font-size: 1.1rem; letter-spacing: 0; }
.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 4px;
    margin: 4px auto 12px;
}
.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.sheet-close {
    width: auto;
    min-width: var(--tap);
    padding: 0 12px;
    font-size: 0.9rem;
}

.cat-row {
    display: grid;
    grid-template-columns: var(--tap) minmax(0, 1fr);
    align-items: center;
    min-height: var(--tap);
    gap: 4px;
    position: relative;
}
.cat-row span { overflow-wrap: anywhere; min-width: 0; }
.cat-row button.star-btn {
    position: relative;
    z-index: 2;
    width: var(--tap);
    min-width: var(--tap);
    height: var(--tap);
    min-height: var(--tap);
    background: none;
    border: 0;
    color: var(--muted-2);
    cursor: pointer;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.cat-row button.star-btn.on { color: var(--warning); }
.cat-row button.star-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.cat-row .cat-name {
    background: none;
    border: 0;
    color: inherit;
    text-align: left;
    min-height: var(--tap);
    min-width: 0;
    padding: 0 4px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    overflow-wrap: anywhere;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}
.cat-row .cat-name:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 8px;
}
.cat-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 12px;
}
.merge-card { margin: 12px 0; }
.merge-choice {
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: var(--tap);
    margin: 4px 0;
}

.qa-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.qa-btn {
    min-height: var(--tap);
    min-width: var(--tap);
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: inherit;
    cursor: pointer;
    font-weight: 600;
    max-width: 100%;
}
.qa-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.period-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.period-row > .chip {
    flex: 0 0 auto;
    max-width: 100%;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.card-head h2 { margin: 0; }
.section-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 650;
    text-decoration: none;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}
.section-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}

.upcoming-sum { margin-bottom: 8px; }
.sum-line { margin: 6px 0; overflow-wrap: anywhere; }
.sum-line .expense { color: var(--expense); }
.sum-line .income { color: var(--income); }

.tpl-card {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.tpl-card:last-child { border-bottom: 0; }
.tpl-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.tpl-actions .btn {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 10px;
}

.detail-amt {
    font-size: 1.6rem;
    text-align: left;
    display: block;
    margin-bottom: 12px;
    max-width: 100%;
}
.detail-dl {
    display: grid;
    gap: 10px;
}
.detail-dl > div {
    display: grid;
    grid-template-columns: 7.2rem minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}
.detail-dl dt { color: var(--muted); font-weight: 500; }
.detail-dl dd { margin: 0; overflow-wrap: anywhere; }

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent-fill);
    color: #fff;
    font-size: 0.75rem;
}
.card.compact { padding: 12px 16px; }
.form-hint { margin: 8px 0 0; }
.hint-chip { font-size: 0.85rem; }
.sheet-sub { font-size: 0.95rem; margin: 12px 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; }
.learn-summary { margin: 8px 0 16px; }
.learn-summary div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.learn-summary dt { color: var(--muted); font-weight: 500; }
.learn-summary dd { margin: 0; text-align: right; }
.learn-actions { display: flex; flex-direction: column; gap: 8px; }
.learn-actions .btn { min-height: var(--tap); width: 100%; }

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
}
.search-bar input,
.search-bar .ctrl {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}
.filter-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: var(--tap);
    padding: 0 12px;
    white-space: nowrap;
}

.more-fields {
    margin: 4px 0 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 12px;
    background: var(--surface-2);
}
.more-fields summary {
    min-height: var(--tap);
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 650;
    list-style: none;
}
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.more-fields[open] summary { margin-bottom: 8px; }

.sticky-save {
    position: sticky;
    bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--kb, 0px));
    z-index: 5;
    padding: 10px 0 8px;
    background: var(--bg);
}
#tx-form #repeat-last {
    width: 100%;
    margin: 4px 0 12px;
}
#tx-form #description {
    min-height: var(--tap);
}

.toast {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(var(--nav-h) + var(--nav-extra) + var(--safe-bottom) + var(--kb, 0px));
    max-width: calc(var(--app-max-width) - 32px);
    margin: 0 auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    z-index: 40;
    text-align: center;
    font-weight: 600;
    overflow-wrap: anywhere;
    pointer-events: none;
}
.muted { color: var(--muted); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.chart-card {
    overflow: hidden;
    max-width: 100%;
    contain: layout;
}
.chart-wrap {
    width: 100%;
    max-width: 100%;
    height: 148px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}
.chart-wrap svg,
.chart-wrap canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}
.chart-legend {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.chart-swatch.expense { background: var(--expense); }
.chart-swatch.income { background: var(--income); }
.chart-caption {
    min-height: 1.3em;
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.bar-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin: 6px 0;
    min-height: var(--tap);
    padding: 4px 0;
    font-size: 0.88rem;
}
.bar-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.bar-row .n {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}
.bar-row .amt {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 0.88rem;
    text-align: right;
    flex: 0 0 auto;
    line-height: 1.25;
}
.bar-pct {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 400;
    margin-top: 1px;
}
.bar-row.is-button,
button.bar-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: none;
    border: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.bar-row.is-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.bar-track,
.category-bar-track {
    display: block;
    position: relative;
    width: 100%;
    height: 10px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    min-width: 0;
}
.bar-fill,
.category-bar-fill {
    display: block;
    flex: none;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
    width: 0%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    background: var(--expense);
    border-radius: 99px;
    box-sizing: border-box;
}
.bar-fill.is-nonzero { /* length comes from [data-w] / inline width, not a shared min-width */ }
.bar-fill.is-tiny { min-width: 3px; }

.insight {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 10px 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
    word-break: break-word;
}
.insight:last-child { border-bottom: 0; }

.insight-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    margin: 0 0 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: inherit;
    font: inherit;
}
.insight-prio {
    font-size: 0.75rem;
    color: var(--muted);
}
.insight-title { font-weight: 600; }
.insight-msg { line-height: 1.4; overflow-wrap: anywhere; }
.forward-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px;
}
.forward-tab {
    min-height: var(--tap);
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: inherit;
    font: inherit;
}
.forward-tab[aria-selected="true"] {
    border-color: var(--accent, #6d8fd4);
}
.insight-how { margin: 8px 0 12px; }

.skeleton-block, .skeleton-card {
    background: var(--surface);
    border-radius: 12px;
    height: 22px;
    margin: 10px 0;
    animation: pulse 1.2s ease-in-out infinite;
}
.skeleton-block.short { width: 40%; }
.skeleton-card { height: 88px; }
@keyframes pulse { 50% { opacity: 0.55; } }

.empty { color: var(--muted); padding: 24px 8px; text-align: center; line-height: 1.45; overflow-wrap: anywhere; }
.state-loading { color: var(--muted); padding: 24px 8px; text-align: center; line-height: 1.45; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
    .skeleton-block, .skeleton-card { animation: none; }
    .nav .fab:active { transform: none; }
    #top-progress span, .btn .spin, .inline-spin { animation: none; }
    .chart-wrap.is-chart-enter .cf-area,
    .chart-wrap.is-chart-enter .cf-line,
    .sparkline .spark-line,
    .sparkline .spark-fill { animation: none; }
    .chart-wrap.is-soft-loading,
    .app-root.is-soft-loading .chart-wrap { opacity: 1; }
}

@media (min-width: 720px) {
    .app-root, .nav, .sheet, .toast, .guest-shell { max-width: var(--app-max-width); }
}

@media (display-mode: standalone) {
    html, body { background: #1e242c; }
    .app-root {
        padding-top: calc(12px + var(--safe-top));
        padding-bottom: calc(var(--nav-h) + var(--nav-extra) + var(--safe-bottom));
    }
}
html.standalone, body.is-standalone { background: #1e242c; }

#top-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    height: 3px;
    background: transparent;
    pointer-events: none;
}
#top-progress span {
    display: block;
    height: 100%;
    width: 40%;
    background: var(--accent);
    animation: progress-slide 1.1s ease-in-out infinite;
}
#update-banner {
    position: sticky;
    top: var(--safe-top);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    max-width: var(--app-max-width);
    margin: 0 auto;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
#update-banner[hidden] { display: none !important; }
#update-banner .btn { width: auto; min-width: 96px; padding: 8px 12px; min-height: 40px; }
#net-banner {
    position: sticky;
    top: var(--safe-top);
    z-index: 29;
    max-width: var(--app-max-width);
    margin: 0 auto;
    padding: 8px 16px;
}

.pressed { filter: brightness(1.14); }
.nav button:not(.fab).pressed { background: var(--hover); color: var(--text); }
.btn.pressed { filter: brightness(1.08); }
.chip.pressed, .tx-row.pressed, .cat-row.pressed, .qa-btn.pressed { opacity: 0.85; }

.btn.busy { pointer-events: none; }
.btn .spin, .inline-spin {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.boot-screen[aria-busy="true"] { min-height: 40vh; }

@keyframes progress-slide {
    0% { transform: translateX(-120%); width: 30%; }
    50% { width: 55%; }
    100% { transform: translateX(280%); width: 30%; }
}
@keyframes spin { to { transform: rotate(360deg); } }

mark.hl {
    background: rgba(109, 143, 212, 0.35);
    color: inherit;
    padding: 0 1px;
    border-radius: 3px;
}
.dash-fold {
    margin: 0 0 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 4px 16px 12px;
    overflow: hidden;
}
.dash-fold > summary {
    list-style: none;
    cursor: pointer;
    min-height: var(--tap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dash-fold > summary::-webkit-details-marker { display: none; }
.dash-fold > summary::after {
    content: 'Részletek';
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    color: var(--accent);
}
.dash-fold[open] > summary::after { content: 'Kevesebb'; }
.dash-fold > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.compare-row {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 0;
    min-height: 48px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}
.compare-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: var(--fill, 0%);
    max-width: 100%;
    background: rgba(109, 143, 212, 0.18);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}
.compare-row:last-child { border-bottom: 0; }
.compare-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.compare-row .lbl {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.compare-row .vals {
    position: relative;
    z-index: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex: 0 0 auto;
    font-weight: 650;
    line-height: 1.35;
    padding-top: 1px;
}
.compare-row .chg { display: block; font-size: 0.8rem; color: var(--muted); }
.compare-row .chg.up { color: var(--expense); }
.compare-row .chg.down { color: var(--income); }
.cal-weekdays, .cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
}
.cal-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    padding: 4px 0;
}
.cal-day {
    min-height: 48px;
    min-width: 0;
    border: 0;
    border-radius: 10px;
    background: var(--surface-2);
    color: inherit;
    padding: 4px 2px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}
.cal-day.is-empty {
    background: transparent;
    cursor: default;
}
.cal-day.is-today { outline: 2px solid var(--accent); }
.cal-day .d { font-weight: 650; font-size: 0.82rem; }
.cal-dots { display: flex; gap: 3px; min-height: 6px; }
.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
}
.cal-dot.income { background: var(--income); }
.cal-dot.expense { background: var(--expense); }
.cal-dot.posted {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--income);
}
.cal-dot.skipped {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--muted);
}
.cal-dot.upcoming { background: var(--accent); }
.cal-day:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.cal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.cal-nav h2 { flex: 1 1 140px; margin: 0; font-size: 1.05rem; }
.cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 10px;
}
.cal-filters label { font-size: 0.82rem; color: var(--muted); }
.cal-filters select { margin-left: 4px; }
.cal-count {
    font-size: 0.68rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.cal-day.is-selected {
    outline: 2px solid var(--text);
    outline-offset: 0;
    background: var(--surface-3, #343c48);
}
.cal-dot.overdue {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--expense);
}
.cal-week { animation: calFade 0.18s ease; }
@keyframes calFade {
    from { opacity: 0.55; }
    to { opacity: 1; }
}
.cal-layout { display: grid; gap: 12px; min-width: 0; }
.cal-agenda, .cal-card { min-width: 0; }
.cal-filters select { max-width: 100%; }
.cal-agenda { min-width: 0; }
.status-pill.overdue { background: var(--expense-bg); color: var(--expense); }
.status-pill.paused, .status-pill.pending { background: #3a4350; color: var(--text); }
@media (min-width: 768px) {
    .cal-layout {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: start;
    }
}
@media (max-width: 420px) {
    .cal-day { min-height: 36px; padding: 2px 0 4px; }
    .cal-day .d { font-size: 0.75rem; }
    .cal-dots { display: none; }
    .cal-count { font-size: 0.62rem; }
}
.status-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 650;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-2);
}
.status-pill.posted { background: var(--income-bg); color: var(--income); }
.status-pill.skipped { background: var(--expense-bg); color: var(--expense); }
.status-pill.upcoming { background: #3a4350; color: var(--text); }
.forecast-line { margin: 6px 0; }
.muted-note { color: var(--muted); font-size: 0.8rem; line-height: 1.4; margin-top: 8px; }
.view-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.view-toggle .btn.primary {
    background: var(--accent-fill);
    color: #fff;
    border-color: transparent;
}

/* BAR-WIDTHS-BEGIN */
/* Width comes from inline style and NaploUiLayout.applyFillWidths. Do not regenerate 0..1000 selectors. */
/* BAR-WIDTHS-END */

.budget-block { margin: 12px 0 8px; }
.budget-block .sheet-sub { margin-bottom: 6px; }
.budget-track {
    height: 8px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0;
}
.budget-fill.status-ok { background: var(--ok); }
.budget-fill.status-warning { background: var(--warning); }
.budget-fill.status-critical { background: var(--error); }
.budget-fill.status-over { background: var(--expense); }
.budget-overview-head { margin: 0 0 8px; font-size: 12px; }
.budget-overview-row { margin: 0 0 10px; }
.budget-overview-row .sum-line { margin: 2px 0 0; }
.budget-alert .muted { margin: 2px 0 6px; }
.budget-over { color: var(--expense); font-weight: 650; margin: 4px 0 0; }
.budget-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 0 12px;
    flex-wrap: wrap;
}
.budget-month-label { font-weight: 700; text-align: center; flex: 1 1 120px; }
.split-panel { margin: 10px 0 16px; }
.split-explain { margin: 0 0 10px; }
.split-row {
    display: grid;
    grid-template-columns: 1fr minmax(88px, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.split-row .split-fill,
.split-row .split-del { min-height: var(--tap); }
@media (min-width: 480px) {
    .split-row {
        grid-template-columns: 1fr minmax(96px, 120px) auto auto;
    }
}
.split-totals {
    position: sticky;
    bottom: calc(var(--tap) + var(--nav-h) + var(--safe-bottom, 0px));
    z-index: 4;
    margin-top: 10px;
    color: var(--muted);
    min-height: var(--tap);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
    background: var(--bg);
    padding: 8px 0;
}
.split-totals .ok { color: var(--ok); }
.split-totals .warn { color: var(--warning); }
#split-toggle,
#split-add,
.split-row select,
.split-row input {
    min-height: var(--tap);
}
#tx-form.prefilled {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 12px;
}
.cat-default-hint {
    margin: 6px 0 0;
    font-size: 0.85rem;
}
#cat-default-template,
#tpl-cat-default {
    min-height: var(--tap);
}

.review-teaser .review-pct,
.review-pct {
    font-size: 1.6rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}
.review-month-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 12px;
}
.review-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin: 8px 0;
}
.review-card .review-amt {
    font-size: 1.45rem;
    font-weight: 750;
    margin-bottom: 4px;
}
.review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}
.btn.tap-lg,
.review-actions .btn {
    min-height: 48px;
    min-width: 48px;
}
.review-todo { width: 100%; text-align: left; margin-bottom: 8px; }
.forecast-flag { color: var(--muted); }
.forecast-flag strong { color: var(--text); }
.check-line { padding: 6px 0; }
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dash-controls {
    margin: 0 0 8px;
}
.quick-status-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}
button.quick-status-card {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    min-width: 48px;
    text-align: left;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: inherit;
    font: inherit;
    cursor: pointer;
}
button.quick-status-card:focus {
    outline: 2px solid var(--accent, #6d8fd4);
    outline-offset: 2px;
}
.quick-status-card .qs-icon {
    font-size: 1.05rem;
    min-width: 18px;
}
.quick-status-card .qs-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}
.quick-status-card .qs-title,
.qs-title {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}
.quick-status-card .qs-status {
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.quick-status-card.sev-warning,
.quick-status-card.sev-attention,
.quick-status-card.sev-forecast_over {
    border-color: #d4a574;
}
.quick-status-card.sev-over {
    border-color: #d08989;
}
.kpi-row-4 {
    grid-template-columns: 1fr 1fr;
}
.dash-month-kpi .kpi {
    min-height: 64px;
    padding: 10px 6px 12px;
}
.scope-summary-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.scope-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}
.scope-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}
button.mini-metric {
    display: block;
    width: 100%;
    min-height: 48px;
    min-width: 48px;
    text-align: left;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.mini-metric .lbl {
    color: var(--muted);
    font-size: 0.7rem;
}
.mini-metric .val {
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}
.mini-metric.income .val { color: var(--income); }
.mini-metric.expense .val { color: var(--expense); }
.card.compact-alerts,
.card.next7 {
    padding: 12px;
}
button.alert-line {
    display: block;
    width: 100%;
    text-align: left;
    min-height: 48px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
button.alert-line:last-of-type {
    border-bottom: 0;
}

/* WAVE 8 — visual analytics tokens (dark theme, no new design system) */
.chart-card {
    --chart-gap: 10px;
    --chart-label: 10px;
}
.chart-card-hero {
    padding-bottom: 14px;
}
.chart-card-hero h2 {
    font-size: 1.02rem;
}
.dash-visual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
}
.dash-visual-grid > .card,
.dash-visual-grid > .chart-card {
    margin-bottom: 0;
    min-width: 0;
}
.chart-legend button.legend-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    min-width: var(--tap);
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}
.chart-legend button.legend-btn.off {
    opacity: 0.42;
}
.chart-legend button.legend-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
#trend-last-month {
    width: 100%;
    margin-top: 8px;
}
.chart-swatch.net { background: var(--accent); }
@keyframes chart-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.chart-wrap.is-chart-enter .cf-area { animation: chart-fade-in 0.38s ease-out; }
.chart-wrap.is-chart-enter .cf-line { animation: chart-fade-in 0.28s ease-out; }
.chart-wrap.is-soft-loading,
.app-root.is-soft-loading .chart-wrap {
    opacity: 0.55;
}
.sparkline {
    display: block;
    width: 72px;
    height: 24px;
    margin: 6px auto 0;
    overflow: visible;
}
.sparkline .spark-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sparkline .spark-fill { fill: currentColor; opacity: 0.18; }
.kpi.income .sparkline { color: var(--income); }
.kpi.expense .sparkline { color: var(--expense); }
.kpi .sparkline { color: var(--accent); }
.budget-progress-row,
.compare-mini-row {
    padding: 8px 0;
    min-height: 48px;
}
.budget-progress-row .bp-meta,
.compare-mini-row .cm-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.88rem;
}
.budget-progress-row .bp-track,
.compare-mini-row .cm-track,
.forecast-track {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-2);
    margin-top: 6px;
    max-width: 100%;
}
.budget-progress-row .bp-fill,
.compare-mini-row .cm-fill {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    min-width: 0;
}
.budget-progress-row.is-over .bp-fill { background: var(--error); }
.budget-progress-row.is-warn .bp-fill { background: var(--warning); }
.forecast-track .forecast-actual { background: var(--expense); height: 100%; }
.forecast-track .forecast-remain { background: var(--warning); height: 100%; opacity: 0.72; }
.forecast-track-legend {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--muted);
}
.cat-visual {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 0;
}
.cat-donut-wrap {
    width: 132px;
    height: 132px;
    margin: 0 auto;
}
.cat-donut-wrap svg { width: 100%; height: 100%; display: block; }
.chart-error {
    color: var(--muted);
    padding: 12px 4px;
    line-height: 1.45;
}
.dash-fold[open] { overflow: visible; }
.dash-fold > :not(summary) { min-width: 0; }

@media (min-width: 768px) {
    :root { --app-max-width: 736px; }
    .chart-wrap { height: 180px; }
    .kpi-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    :root { --app-max-width: 980px; }
    .chart-wrap { height: 200px; }
    .dash-visual-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }
    .cat-visual { grid-template-columns: 140px minmax(0, 1fr); }
}
@media (min-width: 1280px) {
    :root { --app-max-width: 1120px; }
    .chart-wrap { height: 220px; }
}
.chart-card-hero.is-chart-selected {
    outline: 2px solid var(--accent, #6d8fd4);
    outline-offset: 0;
}
.analytics-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0 0 8px;
    min-width: 0;
}
.crumb-btn {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    min-height: var(--tap);
    padding: 0 6px;
    cursor: pointer;
}
.what-changed-card .sheet-sub,
.what-changed .sheet-sub {
    margin: 10px 0 4px;
    font-size: 0.85rem;
}
.sheet .compare-row {
    width: 100%;
}
@media (min-width: 768px) {
    .sheet {
        max-width: min(720px, 100%);
        margin-left: auto;
        margin-right: auto;
    }
}
@media (min-width: 1024px) {
    .sheet {
        max-width: min(860px, 100%);
    }
    .what-changed-card {
        min-width: 0;
    }
}
@media (min-width: 1280px) {
    .sheet {
        max-width: min(980px, 100%);
    }
}

/* WAVE 10 — personalizable dashboard (UI preference only) */
.dash-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}
.dash-toolbar .btn {
    min-height: var(--tap);
}
.dash-vis-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    width: 100%;
    margin-top: 4px;
}
.dash-vis-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    font-size: 0.86rem;
}
.dash-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
}
.dash-slot {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.16s ease;
}
.dash-slot > .card,
.dash-slot > .dash-section,
.dash-slot > .chart-card,
.dash-slot > .scope-summary-wrap,
.dash-slot > details {
    margin-bottom: 0;
    min-width: 0;
}
.dash-edit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.dash-edit-title {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 650;
    min-width: 0;
    flex: 1 1 auto;
}
.dash-handle {
    min-width: var(--tap);
    min-height: var(--tap);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: inherit;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.dash-handle:active { cursor: grabbing; }
.dash-size {
    min-height: var(--tap);
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: inherit;
    font: inherit;
    padding: 0 8px;
}
.dash-slot.is-editing .card,
.dash-slot.is-editing .dash-section,
.dash-slot.is-editing .chart-card,
.dash-slot.is-editing details,
.dash-slot.is-editing .scope-summary-wrap {
    pointer-events: none;
    user-select: none;
}
.dash-slot.is-hidden-card {
    opacity: 0.62;
}
.dash-empty .btn { margin-top: 8px; }
@media (min-width: 1024px) {
    .dash-board {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }
    .dash-slot[data-size="wide"] {
        grid-column: 1 / -1;
    }
}
@media (max-width: 1023px) {
    .dash-slot[data-size="wide"],
    .dash-slot[data-size="standard"],
    .dash-slot[data-size="compact"] {
        grid-column: 1 / -1;
    }
}

.planner-page { min-width: 0; max-width: 100%; }
.planner-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }
.planner-block { margin-bottom: 16px; }
.planner-compare { display: grid; gap: 8px; }
.planner-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    min-width: 0;
}
.planner-row span { min-width: 0; overflow-wrap: anywhere; }
.planner-row:last-child { border-bottom: 0; }
.planner-row .lbl { color: var(--muted); }
.planner-delta { font-weight: 600; }
.planner-chart { width: 100%; max-width: 100%; height: auto; display: block; }
.planner-fact {
    border-left: 3px solid var(--accent);
    padding: 8px 12px;
    margin: 8px 0;
    background: var(--surface-2);
    border-radius: 0 10px 10px 0;
}
.planner-fact .tag {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}
.planner-change {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}
.planner-progress {
    width: 100%;
    height: 10px;
    border-radius: 99px;
    background: var(--surface-2);
    overflow: hidden;
    margin: 8px 0;
}
.planner-progress > span {
    display: block;
    height: 100%;
    background: var(--accent);
    max-width: 100%;
}
.planner-stack .field { margin-bottom: 10px; }
@media (min-width: 768px) {
    .planner-compare { grid-template-columns: 1fr; }
}
.report-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.report-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    max-width: 100%;
    min-width: 0;
    font-size: 0.9rem;
}
.report-custom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin: 0 0 12px;
    min-width: 0;
    max-width: 100%;
}
.report-custom[hidden] {
    display: none;
}
.report-custom label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    font-size: 0.85rem;
    color: var(--muted);
}
.report-custom input {
    min-height: var(--tap);
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
@media (max-width: 430px) {
    .report-custom {
        grid-template-columns: minmax(0, 1fr);
    }
}
.report-export {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}
.report-export .btn {
    min-width: 0;
    width: 100%;
}
.report-xlsx-deferred {
    grid-column: 1 / -1;
    margin: 0;
}
.report-types { margin-bottom: 8px; }
.report-check input { width: 18px; height: 18px; }
@media (min-width: 768px) {
    .report-export { max-width: 420px; }
}

.checkup-card {
    min-width: 0;
    max-width: 100%;
}
.checkup-card h2 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}
.checkup-card p { margin: 0; word-break: break-word; }
.checkup-finding {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    margin: 0 0 8px;
    min-width: 0;
}
.checkup-finding > summary {
    list-style: none;
    cursor: pointer;
    min-height: var(--tap);
    display: flex;
    align-items: center;
    font-weight: 650;
    word-break: break-word;
}
.checkup-finding > summary::-webkit-details-marker { display: none; }
.checkup-finding > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.checkup-finding p { margin: 8px 0 0; word-break: break-word; }
.checkup-links { margin-top: 12px; }
#checkup-run { width: 100%; max-width: 100%; margin: 0 0 12px; }
@media (min-width: 768px) {
    #checkup-run { width: auto; }
}

.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid var(--border, #c8c8c8);
    background: transparent;
    color: var(--muted, #666);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    padding: 0;
}
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-help-inline {
    display: block;
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.35;
}
.detail-field { margin-top: 8px; }
.detail-edit-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
}
.detail-edit-row input.detail-name { flex: 1; min-width: 0; }
.detail-arch { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; white-space: nowrap; }
.split-detail { margin-top: 4px; width: 100%; }

.funds-banner {
    background: var(--surface-2, #2e3640);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--warning, #d4a574);
    margin-bottom: 12px;
}
.funds-grid { display: grid; gap: 8px; }
.funds-card, .funds-sum {
    background: var(--surface, #272e38);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
}
.funds-card { display: flex; gap: 10px; align-items: center; min-height: 72px; }
.funds-swatch { width: 8px; align-self: stretch; border-radius: 4px; }
.funds-main { flex: 1; min-width: 0; }
.funds-name { font-weight: 700; }
.funds-amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.funds-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.funds-filters button, .funds-filters select, .funds-filters input {
    min-height: 44px;
}
.funds-bar { height: 8px; border-radius: 4px; background: #6d8fd4; margin: 4px 0 10px; }
.funds-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.funds-actions .btn { min-height: 44px; }
.funds-note { color: var(--muted); font-size: 0.85rem; }

.tx-money {
    display: block;
    margin-top: 4px;
    font-size: 0.92rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}
.report-money-warning {
    border: 1px solid #c9a227;
    background: #3a3218;
    color: #f3e6c0;
    margin: 12px 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}
.report-money-warning p, .report-money-warning strong {
    margin: 8px 0;
    white-space: normal;
    overflow-wrap: anywhere;
}
.report-money-warning .btn { min-height: 44px; max-width: 100%; white-space: normal; }
.money-state {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1.3;
}
@media (max-width: 720px) {
    .tx-row { align-items: flex-start; }
    .tx-main { min-width: 0; flex: 1; }
    .tx-money { max-width: 100%; }
    #recon-actual, #recon-when, #recon-note, #recon-record, #recon-adjust, #recon-preview-btn,
    #report-open-review {
        width: 100%;
        min-height: 44px;
    }
    .report-money-warning { margin-left: 0; margin-right: 0; }
}

/* 2.0.7 mobil: kompakt gyorsműveletek, lista-sorok, KPI, amely nem lóg ki */
.dash-quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
    gap: 8px;
    width: 100%;
}
.dash-quick .btn {
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: normal;
}
.dash-controls .period-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.dash-controls .chip {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 4px 6px;
    font-size: 0.82rem;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
}
.qa-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.25rem), 1fr));
    gap: 8px;
}
.qa-btn {
    width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    padding: 8px 10px;
}
.dash-month-kpi .kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    overflow: hidden;
}
.dash-month-kpi .kpi .lbl,
.dash-month-kpi .kpi .val,
.kpi-grid .kpi .muted,
.kpi-grid .kpi-val {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
}
.dash-month-kpi .kpi .val {
    font-size: clamp(0.72rem, 3.4vw, 0.95rem);
    position: relative;
    z-index: 1;
}
.dash-month-kpi .sparkline {
    position: relative;
    z-index: 0;
    width: min(72px, 100%);
    height: 20px;
    margin-top: 4px;
    overflow: hidden;
}
.agenda-list { display: flex; flex-direction: column; min-width: 0; }
.agenda-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}
.agenda-item:last-child { border-bottom: 0; }
.agenda-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.agenda-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}
.agenda-date {
    color: var(--muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}
.agenda-amt {
    margin-left: auto;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex: 0 0 auto;
}
.agenda-amt.income { color: var(--income); }
.agenda-amt.expense { color: var(--expense); }
.agenda-name {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.3;
    font-weight: 600;
}
.agenda-more { margin-top: 4px; }
.bar-scale-note {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.35;
}
.bar-meta .amt,
.bar-pct {
    overflow-wrap: anywhere;
}
.dash-fold {
    margin: 0;
    padding: 0 12px;
    min-height: 0;
}
.dash-fold[open] { padding-bottom: 12px; }
.dash-fold > summary { min-height: 44px; }
.insight-more { margin-top: 6px; }
.insight-more > summary {
    min-height: 44px;
    cursor: pointer;
}
.insight-row .insight-msg { overflow-wrap: anywhere; }
#dash-funds .btn,
.pos-card > .btn {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.92rem;
}
.review-month-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
    min-width: 0;
}
.review-month-nav .btn {
    width: 100%;
    min-height: 44px;
    min-width: 0;
    padding: 8px 8px;
    font-size: 0.82rem;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
    hyphens: manual;
}
.review-month-nav .budget-month-label {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.3;
    padding: 2px 4px 4px;
}
.review-month-nav .review-custom {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 0;
}
.review-month-nav .review-custom[hidden] { display: none; }
.review-month-nav .review-custom:not([hidden]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}
.review-month-nav .review-custom label {
    min-width: 0;
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.82rem;
}
.kpi-grid .kpi {
    min-height: 0;
    padding: 8px;
    text-align: left;
}
.nav .nav-label {
    display: block;
    max-width: 100%;
    line-height: 1.05;
    overflow-wrap: anywhere;
}
@media (max-width: 420px) {
    .tx-amt {
        white-space: normal;
        overflow-wrap: anywhere;
        max-width: 48%;
    }
    .pos-total { font-size: 1.05rem; }
    .pos-card .funds-amt { font-size: 0.92rem; }
}
@media (max-width: 389px) {
    :root { --nav-h: 88px; }
}
@media (min-width: 768px) {
    .review-month-nav {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
    }
    .review-month-nav .budget-month-label {
        grid-column: 3;
        grid-row: 1;
        padding: 0 10px;
    }
    .review-month-nav .review-nav-prev { grid-column: 1; grid-row: 1; }
    .review-month-nav .review-nav-now { grid-column: 2; grid-row: 1; }
    .review-month-nav .review-nav-next { grid-column: 4; grid-row: 1; }
    .review-month-nav #review-custom-toggle {
        grid-column: 1;
        grid-row: 2;
        width: auto;
        justify-self: start;
        min-width: 160px;
    }
    .review-month-nav .review-custom { grid-row: 3; }
    .review-month-nav .review-custom:not([hidden]) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        align-items: end;
    }
}

/* 2.0.8 mobil havi ellenőrzés: kompakt rács, lista a táblázat helyett */
.app-root:has(.review-page) {
    padding-bottom: calc(var(--nav-h) + var(--nav-extra) + var(--safe-bottom) + 20px);
}
.review-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 10px;
    max-width: 1200px;
    min-width: 0;
}
.review-kpi-grid .kpi {
    min-height: 0;
    min-width: 0;
    padding: 8px 8px 10px;
    text-align: left;
    overflow: hidden;
}
.review-kpi-grid .kpi .muted {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0 0 4px;
    font-size: 0.72rem;
    line-height: 1.25;
    max-height: 2.5em;
    white-space: normal;
}
.review-kpi-grid .kpi-val {
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    font-size: clamp(0.68rem, 3.15vw, 0.95rem);
    line-height: 1.2;
    white-space: nowrap;
    max-width: 100%;
}
.review-fold { margin: 2px 0 0; }
.review-fold > summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    cursor: pointer;
    font-weight: 650;
}
.review-fold > summary::-webkit-details-marker { display: none; }
.review-page #review-forecast .forecast-line:has(.forecast-label) {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin: 3px 0;
}
.review-page #review-forecast .forecast-label {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
}
.review-page #review-forecast .forecast-line strong {
    white-space: nowrap;
    flex: 0 0 auto;
}
.break-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 8px;
    min-width: 0;
}
.break-mode {
    min-height: 44px;
    min-width: 0;
    padding: 6px 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: inherit;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    cursor: pointer;
    hyphens: manual;
}
.break-mode.is-on {
    background: var(--accent-fill);
    color: #fff;
    border-color: transparent;
}
.break-mode:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.break-list { display: none; }
.break-line {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    min-width: 0;
    margin: 0;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
}
.break-line:last-child { border-bottom: 0; }
.break-line:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.break-line-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.break-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 650;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}
.break-amt {
    flex: 0 0 auto;
    margin-left: 8px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}
.break-meta {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.3;
    white-space: nowrap;
}
.review-exports {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 4px 0 8px;
    min-width: 0;
}
.review-exports .btn {
    min-height: 44px;
    width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
    padding: 8px 10px;
}
.review-exports .review-export-full {
    grid-column: 1 / -1;
}
.review-page .break-table {
    width: 100%;
    max-width: 100%;
}
@media (max-width: 767px) {
    .review-page .card {
        margin-bottom: 8px;
        padding: 12px;
    }
    .review-page .card > h2 { margin-bottom: 6px; }
    .review-page .check-line { padding: 3px 0; }
    .review-page .compare-mini-row { margin: 4px 0; }
    .review-page .card > p { margin: 6px 0; }
    .review-page .break-table { display: none; }
    .review-page .break-list {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
}
@media (max-width: 359px) {
    .review-kpi-grid { grid-template-columns: 1fr; }
    .review-kpi-grid .kpi-val { font-size: 0.95rem; }
    .break-modes { grid-template-columns: 1fr 1fr; }
    .break-modes .break-mode:last-child { grid-column: 1 / -1; }
}
@media (min-width: 768px) {
    .review-exports { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .review-exports .review-export-full { grid-column: auto; }
}
@media (min-width: 900px) {
    .review-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.wealth-card { min-width: 0; overflow: visible; }
.wealth-card h2 { margin: 14px 0 8px; }
.wealth-card h2:first-child { margin-top: 0; }
.wealth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
}
.wealth-metric {
    min-width: 0;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 10px 12px;
    overflow: visible;
}
.wealth-label-row { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.wealth-label-row h2 { margin: 0; flex: 1 1 auto; }
.wealth-label { color: var(--muted); font-size: 0.84rem; line-height: 1.3; overflow-wrap: anywhere; flex: 1 1 auto; }
.wealth-pop {
  margin: 8px 0 0;
  color: var(--text);
  background: #272e38;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.86rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.wealth-compare {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  min-width: 0;
}
.wealth-compare h2 { font-size: 1rem; }
.wealth-compare-summary { margin: 8px 0 0; color: var(--text); overflow-wrap: anywhere; }
.wealth-details { margin-top: 8px; }
.wealth-details > summary { cursor: pointer; min-height: 40px; padding: 8px 0; }
.wealth-val {
    font-size: 1.12rem;
    font-weight: 650;
    margin-top: 4px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.wealth-val.positive, .wealth-amt.positive { color: var(--income); }
.wealth-val.negative, .wealth-amt.negative { color: var(--expense); }
.wealth-val.neutral, .wealth-amt.neutral { color: var(--text); }
.wealth-note { color: var(--muted); font-size: 0.82rem; margin: 6px 0; overflow-wrap: anywhere; }
.wealth-alert { color: var(--warning); font-weight: 650; margin: 8px 0; overflow-wrap: anywhere; }
.wealth-quality {
    margin: 4px 0 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    min-width: 0;
}
.wealth-quality summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.wealth-quality.warn summary { color: var(--warning); }
.wealth-quality.hard summary { color: var(--expense); }
.wealth-quality-body { padding: 0 12px 10px; font-size: 0.84rem; }
.wealth-quality-body p { margin: 0 0 6px; overflow-wrap: anywhere; }
.wealth-months {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
    overflow: visible;
}
.wealth-month {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.wealth-month-hit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 10px 12px 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    white-space: normal;
    overflow: visible;
    cursor: pointer;
}
.wealth-month-title, .wealth-line {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.wealth-line { color: var(--muted); font-size: 0.84rem; }
.wealth-month-title { color: var(--text); font-size: 1rem; }
.wealth-more {
    margin: 2px 12px 10px;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}
.wealth-month-extra {
    padding: 0 12px 10px;
    min-width: 0;
    overflow: visible;
}
.wealth-extra-note { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.wealth-plot {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
}
.wealth-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    max-width: 92px;
    font-size: 0.72rem;
    line-height: 1.15;
    color: var(--muted);
    text-align: right;
}
.wealth-yaxis span { display: block; overflow-wrap: anywhere; white-space: normal; }
.wealth-canvas {
    position: relative;
    height: 200px;
    min-width: 0;
    background: var(--surface-2);
    border-radius: 10px;
    touch-action: pan-y;
    cursor: crosshair;
}
.wealth-svg { width: 100%; height: 100%; display: block; }
.wealth-zero {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed #8b97a6;
    pointer-events: none;
}
.wealth-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    margin-left: -3px;
    margin-top: -3px;
    border-radius: 50%;
    pointer-events: none;
}
.wealth-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #eef0f3;
    pointer-events: none;
}
.wealth-modes { min-width: 0; }
.wealth-card .chip {
    flex: 0 0 auto;
    height: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    text-align: center;
}
.wealth-modes .chip {
    flex: 1 1 150px;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 40px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.25;
    text-align: center;
    padding: 8px 10px;
}
.wealth-tip {
    margin-top: 8px; white-space: pre-line; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 0.82rem;
    overflow-wrap: anywhere;
}
.wealth-custom { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; min-width: 0; }
.wealth-custom input { flex: 1 1 140px; min-width: 0; min-height: var(--tap); }
.wealth-accounts { margin-top: 8px; overflow-wrap: anywhere; }
@media (min-width: 700px) {
    .wealth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .wealth-standing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wealth-period { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wealth-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1800px) {
    .wealth-period { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .wealth-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
