:root {
    /* YNAB light theme + blurple tokens */

    --font-family: Figtree, "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Neutrals (gemeten op app.ynab.com, licht thema) */
    --background-primary: #fff;
    --background-primary-elevated: #fff;
    --label-primary: #191818;
    --label-secondary: #514d4d;
    --label-tertiary: #696763;
    --border: rgba(0, 0, 0, 0.102);
    --scrim-default: rgba(0, 0, 0, 0.102);
    --modal-shadow: rgba(0, 0, 0, 0.2) 0px 16px 64px;
    --table-row: #fff;
    --table-row-master: #f8f6f2;
    --table-hover: rgba(0, 0, 0, 0.102);
    --input-border-active: #b7b3ac;

    /* Blurple / primary acties */
    --action-primary: #3b5eda;
    --action-primary-active: #19223c;
    --button-primary-background: #3b5eda;

    /* Positief / negatief (label-kleuren) */
    --positive: #02bc79;
    --positive-text: #508316;
    --positive-text-active: #346011;
    --negative: #c72c1e;
    --negative-text: #bf2e3b;
    --negative-bg: #feedeb;

    /* Sidebar (gemeten) */
    --sidebar-background: #1c1f58;
    --sidebar-button-background-active: #292c6c;
    --sidebar-button-secondary-background: rgba(255, 255, 255, 0.15);
    --sidebar-active: #383ca3;
    --sidebar-label-primary: #ffffff;
    --sidebar-neg: #ff9a94;
    --sidebar-logo: #545bfe;

    /* Ready to Assign */
    --rta-positive: #c2f680;
    --rta-negative: #feedeb;
    --rta-neutral: #f1f1f2;

    /* Available-badge pill (gemeten, nieuwe YNAB theme) */
    --badge-positive-bg: #aee865;
    --badge-negative-bg: #faada5;
    --badge-cautious-bg: #f8d655;
    --badge-zero-bg: #f3eee2;
    --badge-zero-text: #696763;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--background-primary);
    color: var(--label-primary);
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

button,
input,
select {
    font-family: inherit;
}

/* ============================================================
   Layout / shell (YNAB)
   ============================================================ */

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--sidebar-background);
    color: var(--sidebar-label-primary);
    display: flex;
    flex-shrink: 0;
    align-self: stretch;
    flex-direction: row;
    position: relative;
}

.sidebar-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-contents {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-nav {
    flex: 1 1 auto;
    padding-bottom: 8px;
}

/* ---- Budget / user menu button (bovenaan) ---- */

.sidebar-nav-menu {
    display: flex;
    align-items: center;
    width: calc(100% - 13px);
    margin: 8px 5px 8px 8px;
    padding: 5px 8px 5px 0;
    border: none;
    border-radius: 8px;
    background: var(--sidebar-background);
    color: var(--sidebar-label-primary);
    text-align: left;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    justify-content: space-between;
}

.sidebar-nav-menu:hover {
    background: var(--sidebar-button-background-active);
}

.sidebar-nav-menu:focus-visible {
    outline: 2px solid var(--action-primary);
    outline-offset: -2px;
}

.sidebar-nav-ynab {
    flex: 0 0 auto;
    margin: 0 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    background: linear-gradient(135deg, var(--sidebar-logo), #2b2f87);
}

.sidebar-nav-budget-email {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    text-align: left;
    min-width: 0;
    overflow: hidden;
}

.sidebar-nav-budget-email-budget {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-nav-budget-email-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.7;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
}

.sidebar-nav-arrow {
    flex: 0 0 auto;
    margin-right: 2px;
    color: rgba(255, 255, 255, 0.7);
}

/* ---- Main navigation ---- */

.nav-main {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-main .navlink {
    display: flex;
    height: 40px;
    margin: 0 0 4px;
    padding: 0;
    width: 100%;
}

.nav-main .navlink > a {
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    margin: 0 5px 0 8px;
    padding: 6.4px 0;
    border-radius: 6px;
    color: var(--sidebar-label-primary);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.nav-main .navlink > a:hover {
    background: var(--sidebar-button-background-active);
    color: #fff;
}

.nav-main .navlink.active > a,
.nav-main .navlink > a.active {
    background: var(--sidebar-active);
    color: #fff;
}

.navlink-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0 10px 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
}

.nav-main .navlink.active .navlink-icon,
.nav-main .navlink > a.active .navlink-icon {
    color: #fff;
}

.navlink-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Accounts section ---- */

.nav-accounts {
    margin-top: 8px;
}

.nav-account {
    padding: 8px 0 0;
}

.nav-account-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0;
}

.nav-account-name-button {
    display: inline-flex;
    align-items: center;
    border: none;
    background: transparent;
    color: var(--sidebar-label-primary);
    font-size: 12px;
    font-weight: 500;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    cursor: pointer;
}

.nav-account-name-button .chev {
    flex: 0 0 auto;
    margin: 0 8px 0 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.15s ease;
}

/* Ingeklapte groep: chevron wijst naar rechts (YNAB-gedrag), totaal blijft zichtbaar. */
.nav-account-name-button.collapsed .chev {
    transform: rotate(-90deg);
}

.nav-account-block .nav-account-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--sidebar-label-primary);
    padding-right: 8px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.nav-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0 8px 0 16px;
    color: var(--sidebar-label-primary);
    text-decoration: none;
}

.nav-account-row:hover {
    background: var(--sidebar-button-background-active);
    color: #fff;
}

.nav-account-icons-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 20px;
    color: rgba(255, 255, 255, 0.85);
}

.nav-account-icons-left .dot {
    color: rgba(255, 255, 255, 0.75);
}

.nav-account-icons-left .edit {
    display: none;
    color: rgba(255, 255, 255, 0.85);
}

.nav-account-row:hover .nav-account-icons-left .dot,
.nav-account-row:focus-within .nav-account-icons-left .dot {
    display: none;
}

.nav-account-row:hover .nav-account-icons-left .edit,
.nav-account-row:focus-within .nav-account-icons-left .edit {
    display: inline-flex;
}

.nav-account-row .nav-account-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 16px;
}

