:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #1d2330;
    --muted: #5f6b7d;
    --border: #e1e5eb;
    --brand: #0b6fa4;        /* calm blue, readable on white */
    --brand-ink: #ffffff;
    --accent: #d52b1e;       /* Canadian red */
    --ok: #1f8a4c;
    --ok-bg: #e7f6ed;
    --bad: #c62828;
    --bad-bg: #fdecec;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f141b;
        --surface: #171e27;
        --text: #e6eaf0;
        --muted: #9aa6b6;
        --border: #2a3441;
        --brand: #4fb3e8;
        --brand-ink: #06121b;
        --ok: #5fd08f;
        --ok-bg: #12301f;
        --bad: #ff8a80;
        --bad-bg: #3a1717;
        --shadow: none;
    }
    .q-sign, .sign-card img, .review-item img, .card-icon { background: #e9edf2; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 70vh; }

/* ---- header ---- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.logo { display: block; height: 40px; width: auto; }
.logo-ink { fill: #111d34; }
@media (prefers-color-scheme: dark) { .logo-ink { fill: var(--text); } }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.nav a.active, .nav a:hover { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.langs { position: relative; border-left: 1px solid var(--border); padding-left: 12px; }
.langs summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
    color: var(--muted); padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 15px;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.langs-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px;
    list-style: none; margin: 0; padding: 6px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.langs-menu a { display: block; text-decoration: none; color: var(--text); padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: 15px; }
.langs-menu a:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.langs-menu a.active { color: var(--brand-ink); background: var(--brand); }

/* When the menu doesn't fit next to the logo (narrow screens, long words), it moves to its own scrollable row. */
.topbar.nav-stacked .topbar-inner { flex-wrap: wrap; row-gap: 0; }
.topbar.nav-stacked .langs { margin-left: auto; }
.topbar.nav-stacked .nav { order: 3; flex-basis: 100%; margin: 0 -6px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 640px) {
    .topbar-inner { flex-wrap: wrap; row-gap: 0; }
    .langs { margin-left: auto; }
    .nav { order: 3; flex-basis: 100%; margin: 0 -6px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: none; }
    .logo { height: 28px; }
    .topbar-inner { min-height: 52px; }
    .nav a { padding: 6px 8px; font-size: 14px; }
    .langs { padding-left: 6px; }
    .langs summary { padding: 6px 6px; font-size: 13px; }
}
@media (max-width: 420px) {
    .logo { height: 24px; }
}

[hidden] { display: none !important; }

/* ---- generic blocks ---- */
.hero { margin: 8px 0 24px; }
.hero h1 { font-size: clamp(26px, 4vw, 36px); }
.lead { color: var(--muted); font-size: 18px; max-width: 720px; margin: 0; }
.page-title { font-size: 26px; }
.crumbs { margin: 0 0 8px; font-size: 14px; }
.crumbs a { text-decoration: none; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.disclaimer { color: var(--muted); font-size: 13px; margin-top: 32px; max-width: 820px; }
.badge, .chip {
    display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted);
}
.chip { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
    font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 10px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--brand); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }

/* ---- cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
    position: relative; display: flex; flex-direction: column; gap: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
    color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.card h2 { font-size: 19px; margin: 0; }
.card p { color: var(--muted); margin: 0; flex: 1; }
.card-feature { border-top: 4px solid var(--brand); transition: transform .12s ease; }
.card-feature:hover { transform: translateY(-2px); border-color: var(--brand); }
.card-meta { color: var(--brand); font-weight: 700; font-size: 14px; margin-top: 8px; }
.card-soon { opacity: .75; }
.card-soon .badge { align-self: flex-start; margin-top: 8px; }
.card-icon { width: 52px; height: 52px; border-radius: 12px; padding: 4px; }
.card-icon img { width: 100%; height: 100%; display: block; object-fit: contain; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.ticks { margin: 0; padding-left: 20px; }
.ticks li { margin-bottom: 8px; }
.stats { display: flex; gap: 12px; margin-bottom: 16px; }
.stats div { flex: 1; background: var(--bg); border-radius: 10px; padding: 12px; }
.stats strong { display: block; font-size: 28px; color: var(--brand); }
.stats span { color: var(--muted); font-size: 14px; }
.panel h3 { font-size: 16px; margin-top: 8px; }
.topic-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; }
@media (max-width: 520px) { .topic-list { columns: 1; } }
.topic-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); break-inside: avoid; font-size: 14px; }
.topic-list a { text-decoration: none; }
.topic-list span { color: var(--muted); }

/* ---- signs gallery ---- */
.sign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sign-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.sign-card img { width: 110px; height: 110px; display: block; object-fit: contain; margin: 0 auto 12px; border-radius: 10px; padding: 4px; }
.sign-card h3 { font-size: 15px; margin-bottom: 4px; }
.sign-card .en { color: var(--brand); font-size: 13px; margin: 0 0 6px; font-style: italic; }
.sign-card p { color: var(--muted); font-size: 13px; margin: 0; }

