/* ezSpend — app styles. No framework; mobile first; light + dark. */

:root {
    --bg: #f4f6f6;
    --surface: #ffffff;
    --surface-2: #f0f3f3;
    --text: #12201e;
    --muted: #5d6c69;
    --border: #e1e7e6;
    --primary: #0f766e;
    --primary-strong: #0b5f58;
    --primary-soft: #e3f3f1;
    --accent: #fde047;
    --success: #067647;
    --success-soft: #e7f6ec;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --warning: #8a4b06;
    --warning-soft: #fef4e2;
    --income: #067647;
    --expense: #b42318;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
    --topbar-h: 60px;
    --tabbar-h: 64px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c1413;
        --surface: #131d1c;
        --surface-2: #1a2625;
        --text: #e6eeec;
        --muted: #9aaba8;
        --border: #263432;
        --primary: #2bb3a3;
        --primary-strong: #4cc9ba;
        --primary-soft: #143532;
        --success: #4ade80;
        --success-soft: #11291b;
        --danger: #f87171;
        --danger-soft: #2f1414;
        --warning: #fbbf24;
        --warning-soft: #2c210b;
        --income: #4ade80;
        --expense: #f87171;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.125rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
.num, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* ---------------------------------------------------------------- brand */

.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.brand-name { font-size: 1.2rem; letter-spacing: -.02em; font-weight: 500; }
.brand-name strong { font-weight: 750; color: var(--primary); }

/* ---------------------------------------------------------------- top bar */

.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 1rem;
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}

.topnav { display: none; align-items: center; gap: .25rem; margin-left: .5rem; }
.topnav-link {
    display: inline-flex; align-items: center; height: 36px; padding: 0 .8rem;
    color: var(--muted); border-radius: 999px; font-weight: 550; font-size: .95rem; cursor: pointer;
}
.topnav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topnav-link.is-active { color: var(--primary); background: var(--primary-soft); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: .6rem; min-width: 0; }

.ws-switch select {
    height: 36px; max-width: 46vw; padding: 0 2rem 0 .75rem; font-size: .9rem; border-radius: 999px;
}
.ws-name {
    max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: .9rem; color: var(--muted);
}
.topbar .record-btn { display: none; }
.hide-mobile { display: none !important; }

.avatar {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; user-select: none;
}

/* ---------------------------------------------------------------- menus (<details>) */

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
    min-width: 220px; padding: .4rem; font-size: 1rem; font-weight: 450; text-align: left;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.menu-end .menu-panel { left: auto; right: 0; }
