/**
 * Bottleneck calculator (NL) - /bottleneck-calculator/
 * Colours come from theme-vars.css only. Mobile first, tested down to 360px.
 */

.bn-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: clamp(1rem, 3vw, 1.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.bn-container {
    /* Same content width as the guides and the other tools (1040px). */
    max-width: 65rem;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
}

.bn-header {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.bn-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.bn-intro {
    max-width: 75ch;
    color: var(--text-secondary);
    font-size: clamp(0.9375rem, 1.2vw + 0.25rem, 1rem);
    line-height: 1.65;
    margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
}

/* ---------- Tool ---------- */

.bn-tool {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

.bn-tool__title {
    font-size: 1.125rem;
    margin: 0 0 1rem;
}

.bn-form {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.bn-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.bn-field label,
.bn-field legend {
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0;
}

.bn-field select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font: inherit;
}

.bn-res {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bn-res__option {
    position: relative;
    display: inline-flex;
}

.bn-res__option input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.bn-res__option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.bn-res__option input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-on-fill);
}

.bn-field select:focus-visible,
.bn-res__option input:focus-visible + span,
.bn-submit:focus-visible,
.bn-table-wrap:focus-visible,
.bn-faq__item summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.bn-submit {
    justify-self: start;
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: var(--text-on-fill);
    border: 0;
    border-radius: var(--radius-md);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bn-submit:hover {
    background: var(--accent-hover);
}

/* ---------- Result ---------- */

.bn-result {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.bn-result__headline {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.5rem;
}

.bn-result__detail {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.bn-result__error {
    color: var(--signal-block);
    margin: 0.75rem 0 0;
}

.bn-result__error[x-cloak] {
    display: none;
}

.bn-notice {
    color: var(--text-secondary);
}

/* ---------- Tables ---------- */

.bn-table-wrap {
    overflow-x: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.bn-table {
    width: 100%;
    min-width: 20rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.bn-table--examples {
    min-width: 36rem;
}

.bn-table__caption {
    padding: 0.625rem 0.75rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.bn-table th,
.bn-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-top: 1px solid var(--border);
}

.bn-table thead th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.bn-table tr.is-selected {
    background: var(--bg-hover);
}

.bn-verdict--cpu {
    color: var(--signal-caution);
    font-weight: 600;
}

.bn-verdict--gpu,
.bn-verdict--balanced {
    color: var(--signal-go);
}

/* ---------- Article ---------- */

.bn-article {
    line-height: 1.65;
}

/* Keep running text readable now that the column is wider. */
.bn-article p,
.bn-article ul,
.bn-article ol {
    max-width: 75ch;
}

.bn-short blockquote {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
}

.bn-short h3 {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
}

.bn-short p,
.bn-short ul {
    margin: 0 0 0.75rem;
}

.bn-short ul {
    padding-left: 1.25rem;
}

.bn-toc {
    margin-bottom: 2rem;
}

.bn-toc__title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.bn-toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.bn-section {
    margin-bottom: 2rem;
    scroll-margin-top: calc(var(--header-h, 4rem) + 1rem);
}

.bn-section h2 {
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    line-height: 1.25;
    margin: 0 0 0.75rem;
}

.bn-section p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.bn-section a,
.bn-toc a,
.bn-short a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* ---------- FAQ ---------- */

.bn-faq__item {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.bn-faq__item summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.bn-faq__item p {
    margin: 0.5rem 0 0;
}

@media (min-width: 40rem) {
    .bn-form {
        grid-template-columns: 1fr 1fr;
    }

    .bn-field--res,
    .bn-submit {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bn-page * {
        transition: none !important;
        animation: none !important;
    }
}