/* ---- quiz ---- */
.quiz { max-width: 820px; }
.setup { display: grid; gap: 14px; max-width: 460px; }
.setup label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.setup label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.setup select { font: inherit; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.setup select:disabled { opacity: .5; }
.setup .btn { justify-self: start; }
.setup p { margin: 0; }
.setup h2 { margin: 0; font-size: 20px; }
.setup fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.setup legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.notice { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.notice p { margin: 0; }
.notice .link-btn { justify-self: start; }

.progress { margin-bottom: 12px; }
.progress-label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.progress-track { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 99px; transition: width .2s ease; }

.q-card {
    display: flex; gap: 20px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.q-sign { flex: none; width: 150px; height: 150px; border-radius: 12px; padding: 6px; }
.q-sign img { width: 100%; height: 100%; display: block; object-fit: contain; }
/* Rules-question illustrations: wider road scenes drawn in public/scenes. */
.q-scene { flex: none; width: 300px; margin: 0; }
.q-scene img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.credit { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.explain-pic { margin: 10px 0 12px; max-width: 360px; }
.explain-pic img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.q-body { flex: 1; min-width: 0; }
.q-text { font-size: 19px; }
.q-en { color: var(--brand); font-style: italic; margin: -4px 0 12px; font-size: 15px; }
.alt-toggles { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 600px) {
    .q-card { flex-direction: column; align-items: stretch; padding: 16px; }
    .q-sign { width: 120px; height: 120px; margin: 0 auto; }
    .q-scene { width: 100%; max-width: 400px; margin: 0 auto; }
    .q-text { font-size: 17px; }
}

.answers { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.answer {
    width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left;
    font: inherit; color: var(--text); background: var(--surface);
    border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 12px; cursor: pointer;
}
.answer:hover:not(:disabled) { border-color: var(--brand); }
.answer:disabled { cursor: default; color: var(--text); }
.answer-key {
    flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: var(--bg); font-size: 13px; font-weight: 700; color: var(--muted);
}
.answer-text { display: grid; gap: 2px; padding-top: 1px; }
.answer-en { color: var(--muted); font-style: italic; }
.answer.picked { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.answer.picked .answer-key { background: var(--brand); color: var(--brand-ink); }
.answer.correct { border-color: var(--ok); background: var(--ok-bg); }
.answer.correct .answer-key { background: var(--ok); color: #fff; }
.answer.wrong { border-color: var(--bad); background: var(--bad-bg); }
.answer.wrong .answer-key { background: var(--bad); color: #fff; }

.feedback { margin-top: 12px; border-radius: var(--radius); padding: 16px 18px; border: 1px solid; }
.feedback p { margin: 6px 0 12px; }
.feedback.ok { background: var(--ok-bg); border-color: var(--ok); }
.feedback.ok strong { color: var(--ok); }
.feedback.bad { background: var(--bad-bg); border-color: var(--bad); }
.feedback.bad strong { color: var(--bad); }

.exam-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.exam-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.dot {
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.dot.done { background: color-mix(in srgb, var(--brand) 15%, var(--surface)); color: var(--brand); border-color: transparent; }
.dot.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.dot.gap { margin-left: 14px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); }
.clock.low { color: var(--bad); border-color: var(--bad); background: var(--bad-bg); }

.results h2 { margin-bottom: 8px; }
.big-score { font-size: 28px; font-weight: 800; color: var(--brand); margin: 0 0 12px; }
.verdict { font-weight: 700; font-size: 18px; padding: 12px 14px; border-radius: 10px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.score-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.score-row.ok strong { color: var(--ok); }
.score-row.bad strong { color: var(--bad); }
.review { margin-top: 20px; }
.review-item { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.review-item img { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 8px; padding: 3px; }
.review-item img.scene { width: 96px; height: 72px; padding: 0; }
.review-item p { margin: 0 0 4px; }
.review-q { font-weight: 600; }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }

.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; padding: 20px 0 28px; }

/* ---- my results ---- */
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.progress-notice { margin-bottom: 16px; }
.progress-top { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 16px; }
.progress-top > * { min-width: 0; }
@media (max-width: 820px) { .progress-top { grid-template-columns: 1fr; } }
.panel > h2:first-child { margin-top: 0; }
.readiness-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.readiness-head h2 { margin: 0; }
.status-pill { font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.status-start { background: var(--bad-bg); color: var(--bad); }
.status-close { background: #fff4d6; color: #8a5a00; }
.status-ready { background: var(--ok-bg); color: var(--ok); }
.ready-row { margin: 14px 0; }
.ready-label { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 15px; }
.ready-label span { color: var(--muted); }
.ready-label b { color: var(--text); }
.ready-bar { position: relative; height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); }
.ready-fill { display: block; height: 100%; border-radius: inherit; min-width: 4px; }
.ready-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .55; }
.lvl-low { background: #e5534b; }
.lvl-mid { background: #e8a317; }
.lvl-high { background: var(--ok); }
.recent { margin: 10px 0 0; font-weight: 600; }
.next-step { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.next-step h2, .next-step p { margin: 0; }
.next-alt { font-weight: 600; text-decoration: none; }
.mastery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 28px; }
.mastery li { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 14px; align-items: baseline; }
.mastery-name { font-weight: 600; }
.mastery-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.mastery-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); overflow: hidden; }
.mastery-bar span { display: block; height: 100%; border-radius: inherit; min-width: 3px; }
.mastery-go { grid-column: 1 / -1; font-size: 13px; font-weight: 600; text-decoration: none; }
.table-wrap { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th, .history td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.history th { color: var(--muted); font-weight: 600; font-size: 13px; }
.result-tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.result-passed { background: var(--ok-bg); color: var(--ok); }
.result-partial { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.result-failed { background: var(--bad-bg); color: var(--bad); }
.privacy { margin-top: 24px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.privacy p { margin: 0; max-width: 640px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.empty-state p { margin-top: 0; }
.devices { margin-top: 24px; }
.devices h2 { margin-top: 0; }
.transfer { display: grid; gap: 12px; margin: 12px 0; }
.transfer-code { display: block; font-size: 30px; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--brand); }
.transfer-link, .code-form input {
    font: inherit; width: 100%; padding: 9px 10px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.devices summary { cursor: pointer; font-weight: 600; margin-top: 8px; }
.code-form { display: flex; gap: 8px; margin: 12px 0 8px; max-width: 420px; }
.code-form input { text-transform: uppercase; letter-spacing: .08em; }

/* ---- share with friends ---- */
.share-cta {
    display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
    background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; margin: 0 0 24px;
}
.share-cta p { margin: 0; font-weight: 600; max-width: 620px; }
.share { position: relative; }
.share-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px; display: grid; gap: 2px;
    padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
}
.share-menu[hidden] { display: none; }
.share-option {
    display: block; width: 100%; text-align: left; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
    padding: 9px 12px; border-radius: 6px; border: 0; background: none; color: var(--text); text-decoration: none;
}
.share-option:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.share-option.whatsapp::before, .share-option.telegram::before, .share-option.facebook::before, .share-option.copy::before {
    content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px;
}
.share-option.whatsapp::before { background: #25d366; }
.share-option.telegram::before { background: #229ed9; }
.share-option.facebook::before { background: #1877f2; }
.share-option.copy::before { background: var(--muted); }
.exam-nav .share-menu { left: 0; right: auto; }

/* ---- report an error ---- */
.report { margin-top: 10px; }
.report-link { font-size: 13px; color: var(--muted); }
.report-form { display: grid; gap: 8px; max-width: 460px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.report-form p { margin: 0; }
.report-title { font-weight: 700; }
.report-form label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.report-form textarea { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: vertical; }
.report-status { color: var(--bad); }
.report-done { color: var(--ok); font-weight: 600; margin: 0; }

/* ---- admin ---- */
.admin-logout { margin-left: auto; }
.admin-login { max-width: 460px; margin: 40px auto; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.admin-tabs a { text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.admin-tabs a.active { background: var(--brand); color: var(--brand-ink); }
.admin-report { margin-bottom: 14px; display: grid; gap: 10px; }
.admin-report-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-comment { margin: 0; padding: 8px 12px; border-left: 4px solid var(--brand); background: var(--bg); border-radius: 6px; white-space: pre-wrap; }
.admin-question { display: flex; gap: 14px; align-items: flex-start; }
.admin-question img { width: 110px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.admin-question ol { margin: 6px 0; padding-left: 20px; }
.admin-question p { margin: 0 0 4px; }

/* ---- study / exam language ---- */
.lang-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); border: 1px solid var(--border); }
.lang-settings label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.lang-settings p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 420px) { .lang-settings { grid-template-columns: 1fr; } }

/* ---- first steps checklist ---- */
.steps-progress { position: sticky; top: calc(var(--topbar-height, 60px) + 8px); z-index: 5; display: grid; gap: 8px; padding: 12px 16px; margin-bottom: 8px; }
.steps-progress-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.steps-progress .bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); overflow: hidden; }
.steps-progress .bar span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width .25s; }
.steps-group { margin: 24px 0; display: grid; gap: 12px; }
.steps-group > h2 { margin: 0; }
.step { display: grid; gap: 4px; }
.step p { margin: 0 0 6px; }
.step-head { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.step-head h3 { margin: 0; font-size: 18px; }
.step-head input { width: 22px; height: 22px; flex: none; accent-color: var(--ok); cursor: pointer; }
.step.is-done { opacity: .7; }
.step.is-done h3 { text-decoration: line-through; }
.step-bring { padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.step-links a { margin-left: 2px; }
@media (max-width: 640px) { .steps-progress { padding: 10px 12px; } .step-head h3 { font-size: 17px; } }
.btn-small { padding: 6px 12px; font-size: 14px; }
.card-icon-text { display: grid; place-items: center; font-size: 30px; font-weight: 700; color: var(--ok); }

/* ---- admin statistics ---- */
.stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 16px 0; }
.stat-tile { display: grid; gap: 4px; align-content: start; }
.stat-tile span { color: var(--muted); font-size: 14px; }
.stat-tile strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.day-chart { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 18px; border-bottom: 1px solid var(--border); }
.day-chart-max { position: absolute; top: 0; left: 0; }
.day-bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.day-bar span { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; }
.day-bar:hover span, .day-bar:focus span { filter: brightness(1.2); }
.day-bar:hover::after, .day-bar:focus::after {
    content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 2;
    white-space: nowrap; padding: 4px 8px; border-radius: 6px; font-size: 13px; background: var(--text); color: var(--surface);
}
.day-chart-axis { display: flex; justify-content: space-between; margin: 4px 0 12px; }
.stats-table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 4px 16px 4px 0; text-align: left; border-bottom: 1px solid var(--border); }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-bottom: 10px; }
.share-value { font-variant-numeric: tabular-nums; font-weight: 600; }
.share-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); overflow: hidden; }
.share-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.hard-question { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); }
.nav + .admin-logout { margin-left: 12px; }
@media (max-width: 640px) { .nav + .admin-logout { margin-left: auto; } }

/* ---- news ---- */
.news-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.news-card { display: grid; gap: 6px; align-content: start; overflow: hidden; padding-top: 0; text-decoration: none; color: var(--text); transition: border-color .15s; }
.news-card:hover { border-color: var(--brand); }
.news-card h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.news-card p { margin: 0; color: var(--muted); font-size: 15px; }
.news-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.news-story { max-width: 720px; margin: 0 auto 24px; }
.news-story h1 { margin: 10px 0 8px; line-height: 1.2; }
.news-story p { line-height: 1.65; }
.home-news { margin: 28px 0; }
.home-news-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.admin-news { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.admin-news h2 { margin: 4px 0; font-size: 18px; }
.admin-news.is-hidden { opacity: .6; }

/* ---- resume builder ---- */
.resume-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.resume-layout > * { min-width: 0; }
.resume-side { position: sticky; top: calc(var(--topbar-height, 60px) + 16px); display: grid; gap: 8px; }
/* The calculator's result stays fully on screen and scrolls inside when it is taller than the window. */
.calc-side { max-height: calc(100vh - var(--topbar-height, 60px) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
.resume-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.resume-frame { height: 560px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.resume-frame iframe { width: 816px; height: 1056px; border: 0; transform: scale(.513); transform-origin: 0 0; }
.rf-steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.rf-steps button { flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.rf-steps button b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; background: color-mix(in srgb, var(--muted) 18%, transparent); }
.rf-steps button.done b { background: var(--ok); color: #fff; }
.rf-steps button.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.rf-steps button.active b { background: var(--brand); color: var(--brand-ink); }
.rf-step { display: grid; gap: 14px; }
.rf-step h2, .rf-step h3 { margin: 0; }
.rf-step h3 { margin-top: 8px; }
.rf-field { display: grid; gap: 4px; min-width: 0; }
.rf-label { font-weight: 600; font-size: 14px; }
.rf-field input, .rf-field textarea, .rf-field select, .rf-month input, .rf-month select {
    width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
.rf-field textarea { resize: vertical; }
.rf-pair { padding: 10px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 5%, var(--surface)); border: 1px solid var(--border); }
.rf-pair-row { display: grid; gap: 2px; }
.rf-pair .link-btn { justify-self: start; }
.rf-lang { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.rf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.rf-month { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 6px; }
.rf-dates { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.rf-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.rf-bullets { display: grid; gap: 8px; }
.rf-bullet { display: grid; gap: 4px; }
.rf-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.rf-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.rf-remove { justify-self: start; color: var(--bad); font-size: 13px; }
.rf-templates { display: flex; flex-wrap: wrap; gap: 16px; }
.rf-warnings { margin: 0; padding-left: 20px; color: var(--bad); }
.rf-warnings li { margin-bottom: 4px; }
.rf-downloads { display: flex; flex-wrap: wrap; gap: 10px; }
.rf-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
@media (max-width: 960px) {
    .resume-layout { grid-template-columns: 1fr; }
    .resume-side { position: static; }
    .resume-frame { height: 420px; }
    .resume-frame iframe { transform: scale(.39); }
}
.rf-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rf-options:empty { display: none; }
.rf-options .chip { cursor: pointer; border: 1px solid var(--border); font: inherit; font-size: 13px; }

.news-cover { position: relative; display: flex; align-items: center; aspect-ratio: 2 / 1; margin: 0 -20px 8px; background-size: cover; background-position: center right; }
.news-cover-large { margin: 12px 0 16px; border-radius: var(--radius); }
.news-highlight { margin-left: 22px; max-width: 55%; color: #fff; font-size: clamp(26px, 4.4vw, 40px); font-weight: 800; line-height: 1.05; letter-spacing: -.5px; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.news-cover-large .news-highlight { margin-left: 32px; font-size: clamp(32px, 7vw, 64px); }

.news-topics { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 8px; margin: 0 -4px 10px; scrollbar-width: thin; }
.news-topic { flex: none; display: flex; align-items: flex-end; width: 132px; height: 66px; padding: 8px 10px; border-radius: 12px;
    background-size: cover; background-position: right center; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .45); outline: 3px solid transparent; outline-offset: 2px; }
.news-topic-all { align-items: center; justify-content: center; width: 80px; background: var(--surface); color: var(--text); border: 1px solid var(--border); text-shadow: none; }
.news-topic.active { outline-color: var(--brand); }

.calc-note { border-left: 4px solid var(--brand); margin-bottom: 16px; }
.calc-form { display: grid; gap: 16px; }
.calc-form fieldset { margin: 0; min-width: 0; }
.calc-form legend { padding: 0; float: left; width: 100%; margin-bottom: 4px; }
.calc-form legend + * { clear: both; }
.calc-check { align-items: flex-start; font-weight: 400; }
.calc-check input { flex: none; margin-top: 2px; }
.calc-result { display: grid; gap: 12px; }
.calc-result h3 { margin: 6px 0 0; font-size: 16px; }
.calc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.calc-total strong { font-size: 44px; line-height: 1; color: var(--brand); }
.calc-section { display: grid; gap: 2px; }
.calc-row { display: flex; justify-content: space-between; gap: 10px; }
.calc-row-head { font-weight: 600; }
.calc-row-item { font-size: 13px; color: var(--muted); padding-left: 12px; }
.calc-levels { display: grid; gap: 6px; }
.calc-levels-line { display: grid; gap: 4px; }
.calc-levels-line > span:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
.calc-clb.is-low { background: var(--bad-bg); color: var(--bad); }
.calc-program { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.calc-program.is-ok { border-color: var(--ok); background: var(--ok-bg); }
.calc-program-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; }
.calc-program.is-ok .calc-status { color: var(--ok); font-weight: 600; }
.calc-program.is-no .calc-status { color: var(--bad); }
.calc-program p, .calc-missing { margin: 0; }
.calc-missing { padding-left: 18px; }
.calc-error { color: var(--bad); }
@media (max-width: 900px) { .calc-side { position: static; max-height: none; overflow: visible; } }
.calc-mini { display: none; }
@media (max-width: 900px) {
    .calc-mini:not([hidden]) { display: block; position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 20; padding: 10px 18px;
        border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 700; text-decoration: none; box-shadow: var(--shadow); white-space: nowrap; }
}

.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; font-size: 14px; }
.footer-links a, .footer-links .link-btn { color: var(--brand); font-weight: 600; }
.footer p { margin: 0; }
.feedback-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.feedback-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.feedback-dialog h2 { margin: 0; font-size: 20px; }
.feedback-dialog p { margin: 0; }
.feedback-topics { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.feedback-topics .rf-check { font-weight: 400; }
.feedback-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.feedback-actions { display: flex; justify-content: flex-end; gap: 10px; }
.feedback-status.is-ok { color: var(--ok); font-weight: 600; }
.feedback-status.is-bad { color: var(--bad); }
.privacy { display: grid; gap: 16px; }
.privacy h2 { margin-top: 0; font-size: 20px; }
.privacy p:last-child { margin-bottom: 0; }
.calc-share { justify-self: start; }
.calc-draws { display: grid; gap: 6px; }
.calc-draws-table { width: 100%; border-collapse: collapse; }
.calc-draws-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 6px 4px 0; }
.calc-draws-table td { padding: 5px 6px 5px 0; border-top: 1px solid var(--border); vertical-align: top; }
.calc-draws-table .num { text-align: right; white-space: nowrap; padding-right: 0; }
.calc-draws-table tr.is-ok td { color: var(--ok); font-weight: 600; }

.service-how summary { cursor: pointer; }
.service-how ul { margin: 10px 0 0; padding-left: 20px; }
.service-how li { margin-bottom: 6px; }
.service-categories { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 10px; }
.chip-link { text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; }
.chip-link.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip-link.active .muted { color: inherit; opacity: .8; }
.service-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.service-filters .rf-field { min-width: 200px; }
.service-filters select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.service-card { display: grid; gap: 6px; align-content: start; text-decoration: none; color: var(--text); }
.service-card:hover { border-color: var(--brand); }
.service-card h3, .service-card p { margin: 0; }
.service-category { color: var(--muted); font-size: 13px; font-weight: 600; }
.service-langs { display: flex; flex-wrap: wrap; gap: 4px; }
.service-verified { color: var(--ok); font-weight: 700; font-size: 14px; }
.service-verified.big { font-size: 16px; margin: 6px 0 0; }
.service-add { margin: 10px 0 20px; display: grid; gap: 8px; justify-items: start; }
.service-add h2, .service-add p { margin: 0; }
.service-columns { gap: 16px; margin-bottom: 16px; }
.service-description { margin-top: 0; }
.service-contacts { display: grid; gap: 8px; align-content: start; }
.service-contacts h2 { margin: 0 0 4px; font-size: 18px; }
.service-contacts .btn { justify-content: flex-start; text-align: left; overflow-wrap: anywhere; }
.service-check { margin-bottom: 12px; border-left: 4px solid var(--ok); }
.service-check h2 { margin-top: 0; font-size: 18px; }
.admin-services-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-status { color: var(--ok); font-weight: 600; }
.admin-form { display: grid; gap: 16px; }
.admin-form h2 { margin: 0; font-size: 18px; }
.admin-form input:not([type=checkbox]):not([type=hidden]), .admin-form textarea, .admin-form select { width: 100%; }
.admin-form details summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.admin-langs { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.admin-langs .rf-check { font-weight: 400; }
.admin-form-actions { display: flex; gap: 10px; }
.admin-form-delete { margin-top: 20px; }
.calc-warning { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); }

.section-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 6px; padding-bottom: 4px; scrollbar-width: none; }
.section-tabs a { flex: none; text-decoration: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; }
.section-tabs a.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tracker { display: grid; gap: 12px; margin-bottom: 20px; }
.tracker h2, .tracker p { margin: 0; }
.tracker-list { display: grid; gap: 10px; }
.tracker-item { border: 1px solid var(--border); border-left-width: 5px; border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.tracker-item p { margin: 0; }
.tracker-item.is-ok { border-left-color: var(--ok); }
.tracker-item.is-warn { border-left-color: #e0a800; }
.tracker-item.is-bad { border-left-color: var(--bad); background: var(--bad-bg); }
.tracker-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tracker-state { font-weight: 700; font-size: 13px; }
.tracker-item.is-ok .tracker-state { color: var(--ok); }
.tracker-item.is-warn .tracker-state { color: #a06f00; }
.tracker-item.is-bad .tracker-state { color: var(--bad); }
.tracker-actions { display: flex; gap: 16px; align-items: center; }
.tracker-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.tracker-form select, .tracker-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.links-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.links-group h2 { margin-top: 0; font-size: 18px; }
.links-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.links-group li { display: grid; gap: 2px; }
.links-group a { font-weight: 600; }
.rounds-filters select:disabled { opacity: .5; }
.rounds-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rounds-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rounds-card { display: grid; gap: 2px; text-decoration: none; color: var(--text); padding: 14px; }
.rounds-card:hover { border-color: var(--brand); }
.rounds-card-score { font-size: 30px; line-height: 1.1; color: var(--brand); }
.rounds-chart-box, .rounds-table-box { margin-bottom: 16px; }
.rounds-chart-box h2, .rounds-table-box h2 { margin-top: 0; font-size: 18px; }
.rounds-chart { position: relative; width: 100%; }
.rounds-chart svg { display: block; width: 100%; height: auto; }
.rc-grid { stroke: var(--border); stroke-width: 1; }
.rc-axis { fill: var(--muted); font-size: 11px; }
.rc-line { fill: none; stroke: #2a78d6; stroke-width: 2; }
.rc-dot { fill: #2a78d6; stroke: var(--surface); stroke-width: 2; }
.rc-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.rc-ring { fill: none; stroke: #2a78d6; stroke-width: 2; }
@media (prefers-color-scheme: dark) { .rc-line, .rc-ring { stroke: #3987e5; } .rc-dot { fill: #3987e5; } }
.rounds-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; box-shadow: var(--shadow); max-width: 260px; }
.rounds-chart-box { position: relative; }
.rounds-table-wrap { overflow-x: auto; }
.rounds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rounds-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.rounds-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rounds-table .num { text-align: right; }
.rounds-table .nowrap { white-space: nowrap; }
.rounds-chip { margin-right: 4px; font-size: 12px; }
.print-only { display: none; }
@media print {
    .topbar, .footer, .no-print, .share-cta, .disclaimer, .calc-mini, .feedback-dialog { display: none !important; }
    .print-only { display: block; }
    body, .panel { background: #fff !important; color: #000 !important; box-shadow: none !important; }
    .panel { border: 1px solid #ccc; }
    .rounds-summary { grid-template-columns: repeat(3, 1fr); }
    .rounds-table { font-size: 10.5pt; }
    .rounds-table th { background: #0b6fa4 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rounds-table tr:nth-child(even) td { background: #f3f6f9; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .rounds-table tr { break-inside: avoid; }
    .rounds-print-head { font-weight: 700; margin: 0 0 8px; }
    .hero { margin-bottom: 8px; }
}
.calc-reset { justify-self: end; }
/* Hints under some fields must not push the neighbouring field down. */
.calc-form .rf-grid { align-items: start; }
.sign-page-head { display: flex; gap: 24px; align-items: flex-start; margin: 8px 0 20px; }
.sign-page-head img { flex: none; width: 180px; height: 180px; object-fit: contain; background: #e9edf2; border-radius: 14px; padding: 8px; }
.sign-page-head h1 { font-size: clamp(24px, 3.4vw, 32px); margin: 2px 0 6px; }
.sign-questions { margin-bottom: 16px; display: grid; gap: 8px; }
.sign-questions h2 { margin: 0; font-size: 18px; }
.sign-questions summary { cursor: pointer; font-weight: 600; }
.sign-questions ol { margin: 8px 0; }
.sign-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sign-nav { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0; font-weight: 600; }
.sign-card-link { text-decoration: none; color: var(--text); display: block; }
.sign-card-link:hover { border-color: var(--brand); }
.sign-card h3 a { color: inherit; text-decoration: none; }
@media (max-width: 560px) { .sign-page-head { flex-direction: column; } .sign-page-head img { width: 140px; height: 140px; } }
.pnp-how ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.pnp-ontario { border-left: 5px solid var(--brand); margin: 16px 0 20px; }
.pnp-ontario h2 { margin-top: 0; }
.pnp-alert { font-weight: 600; }
.pnp-ontario dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 16px; margin: 0 0 12px; }
.pnp-ontario dt { font-weight: 700; }
.pnp-ontario dd { margin: 0; }
@media (max-width: 600px) { .pnp-ontario dl { grid-template-columns: 1fr; } .pnp-ontario dd { margin-bottom: 6px; } }
.pnp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pnp-filters button { cursor: pointer; font-family: inherit; }
.pnp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.pnp-card { display: flex; flex-direction: column; gap: 8px; }
.pnp-card[hidden] { display: none; }
.pnp-card h3, .pnp-card p { margin: 0; }
.pnp-card > a { margin-top: auto; font-weight: 600; }
.pnp-streams { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.pnp-streams .badge { margin-left: 4px; font-size: 11px; }
.badge-ee { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-business { background: color-mix(in srgb, var(--warn, #b7791f) 15%, transparent); color: var(--warn, #b7791f); }
.calc-warning p { margin: 0; }
.calc-warning p + p { margin-top: 6px; }
.calc-warning .calc-missing { margin: 4px 0 0; padding-left: 18px; }

/* Home page: compact section cards, icon beside the title, so every section fits on one screen. */
.cards-compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cards-compact .card {
    display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto 1fr auto;
    column-gap: 10px; row-gap: 4px; align-items: center; padding: 14px 16px;
}
.cards-compact .card-icon { grid-row: 1; width: 34px; height: 34px; padding: 2px; border-radius: 8px; }
.cards-compact .card-icon-text { font-size: 22px; }
.cards-compact .card h2 { grid-row: 1; font-size: 16px; line-height: 1.25; }
.cards-compact .card p { grid-column: 1 / -1; align-self: start; font-size: 14px; line-height: 1.4; }
.cards-compact .card-meta { grid-column: 1 / -1; margin-top: 2px; font-size: 13px; }
.cards-compact .card-feature { border-top-width: 3px; }
@media (max-width: 640px) {
    .cards-compact { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cards-compact .card { padding: 12px; grid-template-columns: 28px 1fr; }
    .cards-compact .card-icon { width: 28px; height: 28px; }
    .cards-compact .card-icon-text { font-size: 18px; }
    .cards-compact .card h2 { font-size: 15px; }
    .cards-compact .card p { font-size: 13px; }
}
@media (max-width: 380px) { .cards-compact { grid-template-columns: 1fr; } }

/* Resume builder: several resumes, ready phrases, score and job-ad check. */
.rf-resumes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: end; margin-bottom: 12px; padding: 14px 16px; }
.rf-resumes .rf-field { margin: 0; }
.rf-resumes-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-resumes > small { grid-column: 1 / -1; }
@media (max-width: 640px) { .rf-resumes { grid-template-columns: 1fr; } }
.rf-phrases { margin-top: 10px; border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; }
.rf-phrases summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.rf-phrases[open] summary { margin-bottom: 6px; }
.rf-phrase-list { display: grid; gap: 6px; margin-top: 8px; }
.rf-phrase { display: grid; gap: 2px; text-align: left; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.rf-phrase:hover:not(:disabled) { border-color: var(--brand); }
.rf-phrase small { color: var(--muted); }
.rf-phrase:disabled { opacity: .6; cursor: default; }
.rf-score { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rf-score h3 { margin: 0; }
.rf-score strong { font-size: 22px; }
.rf-score .is-good { color: var(--ok); }
.rf-score .is-mid { color: #b7791f; }
.rf-score .is-low { color: var(--bad); }
.rf-jobad summary { cursor: pointer; }
.rf-jobad textarea { width: 100%; margin: 8px 0; font: inherit; }
.rf-jobad-result .chip { margin: 2px 4px 2px 0; }
.chip-missing { background: var(--bad-bg); color: var(--bad); }
.chip-found { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* Calculator: where else to apply (Express Entry category rounds and provincial streams). */
.calc-pnp { margin: 20px 0; }
.calc-pnp > .panel { display: grid; gap: 12px; }
.calc-pnp h2, .calc-pnp h3, .calc-pnp p { margin: 0; }
.calc-pnp-nomination { font-weight: 600; color: var(--brand); }
.calc-pnp-block { display: grid; gap: 6px; }
.calc-draws-table tr.is-maybe td { color: #b7791f; }
.calc-draws-table tr.is-muted td { color: var(--muted); }
.calc-streams { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.calc-stream { display: grid; gap: 6px; align-content: start; border: 1px solid var(--border); border-left-width: 5px; border-radius: 10px; padding: 10px 12px; }
.calc-stream.is-yes { border-left-color: var(--ok); }
.calc-stream.is-check { border-left-color: #b7791f; }
.calc-stream.is-no { border-left-color: var(--border); opacity: .85; }
.calc-stream ul { margin: 0; padding-left: 18px; }
.calc-stream .calc-checks li { color: var(--muted); }
.calc-stream.is-yes .calc-status { color: var(--ok); }
.calc-stream.is-check .calc-status { color: #b7791f; }
.calc-pnp-summary { display: grid; gap: 2px; margin: 10px 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--brand); text-decoration: none; color: var(--text); }
.calc-pnp-form .calc-pnp-on { border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 4px; }
.pnp-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; border-left: 5px solid var(--brand); }
.pnp-cta h2, .pnp-cta p { margin: 0 0 4px; }
.pnp-cta > div { flex: 1 1 320px; }
.pnp-draws { margin-bottom: 16px; }
.pnp-draws h2 { margin-top: 0; }
.table-wrap { overflow-x: auto; }

/* Money calculators (salary, mortgage, car). */
.money-sub { margin: 4px 0 10px; }
.money-big { font-size: 26px; font-weight: 700; color: var(--brand); }
.money-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
@media (max-width: 520px) { .money-compare { grid-template-columns: 1fr; } }
.money-sources { margin: 20px 0; }
.money-sources h2 { margin-top: 0; font-size: 17px; }
.money-sources ul { margin: 0 0 8px; padding-left: 18px; }
.calc-result h3 { margin: 14px 0 6px; font-size: 16px; }

/* Salary calculator: amount with "$", period buttons, quick amounts and the main numbers under the form. */
.money-amount { position: relative; display: block; }
.money-amount .money-currency { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); pointer-events: none; }
.money-amount input { width: 100%; padding-left: 28px; font-size: 22px; font-weight: 700; }
.money-periods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.money-period input { position: absolute; opacity: 0; pointer-events: none; }
.money-period span { display: block; text-align: center; padding: 8px 6px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; background: var(--surface); }
.money-period input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.money-period input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.money-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.money-presets button { cursor: pointer; font-family: inherit; }
.money-hours[hidden] { display: none; }
.money-summary:empty { display: none; }
.money-summary { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.money-summary p { margin: 6px 0 0; }
.money-summary-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.money-summary-main strong { font-size: 30px; color: var(--brand); }
