/* =========================================================
   Finance Tools — Required Sales Based on Target Ending Cash
   Builds on the brand tokens in redtech.css and the corporate
   page chrome in corporate.css.
   ========================================================= */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------
   Finance Tools index
   --------------------------------------------------------- */

/* One tool, its two modes as large choices beneath. */
.ft-index { padding-top: clamp(32px, 5vw, 56px); }

.ft-tool {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--red-line-soft);
    border-radius: 16px;
    background:
        radial-gradient(ellipse at 100% 0, rgba(226, 18, 26, .16), transparent 55%),
        linear-gradient(180deg, #0e0e0f, #080808);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.ft-tool__head {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.ft-tool__icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border: 1px solid var(--red-line);
    border-radius: 18px;
    background: rgba(226, 18, 26, .12);
    color: var(--red-bright);
    box-shadow: 0 0 28px rgba(226, 18, 26, .18);
}

.ft-tool__name {
    margin: 2px 0 8px;
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: #fff;
}

.ft-tool__text {
    max-width: 680px;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text-dim);
}

.ft-tool__prompt {
    margin: 26px 0 16px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #f5a400;
}

.ft-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.ft-mode {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 24px 22px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    background: rgba(255, 255, 255, .03);
    transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.ft-mode::before {
    content: "";
    position: absolute;
    left: 24px;
    right: 24px;
    top: 0;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--red);
    transform: scaleX(.25);
    transform-origin: left;
    transition: transform .25s ease;
}

.ft-mode:hover,
.ft-mode:focus-visible {
    transform: translateY(-4px);
    border-color: var(--red-line);
    background: rgba(226, 18, 26, .07);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .5), 0 0 26px rgba(226, 18, 26, .14);
    outline: none;
}

.ft-mode:hover::before,
.ft-mode:focus-visible::before { transform: scaleX(1); }

.ft-mode__top { display: flex; align-items: center; justify-content: space-between; }

.ft-mode__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(226, 18, 26, .14);
    color: var(--red-bright);
}

.ft-mode__step { font-size: 13px; font-weight: 800; letter-spacing: .1em; color: var(--text-mute); }
.ft-mode__name { font-size: 20px; font-weight: 800; color: #fff; }
.ft-mode__blurb { flex: 1; font-size: 14.5px; line-height: 1.6; color: var(--text-dim); }

.ft-mode__go {
    align-self: flex-start;
    margin-top: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    background: var(--red);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
    transition: background-color .16s ease;
}

.ft-mode:hover .ft-mode__go { background: var(--red-bright); }

/* The BudgetCore card: the whole card is the link. */
.ft-tool--link {
    display: block;
    margin-top: 22px;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ft-tool--link .ft-tool__head { padding-bottom: 0; border-bottom: 0; }
.ft-tool__tagline { margin: -2px 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #f5a400; }
.ft-tool--link .ft-mode__go { display: inline-block; margin-top: 18px; }

.ft-tool--link:hover,
.ft-tool--link:focus-visible {
    transform: translateY(-4px);
    border-color: var(--red-line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 30px rgba(226, 18, 26, .16);
    outline: none;
}

.ft-tool--link:hover .ft-mode__go { background: var(--red-bright); }

@media (prefers-reduced-motion: reduce) {
    .ft-tool--link { transition: none; }
    .ft-tool--link:hover, .ft-tool--link:focus-visible { transform: none; }
}

@media (max-width: 760px) {
    .ft-tool__head { flex-direction: column; gap: 16px; }
    .ft-modes { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ft-mode, .ft-mode::before { transition: none; }
    .ft-mode:hover, .ft-mode:focus-visible { transform: none; }
}

/* ---------------------------------------------------------
   Page head
   --------------------------------------------------------- */

.rs {
    padding: clamp(28px, 4vw, 44px) clamp(14px, 3vw, 36px) clamp(48px, 6vw, 72px);
}

.rs-head {
    max-width: 1480px;
    margin: 0 auto 24px;
}

.rs-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.rs-crumbs a {
    color: var(--red-bright);
}

.rs-crumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rs-head__title {
    margin: 0 0 8px;
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.01em;
    color: #fff;
}

.rs-head__intro {
    max-width: 860px;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text-dim);
}

/* ---------------------------------------------------------
   Two columns: inputs, and results that stay in view
   --------------------------------------------------------- */

.rs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr);
    gap: 22px;
    align-items: start;
    max-width: 1480px;
    margin: 0 auto;
}

.rs-results {
    position: sticky;
    top: calc(var(--header-h) + 14px);
    max-height: calc(100vh - var(--header-h) - 28px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a transparent;
}

.rs-panel,
.rs-card {
    background: var(--panel-2);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
}

.rs-panel {
    padding: 20px 22px 24px;
    border-color: var(--red-line-soft);
}

.rs-panel__head,
.rs-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.rs-panel__title,
.rs-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
}

.rs-panel__meta,
.rs-card__asof {
    margin: 0;
    font-size: 12px;
    color: var(--text-mute);
}

/* ---------------------------------------------------------
   Draft banner and error summary
   --------------------------------------------------------- */

.rs-draft {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px dashed var(--red-line);
    border-radius: var(--radius-sm);
    background: rgba(226, 18, 26, .06);
}

.rs-draft[hidden] {
    display: none;
}

.rs-draft__text {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
}

.rs-draft__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rs-link {
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mute);
    background: none;
    border: 0;
    cursor: pointer;
}

.rs-link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rs-errors:focus {
    outline: 2px solid var(--red-bright);
    outline-offset: 2px;
}

.rs-errors__title {
    margin: 0 0 6px;
    font-weight: 700;
}

.rs-errors__list {
    margin: 0;
    padding-left: 18px;
}

.rs-errors__list li + li {
    margin-top: 3px;
}

.rs-errors__list a {
    color: #ffd0cc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------------------------------------------------------
   The primary question
   --------------------------------------------------------- */

.rs-question {
    margin-bottom: 14px;
    padding: 16px 18px 18px;
    border: 1px solid var(--red-line);
    border-left: 4px solid var(--red);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(90deg, rgba(226, 18, 26, .10), rgba(226, 18, 26, 0) 70%),
        #0d0d0d;
}

.rs-question__eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--red-bright);
}