.nav-account-row .nav-account-value {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.nav-account-value.neg,
.nav-account-row .nav-account-value .neg {
    color: var(--sidebar-neg);
}

/* Negatief CREDIT-groep-total: rode pill met witte tekst (YNAB-look). */
.nav-account-block-value.nav-account-value-pill {
    display: inline-flex;
    align-items: center;
    background: var(--negative-text, #bf2e3b);
    color: #fff;
    border-radius: 999px;
    padding: 0 8px;
    font-weight: 600;
    line-height: 18px;
}

/* Edit-pen op een accountregel: dezelfde icon-look als de oude span, nu als echte button. */
button.nav-account-icons {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.nav-add-accounts {
    padding-top: 16px;
}

.nav-add-account {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 2rem);
    margin: 0 16px;
    height: 28px;
    padding: 4px 16px;
    background: var(--sidebar-button-secondary-background);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.nav-add-account:hover {
    background: var(--sidebar-button-background-active);
}

/* ---- Sidebar bottom (user / uitloggen) ---- */

.sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-email {
    min-width: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
}

.sidebar-logout:hover {
    background: var(--sidebar-button-background-active);
    color: #fff;
}

/* ---- Content ---- */

.content {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--background-primary);
}

/* ---- Resizable handles (sidebar + inspector) ---- */
.resize-handle {
    flex: 0 0 5px;
    cursor: col-resize;
    position: relative;
    z-index: 5;
    touch-action: none;
}

.sidebar-resize-handle {
    background: transparent;
    margin-right: -1px;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle:active {
    background: rgba(255, 255, 255, 0.15);
}

.inspector-resize-handle {
    position: absolute;
    left: -3px;
    top: 0;
    bottom: 0;
    width: 6px;
    background: transparent;
}

.inspector-resize-handle:hover,
.inspector-resize-handle:active {
    background: var(--action-primary);
    opacity: 0.4;
}

body.resizing {
    cursor: col-resize;
    user-select: none;
}

.layout-content {
    min-height: 100vh;
}

.standard-page {
    padding: 24px 28px;
    max-width: 1150px;
}

/* ============================================================
   Reflect / spending breakdown
   ============================================================ */

.reflect-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    background: #f8f8fa;
}

.reflect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 32px 18px;
    background: var(--background-primary);
    border-bottom: 1px solid var(--border);
}

.reflect-header h1 {
    margin: 2px 0 0;
    font-size: 1.75rem;
}

.reflect-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reflect-export {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--input-border-active);
    border-radius: 6px;
    background: #fff;
    color: var(--action-primary);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.reflect-export:hover {
    background: var(--table-hover);
}

.reflect-eyebrow {
    margin: 0;
    color: var(--label-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.reflect-month-control {
    display: grid;
    grid-template-columns: 36px minmax(150px, auto) 36px;
    align-items: stretch;
    height: 38px;
    border: 1px solid var(--input-border-active);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.reflect-month-control button {
    border: 0;
    background: transparent;
    color: var(--label-primary);
    cursor: pointer;
    font-size: 1.25rem;
}

.reflect-month-control button:hover:not(:disabled) {
    background: var(--table-hover);
}

.reflect-month-control button:disabled {
    color: #b7b3ac;
    cursor: default;
}

.reflect-month-control .reflect-month-label {
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    padding: 0 18px;
    font-size: 0.9rem;
    font-weight: 700;
}

.reflect-range-control {
    display: flex;
    align-items: end;
    gap: 10px;
}

.reflect-range-control label {
    display: grid;
    gap: 3px;
    color: var(--label-tertiary);
    font-size: 0.68rem;
    font-weight: 700;
}

.reflect-range-control input {
    width: 180px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--input-border-active);
    border-radius: 6px;
    background: #fff;
    color: var(--label-primary);
    font: inherit;
}

.reflect-tabs {
    display: flex;
    flex: 0 0 auto;
    gap: 24px;
    min-height: 48px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: var(--background-primary);
}

.reflect-tabs button {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--label-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.reflect-tabs button.active {
    color: var(--action-primary);
}

.reflect-tabs button.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--action-primary);
}

.reflect-tabs button:disabled {
    color: #aaa7a1;
}

.reflect-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 32px 40px;
}

.reflect-filters {
    display: flex;
    align-items: end;
    gap: 16px;
    padding-bottom: 24px;
}

.reflect-filters label {
    display: grid;
    gap: 6px;
    min-width: 220px;
    color: var(--label-secondary);
    font-size: 0.75rem;
    font-weight: 700;
}

.reflect-filters select {
    height: 38px;
    padding: 0 34px 0 10px;
    border: 1px solid var(--input-border-active);
    border-radius: 5px;
    background: #fff;
    color: var(--label-primary);
    font-size: 0.9rem;
}

.reflect-view-toggle {
    display: inline-flex;
    height: 38px;
    margin-left: auto;
    padding: 3px;
    border: 1px solid var(--input-border-active);
    border-radius: 6px;
    background: #fff;
}

.reflect-view-toggle button {
    min-width: 94px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--label-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.reflect-view-toggle button.active {
    background: var(--action-primary);
    color: #fff;
}

.reflect-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.reflect-metric {
    display: grid;
    align-content: center;
    min-height: 92px;
    padding: 16px 20px;
    border-left: 1px solid var(--border);
}

.reflect-metric:first-child {
    border-left: 0;
}

.reflect-metric span {
    color: var(--label-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
}

.reflect-metric strong {
    margin-top: 5px;
    overflow: hidden;
    color: var(--label-primary);
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reflect-metric-primary strong {
    color: var(--action-primary);
    font-size: 1.35rem;
}

.reflect-breakdown {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(440px, 1.2fr);
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.reflect-chart-panel {
    display: grid;
    place-items: center;
    min-height: 430px;
    padding: 40px;
    border-right: 1px solid var(--border);
}

.reflect-donut {
    display: grid;
    place-items: center;
    width: min(300px, 75%);
    aspect-ratio: 1;
    border-radius: 50%;
}

.reflect-donut-center {
    display: grid;
    place-content: center;
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    text-align: center;
}

.reflect-donut-center span {
    color: var(--label-tertiary);
    font-size: 0.8rem;
}

.reflect-donut-center strong {
    margin-top: 4px;
    font-size: 1.25rem;
}

.reflect-legend-panel {
    min-width: 0;
    padding: 26px 30px;
}

.reflect-legend-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.reflect-legend-heading h2 {
    margin: 0;
}

.reflect-legend-heading span {
    color: var(--label-tertiary);
    font-size: 0.8rem;
}

.reflect-legend {
    margin: 0;
    padding: 0;
    list-style: none;
}

.reflect-legend li {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 54px minmax(90px, auto);
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-bottom: 1px solid var(--border);
}

.reflect-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.reflect-legend-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reflect-legend-share {
    color: var(--label-tertiary);
    text-align: right;
}

.reflect-legend li strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.reflect-trends-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 620px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.reflect-net-worth-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.reflect-net-worth-summary small {
    margin-top: 2px;
    color: var(--label-tertiary);
    font-size: 0.72rem;
}

.reflect-trends-panel,
.reflect-trends-table-panel {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.reflect-trends-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.reflect-trends-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.reflect-trends-heading span {
    color: var(--label-tertiary);
    font-size: 0.8rem;
}

.reflect-trends-chart {
    overflow-x: auto;
    padding: 24px 24px 20px;
}

.reflect-net-worth-legend {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    padding: 14px 24px 0;
    color: var(--label-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.reflect-net-worth-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reflect-net-worth-legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.reflect-net-worth-legend .assets,
.reflect-net-worth-bar.assets {
    background: var(--positive-text);
}

.reflect-net-worth-legend .debts,
.reflect-net-worth-bar.debts {
    background: var(--negative-text);
}

.reflect-net-worth-chart {
    min-height: 344px;
    overflow-x: auto;
    padding: 10px 24px 20px;
}

.reflect-net-worth-chart ol {
    display: grid;
    grid-auto-columns: minmax(88px, 1fr);
    grid-auto-flow: column;
    gap: 12px;
    min-width: max-content;
    height: 300px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reflect-net-worth-chart li {
    display: grid;
    grid-template-rows: 38px 220px 28px;
    align-items: end;
    min-width: 88px;
    text-align: center;
}

.reflect-net-worth-values {
    display: grid;
    overflow: hidden;
    color: var(--label-secondary);
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
    white-space: nowrap;
}

.reflect-net-worth-bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 220px;
    border-bottom: 1px solid var(--label-tertiary);
    background: linear-gradient(to top, transparent 24%, var(--border) 25%, transparent 26%, transparent 49%, var(--border) 50%, transparent 51%, transparent 74%, var(--border) 75%, transparent 76%);
}

.reflect-net-worth-bar {
    width: min(30px, 34%);
    min-height: 0;
    border-radius: 3px 3px 0 0;
}

.reflect-net-worth-empty {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    min-height: 300px;
    color: var(--label-secondary);
}

.reflect-net-worth-empty strong {
    color: var(--label-primary);
    font-size: 0.9rem;
}

.reflect-net-worth-positive {
    color: var(--positive-text) !important;
}

.reflect-net-worth-negative {
    color: var(--negative-text) !important;
}

.reflect-trends-chart ol {
    display: grid;
    grid-auto-columns: minmax(72px, 1fr);
    grid-auto-flow: column;
    gap: 12px;
    min-width: max-content;
    height: 300px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reflect-trends-chart li {
    display: grid;
    grid-template-rows: 28px 220px 28px;
    align-items: end;
    min-width: 72px;
    text-align: center;
}

.reflect-trend-value {
    overflow: hidden;
    color: var(--label-secondary);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reflect-trend-bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 220px;
    border-bottom: 1px solid var(--label-tertiary);
    background: linear-gradient(to top, transparent 24%, var(--border) 25%, transparent 26%, transparent 49%, var(--border) 50%, transparent 51%, transparent 74%, var(--border) 75%, transparent 76%);
}

.reflect-trend-bar {
    width: min(46px, 70%);
    min-height: 0;
    border-radius: 4px 4px 0 0;
    background: var(--action-primary);
}

.reflect-trend-bar.negative {
    background: var(--negative-text);
}

.reflect-trend-month {
    align-self: center;
    color: var(--label-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.reflect-table-scroll {
    overflow-x: auto;
}

.reflect-trends-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.reflect-net-worth-table {
    min-width: 480px;
}

.reflect-trends-table th,
.reflect-trends-table td {
    height: 52px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.reflect-trends-table th:first-child,
.reflect-trends-table td:first-child {
    text-align: left;
}

.reflect-trends-table thead th {
    height: 42px;
    background: #f3f3f6;
    color: var(--label-tertiary);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.reflect-trends-table tbody th {
    color: var(--label-primary);
    font-size: 0.88rem;
}

.reflect-trends-table tbody tr:last-child th,
.reflect-trends-table tbody tr:last-child td {
    border-bottom: 0;
}

.reflect-trends-table td:last-child span,
.reflect-trends-table td:last-child small {
    display: block;
}

.reflect-trends-table td:last-child small {
    margin-top: 2px;
    color: var(--label-tertiary);
    font-size: 0.72rem;
}

.reflect-income-expense-panel {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

.reflect-income-expense-table {
    width: 100%;
    min-width: max-content;
    border-collapse: collapse;
}

.reflect-income-expense-table th,
.reflect-income-expense-table td {
    min-width: 118px;
    height: 42px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.reflect-income-expense-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 220px;
    background: #fff;
    text-align: left;
}

.reflect-income-expense-table thead th {
    height: 42px;
    background: #f3f3f6;
    color: var(--label-tertiary);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.reflect-income-expense-table thead th:first-child {
    z-index: 2;
    background: #f3f3f6;
}

.reflect-income-expense-section th,
.reflect-income-expense-section td {
    background: #e9e8f5;
    color: var(--action-primary);
    font-weight: 700;
}

.reflect-income-expense-section th:first-child {
    background: #e9e8f5;
}

.reflect-income-expense-subtotal th,
.reflect-income-expense-subtotal td {
    font-weight: 700;
}

.reflect-income-expense-total th,
.reflect-income-expense-total td,
.reflect-income-expense-net th,
.reflect-income-expense-net td {
    background: #f3f3f6;
    font-weight: 700;
}

.reflect-income-expense-total th:first-child,
.reflect-income-expense-net th:first-child {
    background: #f3f3f6;
}

.reflect-income-expense-table tbody:last-child tr:last-child th,
.reflect-income-expense-table tbody:last-child tr:last-child td {
    border-bottom: 0;
}

.reflect-difference-above {
    color: var(--negative-text);
}

.reflect-difference-below {
    color: var(--positive-text);
}

.reflect-state {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 280px;
    padding: 40px;
    color: var(--label-secondary);
    text-align: center;
}

.reflect-state strong {
    color: var(--label-primary);
    font-size: 1.05rem;
}

.reflect-error strong {
    color: var(--negative-text);
}

.reflect-error button {
    margin-top: 8px;
}

@media (max-width: 1050px) {
    .reflect-summary,
    .reflect-net-worth-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reflect-summary .reflect-metric:nth-child(odd),
    .reflect-net-worth-summary .reflect-metric:nth-child(odd) {
        border-left: 0;
    }

    .reflect-net-worth-summary .reflect-metric:nth-child(n + 3) {
        border-top: 1px solid var(--border);
    }

    .reflect-breakdown {
        grid-template-columns: 1fr;
    }

    .reflect-chart-panel {
        min-height: 360px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 760px) {
    /* A saved desktop resize writes inline width/flex-basis/max-width values.
       Keep the phone rail authoritative so those values cannot consume the viewport. */
    .sidebar {
        flex: 0 0 56px !important;
        width: 56px !important;
        min-width: 56px !important;
        max-width: 56px !important;
        overflow-x: hidden;
    }

    .sidebar-nav-menu {
        justify-content: center;
        width: 48px;
        margin-right: 8px;
        padding-right: 0;
    }

    .sidebar-nav-ynab {
        margin: 0;
    }

    .sidebar-nav-budget-email,
    .sidebar-nav-arrow,
    .navlink-label,
    .nav-accounts,
    .nav-add-accounts,
    .sidebar-user-email,
    .sidebar-resize-handle {
        display: none;
    }

    .nav-main .navlink > a {
        justify-content: center;
        margin-right: 8px;
    }

    .navlink-icon {
        margin: 0;
    }

    .sidebar-bottom {
        justify-content: center;
        padding: 12px 0 14px;
    }

    .reflect-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px 20px;
    }

    .reflect-header-actions {
        align-items: stretch;
        flex-direction: column-reverse;
        width: 100%;
    }

    .reflect-range-control {
        align-items: stretch;
        flex-direction: column;
    }

    .reflect-range-control label {
        width: 100%;
    }

    .reflect-range-control > span {
        display: none;
    }

    .reflect-range-control input {
        width: 100%;
    }

    .reflect-tabs,
    .reflect-scroll {
        padding-right: 20px;
        padding-left: 20px;
    }

    .reflect-tabs {
        gap: 14px;
        overflow-x: auto;
    }

    .reflect-tabs button {
        flex: 0 0 auto;
    }

    .reflect-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .reflect-filters label,
    .reflect-view-toggle {
        width: 100%;
        min-width: 0;
    }

    .reflect-view-toggle {
        margin-left: 0;
    }

    .reflect-view-toggle button {
        flex: 1 1 50%;
    }

    .reflect-summary {
        grid-template-columns: 1fr;
    }

    .reflect-trends-summary {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .reflect-net-worth-summary {
        grid-template-columns: 1fr;
    }

    .reflect-metric,
    .reflect-metric:nth-child(odd) {
        min-height: 76px;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .reflect-metric:first-child {
        border-top: 0;
    }

    .reflect-metric strong {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .reflect-net-worth-summary .reflect-metric:nth-child(n + 2) {
        border-top: 1px solid var(--border);
    }

    .reflect-chart-panel {
        min-height: 300px;
        padding: 28px 20px;
    }

    .reflect-legend-panel {
        padding: 22px 18px;
    }

    .reflect-legend li {
        grid-template-columns: 12px minmax(0, 1fr) minmax(82px, auto);
    }

    .reflect-legend-share {
        display: none;
    }

    .reflect-trends-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .reflect-trends-chart {
        padding-right: 18px;
        padding-left: 18px;
    }

    .reflect-net-worth-chart {
        padding-right: 18px;
        padding-left: 18px;
    }

    .reflect-trends-table th,
    .reflect-trends-table td {
        padding-right: 18px;
        padding-left: 18px;
    }
}

/* ============================================================
   Headings
   ============================================================ */

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--label-primary);
    margin: 0 0 1rem;
}

/* Blazor houdt de paginakop na navigatie als focusdoel; geen focusring tonen. */
h1:focus,
h1:focus-visible {
    outline: none;
}

h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--label-primary);
    margin: 1.25rem 0 0.75rem;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--label-secondary);
    margin: 1rem 0 0.5rem;
}

/* ============================================================
   Budget screen (YNAB header + to-be-budgeted)
   ============================================================ */

.budget-screen {
    padding: 0;
    width: 100%;
}

.budget-body {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.budget-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.budget-toolbar-filters {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 28px 8px 20px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.budget-filter-btn {
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    font-size: 13px;
    font-weight: 500;
    padding: 4px 2px;
    cursor: pointer;
    white-space: nowrap;
}

.budget-filter-btn:hover {
    color: var(--label-primary);
}

.budget-filter-btn.active {
    color: var(--label-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---- Inspector ---- */

.budget-inspector {
    flex: 0 0 clamp(320px, 27vw, 520px);
    width: clamp(320px, 27vw, 520px);
    min-width: 320px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    background: #f7f7f5;
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 88px);
    position: sticky;
    top: 0;
    z-index: 4;
}

.inspector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.inspector-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--label-primary);
}

.inspector-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: var(--label-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.inspector-close:hover {
    color: var(--label-primary);
    background: var(--table-hover);
}

.inspector-rows {
    border-top: 1px solid var(--border);
}

.inspector-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.inspector-label {
    font-size: 14px;
    color: var(--label-secondary);
}

.inspector-amount {
    font-size: 14px;
    color: var(--label-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inspector-amount-available {
    font-size: 1.05rem;
    font-weight: 700;
}

.inspector-available-label {
    font-weight: 600;
}

.inspector-targets,
.inspector-goal {
    margin-top: 20px;
}

.inspector-section-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--label-primary);
    letter-spacing: 0;
}

.inspector-caught-up {
    margin: 0;
    color: var(--positive-text);
    font-size: 14px;
}

/* ---- Inspector: categorie (YNAB) ---- */

.inspector-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
    background: var(--background-primary);
}

.inspector-disclosure > summary {
    position: relative;
    padding-right: 18px;
    cursor: pointer;
    list-style: none;
}

.inspector-disclosure > summary::-webkit-details-marker {
    display: none;
}

.inspector-disclosure > summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 2px;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--label-tertiary);
    border-bottom: 2px solid var(--label-tertiary);
    transform: translateY(-65%) rotate(45deg);
}

.inspector-disclosure:not([open]) > summary::after {
    transform: translateY(-50%) rotate(-45deg);
}

.inspector-card.inspector-disclosure:not([open]) {
    padding-bottom: 8px;
}

.inspector-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.inspector-card-amount {
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inspector-target {
    margin-top: 14px;
}

.inspector-section-head {
    margin: 0 -16px 16px;
    padding: 0 16px 14px;
    border-bottom: 1px solid var(--border);
}

.inspector-target,
.inspector-auto-assign,
.inspector-section-notes {
    padding: 14px 16px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background-primary);
}

.inspector-auto-assign,
.inspector-section-notes {
    margin-top: 14px;
}

.inspector-disclosure:not([open]) > .inspector-section-head {
    margin-bottom: -14px;
    border-bottom: 0;
}

.inspector-disclosure > .inspector-section-head .inspector-section-title {
    margin-bottom: 0;
}

.inspector-target-hint {
    margin: 0 0 12px;
    color: var(--label-secondary);
    font-size: 14px;
}

.goal-create-btn {
    width: 100%;
    justify-content: center;
}

.goal-summary-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.goal-summary-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--label-primary);
}

.goal-summary-subtitle {
    margin: 0;
    color: var(--label-secondary);
    font-size: 14px;
}

.goal-summary-progress {
    display: grid;
    width: 80px;
    height: 80px;
    margin: 16px auto;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--action-primary) var(--goal-progress), #eceae2 0);
    position: relative;
}

.goal-summary-progress::before {
    content: "";
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--background-primary);
}

.goal-summary-progress strong {
    position: relative;
    font-size: 18px;
    color: var(--label-primary);
}

.goal-summary-callout {
    display: grid;
    gap: 10px;
    margin-bottom: 8px;
    padding: 14px;
    border-radius: 8px;
    background: #fff4c7;
    text-align: center;
    font-size: 14px;
}

.goal-summary-assign {
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: #f8c91c;
    color: var(--label-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.goal-summary-assign:hover:not(:disabled) {
    background: #eabb12;
}

.goal-summary-met {
    margin: 16px 0;
    color: var(--positive-text);
    font-weight: 600;
    text-align: center;
}

.goal-edit-btn {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
}

.goal-snooze {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--label-secondary);
}

.inspector-section-notes {
    margin-top: 14px;
}

.inspector-note {
    margin: 0;
    color: var(--label-tertiary);
    font-size: 14px;
}

/* ---- Goal-editor (inline in inspector) ---- */

.goal-editor .field {
    margin-bottom: 12px;
}

.goal-editor label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--label-secondary);
}

.goal-repeat-row {
    display: grid;
    grid-template-columns: minmax(64px, 0.7fr) minmax(0, 1.3fr);
    gap: 8px;
}

.goal-repeat-row .assign-select {
    min-width: 0;
}

.goal-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.goal-checkbox-label input {
    margin: 0;
}

.goal-range-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.goal-range-tab {
    flex: 1 1 auto;
    padding: 6px 8px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--label-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.goal-range-tab.active {
    color: var(--action-primary);
    font-weight: 600;
    border-bottom-color: var(--action-primary);
}

.goal-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.goal-editor-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inspector-auto-options {
    display: grid;
}

.inspector-auto-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 2px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--label-primary);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.inspector-auto-option span:last-child {
    color: var(--action-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.inspector-auto-option:hover:not(:disabled) {
    color: var(--action-primary);
    background: var(--surface-hover);
}

.inspector-auto-option:disabled {
    cursor: default;
    opacity: 0.55;
}

.inspector-auto-resets {
    display: grid;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}

.inspector-auto-resets .inspector-auto-option:last-child {
    border-bottom: 0;
}

/* ---- Categorie-menu (Rename/Hide/Delete/OK) ---- */

.category-menu-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

.category-menu-actions-left,
.category-menu-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger-text {
    color: var(--negative-text);
}

.btn-danger-text:hover {
    border-color: var(--negative-text);
    color: var(--negative-text);
}

.btn-small {
    padding: 4px 12px;
    font-size: 13px;
}

/* ---- Selected row highlight ---- */

.budget-table-row.is-sub-category.selected {
    background: #eef2ff;
}

.budget-table-row.is-sub-category.selected:hover {
    background: #eef2ff;
}

.budget-header {
    display: block;
    /* 88px incl. items */
}

.budget-header-flexbox {
    display: flex;
    align-items: stretch;
}

.budget-header-item {
    display: flex;
    align-items: center;
}

.budget-header-calendar {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px;
    gap: 8px;
}

.budget-header-calendar-prev,
.budget-header-calendar-next {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--label-primary);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.budget-header-calendar-prev:hover,
.budget-header-calendar-next:hover:not(:disabled) {
    color: var(--action-primary);
}

.budget-header-calendar-prev:disabled,
.budget-header-calendar-next:disabled {
    opacity: 0.4;
    cursor: default;
}

.budget-header-calendar-date {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
    min-width: 0;
}

.budget-header-calendar-date-button {
    border: none;
    background: transparent;
    color: var(--label-primary);
    font-size: 21px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.budget-header-calendar-date-button:hover {
    color: var(--action-primary);
}

.budget-header-calendar-note {
    border: none;
    background: transparent;
    color: var(--label-secondary);
    font-size: 12px;
    padding: 2px 0 0;
    cursor: text;
    text-align: left;
}

.budget-header-totals {
    flex: 0 0 auto;
    padding: 8px;
}

.budget-header-share {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px;
}

/* ---- Ready to Assign badge ---- */

.to-be-budgeted {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px 12px;
    border-radius: 8px;
    background: var(--rta-neutral);
    cursor: default;
}

.to-be-budgeted.is-positive {
    background: var(--rta-positive);
}

.to-be-budgeted.is-negative {
    background: var(--rta-negative);
}

.to-be-budgeted.is-zero {
    background: var(--rta-neutral);
}

.to-be-budgeted-heading-wrapper {
    position: relative;
    display: flex;
}

.to-be-budgeted h1 {
    margin: 0;
    display: flex;
    flex-direction: column;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.to-be-budgeted-amount {
    font-size: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.to-be-budgeted-label {
    font-size: 14px;
    font-weight: 500;
}

.to-be-budgeted-view-breakdown {
    position: absolute;
    inset: -8px -16px auto auto;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
}

.to-be-budgeted:hover .to-be-budgeted-view-breakdown {
    opacity: 1;
}

.to-be-budgeted-view-breakdown::after {
    content: "ⓘ";
    position: absolute;
    right: 6px;
    top: 6px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.55);
}

.to-be-budgeted-auto-assign {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 4px 16px;
    border: none;
    border-radius: 8px;
    background: var(--positive-text);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.to-be-budgeted-auto-assign:hover {
    background: var(--positive-text-active);
}

/* ============================================================
   Budget table (YNAB klassen)
   ============================================================ */

.budget-table-container {
    background: var(--background-primary);
    width: 100%;
}

.budget-table {
    display: block;
    width: 100%;
}

.budget-table-header {
    background: var(--background-primary);
}

.budget-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 0 0 8px;
    border-bottom: 1px solid var(--border);
}

.budget-toolbar [role="cell"] {
    display: flex;
    align-items: center;
}

.budget-toolbar-actions {
    gap: 8px;
    padding-right: 16px;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--action-primary);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.ghost-button:hover {
    background: rgba(59, 94, 218, 0.08);
    color: var(--action-primary-active);
}

.budget-table-header-labels,
.budget-table-row {
    display: flex;
    align-items: center;
}

.budget-table-header-labels {
    min-height: 40px;
    height: 40px;
    border-bottom: 1px solid var(--border);
}

.budget-table-row-li {
    flex: 0 1 auto;
}

.budget-table-cell-margin-left {
    width: 14px;
    flex: 0 1 auto;
}

/* Drag-handle-kolom: alleen zichtbaar op touch-apparaten (tablet), waar drag
   alleen vanaf de handle start zodat de rest van de rij kan scrollen. */
.budget-table-cell-drag-handle {
    display: none;
    width: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.budget-table.is-touch .budget-table-cell-drag-handle {
    display: flex;
}

/* Grippie-icoon (6 dots) als drag-handle. */
.drag-handle {
    display: inline-block;
    width: 12px;
    height: 16px;
    background-image: radial-gradient(circle, var(--label-secondary) 1.5px, transparent 1.5px);
    background-size: 6px 6px;
    background-position: 0 0;
    background-repeat: repeat;
    cursor: grab;
    opacity: 0.7;
}

.drag-handle:active {
    cursor: grabbing;
}

.budget-table-cell-collapse {
    width: 16px;
    flex: 0 1 auto;
    text-align: center;
}

/* Collapse/expand toggle for category groups (YNAB chevron-sprite) */
.collapse-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #51504d;
    transition: color 0.15s ease;
    vertical-align: middle;
}

.collapse-toggle:hover {
    color: #222120;
}

/* Chevron-icoon: open groepen wijzen omlaag, ingeklapte groepen wijzen naar rechts. */
.collapse-toggle .collapse-icon {
    display: block;
    transition: transform 0.15s ease;
    transform: rotate(90deg);
}

.collapse-toggle.collapsed .collapse-icon {
    transform: rotate(0deg);
}

/* Toggle-all knop in de collapse-header-kolom (uitgelijnd met de per-rij knoppen). */
.collapse-all-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--label-secondary);
    transition: color 0.15s ease;
}

.collapse-all-toggle:hover {
    color: var(--label-primary);
}

.collapse-all-toggle .collapse-icon {
    display: block;
    transition: transform 0.15s ease;
    transform: rotate(90deg);
}

.collapse-all-toggle .collapse-icon.collapsed {
    transform: rotate(0deg);
}

.budget-table-cell-checkbox {
    width: 27px;
    flex: 0 1 auto;
    padding: 0 2px 0 8px;
}

.budget-table-cell-name {
    flex: 1 1 0%;
    min-width: 0;
    padding: 0 0 0 2px;
}

.budget-table-cell-budgeted {
    flex: 0 0 auto;
    width: 100px;
    padding: 0 4px 0 16px;
    text-align: right;
    white-space: nowrap;
}

.budget-table-cell-activity {
    flex: 0 0 auto;
    width: 100px;
    padding: 0 0 0 6px;
    text-align: right;
    white-space: nowrap;
}

.budget-table-cell-available {
    flex: 0 0 auto;
    width: 100px;
    padding: 6px 6px 6px 16px;
    text-align: right;
    white-space: nowrap;
}

.budget-table-cell-margin-right {
    width: 16px;
    flex: 0 1 auto;
}

/* header labels tekst */
.budget-table-header-labels .budget-table-cell-name,
.budget-table-header-labels .budget-table-cell-budgeted,
.budget-table-header-labels .budget-table-cell-activity,
.budget-table-header-labels .budget-table-cell-available {
    font-size: 12px;
    font-weight: 500;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.budget-table-draggable {
    display: block;
}

/* drop-gap: bij het slepen schuiven de rijen fysiek op zodat je ziet waar het item landt (YNAB-gedrag) */
.budget-table-draggable .budget-table-row {
    transition: margin-top 0.12s ease, margin-bottom 0.12s ease;
}

/* spacer die de "gap" creëert waar het item terechtkomt tijdens het slepen */
.drop-gap-spacer {
    flex: 0 0 auto;
}

/* Pointer-based slepen (muis + touch + pen): touch-action none zodat de vinger
   de rij sleept i.p.v. de pagina te scrollen. */
.budget-table-draggable [data-drag-payload] {
    touch-action: none;
}

/* Op touch-apparaten start drag alleen vanaf de drag-handle; de rest van de rij
   moet gewoon kunnen scrollen. */
.budget-table.is-touch [data-drag-payload] {
    touch-action: auto;
}

.budget-table.is-touch [data-drag-payload] .drag-handle {
    touch-action: none;
}

/* bij het slepen van een groep: alleen de groepsrijen tonen, categorieen verbergen */
.budget-table-draggable.dragging-group .is-sub-category {
    display: none;
}

.budget-table-draggable .is-master-category.dragging,
.budget-table-draggable .is-sub-category.dragging {
    opacity: 0.5;
}

/* ---- Rows ---- */

.budget-table-row {
    min-height: 44px;
}

.budget-table-row.is-master-category {
    min-height: 40px;
    background: var(--table-row-master);
    font-weight: 700;
}

.budget-table-row.is-sub-category {
    min-height: 44px;
    background: var(--table-row);
}

.budget-table-row.is-sub-category:hover {
    background: var(--table-hover);
}

.budget-table-row .budget-table-cell-name,
.budget-table-row .budget-table-cell-budgeted,
.budget-table-row .budget-table-cell-activity,
.budget-table-row .budget-table-cell-available {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.budget-table-row.is-master-category .budget-table-cell-name {
    font-weight: 700;
}

/* ---- Category name ---- */

.budget-table-cell-button {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.budget-table-cell-edit-category {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.budget-table-cell-edit-category-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}

.budget-table-cell-goal-nowrap {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.budget-table-cell-goal-nowrap .category-status {
    margin-left: auto;
}

.budget-table-cell-goal-nowrap > button {
    border: none;
    background: transparent;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.budget-table-cell-goal-nowrap > button:hover {
    color: var(--action-primary);
    text-decoration: underline;
}

.budget-table-row.is-master-category .budget-table-cell-goal-nowrap > button {
    font-weight: 700;
    color: var(--label-primary);
}

.goal-ring {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}

.goal-ring svg {
    display: block;
}

/* YNAB-progressbalk onder de categorienaam */
.ynab-progressbar {
    flex: 1 1 auto;
    width: 100%;
    height: 4px;
    background: #f3eee2;
    border-radius: 16px;
    margin-top: 3px;
    overflow: hidden;
}

.ynab-progressbar-fill {
    height: 100%;
    border-radius: 16px;
    transition: width 0.2s ease;
}

/* Toegewezen deel: groen gearceerd (diagonaal patroon) */
.ynab-progressbar-fill.funded {
    background: repeating-linear-gradient(
        -45deg,
        var(--positive-text),
        var(--positive-text) 3px,
        transparent 3px,
        transparent 6px
    );
}

/* Overspent: rode gearceerde balk (100% gevuld) */
.ynab-progressbar-fill.overspent {
    background: repeating-linear-gradient(
        -45deg,
        var(--negative-text),
        var(--negative-text) 3px,
        transparent 3px,
        transparent 6px
    );
}

/* Weekly-goal: progressbar als blokken (één per week van de maand), vult de hele kolom */
.ynab-progressbar-segments {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    width: 100%;
    flex: 1 1 auto;
}

.ynab-progressbar-segment {
    flex: 1 1 0%;
    height: 4px;
    border-radius: 0;
    background: #f3eee2;
}

.ynab-progressbar-segment:first-child {
    border-radius: 16px 0 0 16px;
}

.ynab-progressbar-segment:last-child {
    border-radius: 0 16px 16px 0;
}

/* Doel behaald: solid groen */
.ynab-progressbar-segment.complete {
    background: var(--positive-text);
}

.ynab-progressbar-segment.spent {
    background: repeating-linear-gradient(
        -45deg,
        var(--positive-text),
        var(--positive-text) 3px,
        transparent 3px,
        transparent 6px
    );
}

/* status-regel achter de categorienaam, rechts uitgelijnd, altijd zwart zonder achtergrond */
.category-status {
    font-size: 0.72rem;
    line-height: 1.3;
    padding: 0 0.25rem;
    white-space: nowrap;
    margin-left: auto;
    color: var(--label-primary);
    background: transparent;
    border-radius: 0;
    display: inline-block;
}

/* add-category per master-rij */
.add-category-btn {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--action-primary);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    padding: 0;
    margin-left: 8px;
}

.is-master-category:hover .add-category-btn,
.is-master-category:focus-within .add-category-btn {
    opacity: 1;
}

.add-category-btn:hover {
    background: var(--action-primary-active);
}

/* ---- Budgeted input ---- */

.assign-input {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: right;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--label-primary);
    padding: 2px 4px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.assign-input:hover {
    border-color: var(--border);
    background: var(--background-primary);
}

.assign-input:focus {
    outline: none;
    border-color: var(--action-primary);
    background: var(--background-primary);
    box-shadow: 0 0 0 3px rgba(59, 94, 218, 0.12);
}

.assigned-cell-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.assigned-cell-controls .assign-input {
    min-width: 0;
}

.assigned-history-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--action-primary);
    cursor: pointer;
}

.assigned-history-button:hover,
.assigned-history-button:focus-visible {
    background: var(--table-hover);
    outline: none;
}

.assigned-history-clock {
    width: 12px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    position: relative;
}

.assigned-history-clock::before,
.assigned-history-clock::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1px;
    background: currentColor;
    transform-origin: 50% 0;
}

.assigned-history-clock::before {
    height: 3px;
    transform: translate(-50%, -100%);
}

.assigned-history-clock::after {
    height: 3px;
    transform: translate(-50%, 0) rotate(-45deg);
}

.budget-activity-button {
    width: 100%;
    padding: 2px 4px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-variant-numeric: tabular-nums;
    text-align: right;
    cursor: pointer;
}

.budget-activity-button:hover,
.budget-activity-button:focus-visible {
    background: var(--table-hover);
    color: var(--action-primary);
    outline: none;
    text-decoration: underline;
}

/* ---- Amount kleuren ---- */

.budget-cell-positive,
.pos {
    color: var(--positive-text);
}

.budget-cell-negative {
    color: var(--negative-text);
}

.neg {
    color: var(--negative-text);
}

/* ---- Available pill (gemeten: nieuwe YNAB) ---- */

.ynab-new-budget-available-number {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border: none;
    border-radius: 1000px;
    background: transparent;
    color: var(--label-primary);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.ynab-new-budget-available-number:hover {
    filter: brightness(0.97);
}

.ynab-new-budget-available-number svg {
    display: block;
    flex: 0 0 auto;
}

.ynab-new-budget-available-number.positive {
    background: #fff0b8;
    color: #514d4d;
}

.ynab-new-budget-available-number.negative {
    background: var(--badge-negative-bg);
    color: var(--negative-text);
}

.ynab-new-budget-available-number.cautious {
    background: var(--badge-cautious-bg);
}

.ynab-new-budget-available-number.goal-met {
    background: var(--badge-positive-bg);
    color: var(--label-primary);
}

.ynab-new-budget-available-number.zero {
    background: var(--badge-zero-bg);
    color: var(--badge-zero-text);
}

.ynab-new-budget-available-number.plain {
    background: transparent;
    color: var(--label-primary);
}

/* compat: oude available-badge naam */
.available-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 1000px;
    padding: 2px 7px;
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    background: transparent;
    color: var(--label-primary);
}

.available-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    font-size: 0.6rem;
    line-height: 1;
}

.available-badge.badge-positive {
    background: var(--badge-positive-bg);
    color: var(--label-primary);
}

.available-badge.badge-negative {
    background: var(--badge-negative-bg);
    color: var(--label-primary);
}

.available-badge.badge-neutral {
    background: var(--badge-zero-bg);
    color: var(--badge-zero-text);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--background-primary);
    color: var(--label-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--action-primary);
    color: var(--action-primary);
}

.btn-primary {
    background: var(--button-primary-background);
    border-color: var(--button-primary-background);
    color: #fff;
}

.btn-primary:hover {
    background: var(--action-primary-active);
    border-color: var(--action-primary-active);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.18);
    color: var(--label-primary);
}

.btn-outline:hover {
    border-color: var(--action-primary);
    color: var(--action-primary);
    background: rgba(59, 94, 218, 0.06);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--label-primary);
}

.btn-ghost:hover {
    background: var(--table-hover);
    color: var(--label-primary);
}

.btn-small {
    padding: 3px 12px;
    font-size: 13px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ============================================================
   Forms
   ============================================================ */

.field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    max-width: 22rem;
}

.field label {
    font-size: 0.85rem;
    color: var(--label-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="month"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--label-primary);
    background: var(--background-primary);
}

input:focus {
    outline: none;
    border-color: var(--action-primary);
    box-shadow: 0 0 0 3px rgba(59, 94, 218, 0.12);
}

.row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
}

/* ============================================================
   Alerts / states
   ============================================================ */

.alert {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert.error {
    background: var(--negative-bg);
    color: var(--negative-text);
    border: 1px solid #facdc9;
}

.alert.dev {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.success {
    color: var(--positive-text);
    font-size: 0.85rem;
}

.muted {
    color: var(--label-secondary);
}

/* ============================================================
   Transactions register
   ============================================================ */

.register-screen {
    padding: 24px 28px;
    width: 100%;
}

@media (min-width: 901px) {
    .register-screen {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    .register-screen > :not(.register-table-wrap) {
        flex: 0 0 auto;
    }

    .register-table-wrap {
        order: 1;
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
    }

    .scheduled-transactions {
        flex: 0 1 auto;
        min-height: 0;
    }

    .scheduled-list {
        max-height: min(24rem, 38vh);
        overflow-y: auto;
    }

    .register-table-wrap .register-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
    }
}

/* Blauwe banner boven het register: nieuwe transacties ter beoordeling */
.register-attention-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--action-primary);
    color: #fff;
    margin: -24px -28px 20px;
    padding: 0.55rem 16px 0.55rem 28px;
    font-size: 0.92rem;
}

.register-attention-icon {
    display: block;
    flex-shrink: 0;
}

.register-attention-text {
    flex: 1;
}

.register-attention-view {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.32rem 1.6rem;
    border-radius: 6px;
    cursor: pointer;
}

.register-attention-view:hover {
    background: rgba(255, 255, 255, 0.28);
}

.reconcile-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: -4px 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--border-default);
    border-left: 4px solid var(--action-primary);
    background: var(--background-primary-elevated);
}

.reconcile-banner p {
    margin: 0.2rem 0 0;
    color: var(--label-secondary);
}

.reconcile-banner-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

.register-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.register-title h1 {
    margin: 0;
    font-size: 1.6rem;
}

.register-title-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--label-secondary);
}

.register-title-meta svg {
    color: var(--label-tertiary);
}

.register-title-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.15rem;
}