.menu-panel a, .menu-item-button {
    display: block; width: 100%; padding: .6rem .75rem; border-radius: var(--radius-sm);
    color: var(--text); text-align: left; font: inherit; background: none; border: 0; cursor: pointer;
}
.menu-panel a:hover, .menu-item-button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel form { margin: 0; }
.menu-header { display: grid; padding: .5rem .75rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-header small { color: var(--muted); }

/* ---------------------------------------------------------------- main + bottom tab bar */

.main {
    width: 100%; max-width: 1180px; margin: 0 auto;
    padding: 1.25rem max(1rem, env(safe-area-inset-right)) calc(var(--tabbar-h) + 2rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-top: 1px solid var(--border);
}
.tab, .tab > summary {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    height: 100%; color: var(--muted); font-size: .7rem; font-weight: 600; cursor: pointer;
}
.tab:hover { text-decoration: none; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab svg circle { fill: currentColor; stroke: none; }
.tab.is-active { color: var(--primary); }
.tab-record { justify-self: center; }
.tabbar-4 { grid-template-columns: repeat(4, 1fr); }
.tab-record svg {
    width: 52px; height: 52px; padding: 13px; border-radius: 50%;
    background: var(--primary); color: #fff; stroke: #fff; stroke-width: 2.4;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent);
    transform: translateY(-10px);
}
.menu-up .menu-panel { top: auto; bottom: calc(100% + 10px); left: auto; right: .5rem; }

@media (min-width: 900px) {
    .topnav { display: flex; }
    .topbar .record-btn { display: inline-flex; }
    .hide-mobile { display: inline-flex !important; }
    .tabbar { display: none; }
    .main { padding-bottom: 3rem; }
}

/* ---------------------------------------------------------------- page structure */

.page-head {
    display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem;
    margin-bottom: 1.25rem;
}
.page-head h1 { margin: 0; }
.page-head p { margin: .2rem 0 0; }

.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.25rem;
}
.card + .card { margin-top: 1rem; }
.card-title { font-size: 1.15rem; margin-bottom: .35rem; }

.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.empty { text-align: center; padding: 2.5rem 1.25rem; }
.empty-icon { width: 40px; height: 40px; margin: 0 auto .75rem; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--primary); margin: 0; line-height: 1; }

.checklist { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .45rem; }
.checklist li { position: relative; padding-left: 1.9rem; color: var(--muted); }
.checklist li::before {
    content: ""; position: absolute; left: 0; top: .2em; width: 1.2rem; height: 1.2rem;
    border: 2px solid var(--border); border-radius: 50%;
}
.checklist li.done { color: var(--text); }
.checklist li.done::before {
    border-color: var(--primary); background: var(--primary)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
        center / 70% no-repeat;
}

.steps { padding-left: 1.25rem; display: grid; gap: .4rem; }
.code {
    font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .9rem; overflow: auto; white-space: pre-wrap; word-break: break-all;
    text-align: left; margin: 1rem 0;
}

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    height: 44px; padding: 0 1.1rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { height: 36px; padding: 0 .85rem; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- forms */

.form { display: grid; gap: 0; }
.form-section { margin: 1.25rem 0 .75rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; align-content: start; }   /* no stretched inputs when the neighbour has a hint */
.field > label { font-weight: 600; font-size: .92rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"],
input[type="search"], input:not([type]), select, textarea {
    width: 100%; min-height: 46px; padding: .6rem .8rem;
    font: inherit; font-size: 16px; /* 16px avoids iOS zoom */
    color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
select {
    appearance: none; padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6c69' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .7rem center; background-size: 18px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
[aria-invalid="true"] { border-color: var(--danger) !important; }
.hint { margin: 0; font-size: .85rem; color: var(--muted); }
.field-error { margin: 0; font-size: .85rem; color: var(--danger); font-weight: 600; }

.check { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.25rem; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ---------------------------------------------------------------- alerts */

.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid transparent; font-size: .95rem; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }

/* ---------------------------------------------------------------- guest pages (login, setup) */

.guest {
    min-height: 100vh; min-height: 100dvh;
    background:
        radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%),
        var(--bg);
}
.guest-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem;
    min-height: 100vh; min-height: 100dvh;
    padding: calc(2rem + env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
}
.guest-brand { display: flex; align-items: center; gap: .7rem; }
.guest-brand img { border-radius: 14px; box-shadow: var(--shadow); }
.guest-brand .brand-name { font-size: 1.7rem; }
.guest-card { width: 100%; max-width: 420px; padding: 1.75rem; }
.guest-card-wide { max-width: 620px; }
.guest-lang { display: flex; gap: .5rem; font-size: .9rem; color: var(--muted); }
.guest-lang a { color: var(--muted); }
.guest-lang a[aria-current="true"] { color: var(--primary); font-weight: 700; }

/* ---------------------------------------------------------------- amounts (used from phase 4) */

.amount-in { color: var(--income); }
.amount-out { color: var(--expense); }

/* ---------------------------------------------------------------- phase 3: lists, forms, chips */

.small { font-size: .85rem; }
.center { text-align: center; }
.spacer { flex: 1; }
.optional { font-weight: 400; color: var(--muted); font-size: .85em; }
.stack { display: grid; gap: 1rem; }
.stack > .card + .card { margin-top: 0; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.form-card { max-width: 760px; }
.form-card-wide { max-width: 900px; }
.form-note { margin: -.25rem 0 1rem; }
.form-actions {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .6rem;
    margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; align-content: start; }
fieldset.field > .segmented { align-self: start; }
fieldset.field legend { font-weight: 600; font-size: .92rem; padding: 0; margin-bottom: .35rem; }

/* list rows (used instead of tables so they work on phones) */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: 0; overflow: visible; }
.list-row {
    display: flex; align-items: center; gap: .85rem;
    padding: .85rem 1.1rem; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row.is-muted .list-main strong, .list-row.is-muted .list-value strong { color: var(--muted); }
.list-main { display: grid; min-width: 0; flex: 1; }
.list-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list-main .small { overflow: hidden; text-overflow: ellipsis; }
.list-value { display: grid; justify-items: end; text-align: right; white-space: nowrap; }
.list-actions { display: flex; align-items: center; gap: .4rem; }
.list-actions form { margin: 0; }
.list-plain .list-row { padding-left: 0; padding-right: 0; }
.list-note { margin-top: .6rem; }
@media (max-width: 599px) {
    /* phones: icon | title over amount | actions */
    .list-row {
        display: grid; grid-template-columns: [lead] auto [lead2] auto [main] minmax(0, 1fr) [end] auto;
        column-gap: 0; row-gap: .2rem; padding: .8rem .9rem;
    }
    .list-row > .order-buttons { grid-column: lead; grid-row: 1 / span 2; margin-right: .45rem; }
    .list-row > .drag-handle { grid-column: lead; grid-row: 1 / span 2; margin-right: .35rem; align-self: center; }
    .list-row > .code-badge, .list-row > .type-dot, .list-row > .avatar { grid-column: lead2; grid-row: 1 / span 2; margin-right: .75rem; }
    .list-row > .list-main { grid-column: main; grid-row: 1; }
    .list-row > .list-value {
        grid-column: main; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem;
        justify-items: start; text-align: left; white-space: normal;
    }
    .list-row > .list-actions, .list-row > .row-menu, .list-row > .badge { grid-column: end; grid-row: 1 / span 2; margin-left: .5rem; }
}

.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
    border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg circle { fill: currentColor; stroke: none; }
.order-buttons { display: grid; gap: 0; margin: -.35rem 0; }
.order-buttons form { margin: 0; }
.order-buttons .icon-btn { width: 28px; height: 22px; border: 0; background: none; -webkit-appearance: none; appearance: none; }
.row-menu > summary { list-style: none; }

.code-badge {
    display: inline-grid; place-items: center; min-width: 42px; height: 26px; padding: 0 .4rem;
    border-radius: 7px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
    background: var(--primary-soft); color: var(--primary);
}
.code-c { background: var(--danger-soft); color: var(--danger); }
.code-a { background: var(--warning-soft); color: var(--warning); }

.type-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.type-i { background: var(--income); }
.type-e { background: var(--expense); }
.type-n { background: var(--border); box-shadow: inset 0 0 0 2px var(--muted); }

.badge {
    display: inline-flex; align-items: center; height: 24px; padding: 0 .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--muted);
}
.badge-role-o { background: var(--primary-soft); color: var(--primary); }
.badge-role-e { background: var(--warning-soft); color: var(--warning); }

.avatar-sm { width: 34px; height: 34px; font-size: .9rem; flex: none; cursor: default; }

.btn-ghost-danger { border-color: transparent; background: none; color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-soft); }

.alert-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.alert-action form { margin: 0; }

/* toolbar + chips */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.toolbar input[type="search"] { flex: 1 1 200px; max-width: 320px; min-height: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    display: inline-flex; align-items: center; height: 34px; padding: 0 .85rem; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .9rem; font-weight: 550;
}
.chip:hover { text-decoration: none; background: var(--surface-2); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.check-inline { margin: 0; }

/* segmented control (radio buttons) */
.segmented {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
    display: grid; place-items: center; min-height: 38px; padding: 0 .5rem; border-radius: 7px;
    font-weight: 600; font-size: .92rem; color: var(--muted); text-align: center;
}
.segmented input:checked + span { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }

/* compact table (member permissions) */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); text-align: left; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.table th.center, .table td.center { text-align: center; }
.table input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }

.defs { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.defs dt { font-weight: 650; }
.defs dd { margin: 0; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- phase 4: record + movements */

.page-head-tight { margin-bottom: .75rem; }
.record-card { max-width: 680px; }
.type-switch span { min-height: 44px; font-size: 1rem; }
.type-switch .ts-e input:checked + span { color: var(--expense); }
.type-switch .ts-i input:checked + span { color: var(--income); }
.type-switch .ts-t input:checked + span { color: var(--primary); }
.amount-field label { display: flex; align-items: center; gap: .5rem; }
.amount-input {
    font-size: 2rem !important; font-weight: 700; min-height: 64px !important; letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}
.currency-tag { font-size: .78rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: .05rem .4rem; }
.currency-tag:empty { display: none; }
.refund-check { margin-top: .45rem; font-size: .9rem; }
.more-details { margin: 0 0 1rem; }
.more-details > summary { cursor: pointer; color: var(--primary); font-weight: 600; padding: .35rem 0; list-style: none; }
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary::before { content: "+ "; }
.more-details[open] > summary::before { content: "− "; }
.more-details[open] > summary { margin-bottom: .6rem; }
.btn-wide { min-width: 140px; }
@media (max-width: 599px) {
    .record-card { padding: 1rem; border-radius: 0; margin: 0 -1rem; border-left: 0; border-right: 0; }
    .record-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); background: var(--surface); margin: .5rem -1rem 0; padding: .75rem 1rem; }
    .record-actions .btn-primary { flex: 1; }
}
.btn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* filters */
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-bottom: 1rem; }
.filters > * { min-width: 0; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll { position: relative; }
.chips-scroll .chip { flex: none; cursor: pointer; position: relative; }
.custom-dates { display: flex; flex-wrap: wrap; gap: .75rem; }
.custom-dates label, .filter-grid label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.custom-dates input { min-height: 40px; }
.filter-search { display: flex; gap: .5rem; }
.filter-search input { flex: 1; min-height: 44px; }
.filter-more > summary { cursor: pointer; font-weight: 600; color: var(--primary); list-style: none; display: inline-flex; gap: .5rem; align-items: center; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin-top: .75rem; }
.filter-grid select, .filter-grid input { min-height: 40px; font-weight: 400; }
.filter-actions { margin-top: .75rem; }

/* totals */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.total-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow); }
.total-currency { font-size: .75rem; font-weight: 750; color: var(--muted); letter-spacing: .05em; }
.total-card dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; margin: .25rem 0 0; }
.total-balance dd { color: var(--primary); }
.total-asof { white-space: nowrap; }
.total-card dt { font-size: .78rem; color: var(--muted); }
.total-card dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1rem; }
.table-card { margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* movement list */
.list-date {
    padding: .45rem 1.1rem; font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
    color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.list-date:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.mv-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.mv-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mv-i { background: var(--success-soft); color: var(--income); }
.mv-e { background: var(--danger-soft); color: var(--expense); }
.mv-t { background: var(--primary-soft); color: var(--primary); }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; color: var(--primary); }
.mv-desc { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.amount-transfer { color: var(--primary); }
.list-row > .mv-icon { margin-right: 0; }
@media (max-width: 599px) {
    .list-row > .mv-icon { grid-column: lead2; grid-row: 1 / span 2; margin-right: .75rem; }
    .movement-row > .list-value { grid-column: end; grid-row: 1 / span 2; display: grid; justify-items: end; text-align: right; margin-left: .5rem; }
    .list-date { padding: .4rem .9rem; }
}
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

/* ---------------------------------------------------------------- phase 5: dashboard + reports */

.dash-section { margin-bottom: 1.25rem; }
.dash-currency { font-size: 1rem; margin: 0 0 .6rem; letter-spacing: .02em; }
.dash-currency .muted { font-weight: 400; font-size: .9rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .9rem; align-items: start; }
.dash-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card + .card.dash-card { margin-top: 0; }
.dash-card-head { padding: .85rem 1rem .5rem; border-top: 4px solid var(--primary); }
.dash-credit .dash-card-head { border-top-color: var(--expense); }
.dash-available .dash-card-head { border-top-color: var(--warning); }
.dash-savings .dash-card-head { border-top-color: #7c3aed; }
.dash-card-head h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0; font-weight: 700; }
.dash-rows { list-style: none; margin: 0; padding: 0 .35rem; }
.dash-rows li { border-bottom: 1px solid var(--border); padding: 0 .65rem; }
.dash-rows li:last-child { border-bottom: 0; }
.dash-rows li.is-muted { opacity: .65; }
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; }
.dash-name { display: grid; min-width: 0; font-weight: 600; }
.dash-name small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.dash-row .money { font-weight: 650; white-space: nowrap; }
.usage { display: block; width: 100%; height: 6px; margin: -.2rem 0 .55rem; }
.dash-card-foot {
    display: flex; justify-content: space-between; align-items: baseline; margin-top: auto;
    padding: .7rem 1rem; background: var(--surface-2); border-top: 1px solid var(--border);
}
.dash-card-foot span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.dash-card-foot strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.dash-categories { margin-top: .25rem; }
.dash-cat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .5rem; }
.dash-cat-filters select { min-height: 38px; width: auto; }
.table .group-row th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: .5rem; padding-bottom: .5rem; }
.table .group-row .type-dot { display: inline-block; vertical-align: middle; margin-right: .35rem; }
.table .subtotal-row td { font-weight: 700; border-bottom: 2px solid var(--border); }
.table .total-row td { font-weight: 800; font-size: 1.02rem; border-bottom: 0; border-top: 2px solid var(--text); }
.table td.strong { font-weight: 700; }
.table .is-zero { color: var(--border); }
.dash-table td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.card + .card.report-tile { margin-top: 0; }
.report-tile { display: grid; gap: .35rem; color: var(--text); transition: border-color .15s, transform .1s; }
.report-tile:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.report-tile svg { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--primary-soft); fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: .35rem; }
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.report-filters label { display: grid; gap: .25rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.report-filters select, .report-filters input { min-height: 40px; width: auto; }
.st-nav { display: inline-flex; gap: .35rem; }
.st-nav .btn { min-width: 40px; min-height: 40px; font-size: 1.1rem; }
.st-cycle { margin: -.25rem 0 1rem; }
.st-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.st-summary .card { margin: 0; }
.st-box { display: grid; gap: .2rem; align-content: start; }
.st-box strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.st-box-total { border-color: var(--primary); }
.st-desc { display: block; max-width: 38ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-opening td { color: var(--muted); font-style: italic; }
.st-table td.num { white-space: nowrap; }
.report-export { margin-left: auto; }
.pnl-table { font-size: .88rem; }
.pnl-table th, .pnl-table td { padding: .45rem .55rem; }
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-row .sticky-col { background: var(--surface-2); }
.diff-bar meter { width: 120px; height: 8px; }
.diff-bar.is-good meter::-webkit-meter-optimum-value { background: var(--income); }
.diff-bar.is-bad meter::-webkit-meter-optimum-value { background: var(--expense); }
.diff-bar.is-good meter::-moz-meter-bar { background: var(--income); }
.diff-bar.is-bad meter::-moz-meter-bar { background: var(--expense); }
@media (max-width: 700px) { .hide-narrow { display: none; } }

/* charts (SVG) */
.chart-card { margin-bottom: 1rem; }
.chart-wrap { width: 100%; overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 520px; height: auto; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-zero { stroke: var(--muted); }
.chart-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.bar-income { fill: var(--income); opacity: .85; }
.bar-expense { fill: var(--expense); opacity: .85; }
.line-net { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.line-net-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.chart-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.legend-income { background: var(--income); }
.legend-expense { background: var(--expense); }
.legend-net { background: var(--primary); height: 3px !important; vertical-align: 3px !important; }
@media (max-width: 599px) {
    .dash-table { font-size: .82rem; }
    .dash-table th, .dash-table td { padding: .5rem .3rem; }
    .dash-table td:first-child { max-width: 120px; white-space: normal; }
    .dash-categories { padding: 1rem .75rem; }
    .dash-card-head { padding: .7rem .9rem .35rem; }
    .dash-card-foot { padding: .55rem .9rem; }
}

/* ---------------------------------------------------------------- phase 7: import */
.import-counts { margin-top: .75rem; }
.import-counts dd { font-variant-numeric: tabular-nums; color: var(--text); }
.table tr.row-bad td { background: var(--danger-soft); }

/* transfers without a counterpart */
.unpaired-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin-top: .75rem; }
.unpaired-filters label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 600; }
.unpaired-filters select { min-height: 40px; font-weight: 400; }
.unpaired-auto { margin: 1rem 0 0; }
.unpaired-search { grid-column: 1 / -1; }
.unpaired-search .filter-search { display: flex; gap: .5rem; }
.unpaired-search input { flex: 1; min-width: 0; min-height: 40px; font-weight: 400; }
.unpaired-bulk { margin-top: 1rem; border-color: var(--primary); }
.leg-head { display: flex; align-items: center; gap: .85rem; }
.leg-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .4rem; font-weight: 650; }
.cand-list { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cand-row { padding: .7rem .85rem; flex-wrap: wrap; }
.cand-row .list-main .small { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .2rem; }
.cand-action { margin: 0; }
.badge-leg { background: var(--primary-soft); color: var(--primary); }
.badge-income { background: var(--success-soft); color: var(--income); }
.badge-spend { background: var(--danger-soft); color: var(--expense); }
.leg-more { margin-top: .85rem; }
.leg-more summary { cursor: pointer; color: var(--primary); font-weight: 600; font-size: .92rem; }
.leg-options { display: grid; gap: 1rem; margin-top: .75rem; }
@media (min-width: 900px) { .leg-options { grid-template-columns: 1fr 1fr; } }
.leg-option { margin: 0; padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); display: grid; gap: .45rem; }
.leg-option h4 { margin: 0; font-size: .95rem; }
.leg-option-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.leg-option-row select, .leg-option-row input { flex: 1 1 160px; min-height: 40px; min-width: 0; }
@media (max-width: 599px) {
    .cand-row.list-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: .6rem; }
    .cand-row > .list-main { grid-column: 1; grid-row: 1; }
    .cand-row > .list-value { grid-column: 2; grid-row: 1; display: grid; justify-items: end; text-align: right; }
    .cand-row > .cand-action { grid-column: 1 / -1; grid-row: 2; margin-top: .4rem; }
    .cand-action .btn { width: 100%; }
    .leg-head { align-items: flex-start; }
}

