/* Income & Benefits: planning-value hierarchy and vesting timeline */
.income-benefits-root {
    gap: 0;
    color: var(--book-ink);
    font-family: var(--font-ui);
}

.income-planning-masthead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 270px);
    gap: 30px;
    padding: 28px 4px 30px;
    border-bottom: 1px solid var(--book-line);
}

.income-masthead-main {
    min-width: 0;
}

.income-masthead-value {
    display: block;
    margin-top: 8px;
    color: var(--book-green);
    font-family: var(--font-display);
    font-size: clamp(44px, 6vw, 68px);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.income-masthead-caption {
    max-width: 62ch;
    margin: 10px 0 0;
    color: var(--book-muted);
    font-size: 12px;
    line-height: 1.5;
}

.income-composition-bar {
    display: flex;
    height: 34px;
    margin-top: 24px;
    overflow: hidden;
    border: 1px solid var(--book-line);
    background: var(--book-panel);
}

.income-composition-bar > span {
    display: flex;
    flex: var(--income-segment) 1 0;
    align-items: center;
    min-width: 4px;
    overflow: hidden;
    padding: 0 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.7);
}

.income-composition-bar > span:last-child {
    border-right: 0;
}

.income-composition-bar > span.salary,
.income-composition-legend i.salary {
    background: #b9cbb9;
}

.income-composition-bar > span.bonus,
.income-composition-legend i.bonus {
    background: #d7e0d4;
}

.income-composition-bar > span.equity,
.income-composition-legend i.equity {
    background: #e8dcbf;
}

.income-composition-bar > span.other,
.income-composition-legend i.other {
    background: #ded5c8;
}

.income-composition-bar em {
    overflow: hidden;
    color: var(--book-ink);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.income-composition-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    margin-top: 14px;
}

.income-composition-legend > span {
    display: grid;
    grid-template-columns: 9px auto;
    gap: 2px 7px;
    align-items: center;
    min-width: 132px;
}

.income-composition-legend i {
    grid-row: 1 / span 3;
    width: 9px;
    height: 9px;
    border: 1px solid rgba(23, 23, 22, 0.08);
}

.income-composition-legend em {
    color: var(--book-muted);
    font-size: 9px;
    font-style: normal;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.income-composition-legend strong {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.income-composition-legend small {
    color: var(--book-dim);
    font-size: 10px;
    line-height: 1.35;
}

.income-masthead-empty {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--book-line);
    color: var(--book-muted);
    font-size: 12px;
}

.income-tax-rail {
    display: grid;
    align-content: start;
    gap: 0;
    padding-left: 26px;
    border-left: 1px solid var(--book-line);
}

.income-tax-rail > div {
    display: grid;
    gap: 4px;
    padding: 0 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(216, 205, 187, 0.62);
}

.income-tax-rail > div > strong {
    color: var(--book-ink);
    font-family: var(--font-display);
    font-size: 23px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.income-tax-rail > div > strong.tax-deduction {
    color: var(--book-red);
}

.income-tax-rail > div > strong.tax-net {
    color: var(--book-green);
}

.income-tax-rail > div > span {
    color: var(--book-muted);
    font-size: 10px;
    line-height: 1.4;
}

.income-tax-rail.attention {
    border-left-color: var(--book-gold);
}

.income-benefits-workbench {
    gap: 0;
}

.income-benefits-workbench > .employment-register-panel {
    margin-top: 0;
    border: 0;
    border-bottom: 1px solid var(--book-line);
    background: transparent;
    box-shadow: none;
}

.income-benefits-workbench > .employment-register-panel > .panel-heading,
.stock-vesting-portfolio > .panel-heading {
    padding: 34px 4px 18px;
    border: 0;
    background: transparent;
}

.income-person-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 4px 36px;
}

.income-person-card {
    border-color: var(--book-line);
    background: var(--book-panel);
    box-shadow: 0 1px 2px rgba(54, 43, 29, 0.04);
}

.income-person-card > header {
    padding: 15px 18px;
    border-bottom-color: rgba(216, 205, 187, 0.65);
    background: transparent;
}

.income-person-card > header h3 {
    font-family: var(--font-display);
    font-size: 18px;
}

.income-person-card > header > span strong {
    color: var(--book-green);
    font-family: var(--font-display);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.income-person-empty-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 56px;
    padding: 13px 18px;
    border: 1px dashed var(--book-line-strong);
    background: transparent;
}

.income-person-empty-card > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.income-person-empty-card h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 16px;
}