.rs-question__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

.rs-question .rs-field {
    max-width: 460px;
}

.rs-question .rs-input {
    height: 44px;
    font-size: 17px;
    font-weight: 700;
}

.rs-question .rs-affix__mark {
    font-size: 14px;
}

/* ---------------------------------------------------------
   Sections
   --------------------------------------------------------- */

.rs-section {
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.rs-section__summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 2px;
    list-style: none;
    cursor: pointer;
}

.rs-section__summary::-webkit-details-marker {
    display: none;
}

.rs-section__summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-left: 4px;
    border-right: 2px solid var(--text-mute);
    border-bottom: 2px solid var(--text-mute);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .16s ease;
}

.rs-section:not([open]) > .rs-section__summary::after {
    transform: rotate(-45deg);
}

.rs-section__summary:focus-visible {
    outline: 2px solid var(--red-bright);
    outline-offset: 2px;
    border-radius: 4px;
}

.rs-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
}

.rs-section__number {
    flex: none;
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--red-bright);
    border: 1px solid var(--red-line);
    border-radius: 999px;
    background: rgba(226, 18, 26, .08);
}

.rs-section__total {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-dim);
}

.rs-section__body {
    padding: 0 2px 18px;
}

.rs-section__error {
    margin: 12px 0 0;
    font-size: 12.5px;
}

.rs-statement {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-dim);
}

.rs-support {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-mute);
}

.rs-support--flag {
    padding-left: 10px;
    border-left: 2px solid var(--red-line);
}

.rs-disclaimer {
    margin: 14px 0 0;
    padding: 11px 13px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-mute);
    background: rgba(255, 255, 255, .025);
    border: 1px solid #262626;
    border-radius: var(--radius-sm);
}

.rs-disclaimer--general {
    max-width: 1480px;
    margin: 22px auto 0;
}

/* ---------------------------------------------------------
   Fields
   --------------------------------------------------------- */

.rs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 22px;
}

.rs-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rs-grid + .rs-figures,
.rs-figures + .rs-grid {
    margin-top: 14px;
}

.rs-field {
    min-width: 0;
}

.rs-field--wide {
    grid-column: 1 / -1;
}

.rs-field__label {
    display: block;
    margin-bottom: 5px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #ededf0;
}

.rs-affix {
    position: relative;
    display: block;
}

.rs-affix__mark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text-mute);
    pointer-events: none;
}

.rs-affix--money .rs-affix__mark {
    left: 12px;
}

.rs-affix--rate .rs-affix__mark {
    right: 13px;
}

.rs-input {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.rs-affix--money .rs-input {
    padding-left: 50px;
}

.rs-affix--rate .rs-input {
    padding-right: 32px;
}

.rs-readout {
    display: flex;
    align-items: center;
    min-height: 36px;
    margin: 0;
    padding: 0 13px;
    font-size: 13.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: #0b0b0b;
    border: 1px dashed var(--field-border);
    border-radius: var(--radius-sm);
}

.rs-readout--cell {
    justify-content: flex-end;
}

/* Figures worked out from the inputs, never typed. */
.rs-figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 0;
}