/* receipts */
.receipt-box { display: grid; gap: .6rem; padding: .85rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.receipt-box[hidden] { display: none; }
.receipt-btn { justify-self: start; }
.receipt-box.is-busy .receipt-btn { opacity: .7; }
.receipt-box.is-busy .receipt-btn .btn-icon { animation: receipt-pulse 1s ease-in-out infinite; }
@keyframes receipt-pulse { 50% { opacity: .3; } }
.receipt-current { display: flex; align-items: center; gap: .85rem; }
.receipt-current[hidden] { display: none; }
.receipt-thumb-link { flex: none; }
.receipt-thumb { width: 64px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); display: block; }
.receipt-meta { display: grid; gap: .4rem; }
.receipt-msg:empty { display: none; }
.receipt-msg.is-error { color: var(--danger); }
.receipt-msg.is-warning { color: var(--warning); }
.is-prefilled { background: var(--primary-soft) !important; }
.mv-clip { width: 13px; height: 13px; vertical-align: -2px; margin-right: .2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 599px) { .receipt-btn { justify-self: stretch; justify-content: center; } }

/* account filter: label + small "inactive accounts" switch on one line (same height as other labels) */
.filter-cell { display: grid; gap: .25rem; align-content: start; min-width: 0; }
.filter-label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.filter-label-row > label:first-child { font-size: .85rem; font-weight: 600; color: var(--muted); }
.unpaired-filters .filter-label-row > label:first-child { color: inherit; }
.filter-cell select { min-height: 40px; font-weight: 400; width: 100%; }
.filter-grid > label { align-content: start; }
.mini-switch { position: relative; display: inline-flex !important; align-items: center; gap: .35rem; font-size: .75rem !important;
    font-weight: 500 !important; color: var(--muted); cursor: pointer; user-select: none; line-height: 1; }
