/*
 * Response Model Lab — tool-specific styles.
 *
 * The design system lives in shared/css/main.css: hero header, .card, buttons,
 * form controls, tables, .skip-link, focus-visible and responsive rules all
 * come from there. Only rules unique to this tool belong here.
 */

/* ── Shape gallery (Step 1: theory before math) ───────────────────────── */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.shape-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 2px solid var(--app-border);
    border-radius: 10px;
    background: var(--app-card-bg);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.shape-card:hover {
    border-color: var(--app-accent);
}

.shape-card[aria-pressed="true"] {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px rgba(42, 125, 225, .15);
}

.shape-card__code {
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .04em;
    color: var(--app-accent);
}

.shape-card__name {
    font-weight: 600;
}

.shape-card__what {
    font-size: .85rem;
    color: var(--app-muted);
    line-height: 1.45;
}

/* The sparkline is decorative; the text carries the meaning. */
.shape-card__spark {
    width: 100%;
    height: 42px;
    display: block;
}

.shape-card__spark path {
    fill: none;
    stroke: var(--app-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
}

/* ── Parameter sliders ───────────────────────────────────────────────── */
.param-row {
    display: grid;
    grid-template-columns: 150px 1fr 96px;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.param-row__label {
    font-weight: 600;
    font-size: .92rem;
}

.param-row__label small {
    display: block;
    font-weight: 400;
    color: var(--app-muted);
    font-size: .8rem;
}

.param-row input[type="range"] {
    width: 100%;
}

.param-row input[type="number"] {
    width: 100%;
}

/* ── Loss readout ────────────────────────────────────────────────────── */
.loss-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.loss-tile {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    background: #fbfdff;
    text-align: center;
}

.loss-tile--active {
    border-color: var(--app-accent);
    background: #eef5fe;
}

.loss-tile__label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--app-muted);
}

.loss-tile__value {
    font-size: 1.45rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.loss-tile__note {
    font-size: .78rem;
    color: var(--app-muted);
}

/* ── Best-so-far marker ──────────────────────────────────────────────── */
.best-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #eef7f1;
    border: 1px solid #bfe0cd;
    font-size: .92rem;
}

.best-banner--beaten {
    background: #fdf3e3;
    border-color: #f0d5a8;
}

/* ── Chart ───────────────────────────────────────────────────────────── */
.chart-container {
    width: 100%;
    min-height: 420px;
}

.chart-container--short {
    min-height: 300px;
}

/* ── Comparison table ────────────────────────────────────────────────── */
.compare-table td.is-winner {
    background: #eef7f1;
    font-weight: 600;
}

/* ── Layout helpers ──────────────────────────────────────────────────── */
.split-2 {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .split-2 {
        grid-template-columns: 1fr;
    }

    .param-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

.step-badge {
    display: inline-block;
    background: var(--app-accent);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 3px 9px;
    border-radius: 999px;
    margin-right: 8px;
    vertical-align: middle;
}

.muted-note {
    color: var(--app-muted);
    font-size: .9rem;
}
