.rentbuy-page .rentbuy-note {
    color: #666;
    font-family: 'Gill Sans', sans-serif;
    font-size: 0.62em;
    line-height: 1.45;
}

.rentbuy-triangle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
        "rent buy"
        "networth networth";
    gap: 2.2rem 2rem;
    margin: 0.5rem auto 1.5rem;
    max-width: 680px;
    position: relative;
}

.rentbuy-triangle::before,
.rentbuy-triangle::after {
    background: #c8c8c0;
    content: "";
    height: 1px;
    left: 50%;
    position: absolute;
    top: 4.6rem;
    transform-origin: left center;
    width: 180px;
    z-index: 0;
}

.rentbuy-triangle::before {
    transform: rotate(200deg);
}

.rentbuy-triangle::after {
    transform: rotate(-20deg);
}

.triangle-node {
    background: var(--bg-color);
    border-top: 1px solid #111;
    font-family: 'Gill Sans', sans-serif;
    padding-top: 0.45rem;
    position: relative;
    z-index: 1;
}

.triangle-node.key-node {
    border-top-color: #f03b20;
}

.triangle-node.key-node label {
    color: #222;
}

.triangle-node label {
    color: #666;
    display: block;
    font-size: 0.62em;
    line-height: 1.2;
}

.triangle-key-label {
    align-items: center;
    cursor: pointer;
    display: inline-flex !important;
    gap: 0.35rem;
}

.triangle-key-radio {
    accent-color: #111;
    height: 0.9em;
    margin: 0;
    width: 0.9em;
}

.triangle-input {
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    color: var(--text-color);
    display: block;
    font-size: 1.1em;
    font-weight: normal;
    line-height: 1.2;
    margin-top: 0.15rem;
    padding: 0.05rem 0;
    width: 100%;
}

.triangle-input:focus {
    background: var(--input-bg);
    border-bottom-color: var(--accent-color);
    outline: none;
}

.triangle-networth {
    grid-area: networth;
    grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
    width: min(100%, 18rem);
}

.triangle-rent {
    grid-area: rent;
    justify-self: start;
    width: min(100%, 18rem);
}

.triangle-buy {
    grid-area: buy;
    justify-self: end;
    text-align: right;
    width: min(100%, 18rem);
}

.rentbuy-years-control {
    font-family: 'Gill Sans', sans-serif;
    margin: 0.2rem auto 0.4rem;
    max-width: 680px;
}

.rentbuy-years-control label {
    align-items: baseline;
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    font-size: 0.8em;
}

.rentbuy-years-control output {
    color: #111;
    font-variant-numeric: tabular-nums;
}

.rentbuy-years-control input[type="range"] {
    accent-color: #111;
    width: 100%;
}

.key-note {
    margin: 0.4rem auto 0;
    text-align: center;
}

.triangle-meaning {
    margin: 0.6rem auto 0;
    max-width: 680px;
    text-align: center;
}

.rentbuy-table th,
.rentbuy-table td {
    vertical-align: top;
}

.rentbuy-page .table-breakout {
    overflow-x: auto;
    margin: 1rem 0 2rem;
}

.rentbuy-table th:not(:first-child),
.rentbuy-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#year-table {
    min-width: 760px;
}

.rentbuy-chart {
    overflow-x: auto;
}

.rentbuy-chart svg {
    max-width: none;
}

.rentbuy-legend {
    font-family: 'Gill Sans', sans-serif;
    font-size: 12px;
}

.sensitivity-wrap {
    overflow-x: auto;
}

.sensitivity-table {
    min-width: 650px;
}

.sensitivity-table th,
.sensitivity-table td {
    text-align: right;
    white-space: nowrap;
}

.sensitivity-table th:first-child,
.sensitivity-table td:first-child {
    color: #555;
    text-align: left;
}

.sensitivity-table td {
    font-variant-numeric: tabular-nums;
}

.sensitivity-table .buy-cell {
    background-color: rgba(17, 17, 17, var(--cell-alpha, 0.08));
}

.sensitivity-table .rent-cell {
    background-color: rgba(240, 59, 32, var(--cell-alpha, 0.08));
}

.sensitivity-table .tie-cell {
    background-color: rgba(0, 0, 0, 0.035);
}

@media (max-width: 700px) {
    .rentbuy-page .chart-container {
        left: 0;
    }

    .rentbuy-triangle {
        grid-template-columns: 1fr;
        grid-template-areas:
            "rent"
            "buy"
            "networth";
        gap: 1rem;
    }

    .rentbuy-triangle::before,
    .rentbuy-triangle::after {
        display: none;
    }

    .triangle-networth,
    .triangle-rent,
    .triangle-buy {
        grid-column: auto;
        justify-self: stretch;
        text-align: left;
        width: auto;
    }
}