.mini-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.mini-switch-track { position: relative; width: 26px; height: 15px; border-radius: 999px; background: var(--border); transition: background .15s; flex: none; }
.mini-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.mini-switch input:checked + .mini-switch-track { background: var(--primary); }
.mini-switch input:checked + .mini-switch-track::after { transform: translateX(11px); }
.mini-switch input:focus-visible + .mini-switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* admin diagnostics */
.diag-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.diag-count { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; display: grid; }
.diag-count strong { font-size: 1.6rem; line-height: 1.1; }
.diag-count span { color: var(--muted); font-size: .85rem; }
.diag-count.diag-fail strong { color: var(--danger); }
.diag-count.diag-warn strong { color: var(--warning); }
.diag-count.diag-ok strong { color: var(--success); }
.diag-row { display: flex; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.diag-row:last-child { border-bottom: 0; }
.diag-icon { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-top: .05rem; }
.diag-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.diag-ok .diag-icon { background: var(--success-soft); color: var(--success); }
.diag-warn .diag-icon { background: var(--warning-soft); color: var(--warning); }
.diag-fail .diag-icon { background: var(--danger-soft); color: var(--danger); }
.diag-info .diag-icon { background: var(--surface-2); color: var(--muted); }
.diag-main { display: grid; gap: .15rem; min-width: 0; flex: 1; }
.diag-detail { overflow-wrap: anywhere; }
.diag-fix { overflow-wrap: anywhere; background: var(--surface-2); border-radius: var(--radius-sm); padding: .35rem .55rem; margin-top: .2rem; }
.diag-action { margin-top: .75rem; }
.page-head .button-row form { margin: 0; }

/* demo workspace */
.demo-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 .5rem; border-radius: 999px; font-size: .72rem;
    font-weight: 800; letter-spacing: .06em; background: var(--warning-soft); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); }
