/* ============================================================
   simulator.css - the shared Ledger layer for both backtesters

   Loaded AFTER turtle-simulator.css / ma-simulator.css, which stay
   in place for anything page-specific. Every class here is one the
   pages already emit or one of their scripts sets, so no markup and
   no JS had to change: the two files disagree on a handful of rules
   and this settles both the same way.

   What it does: takes the cards off. A backtester is a sheet you
   fill in and a report you read, so the controls are underlined
   rather than boxed, the readings sit on hairlines, and the only
   filled surfaces left are the ones that depict something - a chart,
   a tooltip, the run button.
   ============================================================ */

.simulator-container {
    /* The blocks inside set their own max-width and gutter so each can carry
       a rule the full width of the page. */
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

/* ── Presets ────────────────────────────────────────────────
   The quick ways in. Chips on one row, not a panel of buttons. */
.presets {
    max-width: none;
    margin: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
    padding: 1.5rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    position: relative;
    text-align: left;
}
.presets::before {
    content: '';
    position: absolute; left: 0; top: -1px;
    width: 2.6rem; height: 2px; background: var(--gold);
}
.presets h3 {
    margin: 0 0 1.1rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
}
.preset-buttons {
    /* A grid, not flex-wrap. Wrapping left the last chip alone on a row
       with a gap beside it, and the two pages tore differently because
       they have four and five presets. Equal columns tear the same way. */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.5rem;
    justify-content: start;
}
.preset-btn {
    text-align: left;
    padding: 0.7rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: border-color var(--dur-base) var(--ease-out),
                color var(--dur-base) var(--ease-out),
                background var(--dur-base) var(--ease-out),
                transform var(--dur-base) var(--ease-out);
}
.preset-btn:hover {
    border-color: rgba(138, 164, 232, 0.45);
    color: var(--text-primary);
    background: rgba(138, 164, 232, 0.07);
    transform: translateY(-1px);
    box-shadow: none;
}
.preset-btn:active { transform: translateY(0); }
.preset-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── The sheet you fill in ──────────────────────────────────── */
/* Scoped to .simulator-container (0,2,0) because both page sheets set
   `.simulator-container .form-grid` at that specificity - a bare .form-grid
   here loses to them and the card stays. */
.simulator-container .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: clamp(1.25rem, 3vw, 2.25rem);
    max-width: none;
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.form-group {
    display: grid;
    align-content: start;
    gap: 0.45rem;
    background: none;
    border: 0;
    padding: 0;
}
.form-group label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
    margin: 0;
}
.form-group input,
.form-group select {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(238, 241, 248, 0.18);
    border-radius: 0;
    padding: 0.4rem 0;
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    box-shadow: none;
    transition: border-color var(--dur-base) var(--ease-out);
    -webkit-appearance: none;
    appearance: none;
}
.form-group input:hover,
.form-group select:hover { border-bottom-color: rgba(238, 241, 248, 0.32); }
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-bottom-color: var(--accent);
    background: transparent;
    box-shadow: none;
}
/* A select still has to look like it opens. */
.form-group select {
    padding-right: 1.5rem;
    font-size: 1rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-quiet) 50%),
                      linear-gradient(135deg, var(--text-quiet) 50%, transparent 50%);
    background-position: right 0.6rem center, right 0.35rem center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
}
.form-group input[type="date"] { font-size: 1.05rem; }
.form-group input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7) sepia(1) saturate(0.4) hue-rotate(5deg); cursor: pointer; }
.form-group input[type=number]::-webkit-outer-spin-button,
.form-group input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-group input[type=number] { -moz-appearance: textfield; }
.form-group small {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-quiet);
}