.income-person-empty-card span {
    color: var(--book-muted);
    font-size: 11px;
}

.income-person-card .employment-card {
    gap: 0;
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(216, 205, 187, 0.78);
    background: #fffdf8;
}

.income-person-card .employment-card-heading {
    padding: 14px 16px;
}

.employment-card-total strong {
    font-family: var(--font-display);
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.employment-compensation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(216, 205, 187, 0.65);
}

.employment-compensation-grid > span {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 82px;
    padding: 14px 16px;
    border-right: 1px solid rgba(216, 205, 187, 0.55);
}

.employment-compensation-grid > span:last-child {
    border-right: 0;
}

.employment-compensation-grid em,
.employment-compensation-grid small,
.employment-workplace-row em {
    color: var(--book-muted);
    font-size: 9px;
    font-style: normal;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.employment-compensation-grid strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.employment-compensation-grid small {
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

.employment-workplace-row {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(216, 205, 187, 0.65);
    background: var(--book-panel-soft);
}

.employment-benefit-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.employment-benefit-heading > div:first-child {
    display: grid;
    gap: 3px;
}

.employment-benefit-heading > div:first-child strong {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.employment-benefit-heading > div:first-child span {
    color: var(--book-muted);
    font-size: 10px;
}

.employment-benefit-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.employment-benefit-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(216, 205, 187, 0.78);
    border-radius: 5px;
    background: #fffdf8;
}

.employment-benefit-item > div {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.employment-benefit-item strong {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employment-benefit-item small,
.employment-benefit-empty {
    color: var(--book-muted);
    font-size: 9px;
    line-height: 1.35;
}

.employment-benefit-empty {
    padding: 4px 0;
}

.employment-benefit-overflow {
    display: grid;
    gap: 8px;
}

.employment-benefit-overflow > summary {
    width: fit-content;
    color: var(--book-gold);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    list-style: none;
    text-transform: uppercase;
}

.employment-benefit-overflow > summary::-webkit-details-marker {
    display: none;
}

.employment-benefit-overflow > summary::before {
    content: "+ ";
}

.employment-benefit-overflow[open] > summary::before {
    content: "− ";
}

.employment-benefit-overflow .when-open,
.employment-benefit-overflow[open] .when-closed {
    display: none;
}

.employment-benefit-overflow[open] .when-open {
    display: inline;
}

.benefit-catch-up-option {
    grid-column: 1 / -1;
    margin: 2px 0;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--book-line-strong) 72%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--book-paper) 86%, var(--book-panel));
}

.benefit-catch-up-option summary {
    cursor: pointer;
    color: var(--book-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.benefit-catch-up-option[open] summary {
    margin-bottom: 9px;
}

.benefit-catch-up-option label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
}

.benefit-catch-up-option input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.benefit-catch-up-option label span {
    display: grid;
    gap: 2px;
    color: var(--book-ink);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
}

.benefit-catch-up-option label em {
    color: var(--book-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
}

.stock-vesting-portfolio {
    gap: 0;
    padding-bottom: 36px;
    overflow: visible;
    border-bottom: 1px solid var(--book-line);
    background: transparent;
}

.stock-vesting-heading {
    align-items: end;
}

.stock-vesting-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.stock-quote-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.stock-quote-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid var(--book-line);
    background: var(--book-panel);
    color: var(--book-ink);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
}

.stock-quote-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--book-green);
}

.stock-quote-badge small {
    color: var(--book-muted);
    font-size: 9px;
    font-weight: 500;
}

.stock-quote-badge.recorded {
    color: var(--book-muted);
}

.stock-portfolio-summary {
    grid-template-columns: minmax(210px, 1.45fr) repeat(3, minmax(150px, 1fr));
    margin: 0 4px 12px;
    overflow: hidden;
    border: 1px solid var(--book-line);
    background: var(--book-panel);
}

.stock-portfolio-summary > span {
    min-height: 96px;
    padding: 14px 18px;
    background: transparent;
}

.stock-portfolio-summary > span.next {
    background: #edf2e9;
}

.stock-portfolio-summary strong {
    color: var(--book-ink);
    font-family: var(--font-display);
    font-size: 21px;
    font-variant-numeric: tabular-nums;
}

.stock-portfolio-summary > span.next strong {
    color: var(--book-green);
}