.register-edit-btn {
    width: 36px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: rgba(59, 94, 218, 0.12);
    color: var(--action-primary);
    cursor: pointer;
}

.register-edit-btn:hover {
    background: rgba(59, 94, 218, 0.2);
    color: var(--action-primary-active);
}

.register-balances {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}

.register-balance {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.register-balance-op {
    align-self: center;
    margin-top: -1rem;
    color: var(--label-secondary);
    font-size: 1rem;
    font-weight: 600;
}

.register-balance-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--label-secondary);
    white-space: nowrap;
}

.register-balance-label svg {
    flex: 0 0 auto;
    color: var(--label-tertiary);
}

.register-balance-amount {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--label-primary);
    font-variant-numeric: tabular-nums;
}

.register-balance-amount.pos {
    color: var(--positive-text);
}

.register-balance-amount.neg {
    color: var(--negative-text);
}

.register-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.75rem;
}

.register-toolbar-spacer {
    flex: 1 1 auto;
}

.register-toolbar-sep {
    width: 1px;
    align-self: stretch;
    margin: 0.25rem 0.5rem;
    background: var(--border);
}

.register-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.45rem;
    border: none;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--action-primary);
    white-space: nowrap;
    cursor: pointer;
}

.register-action-btn:hover:not(:disabled) {
    background: rgba(59, 94, 218, 0.08);
    color: var(--action-primary-active);
}