/* The run button spans the sheet: it is the one action on the page. */
.simulator-container .form-grid .btn-primary,
.simulator-container .btn-primary {
    grid-column: 1 / -1;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 2rem;
    background: linear-gradient(180deg, #4a63a8 0%, #3d5290 100%);
    color: #ffffff;
    border: 1px solid rgba(169, 189, 240, 0.28);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.simulator-container .form-grid .btn-primary:hover,
.simulator-container .btn-primary:hover { background: linear-gradient(180deg, #5b78c8 0%, #4a63a8 100%); border-color: rgba(201, 169, 98, 0.55); transform: translateY(-1px); }
.simulator-container .btn-primary:active { transform: translateY(0); }
.simulator-container .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── The report ─────────────────────────────────────────────── */
.results-panel {
    max-width: none;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Running. The same ring the page loader uses; no emoji. */
.results-loading { padding: clamp(3rem, 8vw, 5rem) 0; text-align: center; }
.loading-visual { display: grid; place-items: center; margin-bottom: 1.5rem; }
.loading-visual i, .spinner-ring {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(138, 164, 232, 0.16);
    border-top-color: var(--gold);
    animation: sim-spin 1.1s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    font-size: 0;
    background: none;
    color: transparent;
}
.loading-visual i::before { content: none; }
.turtle-emoji { display: none; }
@keyframes sim-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-visual i, .spinner-ring { animation: none; } }
.loading-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--step-3);
    letter-spacing: var(--tracking-display);
    color: var(--text-primary);
}
.loading-sub { margin-top: 0.6rem; font-size: 0.9rem; color: var(--text-quiet); }

/* The headline reading. */
.results-summary {
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    padding: 1.5rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    position: relative;
}
.results-summary::before {
    content: '';
    position: absolute; left: 0; top: -1px;
    width: 2.6rem; height: 2px; background: var(--gold);
}
.results-summary-eyebrow {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
    margin: 0 0 0.5rem;
}
.results-summary-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--step-4);
    letter-spacing: var(--tracking-display);
    color: var(--text-primary);
    margin: 0;
}
.results-summary-headline {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.results-summary-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
    margin-bottom: 0.4rem;
}
.results-summary-value {
    display: block;
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}
.results-summary-value.positive { color: var(--accent-green); }
.results-summary-value.negative { color: var(--accent-red); }
.results-summary-sub {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--font-num);
    font-size: 1rem;
    color: var(--text-quiet);
}
.results-summary-sub.positive { color: var(--accent-green); }
.results-summary-sub.negative { color: var(--accent-red); }

/* The verdict, stated once. */
.results-verdict {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
}
.results-verdict.is-positive { color: var(--accent-green); border-color: rgba(47, 191, 143, 0.4); background: rgba(47, 191, 143, 0.07); }
.results-verdict.is-negative { color: var(--accent-red);   border-color: rgba(224, 90, 90, 0.4);  background: rgba(224, 90, 90, 0.07); }
.results-verdict.is-neutral  { color: var(--accent-warm);  border-color: rgba(201, 169, 98, 0.4); background: rgba(201, 169, 98, 0.07); }

/* What the run was: symbol, window, parameters. */
.results-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 1.25rem;
}
.run-pill {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem 1.25rem 0.35rem 0;
    margin-right: 1.25rem;
    background: none;
    border: 0;
    border-radius: 0;
}
.run-pill + .run-pill { border-left: 1px solid var(--border); padding-left: 1.25rem; }
.run-pill-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-subtle);
}
.run-pill-value {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* ── The three readings ─────────────────────────────────────
   Divided by hairlines, not boxed. */
.metrics-big, .metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 0 0 clamp(2rem, 4vw, 3rem);
}
.metric-card {
    display: grid;
    gap: 0.5rem;
    align-content: start;
    padding: clamp(1.25rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.75rem);
    background: var(--bg-base);
    border: 0;
    border-radius: 0;
    transition: background var(--dur-base) var(--ease-out);
}
.metric-card:hover { background: var(--bg-surface); transform: none; box-shadow: none; }
.metric-card span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
}
.metric-card span i { color: var(--accent-warm); font-size: 0.8rem; }
.metric-card strong {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-weight: 500;
}
.metric-card strong.positive { color: var(--accent-green); }
.metric-card strong.negative { color: var(--accent-red); }
.metric-card.dd-card strong { color: var(--accent-red); }

/* ── Charts ─────────────────────────────────────────────────
   A chart is a depicted object, so it keeps a surface - but a quiet
   one, opened by the same rule as every other section. */
.chart-wrapper {
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    padding: 1.5rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    position: relative;
}
.chart-wrapper::before {
    content: '';
    position: absolute; left: 0; top: -1px;
    width: 2.6rem; height: 2px; background: var(--gold);
}
.chart-wrapper .chart-title,
.chart-wrapper-price .chart-title,
.trades-log-wrapper .chart-title,
.chart-title {
    margin: 0 0 0.35rem;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--step-3);
    letter-spacing: var(--tracking-display);
    color: var(--text-primary);
}
.chart-wrapper .chart-legend-note,
.chart-legend-note { margin: 0 0 1.25rem; font-size: 0.85rem; color: var(--text-quiet); text-align: left; }
.chart-wrapper-price-inner {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(23, 35, 66, 0.5), rgba(10, 15, 30, 0.4));
}