.stock-portfolio-summary small {
    color: var(--book-muted);
    font-size: 10px;
    line-height: 1.35;
}

.vesting-timeline {
    margin: 0 4px;
    padding: 16px 18px 4px;
    border: 1px solid var(--book-line);
    background: var(--book-panel);
    box-shadow: 0 2px 12px rgba(54, 43, 29, 0.045);
}

.vesting-chart-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--book-muted);
    font-size: 10px;
}

.vesting-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vesting-chart-legend i.realized {
    width: 15px;
    border-top: 2px solid var(--book-green);
}

.vesting-chart-legend i.projected {
    width: 15px;
    border-top: 2px solid var(--book-green);
    opacity: 0.58;
}

.vesting-chart-legend i.today {
    width: 15px;
    border-top: 1px dashed var(--book-red);
}

.vesting-chart-legend em {
    margin-left: auto;
    font-style: normal;
}

.vesting-timeline svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.vesting-gridline {
    stroke: rgba(216, 205, 187, 0.65);
    stroke-width: 1;
}

.vesting-axis-label,
.vesting-event-marker text {
    fill: var(--book-muted);
    font-family: var(--font-ui);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.vesting-area {
    fill: rgba(79, 109, 82, 0.1);
}

.vesting-step {
    fill: none;
    stroke: var(--book-green);
    stroke-linejoin: round;
    stroke-width: 2;
}

.vesting-step.projected {
    opacity: 0.72;
    stroke-dasharray: none;
}

.vesting-today-line {
    stroke: var(--book-red);
    stroke-dasharray: 4 4;
    stroke-width: 1.25;
}

.vesting-today-label {
    fill: var(--book-red);
    font-family: var(--font-ui);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.vesting-event-marker line {
    opacity: 0.22;
    stroke: var(--book-green);
    stroke-width: 1;
}

.vesting-event-marker circle {
    fill: var(--book-panel);
    stroke: var(--book-green);
    stroke-width: 2;
    transition: r 120ms ease, fill 120ms ease;
}

.vesting-event-marker.projected circle {
    opacity: 0.72;
}

.vesting-event-marker text.value {
    fill: var(--book-green);
    font-size: 10px;
    font-weight: 750;
}

.vesting-event-marker.is-linked-hover circle {
    r: 7px;
    fill: #e4ece1;
}

.vesting-timeline-empty {
    margin: 0 4px;
    padding: 16px;
    border: 1px dashed var(--book-line-strong);
    color: var(--book-muted);
    font-size: 11px;
}

.vesting-ledger {
    margin: 16px 4px 0;
    overflow: hidden;
    border: 1px solid var(--book-line);
    background: var(--book-panel);
}

.vesting-ledger-head,
.vesting-ledger-row {
    display: grid;
    grid-template-columns: 112px minmax(190px, 1fr) 76px 96px 104px 88px;
    gap: 14px;
    align-items: center;
}

.vesting-ledger-head {
    padding: 8px 16px;
    border-bottom: 1px solid var(--book-line);
    background: var(--book-panel-soft);
}

.vesting-ledger-head span {
    color: var(--book-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vesting-ledger-year > header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(216, 205, 187, 0.58);
    background: #edf2e9;
}

.vesting-ledger-year > header strong {
    font-family: var(--font-display);
    font-size: 15px;
}

.vesting-ledger-year > header span {
    color: var(--book-muted);
    font-size: 10px;
}

.vesting-ledger-row {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(216, 205, 187, 0.45);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    transition: background 120ms ease;
}

.vesting-ledger-row:last-child {
    border-bottom: 0;
}

.vesting-ledger-row .grant {
    font-weight: 700;
}

.vesting-ledger-row .right,
.vesting-ledger-head .right {
    text-align: right;
}

.vesting-ledger-row em {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid var(--book-line);
    color: var(--book-muted);
    font-size: 9px;
    font-style: normal;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.vesting-ledger-row.next em {
    border-color: #a9bca8;
    background: #e4ece1;
    color: var(--book-green);
}

.vesting-ledger-row.is-linked-hover {
    background: #f0f4ec;
}

.vesting-ledger-year.unscheduled > header {
    background: #f5efe5;
}

.vesting-concentration {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    margin: 12px 4px 0;
    padding: 13px 16px;
    border: 1px solid rgba(169, 82, 67, 0.32);
    background: rgba(169, 82, 67, 0.08);
}

.vesting-concentration > span {
    padding-top: 2px;
    color: var(--book-red);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vesting-concentration p {
    margin: 0;
    color: #654238;
    font-size: 11px;
    line-height: 1.55;
}

.vesting-concentration p strong {
    color: #49312a;
}

.income-planning-tail {
    gap: 28px;
    padding: 34px 4px 0;
}

.income-planning-tail > .income-compact-panel {
    border: 0;
    border-top: 1px solid var(--book-line);
    background: transparent;
    box-shadow: none;
}

.income-planning-tail > .income-compact-panel > .panel-heading {
    padding: 18px 0 12px;
    border: 0;
    background: transparent;
}

.income-planning-tail .additional-income-list,
.income-planning-tail .tax-summary-readonly {
    padding-right: 0;
    padding-left: 0;
}

.income-planning-tail .compact-panel-actions {
    padding-right: 0;
    padding-left: 0;
}

.tax-planning-panel {
    position: relative;
    padding-left: 12px;
    border-left: 3px solid var(--book-green) !important;
}

.tax-planning-panel.tax-confidence-open,
.tax-planning-panel.tax-confidence-review {
    border-left-color: var(--book-gold) !important;
}

.tax-confidence-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 7px;
    border: 1px solid var(--book-line);
    color: var(--book-green);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tax-confidence-open .tax-confidence-status,
.tax-confidence-review .tax-confidence-status {
    border-color: rgba(122, 84, 30, 0.35);
    color: var(--book-gold);
}

.tax-setup-message.review {
    border-color: rgba(122, 84, 30, 0.25);
    background: rgba(122, 84, 30, 0.06);
}

@media (max-width: 1100px) {
    .income-planning-masthead {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .income-tax-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        padding: 20px 0 0;
        border-top: 1px solid var(--book-line);
        border-left: 0;
    }

    .income-tax-rail > button {
        grid-column: 1 / -1;
        width: fit-content;
    }

    .stock-portfolio-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-portfolio-summary > span:nth-child(2) {
        border-right: 0;
    }

    .stock-portfolio-summary > span:nth-child(-n + 2) {
        border-bottom: 1px solid var(--book-line);
    }

    .vesting-ledger-head {
        display: none;
    }

    .vesting-ledger-row {
        grid-template-columns: minmax(100px, 0.8fr) minmax(180px, 1.4fr) repeat(2, minmax(90px, 0.7fr));
    }

    .vesting-ledger-row > span:nth-child(3),
    .vesting-ledger-row > span:nth-child(4) {
        display: none;
    }
}

@media (max-width: 760px) {
    .income-planning-masthead {
        padding-top: 24px;
    }

    .income-masthead-value {
        font-size: 42px;
    }

    .income-composition-bar em {
        display: none;
    }

    .income-tax-rail,
    .employment-compensation-grid,
    .income-planning-tail {
        grid-template-columns: 1fr;
    }

    .income-tax-rail {
        gap: 0;
    }

    .income-person-card > header,
    .employment-benefit-heading,
    .stock-vesting-heading,
    .vesting-concentration {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .income-person-card > header > span {
        justify-items: start;
        text-align: left;
    }

    .income-person-empty-card,
    .income-person-empty-card > div {
        align-items: flex-start;
        flex-direction: column;
    }

    .employment-compensation-grid > span {
        border-right: 0;
        border-bottom: 1px solid rgba(216, 205, 187, 0.55);
    }

    .employment-compensation-grid > span:last-child {
        border-bottom: 0;
    }

    .employment-primary-actions,
    .stock-vesting-heading-actions,
    .stock-quote-list {
        justify-content: flex-start;
    }

    .employment-benefit-list {
        grid-template-columns: 1fr;
    }

    .stock-portfolio-summary {
        grid-template-columns: 1fr;
    }

    .stock-portfolio-summary > span,
    .stock-portfolio-summary > span:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid var(--book-line);
    }

    .stock-portfolio-summary > span:last-child {
        border-bottom: 0;
    }

    .vesting-timeline {
        overflow-x: auto;
    }

    .vesting-timeline svg {
        min-width: 720px;
    }

    .vesting-ledger-row {
        grid-template-columns: 1fr 1fr;
        gap: 5px 12px;
    }

    .vesting-ledger-row > span,
    .vesting-ledger-row > strong {
        text-align: left !important;
    }

    .vesting-ledger-row > span:nth-child(3),
    .vesting-ledger-row > span:nth-child(4) {
        display: block;
    }
}