.register-action-btn:disabled {
    color: var(--label-tertiary);
    cursor: default;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.register-toolbar-view {
    position: relative;
    color: var(--action-primary);
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 900px) {
    .register-toolbar {
        flex-wrap: wrap;
    }

    .register-toolbar-spacer {
        display: none;
    }

    .register-toolbar-view {
        margin-left: auto;
    }

    .register-search-wrap {
        flex: 1 1 100%;
        min-width: 0;
    }

    .register-search {
        width: 100%;
    }
}

.register-view-toggle {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--action-primary);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.register-view-caret {
    font-size: 0.8em;
}

/* ---- Zoeksuggesties (YNAB register search) ---- */

.register-popover-catch {
    position: fixed;
    inset: 0;
    z-index: 24;
    background: transparent;
    border: none;
    padding: 0;
    cursor: default;
}

.register-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 25;
    width: 500px;
    max-width: min(88vw, 540px);
    max-height: 480px;
    overflow-y: auto;
    background: var(--background-primary-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    padding: 0.4rem 0;
}

.register-suggestion {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.4rem 0.9rem;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    color: var(--label-primary);
    cursor: pointer;
}

.register-suggestion:hover {
    background: var(--table-hover);
}

.register-suggestion-prefix {
    flex: 0 0 92px;
    color: var(--label-secondary);
    text-align: right;
    white-space: nowrap;
}

.register-suggestion-main {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.register-suggestion-value {
    color: var(--label-primary);
}

.register-suggestion-value.bold {
    font-weight: 700;
}

.register-suggestion-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.register-suggestion-icon-calendar {
    color: #8452d1;
}

.register-suggestion-icon-outflow {
    color: #d64545;
}

.register-suggestion-icon-inflow {
    color: #3fae53;
}

.register-suggestion-icon-emoji {
    font-size: 0.85rem;
    line-height: 1;
}

.register-suggestion-empty {
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
    color: var(--label-secondary);
}

/* ---- View Options popover (verankerd onder de View-knop) ---- */

.register-view-options {
    position: absolute;
    top: calc(100% + 11px);
    right: 0;
    z-index: 25;
    width: 540px;
    max-width: 92vw;
    background: var(--background-primary-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.register-view-options::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 240px;
    width: 14px;
    height: 14px;
    background: var(--background-primary-elevated);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
}

.register-view-options-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--label-primary);
}

.register-view-options-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.register-view-options-preset {
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.28rem 0.72rem;
    font-size: 0.82rem;
    white-space: nowrap;
    color: var(--action-primary);
    cursor: pointer;
}

.register-view-options-preset.selected {
    background: var(--action-primary);
    border-color: var(--action-primary);
    color: #fff;
}

.register-view-options-range {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.register-view-options-range-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.register-view-options-range-label {
    min-width: 40px;
    color: var(--label-secondary);
    font-size: 0.9rem;
}

.register-view-options-range-row select {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    background: var(--background-primary);
}

.register-view-options-checks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.register-view-options-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--label-primary);
    cursor: pointer;
}

.register-view-options-check input {
    accent-color: var(--action-primary);
}

.register-view-options-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.register-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.register-search-icon {
    position: absolute;
    left: 0.5rem;
    color: var(--label-secondary);
    pointer-events: none;
}

