:root {
  color-scheme: light;
  --bg: #f4f7fb; --panel: #ffffff; --panel-2: #f8fafc; --ink: #14213a; --muted: #64748b;
  --line: #dfe7f1; --line-strong: #cbd7e5; --navy: #102a43; --blue: #2563eb; --blue-2: #0ea5e9;
  --teal: #0f9f8f; --green: #159447; --red: #dc3f4f; --amber: #d9860b; --violet: #7457d9;
  --shadow: 0 14px 40px rgba(29, 57, 87, .08); --shadow-lg: 0 30px 80px rgba(16, 42, 67, .16);
  --radius: 20px; --sidebar: 252px; --nav-bg: #0e2943;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1422; --panel: #111e2f; --panel-2: #162538; --ink: #edf4fc; --muted: #9fb0c5;
  --line: #263a50; --line-strong: #385068; --navy: #edf4fc; --blue: #5b8dff; --blue-2: #38bdf8;
  --shadow: 0 16px 48px rgba(0,0,0,.22); --shadow-lg: 0 30px 80px rgba(0,0,0,.35); --nav-bg: #07111d;
}
* { box-sizing: border-box; }
html { width: 100%; min-width: 320px; height: 100%; overflow: hidden; background: var(--bg); }
body { width: 100%; margin: 0; height: 100%; overflow: hidden; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.5; }
#app { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; }
.splash, .fatal { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.splash-card, .fatal { text-align: center; }
.splash-card { width: min(560px, 100%); padding: 48px; border-radius: 28px; background: var(--panel); box-shadow: var(--shadow-lg); }
.brand-mark, .brand-logo { display: grid; place-items: center; color: white; font-weight: 900; background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 12px 28px rgba(37,99,235,.28); }
.brand-mark { width: 64px; height: 64px; margin: auto; border-radius: 20px; font-size: 30px; }
.eyebrow, .section-kicker, .topbar-kicker { margin: 0; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.splash h1 { margin: 16px 0 12px; font-size: 48px; letter-spacing: -.04em; }
.splash .lead { color: var(--muted); font-size: 18px; }
.progress-track, .mini-progress, .bar, .exam-progress { overflow: hidden; border-radius: 99px; background: var(--line); }
.progress-track { height: 9px; margin-top: 28px; }
.progress-track span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-2)); animation: loading 1.8s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
.app-shell { width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 24px 16px 20px; color: #dce9f7; background: var(--nav-bg); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 28px; }
.brand-logo { width: 44px; height: 44px; border-radius: 14px; font-size: 22px; }
.brand strong { display: block; color: #fff; font-size: 17px; line-height: 1.2; }
.brand small { color: #8fb0cd; }
.nav-list { display: grid; gap: 5px; }
.nav-link { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border-radius: 12px; color: #a9bfd3; font-weight: 700; font-size: 14px; transition: .15s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: linear-gradient(100deg, rgba(52,120,246,.9), rgba(20,160,215,.82)); box-shadow: 0 8px 25px rgba(0, 80, 180, .25); }
.nav-link b { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 99px; text-align: center; color: white; background: var(--red); font-size: 11px; }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; color: #8fb0cd; }
.mini-progress { height: 5px; margin-bottom: 8px; background: rgba(255,255,255,.12); }
.mini-progress span { display: block; height: 100%; background: #55d6c7; }
.main-column { height: 100%; min-height: 0; margin-left: var(--sidebar); overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: var(--line-strong) var(--bg); -webkit-overflow-scrolling: touch; }
.main-column::-webkit-scrollbar { width: 14px; }
.main-column::-webkit-scrollbar-track { background: var(--bg); }
.main-column::-webkit-scrollbar-thumb { min-height: 48px; border: 3px solid var(--bg); border-radius: 999px; background: var(--line-strong); }
.main-column::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(22px, 4vw, 54px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(14px); }
.topbar strong { display: block; font-size: 15px; }
.topbar-kicker { color: var(--muted); font-size: 9px; }
.topbar-actions, .hero-actions, .flag-actions, .question-actions, .learning-actions, .modal-actions { display: flex; align-items: center; gap: 12px; }
.data-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.data-status i { width: 7px; height: 7px; border-radius: 50%; background: #20b66c; box-shadow: 0 0 0 4px rgba(32,182,108,.12); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; }
.scroll-helper { position: fixed; z-index: 32; right: 24px; bottom: 24px; min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 15px; border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line)); border-radius: 999px; color: white; background: linear-gradient(110deg, #2764e7, #168fcf); box-shadow: 0 12px 30px rgba(37,99,235,.28); font-weight: 850; cursor: pointer; }
.scroll-helper[hidden] { display: none; }
.scroll-helper .icon { width: 18px; height: 18px; transition: transform .15s ease; }
.scroll-helper.at-bottom .icon { transform: rotate(180deg); }
.content { width: min(1500px, 100%); margin: 0 auto; padding: clamp(24px, 3.5vw, 50px); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.btn { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 800; cursor: pointer; transition: transform .12s ease, filter .12s ease, background .12s ease; }
.btn:hover:not(:disabled) { filter: brightness(1.035); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { color: #fff; background: linear-gradient(110deg, #2764e7, #168fcf); box-shadow: 0 10px 24px rgba(37,99,235,.2); }
.btn-secondary { color: #fff; background: var(--navy); }
:root[data-theme="dark"] .btn-secondary { color: #0b1422; background: #dceafa; }
.btn-light { border-color: var(--line); background: var(--panel); }
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-danger { color: white; background: var(--red); }
.btn-lg { min-height: 52px; padding: 0 24px; border-radius: 13px; }
.btn.full { width: 100%; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: var(--blue); background: transparent; font-weight: 800; cursor: pointer; }
.text-button .icon { width: 17px; }
.hero-card { position: relative; overflow: hidden; min-height: 360px; display: grid; grid-template-columns: 1.35fr .85fr; align-items: center; gap: 30px; padding: clamp(32px, 5vw, 64px); border-radius: 28px; color: white; background: linear-gradient(120deg, #102e4b 5%, #164b70 55%, #1c6d91); box-shadow: 0 28px 70px rgba(16,42,67,.18); }
.hero-card h1 { max-width: 720px; margin: 18px 0; font-size: clamp(38px, 4.5vw, 68px); line-height: 1.03; letter-spacing: -.05em; }
.hero-card h1 em { color: #68d4e9; font-style: normal; }
.hero-card p { max-width: 650px; margin: 0 0 28px; color: #c3d8e9; font-size: 17px; }
.hero-card .btn-light { color: white; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.pill { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 10px; border-radius: 99px; font-size: 11px; font-weight: 850; }
.pill-blue { color: #d7f4ff; background: rgba(54,177,232,.2); }
.pill-soft { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--panel)); }
.pill-amber { color: #9b6100; background: #fff2d3; }
.pill-green { color: #12713a; background: #ddf8e7; }
:root[data-theme="dark"] .pill-amber { color: #ffd88b; background: #4a3615; }
:root[data-theme="dark"] .pill-green { color: #8deaae; background: #173c2a; }
.road-visual { position: relative; min-height: 270px; align-self: stretch; transform: perspective(500px) rotateY(-10deg); }
.road-visual::before { content: ""; position: absolute; inset: -80px -130px -90px 10px; border-radius: 50%; background: radial-gradient(circle, rgba(69,191,225,.28), transparent 63%); }
.road-visual::after { content: ""; position: absolute; left: 25%; bottom: -90px; width: 220px; height: 420px; transform: rotate(26deg); background: linear-gradient(90deg, transparent 0 12%, rgba(255,255,255,.08) 12% 13%, transparent 13% 48%, rgba(255,255,255,.45) 48% 51%, transparent 51% 87%, rgba(255,255,255,.08) 87% 88%, transparent 88%); }
.road-sign { position: absolute; z-index: 2; right: 14%; top: 26%; width: 104px; height: 104px; display: grid; place-items: center; border: 12px solid white; border-radius: 50%; color: white; background: #1761a6; font-size: 50px; font-weight: 900; box-shadow: 0 18px 38px rgba(0,0,0,.25); }
.road-sign::after { content: ""; position: absolute; width: 10px; height: 150px; top: 88px; background: #d9e5ed; z-index: -1; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.metric-card { min-height: 126px; display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.metric-card small { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.metric-card strong { display: block; margin: 2px 0; font-size: 30px; line-height: 1.1; }
.metric-card p { margin: 0; color: var(--muted); font-size: 12px; }
.metric-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; }
.metric-icon.blue { color: #2d69e9; background: #e8f0ff; }.metric-icon.teal { color: #0e8f81; background: #dcf7f2; }.metric-icon.amber { color: #b46e00; background: #fff0d3; }.metric-icon.violet { color: #7052d4; background: #eee9ff; }.metric-icon.red { color: #c43848; background: #ffe6e8; }
:root[data-theme="dark"] .metric-icon.blue { background:#1d3559 }:root[data-theme="dark"] .metric-icon.teal { background:#173d3b }:root[data-theme="dark"] .metric-icon.amber{background:#49361a}:root[data-theme="dark"] .metric-icon.violet{background:#302a55}:root[data-theme="dark"] .metric-icon.red{background:#49242b}
.two-column { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .65fr); gap: 20px; }
.two-column > .panel { padding: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head h2 { margin: 3px 0 0; font-size: 22px; letter-spacing: -.025em; }
.section-head.compact { margin-bottom: 15px; }
.category-list, .stats-list { display: grid; gap: 18px; }
.category-row { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(100px, 1.4fr) 42px; align-items: center; gap: 18px; }
.category-main strong { display: block; font-size: 13px; }
.category-main span { color: var(--muted); font-size: 11px; }
.bar { height: 7px; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.category-row > b { text-align: right; font-size: 12px; }
.quick-panel h2 { margin: 3px 0 20px; }
.quick-action { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 13px 0; border: 0; border-top: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.quick-action:first-of-type { border-top: 0; }
.quick-action > span:nth-child(2) strong, .quick-action > span:nth-child(2) small { display: block; }
.quick-action small { color: var(--muted); }
.quick-action > .icon { width: 17px; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-bottom: 28px; }
.page-head h1 { margin: 5px 0 7px; font-size: clamp(32px, 4vw, 48px); line-height: 1.1; letter-spacing: -.045em; }
.page-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 15px; }
.page-head.split { align-items: center; }
.resume-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; padding: 18px 22px; border: 1px solid #a8c7ff; border-radius: 16px; background: color-mix(in srgb, var(--blue) 8%, var(--panel)); }
.resume-card p { margin: 3px 0 0; color: var(--muted); }
.exam-intro { display: grid; grid-template-columns: 220px 1fr; gap: 38px; padding: clamp(28px, 4vw, 52px); }
.exam-intro-icon { min-height: 390px; display: grid; place-items: center; border-radius: 22px; color: white; background: linear-gradient(150deg, #193d5f, #1a82ac); }
.exam-intro-icon .icon { width: 92px; height: 92px; }
.exam-rules h2 { margin: 0 0 22px; font-size: 27px; }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rule-grid > div { display: grid; grid-template-columns: auto 1fr; column-gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.rule-grid span { grid-row: span 2; width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--panel)); }
.rule-grid strong, .rule-grid small { display: block; }
.rule-grid small { color: var(--muted); }
.info-box { margin: 20px 0; padding: 17px 20px; border-left: 4px solid var(--blue); border-radius: 0 12px 12px 0; background: color-mix(in srgb, var(--blue) 7%, var(--panel)); }
.info-box p { margin: 3px 0 0; color: var(--muted); }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 20px; }
.question-panel { padding: clamp(22px, 3vw, 38px); }
.exam-toolbar, .learning-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.exam-toolbar > div:first-child, .learning-top > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.category-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.timer { min-width: 108px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border-radius: 12px; color: var(--navy); background: var(--panel-2); }
.timer strong { font-variant-numeric: tabular-nums; font-size: 19px; }
.timer.urgent { color: var(--red); background: color-mix(in srgb, var(--red) 9%, var(--panel)); }
.exam-progress { height: 7px; margin: 20px 0 32px; }
.exam-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.question-card h1, .learning-question > h1 { margin: 0 0 8px; font-size: clamp(23px, 2.6vw, 34px); line-height: 1.35; letter-spacing: -.025em; }
.multi-hint { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.question-images { display: flex; justify-content: center; margin: 0 0 26px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.question-images img { max-width: 100%; max-height: 360px; object-fit: contain; }
.compact-images { max-width: 580px; margin-left: 56px; }
.answer-list { display: grid; gap: 11px; }
.answer-option { position: relative; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 13px; min-height: 68px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; transition: .12s ease; }
.answer-option:hover { border-color: color-mix(in srgb, var(--blue) 48%, var(--line)); background: color-mix(in srgb, var(--blue) 3%, var(--panel)); }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { width: 23px; height: 23px; display: grid; place-items: center; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--panel); }
.answer-option input:checked + .custom-check { border-color: var(--blue); background: var(--blue); }
.answer-option input:checked + .custom-check::after { content: ""; width: 9px; height: 5px; border: solid white; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.answer-letter { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: var(--panel-2); font-weight: 850; }
.answer-copy { font-size: 15px; }
.answer-copy small { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; }
.answer-option.correct { border-color: #6ecb91; background: color-mix(in srgb, var(--green) 8%, var(--panel)); }
.answer-option.correct .answer-letter { color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--panel)); }
.answer-option.correct .answer-copy small { color: var(--green); }
.answer-option.wrong { border-color: #ed8b96; background: color-mix(in srgb, var(--red) 8%, var(--panel)); }
.answer-option.wrong .answer-copy small { color: var(--red); }
.question-actions { justify-content: space-between; margin-top: 28px; }
.exam-nav { position: sticky; top: 20px; padding: 22px; }
.number-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.number-button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-weight: 800; cursor: pointer; }
.number-button.answered { color: #116e3b; border-color: #7bd49e; background: #e8f9ef; }
.number-button.current { color: white; border-color: var(--blue); background: var(--blue); box-shadow: 0 6px 16px rgba(37,99,235,.25); }
:root[data-theme="dark"] .number-button.answered { color: #8deaae; background: #173c2a; }
.legend { display: grid; gap: 7px; margin: 18px 0; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--panel-2); }.dot.current { border-color: var(--blue); background: var(--blue); }.dot.answered { border-color: #65c78b; background: #bfeacf; }
.result-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 34px; border-radius: 24px; color: white; box-shadow: var(--shadow-lg); }
.result-hero.passed { background: linear-gradient(120deg, #0d6948, #159466); }.result-hero.failed { background: linear-gradient(120deg, #7d2632, #c44352); }
.result-symbol { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.14); }.result-symbol .icon { width: 34px; height: 34px; }
.result-hero .section-kicker { color: rgba(255,255,255,.72); }.result-hero h1 { margin: 4px 0; font-size: 32px; }.result-hero p { margin: 0; color: rgba(255,255,255,.8); }
.score-ring { width: 124px; height: 124px; display: grid; place-items: center; align-content: center; border: 7px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(255,255,255,.08); }
.score-ring strong { font-size: 40px; line-height: 1; }.score-ring span { font-size: 12px; }
.metric-grid.five { grid-template-columns: repeat(5, 1fr); }
.result-metrics article { padding: 18px; border: 1px solid var(--line); border-radius: 16px; text-align: center; background: var(--panel); }.result-metrics small { display: block; color: var(--muted); }.result-metrics strong { font-size: 25px; }.good { color: var(--green); }.bad { color: var(--red); }
.review-head { margin-top: 34px; }
.review-list { display: grid; gap: 16px; }
.review-card { padding: 24px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 18px; background: var(--panel); }.review-card.correct-card { border-left-color: var(--green); }.review-card.wrong-card { border-left-color: var(--red); }
.review-card-head { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px; }.review-number { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--panel-2); font-weight: 900; }.review-card h3 { margin: 5px 0 0; font-size: 18px; }.points-earned { text-align: center; }.points-earned strong,.points-earned small { display:block }.points-earned strong { font-size: 21px; }
.review-answers { display: grid; gap: 7px; margin: 18px 0 0 54px; }.review-answer { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px; border-radius: 9px; color: var(--muted); background: var(--panel-2); }.review-answer b { color: var(--ink); }.review-answer i { align-self: center; font-size: 10px; font-style: normal; font-weight: 800; }.review-answer small { grid-column: 2/-1; font-weight: 800; }.review-answer.correct { color: var(--ink); background: color-mix(in srgb, var(--green) 10%, var(--panel)); }.review-answer.correct small { color: var(--green); }.review-answer.wrong { color: var(--ink); background: color-mix(in srgb, var(--red) 10%, var(--panel)); }.review-answer.wrong small { color: var(--red); }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }.setup-panel { position: relative; padding: 25px; }.setup-panel.wide { grid-column: 1/-1; }.setup-number { float: left; width: 34px; height: 34px; display: grid; place-items: center; margin-right: 12px; border-radius: 10px; color: white; background: var(--blue); font-weight: 900; }.setup-panel h2 { margin: 0; font-size: 21px; }.setup-panel > div:nth-child(2) > p { margin: 2px 0 20px; color: var(--muted); font-size: 13px; }
.category-checks { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 24px; }.category-checks label { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }.category-checks .select-all { grid-column: 1/-1; color: var(--blue); background: color-mix(in srgb, var(--blue) 5%, var(--panel)); }.category-checks b { color: var(--muted); font-size: 12px; }
.count-options { clear: both; display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-top: 24px; }.count-options input { position:absolute; opacity:0 }.count-options span { min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; font-weight: 850; cursor:pointer }.count-options input:checked + span { color:white; border-color:var(--blue); background:var(--blue) }
.switch-list { clear: both; display: grid; gap: 5px; margin-top: 18px; }.switch-list label { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:12px 0; border-top:1px solid var(--line) }.switch-list strong,.switch-list small{display:block}.switch-list small{color:var(--muted)}.switch { appearance:none; width:44px; height:24px; padding:2px; border-radius:99px; background:var(--line-strong); cursor:pointer }.switch::after{content:"";display:block;width:20px;height:20px;border-radius:50%;background:white;transition:.15s}.switch:checked{background:var(--blue)}.switch:checked::after{transform:translateX(20px)}.setup-submit{grid-column:1/-1;justify-self:center;min-width:240px}
.learning-wrap { max-width: 980px; margin: auto; }.learning-top { margin-bottom: 14px; }.flag-button { display:flex;align-items:center;gap:7px;min-height:39px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);font-weight:750;cursor:pointer }.flag-button.active{color:#a96a00;border-color:#e6b75d;background:#fff5df}.flag-button:nth-child(2).active{color:#c23c4b;border-color:#ed9da6;background:#fff0f1}:root[data-theme="dark"] .flag-button.active{background:#4a3615}:root[data-theme="dark"] .flag-button:nth-child(2).active{background:#49242b}.learning-question{margin-top:0}.feedback{display:flex;gap:14px;margin-top:20px;padding:17px;border-radius:13px}.feedback>span{width:37px;height:37px;display:grid;place-items:center;flex:0 0 auto;border-radius:10px}.feedback p{margin:3px 0 0}.feedback.success{color:#135f36;background:color-mix(in srgb,var(--green) 11%,var(--panel))}.feedback.success>span{background:color-mix(in srgb,var(--green) 18%,var(--panel))}.feedback.error{color:#9d2d39;background:color-mix(in srgb,var(--red) 10%,var(--panel))}.feedback.error>span{background:color-mix(in srgb,var(--red) 17%,var(--panel))}:root[data-theme="dark"] .feedback.success{color:#9beab7}:root[data-theme="dark"] .feedback.error{color:#ffadb5}.learning-actions{justify-content:flex-end;margin-top:24px}.session-summary{max-width:650px;margin:7vh auto;padding:48px;text-align:center}.summary-icon{width:64px;height:64px;display:grid;place-items:center;margin:0 auto 18px;border-radius:18px;color:var(--green);background:color-mix(in srgb,var(--green) 12%,var(--panel))}.summary-icon .icon{width:34px;height:34px}.session-summary h1{margin:7px 0;font-size:40px}.session-summary p{color:var(--muted)}.session-summary .hero-actions{justify-content:center;margin-top:24px}
.filter-panel { display: grid; grid-template-columns: minmax(280px,1fr) 260px 220px; gap: 12px; padding: 15px; }.search-box { display:flex;align-items:center;gap:9px;padding:0 13px;border:1px solid var(--line);border-radius:11px;background:var(--panel-2)}.search-box .icon{color:var(--muted)}.search-box input{width:100%;height:43px;border:0;outline:0;background:transparent;color:var(--ink)}select{min-height:45px;padding:0 12px;border:1px solid var(--line);border-radius:11px;color:var(--ink);background:var(--panel)}.category-chips{display:flex;gap:8px;overflow:auto;padding:14px 0 3px}.category-chip{flex:0 0 auto;display:flex;align-items:center;gap:8px;min-height:36px;padding:0 11px;border:1px solid var(--line);border-radius:99px;background:var(--panel);font-size:11px;cursor:pointer}.category-chip b{color:var(--muted)}.category-chip.active{color:white;border-color:var(--blue);background:var(--blue)}.category-chip.active b{color:#dce8ff}.list-summary{margin:18px 0 10px;color:var(--muted);font-size:13px}.question-list{display:grid;gap:10px}.list-card{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:15px;padding:18px 20px;border:1px solid var(--line);border-radius:15px;background:var(--panel)}.list-index{width:39px;height:39px;display:grid;place-items:center;border-radius:10px;color:var(--muted);background:var(--panel-2);font-size:12px;font-weight:850}.list-meta{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px;font-weight:800}.list-card h2{margin:5px 0 0;font-size:15px;line-height:1.45}.attempt-line{margin:5px 0 0;color:var(--muted);font-size:11px}.status-badge,.image-badge{display:inline-flex;align-items:center;min-height:22px;padding:2px 7px;border-radius:99px;font-size:9px;text-transform:uppercase;letter-spacing:.04em}.status-badge.favorite{color:#956000;background:#fff1cf}.status-badge.difficult,.status-badge.wrong{color:#a22f3c;background:#ffe3e6}.status-badge.unanswered{color:#617083;background:var(--panel-2)}.status-badge.solved{color:#14703c;background:#dff7e8}.image-badge{color:#255ebc;background:#e7efff}:root[data-theme="dark"] .status-badge.favorite{color:#ffd98c;background:#4a3615}:root[data-theme="dark"] .status-badge.difficult,:root[data-theme="dark"] .status-badge.wrong{color:#ffadb5;background:#49242b}:root[data-theme="dark"] .status-badge.solved{color:#8deaae;background:#173c2a}:root[data-theme="dark"] .image-badge{color:#a7c5ff;background:#1d3559}.load-more{display:flex;margin:22px auto}
.mistake-info{display:flex;align-items:center;gap:15px;margin-bottom:18px;padding:18px}.mistake-info>span{width:46px;height:46px;display:grid;place-items:center;border-radius:13px;color:var(--amber);background:color-mix(in srgb,var(--amber) 12%,var(--panel))}.mistake-info p{margin:2px 0;color:var(--muted)}.empty-state{padding:60px;text-align:center}.empty-state p{color:var(--muted)}.empty-compact{padding:30px;color:var(--muted);text-align:center}.stats-metrics{margin-top:0}.stats-columns{grid-template-columns:1fr 1fr}.big-percent{font-size:29px}.stats-row{display:grid;grid-template-columns:minmax(180px,1fr) minmax(100px,1.2fr) 42px;align-items:center;gap:12px}.stats-row strong,.stats-row small{display:block}.stats-row small{color:var(--muted)}.stats-row>b{text-align:right}.difficult-list{display:grid;gap:7px;margin:0;padding:0;list-style:none;counter-reset:rank}.difficult-list li{counter-increment:rank}.difficult-list button{width:100%;display:grid;grid-template-columns:1fr auto;gap:12px;padding:11px;border:0;border-radius:10px;text-align:left;background:var(--panel-2);cursor:pointer}.difficult-list button span{font-size:12px}.difficult-list button b{white-space:nowrap;color:var(--red);font-size:10px}.history-panel{margin-top:20px;padding:28px}.history-table{overflow:auto}.history-row{min-width:760px;display:grid;grid-template-columns:1.4fr .6fr .7fr .7fr .8fr .9fr;align-items:center;gap:12px;padding:12px 7px;border-top:1px solid var(--line);font-size:12px}.history-row.header{color:var(--muted);border:0;font-size:10px;text-transform:uppercase;letter-spacing:.05em}.history-row .text-button{font-size:11px}
.modal-backdrop{position:fixed;z-index:100;inset:0;display:grid;place-items:center;padding:20px;background:rgba(3,12,23,.64);backdrop-filter:blur(4px)}.modal{width:min(480px,100%);padding:26px;border:1px solid var(--line);border-radius:20px;background:var(--panel);box-shadow:var(--shadow-lg)}.modal h2{margin:0 0 10px;font-size:24px}.modal-body{color:var(--muted)}.modal-actions{justify-content:flex-end;margin-top:22px}.confirm-check{display:flex;align-items:flex-start;gap:9px;margin-top:16px;padding:12px;border-radius:10px;background:var(--panel-2);font-size:12px;font-weight:700}.confirm-check input{margin-top:3px}#toast-root{position:fixed;z-index:120;right:20px;bottom:20px;display:grid;gap:9px}.toast{max-width:370px;padding:13px 16px;border:1px solid var(--line);border-radius:11px;color:var(--ink);background:var(--panel);box-shadow:var(--shadow-lg);font-size:13px;font-weight:750}.toast-success{border-color:#72cc95}.toast-error{border-color:#ee8d98}.fatal{align-content:center}.fatal h1{margin-bottom:0}.fatal p{color:var(--muted)}
.offline-banner { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--blue) 25%, var(--line)); border-radius: 14px; color: var(--muted); background: color-mix(in srgb, var(--blue) 5%, var(--panel)); font-size: 13px; font-weight: 750; }
.offline-banner::before { content: ""; width: 10px; height: 10px; flex: 0 0 auto; border: 2px solid var(--blue); border-top-color: transparent; border-radius: 50%; animation: offline-pulse 1s linear infinite; }
.offline-banner.ready { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); background: color-mix(in srgb, var(--green) 7%, var(--panel)); }
.offline-banner.ready::before { border: 0; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent); animation: none; }
.offline-banner.unavailable { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); background: color-mix(in srgb, var(--amber) 7%, var(--panel)); }
.offline-banner.unavailable::before { border: 0; background: var(--amber); animation: none; }
@keyframes offline-pulse { to { transform: rotate(360deg); } }
@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }.metric-grid.five{grid-template-columns:repeat(3,1fr)}.two-column,.stats-columns{grid-template-columns:1fr}.filter-panel{grid-template-columns:1fr 1fr}.search-box{grid-column:1/-1}.road-visual{display:none}.hero-card{grid-template-columns:1fr}.exam-layout{grid-template-columns:1fr}.exam-nav{position:static}.number-grid{grid-template-columns:repeat(10,1fr)}
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }.sidebar{inset:auto 0 0 0;width:100%;height:68px;padding:7px 8px calc(7px + env(safe-area-inset-bottom));overflow:hidden}.brand,.sidebar-foot{display:none}.nav-list{width:100%;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}.nav-link{min-width:0;min-height:54px;flex-direction:column;justify-content:center;gap:2px;padding:3px 1px;border-radius:10px;font-size:9px}.nav-link .icon{width:19px;height:19px}.nav-link b{position:absolute;margin:0 0 28px 35px}.main-column{margin:0;padding-bottom:75px}.topbar{min-height:62px;padding:10px 16px}.data-status{display:none}.content{padding:22px 16px}.hero-card{min-height:0;padding:30px 23px;border-radius:22px}.hero-card h1{font-size:39px}.hero-card p{font-size:15px}.hero-actions{align-items:stretch;flex-direction:column}.metric-grid,.metric-grid.five{grid-template-columns:1fr 1fr}.metric-card{min-height:106px;padding:15px}.metric-icon{width:41px;height:41px}.metric-card strong{font-size:24px}.two-column>.panel{padding:21px}.category-row{grid-template-columns:1fr 50px}.category-row .bar{grid-column:1/-1;grid-row:2}.page-head,.page-head.split{align-items:flex-start;flex-direction:column}.page-head h1{font-size:36px}.exam-intro{grid-template-columns:1fr;padding:22px}.exam-intro-icon{min-height:130px}.rule-grid{grid-template-columns:1fr}.exam-toolbar,.learning-top{align-items:flex-start}.learning-top{flex-direction:column}.number-grid{grid-template-columns:repeat(5,1fr)}.question-panel{padding:20px 16px}.question-card h1,.learning-question>h1{font-size:23px}.answer-option{grid-template-columns:auto auto 1fr;padding:12px 10px}.question-actions{align-items:stretch}.question-actions .btn{flex:1}.result-hero{grid-template-columns:auto 1fr;padding:24px}.score-ring{grid-column:1/-1;justify-self:center}.result-metrics{grid-template-columns:1fr 1fr!important}.review-card{padding:18px 13px}.review-card-head{grid-template-columns:auto 1fr}.points-earned{grid-column:2}.review-answers{margin-left:0}.review-answer{grid-template-columns:25px 1fr}.review-answer i{grid-column:2}.compact-images{margin-left:0}.setup-grid{grid-template-columns:1fr}.setup-panel.wide{grid-column:auto}.category-checks{grid-template-columns:1fr}.category-checks .select-all{grid-column:auto}.count-options{grid-template-columns:repeat(5,1fr)}.setup-submit{grid-column:auto;width:100%}.filter-panel{grid-template-columns:1fr}.search-box{grid-column:auto}.list-card{grid-template-columns:auto 1fr}.list-card>.btn{grid-column:2;justify-self:start}.stats-row{grid-template-columns:1fr 42px}.stats-row .bar{grid-column:1/-1;grid-row:2}.history-panel{padding:20px 14px}.section-head{align-items:flex-start}.section-head .pill{max-width:160px;text-align:center}.modal{padding:22px}.modal-actions{align-items:stretch;flex-direction:column-reverse}.modal-actions .btn{width:100%}
}
@media (max-width: 760px) {
  .scroll-helper { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); min-height: 42px; padding: 0 12px; font-size: 12px; }
}
@media (max-width: 430px) {
  .metric-grid,.metric-grid.five{grid-template-columns:1fr}.metric-card{min-height:90px}.hero-card h1{font-size:34px}.category-main strong{font-size:12px}.count-options{grid-template-columns:repeat(3,1fr)}.flag-actions{width:100%}.flag-button{flex:1;justify-content:center}.timer{min-width:92px}.result-hero{grid-template-columns:1fr;text-align:center}.result-symbol{margin:auto}.list-index{display:none}.list-card{grid-template-columns:1fr}.list-card>.btn{grid-column:1}.question-images{padding:8px}.session-summary{padding:30px 20px}
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior:auto!important;animation:none!important;transition:none!important } }

/* Mobilny egzamin i PWA */
.mobile-exam-nav-toggle,
.exam-nav-backdrop,
.exam-nav-mobile-head { display: none; }

:where(button, a, input, select, label):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 65%, transparent);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  html {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: var(--nav-bg);
  }

  body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--nav-bg);
  }

  button,
  input,
  select { font-size: 16px; }

  .app-shell { width: 100%; max-width: 100%; background: var(--nav-bg); }
  .main-column { width: 100%; max-width: 100%; background: var(--bg); }

  .sidebar {
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 6px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  }

  .nav-link {
    min-height: 56px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
  }

  .nav-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-column {
    height: 100%;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }

  .topbar {
    position: sticky;
    z-index: 34;
    top: 0;
    min-height: calc(62px + env(safe-area-inset-top));
    padding: max(9px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 9px max(14px, env(safe-area-inset-left));
  }

  .topbar > div:first-child { min-width: 0; }
  .topbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .icon-button { width: 44px; height: 44px; flex: 0 0 auto; }

  .content {
    width: 100%;
    max-width: 100%;
    padding: 20px max(14px, env(safe-area-inset-right)) 28px max(14px, env(safe-area-inset-left));
    overflow-wrap: anywhere;
  }

  .hero-card {
    padding: 28px 20px;
    border-radius: 20px;
  }

  .hero-card h1 { font-size: clamp(32px, 10vw, 42px); }
  .hero-card p { font-size: 16px; }
  .hero-card .btn { width: 100%; min-height: 52px; }

  .metric-card,
  .two-column > .panel,
  .setup-panel,
  .history-panel { min-width: 0; }

  .metric-card { align-items: flex-start; }
  .metric-card > div { min-width: 0; }
  .metric-card small,
  .metric-card p { overflow-wrap: anywhere; }

  .page-head { margin-bottom: 22px; }
  .page-head h1 { max-width: 100%; font-size: clamp(30px, 9vw, 38px); overflow-wrap: anywhere; }
  .page-head p { font-size: 15px; }
  .page-head.split .btn { width: 100%; min-height: 50px; }

  .resume-card { align-items: stretch; flex-direction: column; }
  .resume-card .btn { width: 100%; }
  .exam-intro-icon { display: none; }
  .exam-intro { display: block; }
  .exam-rules h2 { font-size: 24px; }
  .rule-grid > div { min-width: 0; }

  .answer-list { gap: 12px; }
  .answer-option {
    width: 100%;
    min-width: 0;
    min-height: 74px;
    grid-template-columns: 28px 30px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 12px;
    touch-action: manipulation;
  }

  .custom-check { width: 28px; height: 28px; border-radius: 8px; }
  .answer-letter { width: 30px; height: 30px; }
  .answer-copy { min-width: 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
  .answer-copy small { font-size: 12px; }

  .question-card h1,
  .learning-question > h1 { font-size: clamp(21px, 6vw, 26px); overflow-wrap: anywhere; }

  .question-images {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    overflow: hidden;
  }

  .question-images img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 52dvh;
  }

  .learning-actions { width: 100%; }
  .learning-actions .btn { width: 100%; min-height: 52px; }
  .learning-top { gap: 12px; }
  .learning-top > div:first-child { min-width: 0; }
  .flag-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .flag-button { min-width: 0; min-height: 48px; padding: 0 8px; }

  .category-checks label { min-height: 58px; padding: 12px; }
  .category-checks input:not(.switch) { width: 24px; height: 24px; accent-color: var(--blue); }
  .category-checks span { min-width: 0; overflow-wrap: anywhere; }
  .count-options span { min-height: 52px; }
  .switch-list label { min-height: 58px; }

  .filter-panel { gap: 10px; padding: 12px; }
  .search-box,
  .filter-panel select { width: 100%; min-width: 0; min-height: 50px; }
  .search-box input { min-width: 0; height: 48px; font-size: 16px; }
  .category-chips { display: none; }

  .list-card { width: 100%; min-width: 0; gap: 12px; padding: 16px; }
  .list-card-body { min-width: 0; }
  .list-meta { flex-wrap: wrap; }
  .list-card h2 { max-width: 100%; font-size: 16px; overflow-wrap: anywhere; }
  .list-card > .btn { min-height: 48px; }

  .mistake-info { align-items: flex-start; }
  .mistake-info > div { min-width: 0; }
  .empty-state { padding: 38px 18px; }

  .stats-columns > .panel { padding: 20px 16px; }
  .stats-row { min-width: 0; }
  .stats-row > div { min-width: 0; }
  .difficult-list button { grid-template-columns: 1fr; min-height: 54px; }
  .difficult-list button b { white-space: normal; }

  .history-table { display: grid; gap: 12px; overflow: visible; }
  .history-row.header { display: none; }
  .history-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
  }

  .history-row [data-label] { min-width: 0; overflow-wrap: anywhere; }
  .history-row [data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .history-row > span:first-child,
  .history-row .text-button { grid-column: 1 / -1; }
  .history-row .status-badge { justify-self: start; align-self: end; }
  .history-row .text-button { min-height: 44px; justify-content: flex-start; }

  .result-hero { gap: 16px; }
  .result-hero h1 { font-size: 27px; overflow-wrap: anywhere; }
  .result-metrics article { min-width: 0; padding: 14px 8px; }
  .result-metrics strong { font-size: 22px; }
  .review-card-head { min-width: 0; }
  .review-card-head > div { min-width: 0; }
  .review-card h3 { font-size: 17px; overflow-wrap: anywhere; }
  .review-answer { min-width: 0; grid-template-columns: 26px minmax(0, 1fr); }
  .review-answer b { overflow-wrap: anywhere; }

  .modal-backdrop {
    place-items: end center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 20px);
    overflow-y: auto;
    border-radius: 22px;
  }

  .modal h2 { font-size: 22px; }
  .modal-actions .btn { min-height: 50px; }

  #toast-root {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
  }

  .toast { width: 100%; max-width: none; }

  .offline-banner { margin-top: 14px; padding: 12px 13px; font-size: 12px; line-height: 1.35; }

  .scroll-helper {
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  /* Aktywny egzamin: maksymalnie dużo miejsca i obsługa jedną ręką. */
  .exam-running .sidebar,
  .exam-running .topbar,
  .exam-running .scroll-helper { display: none; }

  .exam-running .main-column { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .exam-running .content {
    padding: 0 max(12px, env(safe-area-inset-right)) 24px max(12px, env(safe-area-inset-left));
  }

  .exam-layout { display: block; }
  .exam-layout .question-panel {
    min-width: 0;
    padding: 16px 12px 28px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .exam-sticky-header {
    position: sticky;
    z-index: 42;
    top: 0;
    margin: -16px -12px 18px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(16px);
  }

  .exam-toolbar { align-items: center; gap: 8px; }
  .exam-toolbar > div:first-child { min-width: 0; gap: 6px; }
  .exam-toolbar .category-label {
    max-width: min(48vw, 190px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timer { min-width: 96px; min-height: 44px; padding: 7px 9px; }
  .timer strong { font-size: 18px; }
  .exam-progress { height: 6px; margin: 9px 0; }

  .mobile-exam-nav-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--blue);
    background: var(--panel-2);
    font-weight: 800;
  }

  .mobile-exam-nav-toggle b { margin-left: auto; }

  .exam-layout .question-actions {
    position: fixed;
    z-index: 60;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 8px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--panel) 96%, transparent);
    box-shadow: 0 12px 34px rgba(16, 42, 67, .2);
    backdrop-filter: blur(16px);
  }

  .exam-layout .question-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    padding: 8px;
    font-size: 14px;
    line-height: 1.15;
    white-space: normal;
  }

  .exam-nav-backdrop {
    position: fixed;
    z-index: 78;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(3, 12, 23, .58);
    backdrop-filter: blur(3px);
  }

  .exam-nav {
    position: fixed;
    z-index: 80;
    inset: auto 0 0;
    width: 100%;
    max-height: min(82dvh, 680px);
    overflow-y: auto;
    padding: 18px max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    border-radius: 24px 24px 0 0;
    transform: translateY(110%);
    transition: transform .18s ease;
  }

  .exam-nav-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .exam-nav-mobile-head button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    font-size: 28px;
    line-height: 1;
  }

  .exam-nav .number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
  .exam-nav .number-button { min-height: 46px; aspect-ratio: 1; font-size: 16px; }
  .exam-nav .legend { grid-template-columns: 1fr 1fr; }
  .exam-nav .btn { min-height: 50px; }

  body.exam-nav-open .exam-nav-backdrop { display: block; }
  body.exam-nav-open .exam-nav { transform: translateY(0); }
  body.exam-nav-open .main-column { overflow: hidden; }
}

/*
 * Po uruchomieniu z ikony iOS nie ma paska Safari. Używamy wtedy rzeczywistej
 * wysokości okna aplikacji, bez pozostawiania pustego miejsca na przeglądarkę.
 */
html.standalone-pwa,
html.standalone-pwa body,
html.standalone-pwa #app,
html.standalone-pwa .app-shell {
  width: 100%;
  height: var(--app-height, 100%);
  min-height: var(--app-height, 100%);
}

html.standalone-pwa { background: var(--nav-bg); }
html.standalone-pwa body { position: fixed; inset: 0; background: var(--nav-bg); }
html.standalone-pwa .app-shell { position: fixed; inset: 0; overflow: hidden; background: var(--nav-bg); }
html.standalone-pwa .main-column { height: 100%; background: var(--bg); }

@media (display-mode: standalone) and (max-width: 760px) {
  .main-column { height: 100%; }
  .sidebar { position: absolute; top: auto; bottom: 0; }
}

@media (max-width: 760px) {
  html.standalone-pwa .sidebar { position: absolute; top: auto; bottom: 0; }
  html.standalone-pwa .modal-backdrop { height: var(--app-height, 100vh); }
}

@media (max-width: 430px) {
  .content { padding-right: max(12px, env(safe-area-inset-right)); padding-left: max(12px, env(safe-area-inset-left)); }
  .metric-grid,
  .metric-grid.five { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .two-column > .panel { padding: 18px 15px; }
  .section-head { gap: 12px; }
  .section-head h2 { font-size: 20px; }
  .count-options { grid-template-columns: repeat(3, 1fr); }
  .result-metrics.metric-grid { grid-template-columns: 1fr 1fr; }
  .score-ring { width: 112px; height: 112px; }
  .session-summary h1 { font-size: 34px; }
}

@media (max-width: 350px) {
  .nav-link { font-size: 8px; }
  .nav-link .icon { width: 18px; height: 18px; }
  .hero-card h1 { font-size: 31px; }
  .exam-toolbar .category-label { display: none; }
  .answer-option { grid-template-columns: 28px minmax(0, 1fr); }
  .answer-letter { display: none; }
  .flag-button { font-size: 13px; }
}