/* ── Trade log ──────────────────────────────────────────────── */
.trades-log-wrapper {
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    padding: 1.5rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    position: relative;
}
.trades-log-wrapper::before {
    content: '';
    position: absolute; left: 0; top: -1px;
    width: 2.6rem; height: 2px; background: var(--gold);
}
.trades-log-scroll { overflow-x: auto; }
.trades-log {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: 0.86rem;
}
.trades-log thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-base);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-quiet);
    text-align: left;
    padding: 0.75rem 1rem 0.75rem 0;
    border-bottom: 1px solid rgba(138, 164, 232, 0.35);
    white-space: nowrap;
}
.trades-log td {
    padding: 0.7rem 1rem 0.7rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    white-space: nowrap;
}
.trades-log tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.trades-log tbody tr:hover { background: rgba(138, 164, 232, 0.05); }
.trades-log tbody tr:hover td { color: var(--text-primary); }
.trades-log td.positive { color: var(--accent-green); }
.trades-log td.negative { color: var(--accent-red); }

/* ── Everything else the pages carry ────────────────────────── */
.summary-panel {
    margin: 0 0 2rem;
    padding: 1.5rem 0 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
    color: var(--text-muted);
}
.summary-row:last-child { border-bottom: 0; }
.raw-details {
    margin: 0 0 clamp(2rem, 4vw, 3rem);
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 1rem 0 0;
}
.raw-details summary {
    cursor: pointer;
    list-style: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-quiet);
    padding: 0.5rem 0;
    transition: color var(--dur-fast) var(--ease-out);
}
.raw-details summary::-webkit-details-marker { display: none; }
.raw-details summary:hover { color: var(--accent-lt); }

/* Tooltips over the chart: the one place a filled panel is right. */
.turtle-trade-tooltip, .ma-trade-tooltip {
    background: rgba(10, 15, 30, 0.96);
    border: 1px solid var(--border);
    border-left: 2px solid var(--gold);
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    padding: 0.8rem 1rem;
    font-family: var(--font-num);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.turtle-trade-tooltip-title, .ma-trade-tooltip-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}
.turtle-trade-tooltip-line, .ma-trade-tooltip-line { line-height: 1.6; }

/* ── Narrow ─────────────────────────────────────────────────── */
@media (max-width: 800px) {
    .metrics-big, .metrics-grid { grid-template-columns: 1fr; }
    .results-summary-headline { align-items: flex-start; }
    .run-pill + .run-pill { border-left: 0; padding-left: 0; }
}

/* ════════════════════════════════════════════════════════════
   THE THREE STEPS
   Both backtesters are the same page with different parameters,
   so they are numbered the same way: preset, parameters, report.
   The number is the mark; nothing is drawn around it.
   ════════════════════════════════════════════════════════════ */
.sim-step {
    /* One column. The number used to sit in a 3.5rem column of its own,
       which pushed the heading and its text right while everything under
       the section - the presets, the form - stayed at the container edge.
       Nothing lined up. The number is a line above the title now and the
       whole block shares one left edge with the content it introduces. */
    display: block;
    /* It lives INSIDE .simulator-container, which already supplies the page
       gutter - adding its own indented the head past everything it
       introduces. No horizontal padding of its own. */
    max-width: none;
    margin: clamp(3rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.25rem);
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--border);
    position: relative;
}
.sim-step::before {
    content: '';
    position: absolute;
    left: 0; top: -1px;
    width: 2.6rem; height: 2px; background: var(--gold);
}
.sim-step-n {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    line-height: 1;
    color: var(--gold);
    letter-spacing: -0.02em;
}
.sim-step-title {
    margin: 0 0 0.4rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--step-4);
    letter-spacing: var(--tracking-display);
    line-height: 1.05;
    color: var(--text-primary);
}
.sim-step-sub {
    margin: 0;
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 62ch;
}
/* The step head already carries the rule, so the block under it must not
   draw a second one. */
.sim-step + .presets,
.sim-step + .presets::before { border-top: 0; background: none; }
.sim-step + .presets { margin-top: 0; padding-top: 0; }
.sim-step + .presets::before { content: none; }
.sim-step + .form-grid, .simulator-container .sim-step + .form-grid { margin-top: 0; }
.sim-step + .results-panel { margin-top: 0; }


/* ── Before anything has been run ───────────────────────────
   Says what the report will contain rather than showing an icon and
   an instruction. Reads as a contents page for the thing you are
   about to generate. */