.register-search {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.4rem 1.8rem 0.4rem 1.7rem;
    min-width: 240px;
    font-size: 0.9rem;
}

.register-search:focus {
    outline: none;
    border-color: var(--action-primary);
}

.register-search-clear {
    position: absolute;
    right: 0.4rem;
    z-index: 26;
    background: none;
    border: none;
    color: var(--label-secondary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem;
}

.scheduled-transactions {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.scheduled-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: var(--table-row-master);
    border: none;
    color: var(--label-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: left;
}

.scheduled-toggle .chev {
    transition: transform 0.12s ease;
}

.scheduled-toggle.is-open .chev {
    transform: rotate(180deg);
}

.scheduled-list {
    border-top: 1px solid var(--border);
    overflow-x: auto;
}

.scheduled-table {
    border: 0;
    border-radius: 0;
}

.scheduled-table td > * {
    max-width: 100%;
}

.scheduled-table .register-payee,
.scheduled-table .register-category,
.scheduled-table .register-memo {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scheduled-row-frequency {
    color: var(--label-secondary);
    font-size: 0.82rem;
}

.scheduled-row-actions {
    white-space: nowrap;
    padding-left: 0.1rem !important;
    padding-right: 0.1rem !important;
}

.scheduled-row-action {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 20px;
    background: none;
    border: none;
    padding: 0;
    border-radius: 4px;
    font: inherit;
    font-size: 0.78rem;
    color: var(--label-secondary);
    cursor: pointer;
    visibility: hidden;
}

.scheduled-row:hover .scheduled-row-action,
.scheduled-row-action:focus-visible {
    visibility: visible;
}

.scheduled-row-action:hover {
    background: var(--table-hover);
    color: var(--label-primary);
}

.scheduled-row-delete:hover {
    color: var(--negative-text);
}

/* ============================================================
   Payee management
   ============================================================ */

.payees-screen {
    min-height: 100vh;
    background: #f8f6f2;
}

.payees-header {
    min-height: 88px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--background-primary);
    border-bottom: 1px solid var(--border);
}

.payees-header h1 {
    margin: 0 0 3px;
    font-size: 24px;
}

.payees-header p,
.payees-merge p {
    margin: 0;
    color: var(--label-secondary);
}

.payees-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(320px, 40vw);
}

.payees-search svg {
    position: absolute;
    left: 10px;
    color: var(--label-secondary);
    pointer-events: none;
}

.payees-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--input-border-active);
    border-radius: 4px;
    background: var(--background-primary);
}

.payees-search input:focus,
.payees-form input:focus,
.payees-form select:focus,
.payees-merge select:focus {
    outline: 2px solid var(--action-primary);
    outline-offset: 1px;
}

.payees-workspace {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(300px, 380px);
    min-height: calc(100vh - 88px);
}

.payees-list {
    background: var(--background-primary);
    border-right: 1px solid var(--border);
}

.payees-list-heading,
.payees-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 44px;
    padding: 0 24px;
    border: 0;
    border-bottom: 1px solid var(--border);
}

.payees-list-heading {
    color: var(--label-secondary);
    background: var(--table-row-master);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.payees-row {
    background: var(--table-row);
    color: var(--label-primary);
    text-align: left;
    cursor: pointer;
}

.payees-row:hover {
    background: var(--table-hover);
}

.payees-row.selected {
    background: #e8ecff;
    box-shadow: inset 3px 0 var(--action-primary);
}

.payees-row:focus-visible {
    outline: 2px solid var(--action-primary);
    outline-offset: -3px;
}

.payees-row-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payees-transfer-label {
    flex: 0 0 auto;
    color: var(--label-secondary);
    font-size: 12px;
}

.payees-empty {
    padding: 32px 24px;
    color: var(--label-secondary);
}

.payees-inspector {
    padding: 24px;
    background: #f8f6f2;
}

.payees-inspector-empty {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--label-secondary);
}

.payees-inspector-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 24px;
}

.payees-inspector-title span {
    color: var(--label-secondary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.payees-inspector-title strong {
    overflow-wrap: anywhere;
    font-size: 20px;
}

.payees-form,
.payees-merge {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.payees-form label,
.payees-merge label {
    font-weight: 700;
}

.payees-form input,
.payees-form select,
.payees-merge select {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--input-border-active);
    border-radius: 4px;
    background: var(--background-primary);
}

.payees-merge {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.payees-merge,
.payees-delete {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.payees-merge h2,
.payees-delete h2 {
    margin: 0;
    font-size: 16px;
}

.payees-delete {
    margin-top: 28px;
}

.payees-delete p {
    margin: 0 0 16px;
    color: var(--label-secondary);
}

.payees-confirm p {
    margin-bottom: 12px;
}

.payees-confirm .btn + .btn {
    margin-left: 6px;
}

.payees-transfer-note {
    color: var(--label-secondary);
}

@media (max-width: 800px) {
    .payees-header {
        align-items: stretch;
        flex-direction: column;
    }

    .payees-search {
        width: 100%;
    }

    .payees-workspace {
        grid-template-columns: 1fr;
    }

    .payees-list {
        border-right: 0;
    }

    .payees-inspector {
        border-top: 1px solid var(--border);
    }
}

/* ---- Register table ---- */

/* Omhulsel zodat de tabel horizontaal kan scrollen als de ingestelde
   kolombreedtes samen breder zijn dan het scherm. */
.register-table-wrap {
    overflow-x: auto;
}

.register-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 16px;
    color: var(--label-secondary);
    font-size: 13px;
}

.register-load-more-count {
    font-weight: 400;
}

.register-table {
    width: 100%;
    min-width: 1175px;
    table-layout: fixed;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.9rem;
}

.register-table th,
.register-table td {
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.register-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sorteerbare kolomkoppen */
.register-table .register-sortable {
    cursor: pointer;
    user-select: none;
}

.register-table .register-sortable:hover {
    color: var(--label-primary);
}

.register-sort-arrow {
    font-size: 0.65rem;
    margin-left: 0.25rem;
}

/* Resize-handles op de kolomkoppen */
.register-table thead th {
    position: relative;
}

.register-col-resize {
    position: absolute;
    top: 0;
    bottom: 0;
    right: -3px;
    width: 7px;
    cursor: col-resize;
    z-index: 2;
    touch-action: none;
}

body.col-resizing,
body.col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.register-table thead th {
    background: var(--table-row-master);
    color: var(--label-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.register-table tbody tr:last-child td {
    border-bottom: none;
}

.register-table tbody tr:hover td {
    background: var(--table-hover);
}

.register-row td {
    background: var(--table-row);
}

.register-empty td {
    text-align: center;
    padding: 1.25rem;
    color: var(--label-secondary);
}

.register-check-col {
    width: 64px;
    text-align: center;
    white-space: nowrap;
}

.register-check-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.register-check-col input[type="checkbox"],
.register-check-cell input[type="checkbox"] {
    accent-color: var(--action-primary);
}

.register-info-icon {
    display: inline-flex;
    color: var(--action-primary);
    vertical-align: middle;
    cursor: pointer;
}

.register-info-icon svg {
    display: block;
}

.register-flag-col {
    width: 84px;
    white-space: nowrap;
}

.register-flag-pill {
    display: inline-block;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 4px;
    padding: 0.15rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #fff;
    vertical-align: middle;
}

.register-flag-red {
    background: #d7443e;
}

.register-flag-orange {
    background: #e07c1f;
}

.register-flag-yellow {
    background: #f0c429;
}

.register-flag-green {
    background: #63a524;
}

.register-flag-blue {
    background: #4a90d9;
}

.register-flag-purple {
    background: #9d5bc2;
}

.register-clear-col {
    width: 40px;
    color: var(--label-secondary);
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.register-clear-col svg.cleared-glyph {
    color: #0e9e5c;
}

.register-clear-col svg.uncleared-glyph {
    color: var(--label-tertiary);
}

.register-clear-col svg.reconciled-glyph {
    color: #0e9e5c;
}

.register-row.unapproved {
    font-style: normal;
}

.register-row.unapproved > td {
    font-weight: 700;
}

.register-row.unapproved .register-category {
    color: var(--label-primary);
}

.col-num {
    text-align: right;
    white-space: nowrap;
}

.col-clear {
    width: 40px;
    text-align: center;
}

.register-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.register-table .num.neg {
    color: var(--negative-text);
}

.register-account {
    font-weight: 400;
    color: var(--label-primary);
}

.register-date {
    color: var(--label-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.register-payee {
    font-weight: 400;
    color: var(--label-primary);
}

.register-split-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: -2px 0.25rem -2px 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--label-secondary);
    vertical-align: middle;
    cursor: pointer;
}

.register-split-toggle:hover {
    background: var(--table-hover);
    color: var(--label-primary);
}

.register-split-toggle:focus-visible {
    outline: 2px solid var(--action-primary);
    outline-offset: 1px;
}

.register-split-child td {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-size: 0.86rem;
}

.register-split-child .register-payee {
    padding-left: 1.6rem;
}

.register-category {
    color: var(--label-secondary);
}

/* Gele YNAB-badge voor transacties zonder categorie */
.register-needs-category-badge {
    display: inline-block;
    background: #f7ce4c;
    color: #6b4e00;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.register-needs-icon {
    color: #ecb22e;
}

.register-category-transfer {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--label-secondary);
    font-style: italic;
}

.register-memo {
    color: var(--label-secondary);
}

/* ---- Inline edit: add-rij, rij-edit, comboboxen ---- */

.register-edit-row td {
    height: 36px;
    padding: 0.15rem 0.2rem;
    background: var(--table-hover);
}

.register-edit-affordances,
.register-amount-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
}

.register-edit-affordances {
    justify-content: center;
    gap: 2px;
}

.register-edit-icon-button,
.register-edit-flag-wrap {
    position: relative;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.register-edit-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--label-secondary);
    cursor: pointer;
}

.register-edit-flag-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.register-edit-flag-icon {
    color: var(--label-tertiary);
    pointer-events: none;
}

.register-edit-flag-red { color: #d7443e; }
.register-edit-flag-orange { color: #e07c1f; }
.register-edit-flag-yellow { color: #f0c429; }
.register-edit-flag-green { color: #63a524; }
.register-edit-flag-blue { color: #4a90d9; }
.register-edit-flag-purple { color: #9d5bc2; }

.register-edit-flag-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.register-amount-wrap {
    gap: 2px;
}

.register-amount-wrap .register-cell-amount {
    flex: 1 1 auto;
    min-width: 0;
}

.register-calculator-button {
    flex-basis: 18px;
    width: 18px;
}

.register-cell-input {
    width: 100%;
    height: 24px;
    box-sizing: border-box;
    background: var(--background-primary);
    border: 1px solid #545bfe;
    border-radius: 4px;
    padding: 2.8px 4.2px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--label-primary);
}

.register-cell-input:focus {
    outline: none;
}

.register-cell-amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.register-clear-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.register-clear-edit .uncleared-glyph,
.register-clear-edit .cleared-glyph,
.register-clear-edit .reconciled-glyph {
    color: var(--label-secondary);
}

.register-clear-edit .cleared-glyph {
    color: var(--action-primary);
}

.register-edit-actions td {
    height: 36px;
    padding: 0.35rem 0.6rem;
    background: var(--table-hover);
    border-bottom: 1px solid var(--border);
}

.register-edit-actions-buttons {
    float: right;
    display: inline-flex;
    gap: 0.5rem;
}

.register-edit-actions .btn {
    min-height: 24px;
    padding: 3px 16px;
    border-radius: 8px;
}

.register-edit-actions .btn-outline {
    border-color: #545bfe;
    color: #545bfe;
}

.register-edit-actions .btn-primary {
    border-color: #545bfe;
    background: #545bfe;
}

.register-edit-error {
    color: var(--negative-text);
    font-size: 0.85rem;
}

/* Combobox in de edit-rij: input lijkt op de cel-input, de popover hangt
   aan position:fixed (via bucketsRegisterEdit.position) zodat de table-wrap
   hem niet afknipt. */
.register-combobox {
    position: relative;
}

.register-combobox-input {
    width: 100%;
    height: 24px;
    box-sizing: border-box;
    background: var(--background-primary);
    border: 1px solid #545bfe;
    border-radius: 4px;
    padding: 2.8px 16px 2.8px 4.2px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--label-primary);
}

.register-combobox-input:focus {
    outline: none;
}

.register-combobox-input:disabled {
    border-color: var(--border);
    color: var(--label-secondary);
    background: transparent;
}

.register-combobox-pop {
    position: fixed;
    z-index: 25;
    max-height: 320px;
    overflow-y: auto;
    background: var(--background-primary-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    padding: 0.25rem 0;
}

.register-combobox-group {
    padding: 0.45rem 0.75rem 0.2rem;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--label-secondary);
}

.register-combobox-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.3rem 0.75rem;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--label-primary);
    cursor: pointer;
}

.register-combobox-option.grouped {
    padding-left: 1.5rem;
}

.register-combobox-option:hover,
.register-combobox-option.highlight {
    background: var(--table-hover);
}

.register-combobox-option.emphasized {
    font-weight: 400;
}

.register-combobox-option.create {
    color: #545bfe;
    font-weight: 600;
}

.register-combobox-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.register-combobox-option-balance {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: var(--label-secondary);
    font-variant-numeric: tabular-nums;
}

.register-combobox-empty {
    padding: 0.6rem 0.75rem;
    font-size: 0.88rem;
    color: var(--label-secondary);
}

/* ---- Split-editor: sub-rijen onder de edit-rij ---- */

.register-split-row td {
    background: var(--table-hover);
    padding: 0.15rem 0.3rem;
    border-top: 1px dashed var(--border);
}

.register-split-row .register-cell-input {
    background: var(--background-primary);
}

.register-split-index {
    color: var(--label-secondary);
    font-size: 0.78rem;
    padding-left: 0.4rem;
}

.register-category-split {
    color: var(--label-secondary);
    font-style: italic;
    padding-left: 0.4rem;
}

.register-split-add td {
    background: var(--table-hover);
    padding: 0.35rem 0.6rem;
    border-top: 1px dashed var(--border);
}

.register-split-add-btn {
    background: none;
    border: none;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--action-primary);
    cursor: pointer;
    padding: 0.1rem 0.3rem;
}

.register-split-add-btn:hover {
    text-decoration: underline;
}

.register-split-remaining {
    margin-left: 1rem;
    font-size: 0.82rem;
    color: var(--label-secondary);
    font-variant-numeric: tabular-nums;
}

.register-split-remaining.neg {
    color: var(--negative-text);
    font-weight: 600;
}

.register-split-remove {
    background: none;
    border: none;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--label-secondary);
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.register-split-remove:hover {
    background: var(--table-hover);
    color: var(--negative-text);
}

/* ---- Bulk-balk (zwevend onderin, YNAB-stijl) ---- */

.register-bulk-bar {
    position: fixed;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #24272c;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 0.45rem 0.6rem;
}

.register-bulk-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.register-bulk-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.register-bulk-count {
    font-size: 0.88rem;
    font-weight: 600;
    padding-right: 0.25rem;
}

.register-bulk-sep {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.22);
    margin: 0.15rem 0.25rem;
}

.register-bulk-action {
    background: none;
    border: none;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
}

.register-bulk-action:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* Bulk-popover (Categorize / More / Flag / Memo) boven de balk */

.register-bulk-popover {
    position: fixed;
    bottom: 5.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    min-width: 300px;
    max-height: 46vh;
    overflow-y: auto;
    background: var(--background-primary-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
    padding: 0.4rem 0;
}

.register-bulk-popover-title {
    padding: 0.35rem 0.9rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--label-secondary);
}

.register-bulk-menu-group {
    padding: 0.35rem 0.9rem 0.15rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--label-secondary);
}

.register-bulk-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.35rem 0.9rem;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    color: var(--label-primary);
    cursor: pointer;
}

.register-bulk-menu-item:hover {
    background: var(--table-hover);
}

.register-bulk-menu-item.register-bulk-danger {
    color: var(--negative-text);
}

.register-bulk-menu-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.register-bulk-menu-balance {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: var(--label-secondary);
    font-variant-numeric: tabular-nums;
}

.register-bulk-caret {
    color: var(--label-secondary);
    margin-left: auto;
}

.register-context-menu {
    position: fixed;
    z-index: 30;
    min-width: 200px;
    background: var(--background-primary-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
    padding: 0.4rem 0;
}

.register-flag-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    margin-right: 0.4rem;
    border: 1px solid var(--border);
}

.register-flag-swatch-none {
    background: transparent;
}

.register-flag-swatch-red {
    background: #d64545;
}

.register-flag-swatch-orange {
    background: #e8833a;
}

.register-flag-swatch-yellow {
    background: #ecb22e;
}

.register-flag-swatch-green {
    background: #3fae53;
}

.register-flag-swatch-blue {
    background: #3f7fd6;
}

.register-flag-swatch-purple {
    background: #8452d1;
}

.register-bulk-memo-input {
    width: calc(100% - 1.8rem);
    margin: 0.2rem 0.9rem;
    box-sizing: border-box;
    background: var(--background-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    font: inherit;
    font-size: 0.88rem;
    color: var(--label-primary);
}

.register-bulk-memo-input:focus {
    outline: 2px solid var(--action-primary);
    outline-offset: -1px;
}

.register-bulk-memo-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem 0.4rem;
}

/* ---- Datepicker in de edit-rij (kalender + Repeat-selector) ---- */

.register-date-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.register-date-wrap .register-cell-input {
    flex: 1 1 auto;
    min-width: 0;
}

.register-date-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.2rem;
    color: var(--label-secondary);
    cursor: pointer;
}

.register-date-toggle:hover {
    color: var(--label-primary);
}

.register-datepicker {
    position: fixed;
    z-index: 25;
    width: 240px;
    background: var(--background-primary-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    padding: 0.6rem 0.7rem 0.7rem;
}

.register-datepicker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.register-datepicker-month {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--label-primary);
}

.register-datepicker-nav {
    background: none;
    border: none;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    color: var(--label-secondary);
    cursor: pointer;
    border-radius: 4px;
}

.register-datepicker-nav:hover {
    background: var(--table-hover);
    color: var(--label-primary);
}

.register-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 0.15rem;
}