.card-title .demo-badge { vertical-align: middle; margin-left: .4rem; }
.demo-list { margin: 0 0 1rem; padding-left: 1.2rem; display: grid; gap: .35rem; }
.demo-reset { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0; }
.demo-go { margin-top: 1rem; }

/* drag-and-drop ordering */
.drag-handle { flex: none; width: 30px; height: 36px; margin-left: -.35rem; display: grid; place-items: center; border: 0; background: none;
    color: var(--muted); border-radius: var(--radius-sm); cursor: grab; touch-action: none; padding: 0; }
.drag-handle svg { width: 18px; height: 18px; fill: currentColor; }
.drag-handle:hover { background: var(--surface-2); color: var(--text); }
.drag-handle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.list-row.is-dragging { position: fixed; z-index: 60; margin: 0; background: var(--surface); box-shadow: 0 12px 32px rgba(0,0,0,.18);
    border: 1px solid var(--border); border-radius: var(--radius-sm); pointer-events: none; opacity: .97; }
.drag-placeholder { list-style: none; border: 2px dashed color-mix(in srgb, var(--primary) 55%, transparent); background: var(--primary-soft);
    border-radius: var(--radius-sm); margin: 2px 6px; }
body.is-sorting, body.is-sorting * { cursor: grabbing !important; user-select: none; }
.sort-status.is-ok { color: var(--success); font-weight: 600; }
.sort-status.is-error { color: var(--danger); font-weight: 600; }

