/* ==========================================================================
   Gemensam stilmall för Skolprov Flygskolan
   Vit, luftig design med mjuka kanter.
   ========================================================================== */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --border: #e3e6eb;
    --border-strong: #cbd1d9;
    --text: #1f2328;
    --text-muted: #6b7280;
    --text-faint: #c3c8cf;

    --accent: #2e8b3e;
    --accent-hover: #267534;
    --accent-soft: #eef7f0;
    --accent-letter: #9fd0a8;
    --accent-ring: rgba(46, 139, 62, 0.22);

    --blue: #2563eb;
    --blue-hover: #1d4fd0;
    --blue-soft: #eef3fe;

    --danger: #d64545;
    --danger-hover: #b93636;
    --danger-soft: #fdeeee;
    --danger-letter: #f0a9a9;

    --warning-soft: #fdf8e6;
    --warning-border: #f1e3a8;

    --radius-lg: 18px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

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

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 0.8em; }

hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* --- Layout ------------------------------------------------------------- */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 18px;
}
.brand small {
    display: block;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.2;
}

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 36px 20px 64px;
}
.page--narrow { max-width: 460px; }
.page--wide { max-width: 1040px; }

.page-header { margin-bottom: 24px; }
.page-header--center { text-align: center; }
.page-header p { color: var(--text-muted); margin: 0; }
.page-header--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 20px;
}
.card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.card-title h2 { margin: 0; }
.card--blue { background: var(--blue-soft); border-color: #d6e2fb; box-shadow: none; }

.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.center { text-align: center; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* --- Formulär ------------------------------------------------------------ */

.field { margin-bottom: 18px; }

label, .label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.hint { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }

input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font: inherit;
    font-size: 16px; /* minst 16px, annars zoomar iPhone/iPad in när fältet väljs */
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}
select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}
input[readonly] { background: var(--surface-muted); color: var(--text-muted); }

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }

.checkbox-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    font-size: 15px;
}
.checkbox-field input { width: 18px; height: 18px; margin: 3px 0 0; flex-shrink: 0; }
.checkbox-field label { font-weight: 400; margin: 0; }
.checkbox-field.malsman { color: var(--text-muted); }

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.inline-form .field { flex: 1 1 200px; margin-bottom: 0; }

@media (max-width: 640px) {
    .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
}

/* --- Knappar ------------------------------------------------------------- */

.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: var(--accent);
    border: 1.5px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover, button:hover { background: var(--accent-hover); text-decoration: none; }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
button:disabled { opacity: 0.7; cursor: default; }

.btn-block { display: flex; width: 100%; padding: 15px 20px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }

.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue-hover); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: #f2c4c4; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-muted); border-color: var(--border-strong); }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Meddelanden --------------------------------------------------------- */

