/* Accounts & Assets, simplified (accountssimplify, 2026-11-23; .automation/planning/accountssimplify/PLAN.md).
   Loaded after accounts-tool.css. Everything here is scoped to .acct-simple (the page's container), so the old
   rules in accounts-tool.css stay as they are for the popups and previews that share its classes.
   Colours: theme variables only. The four "what you own" colours are the section icons' own. */

.acct-simple {
    --acct-own-col: minmax(0, 0.8fr);
    --acct-amount-col: 232px;
    --acct-more-col: 36px;
    --acct-investment: var(--color-blue-6);
    --acct-cash: var(--color-green-5);
    --acct-asset: var(--color-amber-2);
    --acct-realEstate: var(--color-orange-2);
    --acct-line: var(--color-ui-card-divider);
}

/* ---------- Title row ---------- */
.acct-simple .acct-top {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.acct-simple .acct-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
}
.acct-simple .acct-title-text {
    flex: 1 1 420px;
    min-width: 0;
}
.acct-simple .acct-title-text .aa-title {
    margin: 0;
}
.acct-simple .acct-title-text .aa-subtitle {
    margin: 2px 0 0;
    max-width: 780px;
}
.acct-simple .acct-title-words {
    min-width: 0;
}
.acct-simple .acct-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}
.acct-simple .acct-share-label {
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-share .aa-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- Net worth card ---------- */
.acct-simple .acct-nw-card {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 36px;
    padding: 16px 24px 12px;
    background: var(--color-white-1);
    border: 1px solid var(--color-ui-card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}
.acct-simple .acct-nw-left {
    flex: 1 1 250px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.acct-simple .acct-nw-right {
    flex: 3 1 440px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.acct-simple .acct-nw-eyebrow {
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-nw-figure {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-nw-eq {
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-nw-card .ia-net-worth-excl {
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    gap: 8px;
}
.acct-simple .acct-nw-card .ia-net-worth-excl-value {
    margin-left: 0;
    font-weight: 700;
    color: var(--ui-text-primaryText);
}
/* The card's last line, full width (it stood in the left column, where it made the card taller). */
.acct-simple .acct-nw-progress {
    flex: 1 1 100%;
    padding-top: 8px;
    border-top: 1px solid var(--acct-line);
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-nw-progress a {
    color: var(--ui-text-linkText);
}
.acct-simple .acct-nw-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.acct-simple .acct-nw-line-label {
    font-weight: 600;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-nw-line-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-neg {
    color: var(--color-semantic-danger);
}
.acct-simple .acct-nw-bar,
.acct-simple .acct-bucket-bar {
    display: flex;
    gap: 2px;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-gray-100);
}
.acct-simple .acct-bucket-bar {
    height: 8px;
    border-radius: 4px;
}
.acct-simple .acct-seg,
.acct-simple .acct-bseg {
    flex: 0 1 0;
    min-width: 0;
    transition: flex-grow 0.3s ease;
}
.acct-simple .acct-seg--investment { background: var(--acct-investment); }
.acct-simple .acct-seg--cash { background: var(--acct-cash); }
.acct-simple .acct-seg--asset { background: var(--acct-asset); }
.acct-simple .acct-seg--realEstate { background: var(--acct-realEstate); }
.acct-simple .acct-bseg--preTax { background: var(--bucket-pre-tax); }
.acct-simple .acct-bseg--taxFree { background: var(--bucket-tax-free); }
.acct-simple .acct-bseg--taxable { background: var(--bucket-taxable); }
.acct-simple .acct-bseg--hsa { background: var(--bucket-hsa); }
.acct-simple .acct-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.acct-simple .acct-nw-key {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 0 28px;
}
.acct-simple .acct-key {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    padding: 2px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    color: var(--ui-text-primaryText);
    text-decoration: none;
}
.acct-simple .acct-key:hover,
.acct-simple .acct-key:focus-visible {
    background: var(--color-gray-100);
}
.acct-simple .acct-key-label {
    flex: 1 1 auto;
    min-width: 0;
}
.acct-simple .acct-key-amount {
    font-weight: 600;
}
.acct-simple .acct-key-pct {
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-nw-key .acct-key-pct {
    width: 38px;
    text-align: right;
}
.acct-simple .acct-nw-owe {
    padding-top: 6px;
    border-top: 1px solid var(--acct-line);
    align-items: center;
}
.acct-simple .acct-key--owe {
    flex: 1 1 auto;
    flex-wrap: wrap;
}
.acct-simple .acct-nw-owe-note {
    color: var(--ui-text-secondaryText);
}
/* ---------- "Your accounts" heading and the owner switch ---------- */
.acct-simple .acct-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 24px;
    margin-top: 20px;
}
.acct-simple .acct-list-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-list-hint {
    margin-top: 2px;
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-owner-filter[hidden],
.acct-simple .acct-filter-note[hidden] {
    display: none;
}
.acct-simple .acct-filter-note {
    margin-top: 8px;
    color: var(--ui-text-secondaryText);
}

/* ---------- Sections ---------- */
.acct-simple .acct-sec {
    padding: 0;
    scroll-margin-top: 16px;
}
.acct-simple .acct-sec.acct-flash {
    animation: acct-flash 1.4s ease;
}
@keyframes acct-flash {
    0% { box-shadow: 0 0 0 4px rgba(var(--color-blue-6-rgb), 0.35); }
    100% { box-shadow: 0 0 0 4px rgba(var(--color-blue-6-rgb), 0); }
}
.acct-simple .acct-sec > .ia-header {
    flex-wrap: wrap;
    margin: 0;
    padding: 14px 18px 14px 22px;
}
.acct-simple .acct-sec .ia-header-left {
    flex: 1 1 auto;
    min-width: 0;
}
.acct-simple .acct-sec .ia-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}
.acct-simple .acct-sec-count,
.acct-simple .acct-sec-extra {
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-sec-extra {
    padding-left: 12px;
    border-left: 1px solid var(--acct-line);
}
.acct-simple .acct-apy-value {
    font-weight: 600;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-apy-help {
    margin-left: 4px;
    cursor: pointer;
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-sec-total {
    font-size: 17px;
    font-weight: 700;
    color: var(--ui-text-primaryText);
    white-space: nowrap;
}
.acct-simple .acct-sec-total.acct-neg {
    color: var(--color-semantic-danger);
}
.acct-simple .acct-add {
    white-space: nowrap;
}

/* Bucket bar under the Investment Accounts header */
.acct-simple .acct-buckets {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 22px 16px;
}
.acct-simple .acct-buckets[hidden],
.acct-simple .acct-by-person[hidden],
.acct-simple .acct-bkey[hidden] {
    display: none;
}
.acct-simple .acct-bucket-key {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-bkey {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}
.acct-simple .acct-by-person {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 32px;
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-person strong {
    margin: 0 6px 0 4px;
    color: var(--ui-text-primaryText);
}

/* ---------- Tables ---------- */
.acct-simple .acct-sec .ia-table-card {
    overflow-x: auto;
    border-top: 1px solid var(--acct-line);
}
.acct-simple .acct-sec .ia-table-header,
.acct-simple .acct-sec .ia-row {
    min-width: 760px;
    padding-left: 22px;
    padding-right: 10px;
}
.acct-simple .acct-sec .ia-table-header {
    border: 0;
    border-bottom: 1px solid var(--acct-line);
    border-radius: 0;
    background: var(--color-gray-50);
    font-weight: 600;
    padding-top: 8px;
    padding-bottom: 8px;
    align-items: center;
}
.acct-simple .acct-sec .ia-row {
    padding-top: 7px;
    padding-bottom: 7px;
    background: transparent;
    border-top: 0;
    border-bottom: 0;   /* no line between rows (Steve 2026-11-24) */
}
.acct-simple .acct-sec [id$="TableBody"] > .ia-row:last-of-type {
    border-bottom: 0;
}
.acct-simple .acct-sec .ia-row:hover {
    background: var(--color-gray-50);
}
.acct-simple .acct-sec .ia-row.acct-row-editing,
.acct-simple .acct-sec .ia-row.acct-row-editing:hover {
    background: var(--color-brand-light);
}

.acct-simple .acct-grid--investment {
    grid-template-columns: minmax(0, 2.2fr) var(--acct-own-col) minmax(0, 1.1fr) minmax(0, 1.1fr) var(--acct-amount-col) var(--acct-more-col);
}
.acct-simple .acct-grid--cash {
    grid-template-columns: minmax(0, 2.4fr) var(--acct-own-col) minmax(0, 1fr) minmax(0, 1fr) var(--acct-amount-col) var(--acct-more-col);
}
.acct-simple .acct-grid--asset,
.acct-simple .acct-grid--liability {
    grid-template-columns: minmax(0, 2.4fr) var(--acct-own-col) minmax(0, 2fr) var(--acct-amount-col) var(--acct-more-col);
}
.acct-simple .acct-grid--realEstate,
.acct-simple .ia-table-header.re-grid.acct-grid--realEstate,
.acct-simple .ia-row.re-grid.acct-grid--realEstate {
    grid-template-columns: minmax(0, 2.4fr) var(--acct-own-col) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.1fr) var(--acct-more-col);
}

/* A long bucket name ("Inherited Pre-Tax") wraps inside its own column instead of running into Growth. */
.acct-simple .acct-sec .ia-bucket-pill {
    max-width: 100%;
    white-space: normal;
    border-radius: 14px;
    line-height: 1.2;
}

/* Owner column: gone when one person is picked, or the household has no spouse and nothing listed for one. */
.acct-simple[data-has-spouse="false"],
.acct-simple[data-owner-filter="primary"],
.acct-simple[data-owner-filter="spouse"] {
    --acct-own-col: 0px;
}
.acct-simple[data-has-spouse="false"] .acct-sec .ia-cell.owner,
.acct-simple[data-has-spouse="false"] .acct-th-owner,
.acct-simple[data-owner-filter="primary"] .acct-sec .ia-cell.owner,
.acct-simple[data-owner-filter="primary"] .acct-th-owner,
.acct-simple[data-owner-filter="spouse"] .acct-sec .ia-cell.owner,
.acct-simple[data-owner-filter="spouse"] .acct-th-owner {
    visibility: hidden;
    overflow: hidden;
    padding: 0;
    white-space: nowrap;
}
.acct-simple[data-owner-filter="primary"] .acct-sec .ia-row[data-order-owner="spouse"],
.acct-simple[data-owner-filter="spouse"] .acct-sec .ia-row[data-order-owner="primary"] {
    display: none;
}

/* Header cells: sort arrows show on hover (or when that column sorts the table) */
.acct-simple .acct-sec .ia-th-sortable .ia-sort-arrow {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.acct-simple .acct-sec .ia-th-sortable:hover .ia-sort-arrow,
.acct-simple .acct-sec .ia-th-sortable:focus-visible .ia-sort-arrow,
.acct-simple .acct-sec .ia-th-sortable.is-active .ia-sort-arrow {
    opacity: 1;
}
.acct-simple .acct-th-amount {
    text-align: right;
    justify-self: end;
    padding-right: 11px;
}

/* Name cell: grip, name, the type under it */
.acct-simple .acct-sec .ia-cell.name {
    font-size: 15px;
    font-weight: 500;
    color: var(--ui-text-primaryText);
    min-width: 0;
    overflow-wrap: anywhere;
}
.acct-simple .acct-grip {
    margin-right: 10px;
    font-size: 12px;
    color: var(--ui-text-secondaryText);
    opacity: 0.55;
}
.acct-simple .ia-row:hover .acct-grip {
    opacity: 1;
}
.acct-simple .ia-sub,
.acct-simple .acct-sec .ia-cell.name .inherited-account-info,
.acct-simple .acct-sec .ia-cell.name > div {
    padding-left: 20px;
}
.acct-simple .ia-sub {
    margin-top: 1px;
    font-weight: 400;
    color: var(--ui-text-secondaryText);
}
.acct-simple .acct-sec .ia-cell.owner {
    color: var(--ui-text-primaryText);
    overflow: hidden;
    text-overflow: ellipsis;
}
.acct-simple .acct-empty {
    padding: 16px 22px;
    color: var(--ui-text-secondaryText);
}

/* ---------- Balance: a plain number until it is clicked ---------- */
.acct-simple .acct-sec .ia-balance-cell {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.acct-simple .acct-re-value {
    text-align: right;
    padding-right: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-fixed-amount {
    padding: 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-edit-actions {
    display: none;
    flex: 1 1 100%;
    justify-content: flex-end;
    gap: 6px;
}
.acct-simple .acct-edit-btn {
    min-height: 30px;
    padding: 2px 12px;
}
.acct-simple .acct-editable .ia-slider-placeholder {
    flex: 1 1 100%;
}
.acct-simple .acct-editable .account-balance-slider {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: 100% !important;
}
.acct-simple .acct-editable:not(.is-editing) .account-balance-slider .slider-control,
.acct-simple .acct-editable:not(.is-editing) .account-balance-slider .spinner-buttons,
.acct-simple .acct-editable:not(.is-editing) .slider-clamp-note {
    display: none !important;
}
.acct-simple .acct-editable .account-balance-slider .slider-input {
    order: 1;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    display: flex;
    align-items: center;
    gap: 4px;
}
.acct-simple .acct-editable .account-balance-slider .slider-input input[type="text"] {
    flex: 0 0 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: none !important;
    height: 36px;
    text-align: right;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-variant-numeric: tabular-nums;
    color: var(--ui-text-primaryText);
    border-radius: 8px;
    cursor: text;
}
.acct-simple .acct-editable:not(.is-editing) .account-balance-slider .slider-input input[type="text"] {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}
.acct-simple .acct-editable:not(.is-editing) .account-balance-slider .slider-input input[type="text"]:hover {
    border-color: var(--ui-borders-borderDefault) !important;
    background: var(--color-white-1) !important;
}
.acct-simple .acct-editable.is-editing .account-balance-slider .slider-input input[type="text"] {
    border-color: var(--ui-text-linkText) !important;
    background: var(--color-white-1) !important;
    box-shadow: 0 0 0 3px rgba(var(--color-blue-6-rgb), 0.16) !important;
}
.acct-simple .acct-editable.is-editing .account-balance-slider .slider-control {
    order: 2;
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 4px 0 2px !important;
}
.acct-simple .acct-editable.is-editing .acct-edit-actions {
    display: flex;
}

/* ---------- Row "more" menu and the Add menu ---------- */
.acct-simple .acct-actions,
.acct-simple .ia-row:hover .acct-actions {
    justify-content: flex-end;
    position: relative;
    opacity: 1;
    visibility: visible;
    margin: 0;
    padding: 0;
}
.acct-simple .acct-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ui-text-secondaryText);
    cursor: pointer;
}
.acct-simple .acct-more:hover,
.acct-simple .acct-more[aria-expanded="true"] {
    background: var(--color-gray-100);
    color: var(--ui-text-primaryText);
}
.acct-simple .acct-more:focus-visible {
    outline: 2px solid var(--ui-text-linkText);
    outline-offset: 2px;
}
.acct-menu[hidden] {
    display: none;
}
.acct-menu.is-open,
.acct-menu.acct-menu--add {
    position: fixed;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    min-width: 170px;
    max-width: 320px;
    padding: 6px;
    background: var(--ui-backgrounds-cardBg, var(--color-white-1));
    border: 1px solid var(--color-ui-card-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(var(--color-ui-shadow-rgb), 0.22);
}
.acct-menu .ia-action-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 38px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    font-size: 14px;
    text-align: left;
    color: var(--ui-text-primaryText);
    cursor: pointer;
}
.acct-menu .ia-action-btn i {
    width: 16px;
    text-align: center;
    color: var(--ui-text-secondaryText);
}
.acct-menu .ia-action-btn:hover:not([disabled]),
.acct-menu .ia-action-btn:focus-visible {
    background: var(--color-gray-100);
    outline: none;
}
.acct-menu .ia-action-btn.delete,
.acct-menu .ia-action-btn.delete i {
    color: var(--color-semantic-danger);
}
.acct-menu .ia-action-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}
.acct-menu-label {
    white-space: normal;
}

/* ---------- Narrow ---------- */
@media (max-width: 720px) {
    .acct-simple .acct-nw-card {
        padding: 18px 16px;
    }
    .acct-simple .acct-nw-figure {
        font-size: 32px;
    }
    .acct-simple .acct-sec > .ia-header {
        padding: 12px 14px;
    }
    .acct-simple .acct-buckets {
        padding: 0 14px 14px;
    }
    .acct-simple .acct-sec .ia-table-header,
    .acct-simple .acct-sec .ia-row {
        padding-left: 14px;
    }
}

/* ---------- No column headers (Steve 2026-11-24) ---------- */
/* The header rows stay in the page (their markup is the tables' grid and the sort module's hook) but are not shown;
   a figure that needs a word carries it (.acct-unit). */
.acct-simple .acct-sec .ia-table-header {
    display: none;
}
.acct-simple .acct-unit {
    color: var(--ui-text-secondaryText);
    font-weight: 400;
    font-size: var(--text-small, 14px);
}

/* ---------- "Who is this account for?" (Steve 2026-11-24) ---------- */
/* The house popup, small: one card per person. Lives on <body>, so its rules start at .acct-menu-who. */
.acct-menu-who.main-popup {
    max-width: 440px;
}
.acct-menu-who .main-popup-title {
    font-size: 20px;
    white-space: nowrap;
}
.acct-menu-who-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}
.acct-menu-who-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--ui-borders-borderDefault);
    border-radius: 12px;
    background: var(--ui-backgrounds-cardBg);
    color: var(--ui-text-primaryText);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}
.acct-menu-who-btn:hover,
.acct-menu-who-btn:focus-visible {
    border-color: var(--ui-text-linkText);
    background: rgba(var(--color-blue-6-rgb), 0.06);
    outline: none;
}
.acct-menu-who-btn:active {
    transform: scale(0.99);
}
.acct-menu-who-badge {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ui-text-linkText);
    color: var(--ui-backgrounds-cardBg);
    font-weight: 700;
}
.acct-menu-who-badge--spouse {
    background: var(--color-teal-3);
}
.acct-menu-who-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.acct-menu-who-arrow {
    flex: none;
    color: var(--ui-text-secondaryText);
}

/* ---------- A loan's payment and the plan's budget (respondtomanny round 25, 2026-11-25) ---------- */
/* The line under a loan's payment (filled by fillBudgetSyncBadges): "Synced to budget: ..." or, when the plan's budget
   does not carry the payment, "Not in your budget" and one button that adds it. The home rows' mortgage cell carries
   the same line (both tables are inside .acct-simple). */
.acct-simple .acct-budget-line {
    margin-top: 2px;
    color: var(--ui-text-linkText);
    white-space: normal;
}
.acct-simple .re-budget-sync-badge .budget-gap {
    color: var(--color-semantic-warning-deep);
    font-weight: 500;
}
.acct-simple .re-budget-sync-badge .budget-gap i {
    color: var(--color-semantic-warning);
}
.acct-simple .re-budget-sync-badge .budget-gap-add {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ui-text-linkText);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.acct-simple .re-budget-sync-badge .budget-gap-add:disabled {
    opacity: 0.55;
    cursor: default;
}