/* bank statement import */
.stmt-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stmt-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.stmt-table td { vertical-align: top; }
.stmt-table .stmt-check { width: 34px; }
.stmt-table .stmt-check input { width: 18px; height: 18px; margin-top: .45rem; }
.stmt-main { min-width: 260px; }
.stmt-name { width: 100%; min-height: 36px; font-weight: 600; }
.stmt-desc { display: block; margin-top: .2rem; overflow-wrap: anywhere; }
.stmt-learned { display: block; color: var(--primary); margin-top: .15rem; }
.stmt-cat { min-width: 180px; min-height: 36px; }
.stmt-payment-hint { display: block; margin-top: .25rem; max-width: 220px; }
.stmt-row.is-off td:not(.stmt-check) { opacity: .45; }
.stmt-badge-new { background: var(--success-soft); color: var(--success); }
.stmt-badge-maybe { background: var(--warning-soft); color: var(--warning); }
.stmt-badge-duplicate { background: var(--surface-2); color: var(--muted); }
.stmt-badge-error { background: var(--danger-soft); color: var(--danger); }
.stmt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }
.stmt-actions .hint { flex: 1 1 280px; }
.nowrap { white-space: nowrap; }
.stmt-table .badge { white-space: nowrap; }
.stmt-table td.num .muted { display: block; margin-top: .15rem; }