.rs-figures--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rs-figure {
    margin: 0;
    padding: 10px 13px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid #242424;
    border-radius: var(--radius-sm);
}

.rs-figure dt {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.rs-figure dd {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.rs-figure--strong {
    border-color: var(--red-line-soft);
}

.rs-subtotal,
.rs-grand {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-top: 14px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
}

.rs-subtotal output,
.rs-grand output {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.rs-grand {
    margin: 0 0 4px;
    padding: 14px 16px;
    border: 1px solid var(--red-line-soft);
    border-radius: var(--radius-sm);
    background: rgba(226, 18, 26, .06);
}

.rs-grand small {
    flex-basis: 100%;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-mute);
}

/* ---------------------------------------------------------
   Other cash inflows: received and expected, side by side
   --------------------------------------------------------- */

.rs-inflows {
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rs-inflows__row {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.rs-inflows__row:first-child {
    border-top: 0;
}

.rs-inflows__row--head {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #c9c9cf;
    background: rgba(226, 18, 26, .10);
}

.rs-inflows__row--head span:not(:first-child),
.rs-inflows__row--total span:not(:first-child) {
    text-align: right;
}

.rs-inflows__row--total {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .03);
}

.rs-inflows__row--total output {
    font-variant-numeric: tabular-nums;
}

.rs-inflows__label {
    font-size: 13px;
    font-weight: 600;
    color: #ededf0;
}

.rs-inflows__note {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-mute);
}

.rs-inflows__cell-label {
    display: none;
}

/* ---------------------------------------------------------
   Income tax, confirmation, actions
   --------------------------------------------------------- */

.rs-standard {
    margin: 14px 0 0;
    padding: 11px 13px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-dim);
    border-left: 3px solid var(--red);
    background: rgba(255, 255, 255, .03);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.rs-standard strong {
    color: #fff;
}

.rs-confirm {
    margin: 6px 0 0;
    padding: 16px 18px;
    border: 1px solid var(--red-line);
    border-radius: var(--radius-sm);
    background: rgba(226, 18, 26, .05);
}

.rs-confirm--invalid {
    border-color: var(--red-bright);
    box-shadow: 0 0 0 3px rgba(255, 42, 36, .12);
}

.rs-confirm__question {
    padding: 0 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    color: #fff;
}

.rs-actions {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.rs-actions__primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.rs-actions__calculate.btn-submit {
    flex: 1 1 280px;
    min-width: 0;
    height: 46px;
    font-size: 16px;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.rs-actions__button {
    flex: 0 1 auto;
    height: 46px;
    padding: 0 22px;
    line-height: 44px;
    text-align: center;
}

.rs-actions__files,
.rs-results__files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.rs-file {
    flex: 1 1 160px;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .03em;
    color: #fff;
    background: #141414;
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}

.rs-file:hover {
    border-color: var(--red-line);
    background: #1b1b1b;
}

.rs-file:focus-visible {
    outline: 2px solid var(--red-bright);
    outline-offset: 2px;
}

.rs-file[aria-busy="true"] {
    cursor: progress;
    color: var(--text-dim);
}

.rs-actions__status {
    min-height: 18px;
    margin: 12px 0 0;
    font-size: 12.5px;
    color: #a9e8c2;
}

.rs-privacy {
    margin: 6px 0 0;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-mute);
}

/* ---------------------------------------------------------
   Results column
   --------------------------------------------------------- */

.rs-card {
    padding: 18px 18px 20px;
}

.rs-card--results {
    border-color: var(--red-line-soft);
}

.rs-empty {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dim);
}

.rs-empty p {
    margin: 0 0 10px;
}

.rs-empty__title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.rs-headline {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--red-line);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(135deg, rgba(226, 18, 26, .16), rgba(226, 18, 26, .02) 70%),
        #0e0e0e;
}

.rs-headline__label {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ededf0;
}

.rs-headline__value {
    margin: 0;
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--red-bright);
    overflow-wrap: anywhere;
}

.rs-metrics {
    margin: 0 0 14px;
}

.rs-metrics__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.rs-metrics__row dt {
    font-size: 12.5px;
    color: var(--text-dim);
}

.rs-metrics__row dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.rs-metrics__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rs-statements {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.rs-statement-card {
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .025);
}

.rs-statement-card__title {
    margin: 0 0 3px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.rs-statement-card__text {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-dim);
}