.flashes { list-style: none; padding: 0; margin: 0 0 20px; }
.flashes li {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 15px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.flashes .error { background: var(--danger-soft); border-color: #f4c7c7; color: #8f2424; }
.flashes .success { background: var(--accent-soft); border-color: #cfe8d4; color: #1f6a2d; }

.notice {
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--warning-soft);
    border: 1px solid var(--warning-border);
    color: #5c5129;
    font-size: 14px;
    line-height: 1.6;
}
.notice p:last-child { margin-bottom: 0; }
.notice--green { background: var(--accent-soft); border-color: #d6ebda; color: #235c2e; }
.notice--info { background: var(--blue-soft); border-color: #d6e2fb; color: #1e3a6e; margin-top: 18px; }
.notice--info strong { display: block; margin-bottom: 4px; font-size: 15px; }
.notice--info p { margin-bottom: 8px; }
.notice--info a { font-weight: 600; }
.notice--info a::after { content: " ↗"; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}
.badge--ok { background: var(--accent-soft); border-color: #cfe8d4; color: #1f6a2d; }
.badge--fail { background: var(--danger-soft); border-color: #f4c7c7; color: #8f2424; }

/* --- Svarsalternativ (kort med stora bokstäver) -------------------------- */

.option-list { display: flex; flex-direction: column; gap: 10px; }

.option {
    display: block;
    position: relative;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}
.option input {
    position: absolute;
    top: 50%;
    left: 28px;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}
.option-box {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 60px;
    padding: 12px 22px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
@media (hover: hover) {
    .option:hover .option-box { border-color: var(--border-strong); }
}
.option-letter {
    flex-shrink: 0;
    width: 30px;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    text-align: center;
    color: var(--text-faint);
    transition: color 0.15s;
}
.option-text { font-size: 16px; line-height: 1.5; }
.option-tag {
    margin-left: auto;
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.option input:checked + .option-box { border-color: var(--accent); }
.option input:checked + .option-box .option-letter { color: var(--accent-letter); }
.option input:checked + .option-box .option-text { color: var(--accent); font-weight: 600; }
.option input:focus-visible + .option-box { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Kompakt variant med prick, t.ex. för ämnesval */
.option--compact .option-box { min-height: 0; padding: 14px 18px; gap: 14px; }
.option-dot {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.option input:checked + .option-box .option-dot {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent);
}

/* Ej valbart alternativ, t.ex. ämne som inte finns på engelska */
.option.is-disabled { cursor: not-allowed; }
.option.is-disabled .option-box { background: var(--surface-muted); border-style: dashed; }
.option.is-disabled .option-text { color: var(--text-muted); }
.option-tag--muted { background: var(--surface-muted); color: var(--text-muted); border: 1px solid var(--border); }
.option--compact .option-box { flex-wrap: wrap; row-gap: 8px; }
.option--compact .option-text { flex: 1 1 auto; min-width: 0; }

/* Språkväljare (Svenska / English) */
.lang-switch {
    display: flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 20px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.lang-option { flex: 1; margin: 0; position: relative; cursor: pointer; }
.lang-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lang-option span {
    display: block;
    padding: 10px 12px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 10px;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.lang-option input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.lang-option input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Variant med länkar (admin) */
.lang-switch--links { margin-bottom: 0; min-width: 260px; }
.lang-link {
    flex: 1;
    padding: 10px 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 10px;
}
.lang-link:hover { color: var(--text); text-decoration: none; }
.lang-link.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* Facit-lägen (resultatsidan) */
.option-box.is-correct { border-color: var(--accent); }
.option-box.is-correct .option-letter { color: var(--accent-letter); }
.option-box.is-correct .option-text { color: var(--accent); font-weight: 600; }
.option-box.is-correct .option-tag { background: var(--accent-soft); color: var(--accent); }
.option-box.is-wrong { border-color: var(--danger); }
.option-box.is-wrong .option-letter { color: var(--danger-letter); }
.option-box.is-wrong .option-text { color: var(--danger); font-weight: 600; }
.option-box.is-wrong .option-tag { background: var(--danger-soft); color: var(--danger); }
.option-list--static .option { cursor: default; }
.option-list--static .option:hover .option-box { border-color: var(--border); }
.option-list--static .option:hover .option-box.is-correct { border-color: var(--accent); }
.option-list--static .option:hover .option-box.is-wrong { border-color: var(--danger); }

@media (max-width: 640px) {
    .option-box { gap: 14px; padding: 11px 14px; min-height: 54px; }
    .option-letter { font-size: 28px; width: 24px; }
    .option-text { font-size: 15px; }
}

/* --- Frågor -------------------------------------------------------------- */

.question { padding: 26px 28px; margin-bottom: 16px; }
.question-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.question-text {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.55;
    margin-bottom: 18px;
}
.question-image {
    display: block;
    margin: 0 0 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.explanation {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    font-size: 15px;
}
.explanation strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; }

@media (max-width: 640px) {
    .page { padding: 20px 12px 48px; }
    .card, .question { padding: 18px; }
    .question-text { font-size: 17px; }
    h1 { font-size: 24px; }
}

/* --- Timer --------------------------------------------------------------- */

.timer-bar {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    pointer-events: none;
}
#timer {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--danger);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow);
}
#timer::before { content: "⏱"; font-size: 16px; }

/* --- Resultat ------------------------------------------------------------ */

.score {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.score-ring {
    --p: 0;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 50%;
    background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--border) 0);
    display: grid;
    place-items: center;
}
.score-ring span {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 700;
}
.score-text h2 { margin-bottom: 4px; font-size: 22px; }

.info-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 24px;
    margin: 0;
}
.info-list dt { font-size: 13px; color: var(--text-muted); }
.info-list dd { margin: 0; font-weight: 600; word-break: break-word; }

/* --- Tabeller ------------------------------------------------------------ */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-muted); }
.table .empty { text-align: center; color: var(--text-muted); padding: 24px; }
.table .nowrap { white-space: nowrap; }
.table .break { word-break: break-all; }

/* --- Admin --------------------------------------------------------------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.tile::after { content: "→"; color: var(--text-faint); transition: color 0.15s; }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile:hover::after { color: var(--accent); }

/* Ämnesruta med en knapp per språk */
.tile--split { flex-direction: column; align-items: stretch; gap: 12px; }
.tile--split::after { content: none; }
.tile--split:hover { border-color: var(--border); }
.tile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tile-actions .btn { flex: 1 1 auto; font-weight: 500; }
.btn-dim { color: var(--text-muted); border-style: dashed; }

.student-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.student-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.student-item[hidden] { display: none; }
.student-item details[open] { border-radius: var(--radius); box-shadow: 0 0 0 2px var(--accent-ring); }

/* Kompakt elevrad som fälls ut med ett tryck */
.student-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    min-height: 54px;
}
.student-summary::-webkit-details-marker { display: none; }
.student-summary::after { content: "▾"; color: var(--text-faint); transition: transform 0.15s; flex-shrink: 0; }
details[open] > .student-summary::after { transform: rotate(180deg); }
.student-summary .student-name { font-size: 16px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.student-meta { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.student-body { padding: 0 16px 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.student-body .student-code { display: inline-block; margin-bottom: 12px; }
.student-group-field { max-width: 280px; margin-bottom: 12px; }
.badge--grupp { background: var(--blue-soft); border-color: #d6e2fb; color: #1e3a6e; padding: 3px 10px; font-size: 13px; }
.badge--count { display: inline-block; padding: 3px 10px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.badge[hidden] { display: none; }

/* Sök, sortering och gruppfilter */
.student-toolbar { display: flex; gap: 10px; margin: 16px 0 10px; flex-wrap: wrap; }
.student-toolbar input[type="search"] { flex: 1 1 220px; }
.student-toolbar select { flex: 0 1 220px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-row[hidden] { display: none; }
.chip {
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 999px;
}
.chip:hover { background: var(--surface-muted); border-color: var(--border-strong); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.add-student > summary { list-style: none; cursor: pointer; }
.add-student > summary::-webkit-details-marker { display: none; }
.add-student[open] > summary { margin-bottom: 14px; }
.add-student-form { padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }

/* Snabblänkar överst på dashboarden */
.jump-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.jump-nav a {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.jump-nav a:hover { border-color: var(--accent); text-decoration: none; }
section[id] { scroll-margin-top: 80px; }

/* Provlistor (dashboard och arkiv) */
.result-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.result-item[hidden] { display: none; }
.result-item:has(.valj-prov:checked) { border-color: var(--danger); background: var(--danger-soft); }
.result-check { margin: 0; display: flex; padding: 6px; cursor: pointer; }
.result-check input { width: 20px; height: 20px; margin: 0; }
.result-main { flex: 1; min-width: 0; }
.result-name { font-weight: 600; overflow-wrap: anywhere; }
.result-meta { font-size: 14px; color: var(--text-muted); }
.result-actions { display: flex; gap: 8px; flex-shrink: 0; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bulk-check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; cursor: pointer; }
.bulk-check input { width: 20px; height: 20px; margin: 0; }

@media (max-width: 640px) {
    .jump-nav { flex-wrap: nowrap; overflow-x: auto; margin: 12px -12px 0; padding: 0 12px 4px; scrollbar-width: none; }
    .jump-nav::-webkit-scrollbar { display: none; }
    .jump-nav a { flex-shrink: 0; padding: 7px 12px; }
    .result-item { flex-wrap: wrap; }
    .result-actions { width: 100%; padding-left: 0; }
    .result-actions .btn, .result-actions button { flex: 1; }
    .student-toolbar select { flex: 1 1 100%; }
    .student-meta .badge--grupp { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.student-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.student-name { font-size: 17px; font-weight: 700; }
.student-code {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px 8px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.student-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
}
.check-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.check-pill:hover { border-color: var(--border-strong); }
.check-pill input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; }
.check-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.question-row-title { font-weight: 600; }
.question-row-meta { font-size: 13px; color: var(--text-muted); }
.answer-chip {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

/* Diskret admin-länk på startsidan */
#admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: var(--shadow);
    opacity: 0.6;
    transition: opacity 0.2s;
}
#admin-link:hover { opacity: 1; text-decoration: none; }

.footer-info { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 24px; }

/* Faktalista, t.ex. om en utbildning */
.fact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.fact-list li { display: flex; gap: 14px; align-items: flex-start; }
.fact-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: var(--accent-soft);
    border-radius: 12px;
}
.fact-list strong { display: block; font-size: 16px; }
.fact-list p { margin: 2px 0 0; color: var(--text-muted); font-size: 15px; }
textarea { resize: vertical; min-height: 84px; }

/* Val med några få alternativ bredvid varandra, t.ex. PPL / LAPL */
.choice-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.choice-field legend { padding: 0; }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