.stmt-hint { display: block; margin-top: .2rem; }
.stmt-apply { display: block; margin-top: .3rem; font-size: .82rem; }
.stmt-edit-hint { margin: 0; padding: .5rem 1rem; border-bottom: 1px solid var(--border); }
.stmt-date { min-height: 36px; width: 9.6rem; font-variant-numeric: tabular-nums; }
.stmt-postdate { display: block; margin-top: .2rem; }
.stmt-desc-input { width: 100%; min-height: 32px; margin-top: .3rem; font-size: .85rem; color: var(--muted); }
.stmt-desc-input:focus, .stmt-desc-input.is-edited { color: var(--text); }
.stmt-date.is-edited, .stmt-name.is-edited, .stmt-desc-input.is-edited { border-color: var(--primary); background: var(--primary-soft); }
.stmt-msi-badge { display: inline-block; margin-top: .3rem; background: var(--primary-soft); color: var(--primary); }
.stmt-msi-deferral .stmt-name { font-style: italic; }
.stmt-checks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.stmt-note { display: flex; gap: .6rem; align-items: flex-start; line-height: 1.4; }
.stmt-note-icon { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.stmt-note-ok .stmt-note-icon { background: var(--success-soft); color: var(--success); }
.stmt-note-warn .stmt-note-icon { background: var(--warning-soft); color: var(--warning); }
.stmt-note-warn { font-weight: 600; }
.stmt-note-info .stmt-note-icon { background: var(--surface-2); color: var(--muted); }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 600; cursor: pointer; text-align: left; }
.link-button:hover { text-decoration: underline; }

/* dashboard: link to uncategorized movements */
.uncat-link { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); color: var(--warning); gap: .45rem; }
.uncat-link:hover { background: var(--warning-soft); }
.uncat-count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 .4rem; border-radius: 999px;
    background: var(--warning); color: #fff; font-size: .78rem; font-weight: 800; }