.rs-statement-card--achieved,
.rs-statement-card--surplus {
    border-left-color: #2f9e5c;
}

.rs-statement-card--achieved .rs-statement-card__title,
.rs-statement-card--surplus .rs-statement-card__title {
    color: #7ee0a4;
}

.rs-statement-card--deficiency {
    border-left-color: var(--red-bright);
}

.rs-statement-card--deficiency .rs-statement-card__title {
    color: #ffb3ae;
}

.rs-statement-card--capacity,
.rs-statement-card--income {
    border-left-color: #d66a1a;
}

.rs-statement-card--capacity .rs-statement-card__title,
.rs-statement-card--income .rs-statement-card__title {
    color: #ffb26b;
}

.rs-statement-card--info {
    border-left-color: #6d6d74;
}

.rs-statement-card--info .rs-statement-card__title {
    color: #d7d7dc;
}

.rs-warnings {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid rgba(214, 158, 46, .5);
    border-radius: var(--radius-sm);
    background: rgba(214, 158, 46, .08);
}

.rs-warnings__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 6px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ffd27a;
}

.rs-warnings__title svg {
    color: #ffd27a;
}

.rs-warnings ul {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-dim);
}

.rs-warnings li + li {
    margin-top: 5px;
}

/* Reconciliation --------------------------------------------- */

.rs-recon__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.rs-recon__table caption {
    padding: 0 0 8px;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
}

.rs-recon__table thead th {
    padding: 8px 10px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    color: #c9c9cf;
    background: rgba(226, 18, 26, .12);
    border-bottom: 1px solid var(--red-line);
}

.rs-recon__table th[scope="row"],
.rs-recon__table td {
    padding: 7px 10px;
    font-weight: 500;
    text-align: left;
    color: #e4e4e8;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.rs-recon__amount {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rs-recon__row--opening th,
.rs-recon__row--opening td {
    font-weight: 700;
}

.rs-recon__row--adjustment th,
.rs-recon__row--adjustment td {
    font-style: italic;
    color: #ffd27a;
}

.rs-recon__row--total th,
.rs-recon__row--total td {
    font-weight: 800;
    color: #fff;
    background: rgba(226, 18, 26, .10);
    border-top: 1px solid var(--red-line);
}

.rs-recon__row--variance th,
.rs-recon__row--variance td {
    font-weight: 800;
    color: #fff;
    border-bottom: 0;
}

.rs-recon__note,
.rs-results__note {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.55;
    color: var(--text-mute);
}

.rs-results__more {
    display: inline-block;
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--red-bright);
}

.rs-results__more:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------
   Detailed results
   --------------------------------------------------------- */

.rs-detail {
    max-width: 1480px;
    margin: 30px auto 0;
}

.rs-detail__head {
    margin-bottom: 16px;
}

.rs-detail__title {
    margin: 0 0 4px;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    color: #fff;
}

.rs-detail__meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-mute);
}

.rs-detail__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
    align-items: start;
}

.rs-result-group .rs-card__title {
    margin-bottom: 12px;
}

.rs-result-group__caption {
    margin: -6px 0 10px;
    font-size: 12px;
    color: var(--text-mute);
}

.rs-kv {
    margin: 0;
}

.rs-kv__row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.rs-kv__row:last-child {
    border-bottom: 0;
}

.rs-kv__row dt {
    font-size: 12.5px;
    color: var(--text-dim);
}

.rs-kv__row dd {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.rs-kv__row--strong dt,
.rs-kv__row--strong dd {
    font-weight: 800;
    color: #fff;
}

.rs-allocation,
.rs-steps {
    margin-top: 16px;
}

.rs-allocation__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 14px;
}

.rs-allocation__lead {
    max-width: 900px;
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-dim);
}

.rs-allocation__lead strong {
    color: #fff;
}

.rs-allocation__table td,
.rs-allocation__table th {
    vertical-align: middle;
}