.register-datepicker-weekday {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--label-secondary);
}

.register-datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}

.register-datepicker-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    background: none;
    border: none;
    border-radius: 50%;
    font: inherit;
    font-size: 0.8rem;
    color: var(--label-primary);
    cursor: pointer;
}

.register-datepicker-day:hover {
    background: var(--table-hover);
}

.register-datepicker-day.selected {
    background: var(--action-primary);
    color: #fff;
    font-weight: 600;
}

.register-datepicker-day.today:not(.selected) {
    border: 1px solid var(--action-primary);
}

.register-datepicker-empty {
    cursor: default;
}

.register-datepicker-today {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border);
    margin-top: 0.4rem;
    padding-top: 0.35rem;
}

.register-datepicker-today-btn {
    background: none;
    border: none;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--action-primary);
    cursor: pointer;
    padding: 0.1rem 0.5rem;
}

.register-datepicker-today-btn:hover {
    text-decoration: underline;
}

.register-datepicker-repeat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid var(--border);
    margin-top: 0.3rem;
    padding-top: 0.45rem;
}

.register-datepicker-repeat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--label-secondary);
}

.register-datepicker-repeat-select {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--background-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.18rem 0.3rem;
    font: inherit;
    font-size: 0.8rem;
    color: var(--label-primary);
}

/* ============================================================
   Accounts & Dashboard cards
   ============================================================ */

.accounts-card,
.plans-card {
    background: var(--background-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.account-row,
.plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.account-row:hover,
.plan-row:hover {
    background: var(--table-hover);
}

.account-row:last-child,
.plan-row:last-child {
    border-bottom: none;
}

.account-row-name,
.plan-row-name {
    font-weight: 600;
    color: var(--label-primary);
}

.account-row-type,
.plan-row-meta {
    font-size: 0.8rem;
    color: var(--label-secondary);
    margin-top: 0.15rem;
}

.account-row-balance {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--label-primary);
    font-variant-numeric: tabular-nums;
}

.account-row-balance.neg {
    color: var(--negative-text);
}

.plan-row-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Accounts overview table ---- */

.accounts-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.accounts-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.accounts-show-closed {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--label-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
}

.accounts-overview-scroll {
    overflow-x: auto;
}

.accounts-overview-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.9rem;
}

.accounts-overview-table th,
.accounts-overview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.accounts-overview-table thead th {
    background: var(--table-row-master);
    color: var(--label-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.accounts-overview-table tbody tr:hover td {
    background: var(--table-hover);
}

.accounts-overview-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.accounts-overview-table .num.neg {
    color: var(--negative-text);
}

.accounts-group-row td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--table-row-master);
    font-weight: 600;
    color: var(--label-primary);
    cursor: default;
}

.accounts-overview-table tbody tr.accounts-group-row:hover td {
    background: var(--table-row-master);
}

.accounts-group-total {
    font-variant-numeric: tabular-nums;
}

.accounts-account-link {
    color: var(--label-primary);
    font-weight: 600;
    text-decoration: none;
}

.accounts-account-link:hover {
    color: var(--action-primary);
    text-decoration: underline;
}

.accounts-edit-col {
    width: 36px;
    text-align: right;
}

.accounts-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--label-tertiary);
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
}

.accounts-edit-btn:hover {
    color: var(--label-primary);
    background: var(--table-hover);
}

.accounts-edit-btn svg {
    display: block;
}

.accounts-total-row td {
    background: var(--table-row);
    border-top: 2px solid var(--border);
    font-weight: 700;
    color: var(--label-primary);
}

.accounts-overview-table tbody tr.accounts-total-row:hover td {
    background: var(--table-row);
}

/* Legacy table */
.table,
.ynab-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td,
.ynab-table th,
.ynab-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table th,
.ynab-table th {
    background: transparent;
    font-weight: 600;
    color: var(--label-secondary);
}

.table .num,
.ynab-table .num,
.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table tbody tr:hover,
.ynab-table tbody tr:hover {
    background: var(--table-hover);
}

.ynab-table tbody tr.sub-row:hover td {
    background: var(--table-hover);
}

.master-row td {
    background: var(--table-row-master);
    font-weight: 700;
    color: var(--label-primary);
}

