/*
 * Stairs constructor page (templates/calculator/konstruktor-lestnitsy.html.twig): the form with its first screen, the verdict cards,
 * the warnings, the marking tables and the tables of the result. On top of engine.css, site.css and roof.css (presets, folded
 * sections, tabs, tables, drawing frames); tokens only. The status of a verdict is told by a word and a sign, the colour only helps.
 */
:root {
    --sc-ok: #1b6e3c;
    --sc-on-ok: #fff;
    --sc-warn: #8a5a00;
    --sc-on-warn: #fff;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --sc-ok: #6fd39a;
        --sc-on-ok: #06210f;
        --sc-warn: #e6b84f;
        --sc-on-warn: #261a00;
    }
}
@media not print {
    :root[data-theme="dark"] {
        --sc-ok: #6fd39a;
        --sc-on-ok: #06210f;
        --sc-warn: #e6b84f;
        --sc-on-warn: #261a00;
    }
}

/* ---------- Form ---------- */
/* The first screen is eight fields: two columns from a phone's landscape width on, so that the button is near. */
.sc-form .form-section:first-of-type .form-grid { gap: 0 var(--s-4); }
.sc-form .form-section .help { max-width: var(--measure); }
.sc-form .form-fold .form-grid, .sc-form .form-sub .form-grid { padding-top: var(--s-1); }

/* The way to the button is short on a phone: the actions stay at the bottom of the screen while the form is long. */
@media (max-width: 719px) {
    .sc-actions { position: sticky; bottom: 0; z-index: 5; margin: var(--s-3) calc(-1 * var(--s-3)) calc(-1 * var(--s-3)); padding: var(--s-2) var(--s-3); border-top: 1px solid var(--c-border); background: var(--c-surface); box-shadow: 0 -4px 12px rgba(16, 24, 32, .08); }
    .sc-actions button { flex: 1 1 auto; }
}

/* ---------- Result: warnings and notes (above the tabs) ---------- */
.sc-warnings p, .sc-notes li { max-width: var(--measure); }
.sc-advice { color: var(--c-muted); font-size: var(--fs-sm); }
.sc-notes { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); border: 1px solid var(--c-border); border-left: 4px solid var(--c-border-strong); border-radius: var(--radius); background: var(--c-surface-alt); font-size: var(--fs-sm); }
.sc-notes > p { margin: 0 0 var(--s-2); }
.sc-notes ul { margin: 0; padding-left: 1.2em; }
.sc-notes li { margin: 0 0 var(--s-2); }
.sc-notes li:last-child { margin-bottom: 0; }

/* ---------- Result: the verdicts ---------- */
.sc-verdicts { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin: 0 0 var(--s-4); }
.sc-verdict { min-width: 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--c-border); border-left: 4px solid var(--c-border-strong); border-radius: var(--radius); background: var(--c-surface); }
.sc-verdict--ok { border-left-color: var(--sc-ok); }
.sc-verdict--warn { border-left-color: var(--sc-warn); }
.sc-verdict--note { border-left-color: var(--c-border-strong); }
.sc-verdict > p { margin: 0 0 var(--s-2); font-size: var(--fs-sm); }
.sc-verdict__label { font-size: var(--fs-xs) !important; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.sc-verdict__headline { margin: 0 0 var(--s-2); font-family: var(--font); font-size: var(--fs-base); font-weight: 700; line-height: 1.35; }
.sc-badge { display: inline-block; margin-right: var(--s-1); padding: 1px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; background: var(--c-surface-alt); color: var(--c-text); }
.sc-badge--ok { background: var(--sc-ok); color: var(--sc-on-ok); }
.sc-badge--warn { background: var(--sc-warn); color: var(--sc-on-warn); }
.sc-checks { margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.sc-checks li { display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); gap: 0 var(--s-2); padding: 3px 0; border-top: 1px dashed var(--c-border); }
.sc-checks__mark { font-weight: 700; }
.sc-checks__mark--ok { color: var(--sc-ok); }
.sc-checks__mark--warn { color: var(--sc-warn); }
.sc-checks__mark--note { color: var(--c-muted); }
.sc-checks__limit { color: var(--c-muted); }

@media (min-width: 960px) {
    .sc-verdicts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Result: the summary ---------- */
.sc-cta { margin: 0 0 var(--s-4); }
.sc-cta .btn { display: inline-flex; align-items: center; }
.sc-main { margin-top: var(--s-4); }
.sc-disclaimer { max-width: var(--measure); }

/* ---------- Result: the marking, the key output for the carpenter ---------- */
.sc-flight { margin: 0 0 var(--s-5); padding: var(--s-3) var(--s-4) 0; border: 1px solid var(--c-border-strong); border-left: 4px solid var(--c-accent); border-radius: var(--radius); background: var(--c-surface); }
.sc-flight > h4 { margin: 0 0 var(--s-2); font-size: var(--fs-lg); }
.sc-flight .rc-table { font-size: var(--fs-base); }
.sc-flight .rc-table td.num, .sc-flight .rc-table th[scope="row"] { font-variant-numeric: tabular-nums lining-nums; }
.sc-flight .rc-table td.num { font-weight: 600; }
.sc-flight .table-wrap { margin-bottom: var(--s-3); }

/* ---------- Result: tables ---------- */
.sc-table td:last-child { white-space: normal; }
.sc-plan { margin: var(--s-2) 0; }
.sc-fig { margin-bottom: var(--s-4); }
.sc-fig svg { min-width: 720px; }

/* ---------- Print of the page itself ---------- */
@media print {
    .sc-actions, .sc-presets, .sc-cta { display: none !important; }
    .sc-verdicts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 719px) {
    .sc-flight { padding-inline: var(--s-2); }
    .sc-flight .rc-table { font-size: var(--fs-sm); }
    .sc-flight .rc-table th[scope="row"] { min-width: 7rem; white-space: normal; }
}