.rs-allocation__table tfoot th,
.rs-allocation__table tfoot td {
    font-weight: 700;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.rs-allocation__input {
    width: 190px;
    max-width: 100%;
    margin-left: auto;
}

.rs-allocation__over td,
.rs-allocation__over th {
    color: #ffb26b;
}

.rs-allocation__difference.is-off th,
.rs-allocation__difference.is-off td {
    color: #ff8a84;
}

.rs-steps__summary {
    list-style: none;
    cursor: pointer;
}

.rs-steps__summary::-webkit-details-marker {
    display: none;
}

.rs-steps__summary .rs-card__title::after {
    content: " +";
    color: var(--red-bright);
}

.rs-steps[open] .rs-steps__summary .rs-card__title::after {
    content: " −";
}

.rs-steps[open] .rs-steps__summary {
    margin-bottom: 14px;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1180px) {
    .rs-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .rs-results {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 760px) {
    .rs-panel {
        padding: 16px 14px 20px;
    }

    .rs-grid,
    .rs-grid--three,
    .rs-figures,
    .rs-figures--three {
        grid-template-columns: minmax(0, 1fr);
    }

    .rs-question .rs-field {
        max-width: none;
    }

    /* Each receipt becomes its own small card, its two amounts labelled. */
    .rs-inflows__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .rs-inflows__row--head {
        display: none;
    }

    .rs-inflows__row--total span:not(:first-child) {
        text-align: left;
    }

    .rs-inflows__cell-label {
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        color: var(--text-mute);
    }

    .rs-actions__calculate.btn-submit,
    .rs-actions__button {
        flex: 1 1 100%;
    }

    .rs-detail__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rs-kv__row {
        flex-wrap: wrap;
    }
}

/* =========================================================
   Forecasting Mode
   The mode chooser, the line item tables the user builds,
   and the financial analysis.
   ========================================================= */

.rs-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.rs-mode {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    background: var(--panel-2);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius);
    transition: border-color .18s ease, background .18s ease;
}

.rs-mode:hover,
.rs-mode:focus-visible {
    border-color: var(--red-line);
    background: rgba(226, 18, 26, .06);
}

.rs-mode.is-current {
    border-color: var(--red-line);
    background: rgba(226, 18, 26, .1);
}

.rs-mode__name {
    display: block;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
}

.rs-mode.is-current .rs-mode__name::after {
    content: " — selected";
    font-weight: 600;
    letter-spacing: normal;
    color: var(--red-bright);
}

.rs-mode__blurb {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-dim);
}

.rs-mode__go {
    display: inline-block;
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--red-bright);
}

/* Line item tables ------------------------------------------- */

.rs-lines {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.rs-lines__head,
.rs-line {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.1fr) 34px;
    gap: 8px;
    align-items: start;
}

.rs-lines--pair .rs-lines__head,
.rs-lines--pair .rs-line {
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) 34px;
}

.rs-lines--scenarios .rs-lines__head,
.rs-lines--scenarios .rs-line {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
}

.rs-lines__head span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.rs-lines__title {
    margin: 18px 0 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fff;
}

.rs-lines__add {
    margin-top: 10px;
}

.rs-line__label {
    display: none;
}

/* The fields a line does not use are hidden with the attribute; the affix
   wrappers set their own display, so they have to be told. */
.rs-line [hidden] {
    display: none;
}

.rs-line__select {
    width: 100%;
}

.rs-line__note {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-mute);
    white-space: normal;
}

.rs-line__none {
    display: inline-block;
    padding-top: 10px;
    font-size: 12px;
    color: var(--text-mute);
}

.rs-line__remove {
    width: 34px;
    height: 38px;
    font-size: 18px;
    line-height: 1;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease;
}

.rs-line__remove:hover,
.rs-line__remove:focus-visible {
    color: #fff;
    border-color: var(--red-line);
}

.rs-line--scenario .rs-line__cell--name {
    font-size: 13px;
    color: #fff;
}

/* Detail tables ----------------------------------------------- */

.rs-table {
    white-space: normal;
}

.rs-table tbody th,
.rs-table tfoot th {
    padding: 13px 16px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: #e4e4e8;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.rs-table__amount {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rs-table__total th,
.rs-table__total td {
    font-weight: 800;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.rs-steps__note {
    max-width: 460px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-mute);
}

.rs-notes {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-dim);
}

.rs-notes li + li {
    margin-top: 6px;
}

/* Financial analysis ------------------------------------------ */

.rs-analysis {
    margin-top: 28px;
}

.rs-analysis__sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.rs-analysis__text {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-dim);
}

.rs-analysis__text:last-child {
    margin-bottom: 0;
}

@media (max-width: 860px) {
    .rs-lines__head {
        display: none;
    }

    .rs-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        padding: 12px;
        background: rgba(255, 255, 255, .02);
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: var(--radius-sm);
    }

    .rs-lines--pair .rs-line,
    .rs-lines--scenarios .rs-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .rs-line__cell--name {
        grid-column: 1 / -1;
    }

    .rs-line__cell--action {
        grid-column: 1 / -1;
        justify-self: end;
    }

    .rs-line__label {
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        color: var(--text-mute);
    }
}