.sub-row td {
    background: var(--table-row);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.card {
    background: var(--background-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.card-label {
    font-size: 0.75rem;
    color: var(--label-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--label-primary);
    font-variant-numeric: tabular-nums;
}

.breadcrumb {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.breadcrumb a,
.back {
    color: var(--action-primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.breadcrumb a:hover,
.back:hover {
    text-decoration: underline;
}

/* ============================================================
   Modal (YNAB)
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--scrim-default);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    outline: none;
}

.modal {
    background: var(--background-primary-elevated);
    border-radius: 6px;
    box-shadow: var(--modal-shadow);
    padding: 1.2rem 1.3rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-head,
.assign-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--label-primary);
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--label-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--label-primary);
    background: var(--table-hover);
}

.budget-history-modal {
    max-width: 560px;
    padding: 0;
    overflow: hidden;
}

.budget-history-head {
    margin: 0;
    padding: 1rem 1.15rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.budget-history-subtitle {
    margin: 0.15rem 0 0;
    color: var(--label-secondary);
    font-size: 0.8rem;
}

.budget-history-list {
    max-height: min(55vh, 440px);
    overflow-y: auto;
}

.budget-history-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 54px;
    padding: 0.65rem 1.15rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--label-primary);
    font: inherit;
    text-align: left;
}

button.budget-history-row {
    cursor: pointer;
}

button.budget-history-row:hover,
button.budget-history-row:focus-visible {
    background: var(--table-hover);
    outline: none;
}

.budget-history-row.is-adjustment {
    background: var(--table-row-master);
}

.budget-history-date,
.budget-history-description small {
    color: var(--label-secondary);
    font-size: 0.78rem;
}

.budget-history-description {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.budget-history-description strong,
.budget-history-description small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.budget-history-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.budget-history-state {
    margin: 0;
    padding: 2rem 1.15rem;
    color: var(--label-secondary);
    text-align: center;
}

.budget-history-total {
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    background: var(--table-row-master);
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

.register-row-deep-linked {
    animation: register-deep-link-highlight 2.4s ease-out;
    outline: none;
}

@keyframes register-deep-link-highlight {
    0%, 30% { box-shadow: inset 0 0 0 999px rgba(59, 94, 218, 0.18); }
    100% { box-shadow: inset 0 0 0 999px rgba(59, 94, 218, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .register-row-deep-linked {
        animation: none;
        box-shadow: inset 3px 0 var(--action-primary);
    }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.file-import-modal {
    width: min(760px, calc(100vw - 32px));
    max-width: 760px;
    padding: 24px;
}

.file-import-intro {
    margin: 0 0 18px;
    color: var(--label-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.file-import-formats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.file-import-formats div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
}

.file-import-formats strong {
    color: var(--label-secondary);
    font-size: 12px;
}

.file-import-formats span,
.file-import-duplicates {
    color: var(--label-primary);
    font-size: 14px;
}

.file-import-duplicates {
    margin: 0 0 18px;
    line-height: 1.5;
}

.file-import-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--label-primary);
    font-size: 14px;
    cursor: pointer;
}

.file-import-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--action-primary);
}

.file-import-pre-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
}

.file-import-pre-actions a {
    color: var(--action-primary);
    font-size: 14px;
    font-weight: 600;
}

.file-import-picker {
    display: inline-block;
    cursor: pointer;
}

.file-import-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.file-import-picker:focus-within .btn {
    outline: 2px solid var(--action-primary);
    outline-offset: 2px;
}

.file-import-file-name {
    margin-left: 10px;
    color: var(--label-primary);
    font-size: 13px;
}

.file-import-hint {
    margin: 7px 0 0;
    color: var(--label-tertiary);
    font-size: 12px;
}

.file-import-mapping,
.file-import-account-mapping,
.file-import-preview {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.file-import-account-mapping > .file-import-preview-head {
    margin-bottom: 12px;
}

.file-import-account-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 40%);
    align-items: center;
    gap: 14px;
    padding: 8px 0;
    border-top: 1px solid var(--border-subtle);
}

.file-import-source-label {
    overflow-wrap: anywhere;
    color: var(--label-primary);
    font-size: 12px;
}

.file-import-account-choice select {
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--background-primary);
    color: var(--label-primary);
    font: inherit;
}

.file-import-mapping h3,
.file-import-preview h3 {
    margin: 0;
    color: var(--label-primary);
    font-size: 14px;
    font-weight: 700;
}

.file-import-mapping-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.file-import-mapping-grid label {
    display: grid;
    gap: 5px;
    color: var(--label-secondary);
    font-size: 12px;
    font-weight: 600;
}

.file-import-mapping-grid select {
    width: 100%;
    height: 34px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--background-primary);
    color: var(--label-primary);
    font: inherit;
}

.file-import-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.file-import-preview-head span {
    color: var(--label-tertiary);
    font-size: 12px;
    font-weight: 700;
}

.file-import-table-wrap {
    max-height: 300px;
    overflow: auto;
    border: 1px solid var(--border-subtle);
}

.file-import-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.file-import-table th,
.file-import-table td {
    padding: 7px 9px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-import-table th.select-row,
.file-import-table td.select-row {
    width: 36px;
    padding: 6px 8px;
    text-align: center;
}

.file-import-table .select-row input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--action-primary);
}

.file-import-table .file-import-row-skipped {
    color: var(--label-tertiary);
}

.file-import-table th {
    position: sticky;
    top: 0;
    background: var(--background-primary-elevated);
    color: var(--label-secondary);
    font-weight: 700;
}

.file-import-table .amount {
    text-align: right;
}

.file-import-table .amount.neg {
    color: var(--negative-text);
}

.file-import-rejected {
    margin-top: 12px;
    color: var(--status-negative, #b42318);
    font-size: 12px;
}

.file-import-rejected ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.file-import-actions {
    margin-top: 20px;
}

.file-import-success {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
}

.file-import-success p {
    margin: 4px 0 0;
    color: var(--label-secondary);
}

.file-import-success-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--status-positive, #2f855a);
    color: white;
    font-size: 22px;
    font-weight: 700;
}

@media (max-width: 680px) {
    .file-import-formats {
        grid-template-columns: 1fr;
    }

    .file-import-mapping-grid {
        grid-template-columns: 1fr 1fr;
    }

    .file-import-account-choice {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .file-import-file-name {
        display: block;
        margin: 9px 0 0;
    }
}

.reconcile-modal {
    width: min(440px, calc(100vw - 32px));
    padding: 28px;
}

.reconcile-question {
    margin: 0 0 0.8rem;
    color: var(--label-primary);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
}

.reconcile-question strong {
    white-space: nowrap;
}

.reconcile-help {
    color: var(--action-primary);
    font-size: 0.88rem;
    font-weight: 600;
}

.reconcile-actions {
    margin-top: 1.5rem;
}

.reconcile-balance-field {
    display: grid;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    color: var(--label-secondary);
    font-size: 0.82rem;
    font-weight: 600;
}

.reconcile-balance-field input {
    width: 100%;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    padding: 0.7rem 0.75rem;
    color: var(--label-primary);
    background: var(--background-primary);
    font: inherit;
    font-size: 1rem;
    text-align: right;
}

.reconcile-balance-field input:focus {
    border-color: var(--action-primary);
    outline: 2px solid rgba(59, 94, 218, 0.2);
}

.reconcile-difference {
    margin: 1rem 0;
    color: var(--label-primary);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

.reconcile-guidance,
.reconcile-success-copy {
    color: var(--label-secondary);
    line-height: 1.5;
}

.reconcile-success-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--positive-background);
    color: var(--positive-text);
    font-size: 1.5rem;
    font-weight: 700;
}

.reconcile-success-title,
.reconcile-success-copy {
    margin: 0;
    text-align: center;
}

.reconcile-success-title {
    color: var(--label-primary);
    font-size: 1.3rem;
}

@media (max-width: 720px) {
    .reconcile-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .reconcile-banner-actions {
        justify-content: flex-end;
    }
}

/* ---- Add/Edit Account modal ---- */

.account-modal {
    width: min(480px, calc(100vw - 32px));
    max-width: none;
    border-radius: 8px;
    padding: 18px 20px;
}

.account-modal-add {
    width: min(360px, calc(100vw - 32px));
}

.account-modal .modal-head {
    min-height: 32px;
    margin-bottom: 16px;
}

.account-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
}

.account-modal-step-head {
    display: grid;
    grid-template-columns: 48px 1fr 32px;
    text-align: center;
}

.account-modal-back {
    border: 0;
    background: transparent;
    color: var(--action-primary);
    padding: 0;
    font: 600 13px/32px inherit;
    cursor: pointer;
    text-align: left;
}

.account-modal-intro {
    margin: 0 0 18px;
    color: var(--label-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.account-bank-search label,
.account-modal-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--label-primary);
    font-size: 13px;
    font-weight: 600;
}

.account-bank-search input,
.account-modal-field input,
.account-type-select {
    width: 100%;
    height: 32px;
    box-sizing: border-box;
    font: 500 14px/1 inherit;
    letter-spacing: 0;
}

.account-bank-search input:disabled {
    color: var(--label-tertiary);
    background: var(--table-hover);
    cursor: not-allowed;
}

.account-unlinked-cta {
    width: 100%;
    height: 32px;
    margin-top: 20px;
}

.account-type-groups {
    display: grid;
    gap: 18px;
}

.account-type-group h4,
.account-modal-section-title,
.account-bank-connection h4 {
    margin: 0;
    color: var(--label-primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

.account-type-group p,
.account-bank-connection p {
    margin: 4px 0 9px;
    color: var(--label-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.account-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.account-type-option {
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--background-primary);
    color: var(--label-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.account-type-option:hover {
    background: var(--table-hover);
}

.account-type-option.selected {
    border-color: var(--action-primary);
    color: var(--action-primary);
    font-weight: 600;
}

.account-modal-field {
    max-width: none;
    margin-top: 14px;
}

.account-modal-field textarea {
    width: 100%;
    min-height: 64px;
    box-sizing: border-box;
    resize: vertical;
    font: 500 14px/1.4 inherit;
    letter-spacing: 0;
}

.account-type-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--background-primary);
    color: var(--label-primary);
    cursor: pointer;
}

.account-modal-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--label-tertiary);
}

.account-modal-section-title {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border-subtle);
}

.account-bank-connection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.account-bank-connection p {
    margin-bottom: 0;
}

.account-modal .btn {
    min-height: 32px;
}

.account-edit-actions {
    margin-top: 20px;
}

.account-actions-spacer {
    flex: 1;
}

.btn-danger-text {
    border: 0;
    background: transparent;
    color: var(--status-negative, #b42318);
    font-weight: 600;
    cursor: pointer;
}

.btn-danger-text:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.account-modal-error {
    margin: 12px 0 0;
}

/* ---- Assign modal ---- */

.segmented-control {
    display: inline-flex;
    background: var(--table-hover);
    border-radius: 6px;
    padding: 2px;
}

.segmented-btn {
    border: none;
    background: transparent;
    color: var(--label-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 5px 18px;
    border-radius: 5px;
    cursor: pointer;
}

.segmented-btn.active {
    background: var(--background-primary);
    color: var(--action-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

.assign-auto {
    margin-bottom: 0.75rem;
}

.assign-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--border);
}

.assign-option:last-child {
    border-bottom: none;
}

.assign-option-name {
    font-size: 14px;
    color: var(--label-primary);
}

.assign-option-amount {
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.assign-auto-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.assign-manually {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.assign-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--label-secondary);
}

.assign-select,
.assign-input-row {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--label-primary);
    background: var(--background-primary);
}

.assign-select:focus,
.assign-input-row:focus {
    outline: none;
    border-color: var(--action-primary);
    box-shadow: 0 0 0 3px rgba(59, 94, 218, 0.12);
}

.assign-manually-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.assign-message {
    margin: 0.6rem 0 0;
}

/* ---- Breakdown modal ---- */

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown-table td {
    padding: 0.45rem 0.25rem;
    font-size: 0.9rem;
    color: var(--label-primary);
    border-bottom: 1px solid var(--border);
}

.breakdown-table tr:last-child td {
    border-bottom: none;
}

.breakdown-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.breakdown-table .breakdown-total td {
    border-top: 1px solid var(--border);
    font-weight: 700;
    color: var(--label-primary);
}

/* ---- Category (goal) modal ---- */

.goal-fields {
    margin-bottom: 0.75rem;
}

.goal-value {
    font-size: 0.9rem;
    color: var(--label-primary);
    font-variant-numeric: tabular-nums;
}

.goal-edit {
    border-top: 1px solid var(--border);
    padding-top: 0.6rem;
}

/* ---- Danger button (verwijderen) ---- */

.btn-danger {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.18);
    color: var(--negative-text, #bf2e3b);
}

.btn-danger:hover {
    background: var(--negative-bg, #fce8e6);
    border-color: var(--negative-text, #bf2e3b);
    color: var(--negative-text, #bf2e3b);
}

/* ---- Group popup modal ---- */

.group-modal .field {
    margin-bottom: 0.75rem;
}

.group-actions,
.group-actions-danger,
.category-delete-action {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.group-actions {
    flex-wrap: wrap;
}

.group-actions-danger,
.category-delete-action {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.category-delete-action {
    justify-content: flex-start;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.topbar-email {
    color: var(--label-secondary);
    font-size: 0.85rem;
}

/* Mobile budget surface: keep the category-first YNAB flow usable without page overflow. */
.mobile-only,
.mobile-inspector-toggle {
    display: none;
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .layout {
        width: 100%;
        min-width: 0;
    }

    .content,
    .layout-content,
    .budget-screen,
    .budget-body,
    .budget-main {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .budget-header-flexbox {
        flex-wrap: wrap;
        border-bottom: 1px solid var(--border);
    }

    .budget-header-calendar {
        flex: 1 1 100%;
        min-height: 56px;
        padding: 4px 8px;
    }

    .budget-header-calendar-prev,
    .budget-header-calendar-next,
    .budget-header-calendar-date-button,
    .mobile-inspector-toggle,
    .budget-filter-btn,
    .to-be-budgeted-auto-assign {
        min-height: 44px;
    }

    .budget-header-calendar-date-button {
        font-size: 18px;
    }

    .budget-header-totals {
        flex: 1 1 auto;
        padding: 4px 8px 8px;
    }

    .budget-header-share {
        flex: 0 0 auto;
        padding: 4px 8px 8px;
    }

    .mobile-inspector-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-width: 92px;
        padding: 8px 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--background-primary);
        color: var(--action-primary);
        font-weight: 600;
        cursor: pointer;
    }

    .budget-toolbar-filters {
        gap: 4px;
        padding: 4px 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    .budget-filter-btn {
        flex: 0 0 auto;
        padding: 8px 10px;
    }

    .budget-toolbar {
        min-height: 48px;
        height: auto;
        padding-left: 4px;
    }

    .budget-toolbar-actions {
        display: none !important;
    }

    .budget-table {
        width: 100%;
        overflow: hidden;
    }

    .budget-table-cell-margin-left,
    .budget-table-cell-checkbox,
    .budget-table-cell-margin-right {
        display: none !important;
    }

    .budget-table-cell-collapse {
        width: 28px;
        flex: 0 0 28px;
    }

    .budget-table-cell-name {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        padding-left: 4px;
    }

    .budget-table-cell-budgeted,
    .budget-table-cell-activity,
    .budget-table-cell-available {
        flex: 0 0 19%;
        width: 19%;
        min-width: 0;
        padding-left: 2px;
        padding-right: 4px;
        font-size: 12px !important;
    }

    .budget-table-header-labels .budget-table-cell-name,
    .budget-table-header-labels .budget-table-cell-budgeted,
    .budget-table-header-labels .budget-table-cell-activity,
    .budget-table-header-labels .budget-table-cell-available {
        font-size: 10px;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .budget-table-row {
        min-height: 52px;
    }

    .budget-table-row.is-master-category {
        min-height: 48px;
    }

    .budget-table-cell-name,
    .budget-table-cell-name button,
    .budget-table-cell-button {
        min-height: 44px;
    }

    .budget-table-cell-name button {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .assigned-cell-controls {
        justify-content: flex-end;
    }

    .assign-input.assign-readonly,
    .budget-activity-button,
    .ynab-new-budget-available-number,
    .assigned-history-button,
    .collapse-toggle,
    .collapse-all-toggle,
    .add-category-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .budget-inspector {
        position: fixed;
        inset: auto 0 0;
        z-index: 30;
        width: 100%;
        min-width: 0;
        max-height: min(82vh, 680px);
        padding: 16px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
        border-top: 1px solid var(--border);
        border-left: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 36px rgba(25, 24, 24, 0.2);
        transform: translateY(105%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.2s ease, visibility 0.2s ease;
    }

    .budget-inspector.is-mobile-open {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-only {
        display: inline-flex;
    }

    .inspector-close {
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    .inspector-head {
        min-height: 44px;
        margin-bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .budget-inspector {
        transition: none;
    }
}

/* Touch drag affordance: rows remain scrollable, while the handle owns the drag gesture. */
@media (max-width: 760px) and (pointer: coarse) {
    .budget-table-cell-drag-handle {
        display: flex !important;
        width: 28px;
        flex: 0 0 28px;
        align-items: center;
        justify-content: center;
    }

    .budget-table-cell-drag-handle .drag-handle {
        width: 20px;
        height: 28px;
        padding: 4px;
        touch-action: none;
    }

    .budget-table.is-touch [data-drag-payload] {
        touch-action: auto;
    }

    .budget-table.is-touch [data-drag-payload] .drag-handle {
        touch-action: none;
    }
}

/* At phone widths the month total and inspector control each get a full row. */
@media (max-width: 480px) {
    .content {
        flex: 1 1 0;
        width: calc(100% - 56px);
        min-width: 0;
    }

    .layout-content {
        width: 100%;
        min-width: 0;
    }

    .budget-header-totals,
    .budget-header-share {
        flex: 1 1 100%;
        width: 100%;
    }

    .budget-header-totals {
        justify-content: center;
        padding-bottom: 4px;
    }

    .budget-header-share {
        justify-content: stretch;
        padding: 4px 8px 8px;
    }

    .mobile-inspector-toggle {
        width: 100%;
    }
}

/* Bank connection settings */
.bank-settings-shell { width: 100%; min-height: 100vh; padding: clamp(24px, 4vw, 56px); background: #f8f6f2; }
.bank-settings-shell h1 { margin: 6px 0 4px; font-size: 32px; letter-spacing: -.025em; }
.bank-settings-shell h2 { margin: 0 0 8px; font-size: 21px; }
.bank-settings-shell p { color: var(--label-secondary); line-height: 1.5; }
.bank-settings-header { max-width: 1120px; margin: 0 auto 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.bank-back-link { color: var(--action-primary); font-weight: 650; text-decoration: none; }
.bank-settings-shell button, .bank-settings-shell input, .bank-settings-shell select { min-height: 42px; border-radius: 6px; }
.bank-settings-shell input:not([type=checkbox]):not([type=radio]), .bank-settings-shell select { width: 100%; padding: 9px 11px; color: var(--label-primary); background: #fff; border: 1px solid var(--input-border-active); font-size: 15px; }
.bank-settings-shell label:not(.bank-provider-option):not(.bank-confirm-check):not(.bank-account-choice) { display: block; margin: 18px 0 6px; font-weight: 650; }
.bank-settings-shell button { padding: 8px 15px; border: 1px solid #c9c6bf; background: #fff; color: #20204f; font-weight: 700; cursor: pointer; }
.bank-settings-shell button:hover:not(:disabled) { background: #efedff; border-color: #8c91e8; }
.bank-settings-shell button:focus-visible, .bank-settings-shell input:focus-visible, .bank-settings-shell select:focus-visible, .bank-back-link:focus-visible { outline: 3px solid #7d8df2; outline-offset: 2px; }
.bank-settings-shell button:disabled { cursor: not-allowed; opacity: .52; }
.bank-settings-shell .bank-primary { border-color: var(--action-primary); background: var(--action-primary); color: #fff; }
.bank-settings-shell .bank-primary:hover:not(:disabled) { border-color: #283fa8; background: #283fa8; }
.bank-live { min-height: 22px; max-width: 1120px; margin: 0 auto; color: #346011; font-weight: 650; }
.bank-alert, .bank-success { max-width: 1120px; margin: 10px auto 20px; padding: 12px 15px; border-radius: 6px; }
.bank-alert { color: #8a1f26; background: #feedeb; border: 1px solid #f2b9b4; }
.bank-success { margin: 18px 0; color: #346011; background: #e9f8d7; border: 1px solid #add87a; }
.bank-wizard, .bank-empty, .bank-connection-card { max-width: 820px; margin: 0 auto 20px; padding: clamp(22px, 4vw, 38px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 2px 10px rgba(25,24,24,.06); }
.bank-wizard-progress { margin-bottom: 28px; display: grid; grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 14px; color: var(--label-secondary); font-weight: 700; }
.bank-wizard-progress progress { width: 100%; height: 8px; accent-color: var(--action-primary); }
.bank-wizard fieldset { margin: 18px 0; padding: 0; border: 0; }
.bank-wizard legend { margin-bottom: 7px; font-weight: 700; }
.bank-provider-option, .bank-account-choice, .bank-confirm-check { display: flex; align-items: center; gap: 12px; }
.bank-provider-option { padding: 16px; border: 2px solid var(--action-primary); border-radius: 8px; background: #f4f3ff; }
.bank-provider-option span, .bank-account-choice span { display: grid; gap: 3px; }
.bank-provider-option small, .bank-account-choice small { color: var(--label-secondary); }
.bank-provider-option input, .bank-account-choice input, .bank-confirm-check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--action-primary); }
.bank-wizard-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.bank-mapping-table { margin-top: 20px; border-top: 1px solid var(--border); }
.bank-mapping-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr); align-items: center; gap: 20px; padding: 16px 4px; border-bottom: 1px solid var(--border); }
.bank-mapping-row label { margin: 0 !important; }
.bank-baseline-callout { margin: 20px 0; padding: 18px; border-left: 4px solid #e3ae00; border-radius: 4px; background: #fff6cf; }
.bank-baseline-callout p { margin-bottom: 0; }
.bank-confirm-check { align-items: flex-start; font-weight: 650; line-height: 1.45; }
.bank-review, .bank-sync-facts { display: grid; grid-template-columns: repeat(2, minmax(150px,1fr)); gap: 16px 32px; }
.bank-review div, .bank-sync-facts div { min-width: 0; }
.bank-review dt, .bank-sync-facts dt { color: var(--label-secondary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.bank-review dd, .bank-sync-facts dd { margin: 4px 0 0; font-weight: 650; }
.bank-connection-list { max-width: 1120px; margin: 0 auto; }
.bank-connection-card { max-width: none; }
.bank-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.bank-card-heading p { margin: 2px 0 0; }
.bank-draft-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.bank-draft-description { margin: 20px 0 0; padding: 14px 16px; border-radius: 7px; background: #f4f3ff; }
.bank-status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-weight: 700; color: #346011; background: #dcf5bf; }
.bank-status-attentionrequired { color: #7a5510; background: #fff0b4; }
.bank-status-disabled, .bank-status-revoked { color: #5b5754; background: #ebe8e2; }
.bank-status-pending { color: #32348c; background: #e6e5ff; }
.bank-sync-facts { margin: 24px 0; padding: 18px; border-radius: 7px; background: #f8f6f2; }
.bank-diagnostic { padding: 12px 14px; border-radius: 6px; color: #744e00 !important; background: #fff6cf; }
.bank-mapping-list { margin: 0 0 20px; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.bank-mapping-list li { display: flex; justify-content: space-between; gap: 20px; padding: 11px 2px; border-bottom: 1px solid var(--border); }
.bank-mapping-list li span:last-child { color: var(--label-secondary); text-align: right; }
.bank-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-settings-shell .bank-danger-link { margin-left: auto; color: var(--negative-text); }
.bank-disconnect-warning { margin-top: 18px; padding: 18px; border: 1px solid #eeaaa4; border-radius: 7px; background: #feedeb; }
.bank-disconnect-warning h3 { margin-top: 0; }
.bank-disconnect-warning button { margin-right: 8px; }
.bank-settings-shell .bank-danger { border-color: #a6222d; background: #a6222d; color: #fff; }
.bank-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; }

@media (max-width: 760px) {
    .bank-settings-shell { padding: 22px 16px 40px; }
    .bank-settings-header, .bank-card-heading { align-items: stretch; flex-direction: column; }
    .bank-settings-header .bank-primary, .bank-card-heading .bank-primary { width: 100%; }
    .bank-draft-actions { width: 100%; justify-content: stretch; }
    .bank-draft-actions button { flex: 1 1 150px; }
    .bank-wizard, .bank-empty, .bank-connection-card { padding: 20px 16px; }
    .bank-mapping-row, .bank-review, .bank-sync-facts { grid-template-columns: 1fr; }
    .bank-wizard-actions { flex-wrap: wrap; }
    .bank-wizard-actions button { flex: 1 1 120px; }
    .bank-card-actions button { flex: 1 1 150px; }
    .bank-settings-shell .bank-danger-link { margin-left: 0; }
    .bank-mapping-list li { flex-direction: column; gap: 3px; }
    .bank-mapping-list li span:last-child { text-align: left; }
}

/* Transaction duplicate matching */
.duplicate-suggestions {
    margin: 0 0 1rem;
    border: 1px solid #cbd5f7;
    border-radius: 7px;
    background: #f7f8ff;
}

.duplicate-suggestions-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
}

.duplicate-suggestions-heading.is-expanded {
    border-bottom: 1px solid #dbe3fa;
}

.duplicate-suggestions-toggle {
    flex: 0 0 auto;
    padding: 0.4rem 0.65rem;
    border: 1px solid #aebcf2;
    border-radius: 4px;
    background: #fff;
    color: var(--action-primary);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.duplicate-suggestions-toggle:hover,
.duplicate-suggestions-toggle:focus-visible {
    border-color: var(--action-primary);
    background: #eef1ff;
    outline: none;
}

.duplicate-suggestions-toggle:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--action-primary) 35%, transparent);
}

.duplicate-suggestions h2,
.duplicate-suggestions p {
    margin: 0;
}

.duplicate-suggestions h2 {
    color: var(--label-primary);
    font-size: 0.9rem;
}

.duplicate-suggestions p {
    margin-top: 0.2rem;
    color: var(--label-secondary);
    font-size: 0.8rem;
}

.duplicate-suggestions-list {
    max-height: min(24rem, 38vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.duplicate-suggestions-list > ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.duplicate-suggestions-list li + li {
    border-top: 1px solid #e0e6f8;
}

.duplicate-suggestion-item {
    padding: 0.7rem 1rem;
}

.duplicate-suggestion-imported {
    margin-bottom: 0.45rem;
}

.duplicate-suggestion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.5rem 0;
    border: 0;
    background: transparent;
    color: var(--label-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.duplicate-suggestion-choices {
    display: grid;
    gap: 0.35rem;
}

.duplicate-suggestion-choice-label {
    color: var(--label-secondary);
    font-size: 0.78rem;
}

.duplicate-suggestion-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #dbe3fa;
    border-radius: 4px;
    background: #fff;
    color: var(--label-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.duplicate-suggestion-choice:hover,
.duplicate-suggestion-choice:focus-visible {
    border-color: var(--action-primary);
    background: #eef1ff;
    outline: none;
}

.duplicate-suggestion:hover,
.duplicate-suggestion:focus-visible {
    background: #eef1ff;
    outline: none;
}

.duplicate-suggestion:focus-visible {
    box-shadow: inset 0 0 0 2px var(--action-primary);
}

.duplicate-suggestion-transactions {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
}

.duplicate-suggestion-transactions strong,
.duplicate-suggestion-transactions span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duplicate-suggestion-transactions span,
.duplicate-suggestion-match {
    color: var(--label-secondary);
    font-size: 0.78rem;
}

.duplicate-suggestion-review,
.register-match-status {
    border-radius: 999px;
    color: var(--action-primary);
    font-size: 0.76rem;
    font-weight: 700;
}

.duplicate-suggestion-review {
    padding: 0.3rem 0.5rem;
    background: #e3e8ff;
}

.register-match-status {
    margin-left: 0.4rem;
    padding: 0.14rem 0.4rem;
    border: 1px solid #bcc8f2;
    background: #f1f4ff;
    cursor: pointer;
}

.register-match-status:hover,
.register-match-status:focus-visible {
    background: #e3e8ff;
}

.transaction-match-modal {
    width: min(500px, calc(100vw - 32px));
    max-width: 500px;
}

.transaction-match-modal > p {
    color: var(--label-secondary);
    line-height: 1.45;
}

.transaction-match-details {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 0.6rem 1rem;
    margin: 1rem 0;
    padding: 0.85rem;
    border-radius: 5px;
    background: var(--table-row-master);
}

.transaction-match-details dt {
    color: var(--label-secondary);
    font-size: 0.8rem;
    font-weight: 700;
}

.transaction-match-details dd {
    min-width: 0;
    margin: 0;
    color: var(--label-primary);
    font-size: 0.86rem;
}

@media (max-width: 640px) {
    .duplicate-suggestion {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .duplicate-suggestion-review {
        grid-row: span 2;
    }

    .transaction-match-details {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .transaction-match-details dd + dt {
        margin-top: 0.55rem;
    }
}