#no-results {
    /* Centred. It is the one block on the page with nothing in it yet, so
       it reads as a title page for the report rather than as another
       left-aligned section - which is what it looked like when it was
       lined up with everything else. */
    display: block;
    align-items: initial;
    justify-content: initial;
    min-height: 0;
    max-width: 46rem;
    margin-inline: auto;
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    background: none;
    border-radius: 0;
}
#no-results i { display: none; }
#no-results p { max-width: none; }
#no-results .caps { display: block; margin-bottom: 0.75rem; color: var(--accent-warm); }
.sim-idle-title {
    margin: 0 0 0.6rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--step-4);
    letter-spacing: var(--tracking-display);
    color: var(--text-primary);
}
.sim-idle-sub {
    margin: 0 auto 2.5rem;
    font-size: var(--step-0);
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 52ch;
}
.sim-idle-list {
    /* Rows, not tiles. Five items in an auto-fit grid left a dead cell
       painted in the divider colour, which read as a broken panel. */
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
}
.sim-idle-list li {
    display: block;
    padding: 0.9rem 0;
    border-top: 1px solid var(--border);
    background: none;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-quiet);
}
.sim-idle-list li:last-child { border-bottom: 1px solid var(--border); }

.sim-idle-list li span {
    display: block;
    margin-bottom: 0.2rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--text-primary);
}

/* ════════════════════════════════════════════════════════════
   BLOCKS
   Head beside its controls, not stacked above them. Three sections
   running one under another at full width read as a long form; with
   the head held in a column of its own the page has two rhythms and
   the eye always knows which step it is in - the head stays put while
   its controls scroll past.
   ════════════════════════════════════════════════════════════ */
.sim-block {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 4vw, 3.5rem);
    border-top: 1px solid var(--border);
    position: relative;
}
/* No exception for the first block. The two pages disagreed only because
   the turtle hero is a <div> and the MA hero a <section>, so :first-of-type
   matched a different element on each and one page opened without its rule.
   Both open with the rule and the tick now. */
.sim-block::before {
    content: '';
    position: absolute;
    left: clamp(1.25rem, 4vw, 3.5rem); top: -1px;
    width: 2.6rem; height: 2px; background: var(--gold);
}

/* The report is wide - a chart and a ten-column table - so its head sits
   above it rather than stealing a third of the width. */
.sim-block-wide { grid-template-columns: 1fr; gap: clamp(1.5rem, 3vw, 2.5rem); }

/* The head no longer draws its own rule or gutter: the block owns both. */
.sim-block .sim-step {
    margin: 0;
    padding: 0;
    border-top: 0;
    position: sticky;
    top: calc(var(--nav-h, 4.5rem) + 2rem);
}
.sim-block .sim-step::before { content: none; }
.sim-block-wide .sim-step { position: static; }
.sim-block-body { min-width: 0; }
/* Inside a block everything starts at the body's edge, so the pieces that
   used to carry their own rule or spacing give it up. */
.sim-block-body > .presets { margin: 0; padding: 0; border-top: 0; }
.sim-block-body > .presets::before { content: none; }
.sim-block-body > .form-grid,
.simulator-container .sim-block-body > .form-grid { margin: 0; }
.sim-block-body > .results-panel { margin: 0; }
.sim-block-body > .presets h3 { margin-bottom: 1rem; }
/* Two columns of fields inside a two-thirds column reads better than the
   auto-fit three the full width allowed. */
.simulator-container .sim-block:not(.sim-block-wide) .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

@media (max-width: 1000px) {
    .sim-block { grid-template-columns: 1fr; gap: clamp(1.25rem, 3vw, 2rem); }
    .sim-block .sim-step { position: static; }
}

/* ── The opening ────────────────────────────────────────────
   Statement on the left, what the engine is on the right, the badges
   as a strip beneath - the same shape every other page opens with,
   instead of a centred title and three pills. */
.sim-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: end;
    max-width: var(--page-max);
    margin-inline: auto;
}
.sim-hero-copy { min-width: 0; }
.sim-hero-reading { display: grid; margin: 0; align-self: end; }
.sim-hero-reading > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--border);
}
.sim-hero-reading > div:last-child { border-bottom: 1px solid rgba(201, 169, 98, 0.35); }
.sim-hero-reading dt { font-size: 0.86rem; color: var(--text-quiet); }
.sim-hero-reading dd {
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}
.sim-hero-grid .simulator-badges { grid-column: 1 / -1; margin-top: clamp(2rem, 4vw, 3rem); }
@media (max-width: 900px) {
    .sim-hero-grid { grid-template-columns: 1fr; align-items: start; }
}
