/* Confusables Practice styles.
 *
 * Same dark palette and highlight as the Confusables site, written as a small
 * standalone sheet because this page is published on its own. System fonts
 * only, no web fonts, no images in the stylesheet. Sizes use rem so enlarged
 * text reflows instead of clipping.
 */

:root {
    --bg: #0f1115;
    --panel: #191c22;
    --raised: #20242c;
    --ink: #eef1f6;
    --muted: #a2abba;
    --brand: #4aa8ff;
    --brand-hover: #7cc2ff;
    --brand-solid: #0b6fc4;
    --brand-solid-hover: #0a5ea6;
    --on-solid: #ffffff;
    --border: #2a2f38;
    --control: #8a94a6;
    --selected: #12304d;
    --ok: #6fd69a;
    --partial: #ffd54f;
    --bad: #ff8a8a;
    --hl-bg: #ffd54f;
    --hl-ink: #1a1a1a;
    --font-body: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    color-scheme: dark;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--brand-solid);
    color: var(--on-solid);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    z-index: 10;
}

.skip-link:focus {
    top: 0.5rem;
}

.site-header,
.site-footer {
    background: var(--panel);
    text-align: center;
}

.site-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.site-header a {
    display: inline-block;
    line-height: 0;
    border-radius: 4px;
}

.site-header img {
    max-width: 100%;
    height: auto;
}

.site-footer {
    margin-top: auto;
    padding: 1.1rem 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--muted);
}

.site-footer p {
    margin: 0.25rem 0;
}

main {
    overflow-wrap: break-word;
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    margin: 1.4em 0 0.5em;
    overflow-wrap: anywhere;
}

h1 {
    font-size: 1.9rem;
    margin-top: 0.5rem;
}

h2 {
    font-size: 1.45rem;
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1rem;
}

p,
ol,
ul {
    margin: 0.7em 0;
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
h2:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.lead {
    font-size: 1.1rem;
    color: var(--muted);
}

.notice,
.draft-note {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 4px solid var(--partial);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.families {
    columns: 2 14rem;
    column-gap: 1.5rem;
    padding-left: 1.2rem;
}

.counts {
    color: var(--muted);
    margin-bottom: 0.4rem;
}

/* Buttons */

.button {
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--control);
    border-radius: 8px;
    min-height: 2.75rem;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
}

.button:hover {
    border-color: var(--brand);
}

.button.primary {
    background: var(--brand-solid);
    border-color: var(--brand-solid);
    color: var(--on-solid);
}

.button.primary:hover {
    background: var(--brand-solid-hover);
    border-color: var(--brand-solid-hover);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

/* Question screens */

.where {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.meter {
    display: block;
    width: 100%;
    height: 0.5rem;
    accent-color: var(--brand);
}

.context {
    color: var(--muted);
    margin: 0.25rem 0 0.75rem;
}

.sentences {
    margin: 0.75rem 0 1rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.sentences dt {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.sentences dd {
    margin: 0.15rem 0 0.8rem;
}

.sentences dd:last-child {
    margin-bottom: 0;
}

.sentence {
    font-size: 1.2rem;
    line-height: 1.5;
}

.changed {
    background: var(--hl-bg);
    color: var(--hl-ink);
    font-weight: 700;
    padding: 0 0.2em;
    border-radius: 3px;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

fieldset.choices {
    border: 0;
    margin: 0 0 1rem;
    padding: 0;
    min-width: 0;
}

fieldset.choices legend {
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0;
    margin-bottom: 0.5rem;
}

.help {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0 0 0.6rem;
}

.guidance {
    background: var(--selected);
    border-left: 4px solid var(--brand);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    margin: 0 0 1rem;
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.choice-list.chips {
    flex-direction: row;
    flex-wrap: wrap;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--control);
    border-radius: 10px;
    cursor: pointer;
}

.choice:hover {
    border-color: var(--brand);
}

.choice:has(input:checked) {
    background: var(--selected);
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
}

.choice:focus-within {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.choice input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    flex: none;
    accent-color: var(--brand);
}

.choice-text {
    overflow-wrap: anywhere;
}

.form-error {
    color: var(--bad);
    font-weight: 600;
    margin: 0 0 0.9rem;
}

/* Feedback, results and review */

.verdict {
    margin: 0.5rem 0;
    padding: 0.65rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 4px solid var(--bad);
    border-radius: 8px;
}

.verdict-correct {
    border-left-color: var(--ok);
}

.verdict-partial {
    border-left-color: var(--partial);
}

.point {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.6rem;
    font-size: 0.85rem;
    border: 1px solid var(--control);
    border-radius: 999px;
}

.family {
    color: var(--muted);
    font-size: 0.92rem;
}

.family strong {
    color: var(--ink);
}

.explanation {
    margin: 1rem 0;
}

.explanation h3,
.explanation h4 {
    margin-top: 0.4rem;
}

.score {
    font-size: 1.2rem;
}

.plain-list {
    padding-left: 1.2rem;
}

.review-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.review-item {
    border-top: 1px solid var(--border);
    padding: 0.5rem 0 1rem;
}

.review-item h3 {
    margin-top: 0.8rem;
}

@media (forced-colors: active) {
    .choice,
    .button,
    .verdict,
    .sentences {
        border: 1px solid CanvasText;
    }

    .changed {
        forced-color-adjust: none;
    }
}

@media (max-width: 26rem) {
    main {
        padding: 1rem 0.9rem 2.5rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .button {
        width: 100%;
    }
}
