:root {
  color-scheme: light;
  --ink: #173c37;
  --ink-2: #516d68;
  --ink-3: #82958f;
  --surface: #ffffff;
  --canvas: #f4f6f3;
  --line: #dce6e1;
  --green: #148771;
  --green-dark: #0f695b;
  --green-soft: #e5f3ee;
  --on-accent: #ffffff;
  --yellow: #f4c34e;
  --yellow-soft: #fff4d2;
  --on-yellow: #241a00;
  --red: #e96858;
  --red-soft: #fff0ed;
  --on-red: #ffffff;
  --danger-ink: #934238;
  --header-bg: rgba(244, 246, 243, .9);
  --glass-bg: rgba(255, 255, 255, .94);
  --surface-translucent: rgba(255, 255, 255, .68);
  --surface-soft: #f0f4f2;
  --surface-hover: #f8fbfa;
  --context-bg: #faf8f0;
  --context-ink: #4f6863;
  --feedback-copy: #4b6560;
  --exam-ink: #80600d;
  --track: #dce7e2;
  --goal-track: #dce8e3;
  --line-soft: #edf1ef;
  --line-hover: #b5d0c7;
  --muted-icon: #6f8781;
  --quick-bg: #153f39;
  --quick-hover: #123a35;
  --quick-kicker: #9cd7ca;
  --button-hover: #0f695b;
  --overlay: rgba(17, 45, 41, .48);
  --toast-bg: #173c37;
  --toast-text: #ffffff;
  --handle: #d6e0dc;
  --neutral-dot: #aabbb6;
  --focus-ring: #258f79;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(23, 60, 55, 0.07);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf6f2;
  --ink-2: #b2c5bf;
  --ink-3: #819a92;
  --surface: #182824;
  --canvas: #0f1816;
  --line: #2b403a;
  --green: #35b896;
  --green-dark: #82ddc3;
  --green-soft: #193c34;
  --on-accent: #082019;
  --yellow: #f2c65b;
  --yellow-soft: #40351b;
  --on-yellow: #241a00;
  --red: #f27769;
  --red-soft: #402723;
  --on-red: #2a0906;
  --danger-ink: #ffb2a8;
  --header-bg: rgba(15, 24, 22, .9);
  --glass-bg: rgba(24, 40, 36, .94);
  --surface-translucent: rgba(24, 40, 36, .72);
  --surface-soft: #21342f;
  --surface-hover: #1d322c;
  --context-bg: #272d24;
  --context-ink: #c4d2cd;
  --feedback-copy: #c3d4ce;
  --exam-ink: #f5d77f;
  --track: #293d37;
  --goal-track: #2a3d38;
  --line-soft: #243630;
  --line-hover: #4b7165;
  --muted-icon: #93aaa3;
  --quick-bg: #16443b;
  --quick-hover: #1a5045;
  --quick-kicker: #98dfcd;
  --button-hover: #258b72;
  --overlay: rgba(3, 9, 8, .72);
  --toast-bg: #e7f3ef;
  --toast-text: #12231f;
  --handle: #425a53;
  --neutral-dot: #71877f;
  --focus-ring: #79e0c4;
  --shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: -70px; left: 16px; padding: 11px 16px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-text); font-weight: 700; }
.skip-link:focus { top: 16px; }

.app-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(14px); }
.header-inner { width: min(100% - 40px, 980px); height: 68px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--on-yellow); background: var(--yellow); box-shadow: 0 6px 14px rgba(244, 195, 78, .22); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-name { font-size: 18px; font-weight: 850; letter-spacing: -.8px; }
.brand-name span { color: var(--green); }
.header-actions { display: flex; align-items: center; gap: 9px; }
.library-size { min-height: 34px; padding: 0 13px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-translucent); color: var(--ink-2); font-size: 11px; }
.library-size strong { color: var(--ink); }
.theme-toggle { flex: 0 0 auto; width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-translucent); color: var(--ink-2); cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.theme-toggle:hover { color: var(--green); border-color: var(--line-hover); transform: translateY(-1px); }
.theme-toggle svg { grid-area: 1 / 1; width: 18px; height: 18px; }
.sun-icon { display: none; }
html[data-theme="dark"] .moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: block; }
.immersive .app-header { display: none; }

.dashboard-shell { width: min(100% - 40px, 980px); margin: 0 auto; padding: 48px 0 55px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.overline { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.dashboard-heading h1 { margin: 8px 0 0; font-family: "Aptos Display", "Trebuchet MS", ui-rounded, sans-serif; font-size: clamp(32px, 4vw, 43px); line-height: 1.1; letter-spacing: -1.9px; }
.real-progress { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 5px; border: 0; border-radius: 16px; background: transparent; text-align: left; cursor: pointer; }
.real-progress:hover { background: var(--surface-soft); }
.goal-ring { --goal: 8%; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle closest-side, var(--canvas) 75%, transparent 77%), conic-gradient(var(--green) var(--goal), var(--goal-track) 0); }
.goal-ring strong { font-size: 13px; }
.real-progress > span:last-child { display: grid; gap: 2px; }
.real-progress small { color: var(--ink-3); font-size: 9px; font-weight: 700; }
.real-progress > span:last-child strong { max-width: 110px; font-size: 11px; line-height: 1.2; }

.quick-card { width: 100%; min-height: 122px; margin-top: 34px; padding: 24px 25px; overflow: hidden; position: relative; display: flex; align-items: center; gap: 18px; border: 0; border-radius: 24px; background: var(--quick-bg); color: white; cursor: pointer; text-align: left; box-shadow: 0 13px 30px rgba(5, 25, 21, .16); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.quick-card::before { content: ""; position: absolute; width: 180px; height: 180px; right: 100px; top: -122px; border: 32px solid rgba(255,255,255,.045); border-radius: 50%; }
.quick-card::after { content: ""; position: absolute; width: 8px; height: 8px; right: 30%; bottom: 22px; border-radius: 50%; background: var(--yellow); box-shadow: 27px -30px 0 rgba(255,255,255,.14), -39px 4px 0 rgba(255,255,255,.1); }
.quick-card:hover { transform: translateY(-2px); background: var(--quick-hover); box-shadow: 0 17px 36px rgba(5, 25, 21, .22); }
.quick-icon { flex: 0 0 auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--yellow); color: var(--on-yellow); }
.quick-icon svg { width: 28px; height: 28px; }
.quick-copy { position: relative; z-index: 1; display: grid; gap: 3px; }
.quick-copy small { color: var(--quick-kicker); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.quick-copy strong { font-family: "Aptos Display", "Trebuchet MS", sans-serif; font-size: 20px; letter-spacing: -.4px; }
.quick-copy > span { color: rgba(255,255,255,.65); font-size: 11px; }
.quick-action { position: relative; z-index: 1; margin-left: auto; display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 850; }
.quick-arrow { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: white; color: #173c37; }
.quick-arrow svg { width: 19px; height: 19px; }

.subjects-section { margin-top: 37px; }
.section-heading { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; font-family: "Aptos Display", "Trebuchet MS", sans-serif; font-size: 21px; letter-spacing: -.6px; }
.filter-button { min-height: 37px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 11px; font-weight: 750; transition: border-color .16s ease, color .16s ease, transform .16s ease; }
.filter-button:hover { color: var(--green); border-color: var(--line-hover); transform: translateY(-1px); }
.filter-button svg { width: 17px; height: 17px; }
.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.subject-card { min-height: 126px; padding: 19px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; box-shadow: 0 4px 16px rgba(5,25,21,.035); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.subject-card:hover { transform: translateY(-3px); border-color: var(--line-hover); box-shadow: var(--shadow); }
.subject-icon { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--card-soft); color: var(--card-color); }
html[data-theme="dark"] .subject-icon { background: var(--surface-soft); background: color-mix(in srgb, var(--card-color) 17%, var(--surface)); }
.subject-icon svg { width: 25px; height: 25px; }
.subject-card h3 { flex: 1; min-width: 0; margin: 0; font-family: "Aptos Display", "Trebuchet MS", sans-serif; font-size: 16px; letter-spacing: -.25px; }
.subject-label { display: grid; gap: 4px; flex: 1; min-width: 0; }
.subject-label strong { font-size: 15px; font-weight: 750; letter-spacing: -.3px; }
.subject-label small { color: var(--ink-3); font-size: 10px; }
.card-arrow { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--muted-icon); transition: background .18s ease, color .18s ease, transform .18s ease; }
.card-arrow svg { width: 16px; height: 16px; }
.subject-card:hover .card-arrow { transform: translateX(2px); background: var(--green); color: var(--on-accent); }
.content-note { margin: 22px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink-3); font-size: 10px; text-align: center; }
.content-note > span { width: 16px; height: 16px; display: grid; place-items: center; border: 1px solid var(--line-hover); border-radius: 50%; font-family: Georgia, serif; font-size: 10px; font-weight: 700; }
.section-hint { color: var(--ink-3); font-size: 10px; }
.review-section { margin-top: 28px; }
.review-section .section-heading h2 { font-size: 19px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.review-card { min-width: 0; min-height: 80px; padding: 15px 18px; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.review-card:hover:not(:disabled) { border-color: var(--line-hover); background: var(--surface-hover); }
.review-card:disabled { cursor: default; }
.review-symbol { flex: 0 0 auto; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-size: 26px; }
.review-symbol svg { width: 20px; height: 20px; }
.errors-symbol { background: var(--yellow-soft); color: var(--exam-ink); }
.review-copy { display: grid; gap: 4px; min-width: 0; }
.review-copy strong { font-size: 12px; }
.review-copy small { color: var(--ink-3); font-size: 10px; line-height: 1.4; }
.review-count { display: grid; place-items: center; flex: 0 0 auto; margin-left: auto; min-width: 25px; height: 25px; border-radius: 50%; background: var(--surface-soft); color: var(--ink-2); font-size: 11px; font-weight: 800; }
.local-data-note { display: block; margin: 10px auto 0; border: 0; background: transparent; color: var(--ink-3); font-size: 10px; cursor: pointer; min-height: 28px; }
.local-data-note:hover { color: var(--green-dark); }
.catalog-status { padding: 24px; color: var(--ink-2); text-align: center; font-size: 13px; }
.catalog-status button { margin-left: 10px; }
.text-button { min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--green-dark); font-size: 12px; font-weight: 750; cursor: pointer; }
.storage-warning { margin: 12px auto 0; max-width: 540px; text-align: center; color: var(--danger-ink); font-size: 11px; line-height: 1.5; }
.is-loading .subject-card, .is-loading .review-card, .is-loading .result-actions { pointer-events: none; opacity: .6; }
.quick-card:disabled { cursor: wait; }

.quiz-view { min-height: 100vh; }
.quiz-shell { width: min(100% - 32px, 720px); margin: 0 auto; padding: 24px 0 50px; }
.quiz-appbar { height: 52px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; }
.close-session, .bookmark-button, .round-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.close-session { width: 40px; height: 40px; }
.close-session:hover, .bookmark-button:hover, .round-button:hover { color: var(--green); border-color: var(--line-hover); }
.close-session svg, .bookmark-button svg, .round-button svg { width: 19px; height: 19px; }
.session-title { min-width: 0; display: grid; gap: 1px; }
.session-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.session-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 9px; }
.session-position { min-width: 38px; padding: 7px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; text-align: center; }
.session-actions { display: flex; align-items: center; gap: 7px; }
.compact-theme-toggle { width: 34px; height: 34px; background: var(--surface); }
.compact-theme-toggle svg { width: 16px; height: 16px; }
.progress-track { height: 5px; margin: 12px 0 20px; overflow: hidden; border-radius: 999px; background: var(--track); }
.progress-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--green); transition: width .28s ease; }

.question-card { padding: 26px 28px 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 8px 25px rgba(5,25,21,.065); }
.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meta-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.subject-tag, .exam-tag { min-height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: 9px; font-weight: 850; }
.subject-tag { background: var(--green-soft); color: var(--green-dark); }
.exam-tag { background: var(--yellow-soft); color: var(--exam-ink); }
.bookmark-button { flex: 0 0 auto; width: 37px; height: 37px; }
.bookmark-button[aria-pressed="true"] { border-color: var(--line-hover); background: var(--green-soft); color: var(--green); }
.bookmark-button[aria-pressed="true"] path { fill: currentColor; }
.question-topic { margin: 19px 0 9px; color: var(--ink-3); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.question-context { margin: 0 0 17px; padding: 14px 16px; border-left: 3px solid var(--yellow); border-radius: 5px 13px 13px 5px; background: var(--context-bg); color: var(--context-ink); font-size: 12px; line-height: 1.6; }
.question-text { margin: 0 0 21px; font-family: "Aptos Display", "Trebuchet MS", ui-rounded, sans-serif; font-size: 20px; line-height: 1.46; letter-spacing: -.32px; }
.answers-list { display: grid; gap: 9px; }
.answer-option { width: 100%; min-height: 57px; padding: 10px 14px 10px 11px; display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.answer-option:hover:not(.locked) { transform: translateX(2px); border-color: var(--line-hover); background: var(--surface-hover); }
.answer-letter { flex: 0 0 auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-soft); color: var(--ink-2); font-size: 10px; font-weight: 900; }
.answer-copy { flex: 1; font-size: 12px; line-height: 1.45; }
.answer-status { flex: 0 0 auto; width: 20px; color: var(--ink); font-size: 17px; font-weight: 850; text-align: center; }
.answer-option.correct { border-color: var(--green); background: var(--green-soft); }
.answer-option.correct .answer-letter { background: var(--green); color: var(--on-accent); }
.answer-option.wrong { border-color: var(--red); background: var(--red-soft); }
.answer-option.wrong .answer-letter { background: var(--red); color: var(--on-red); }
.answer-option.dimmed { border-color: var(--line-soft); color: var(--ink-3); }
.answer-option.dimmed .answer-letter { color: var(--ink-3); }
.answer-option.locked { cursor: default; }
.answer-option.pending { border-color: var(--green); background: var(--green-soft); }
.answer-option:disabled { -webkit-text-fill-color: currentColor; opacity: 1; }
.answer-error { padding: 12px; border-radius: 12px; color: var(--danger-ink); background: var(--red-soft); font-size: 12px; line-height: 1.5; }
.question-source { margin-top: 19px; border-top: 1px solid var(--line-soft); padding-top: 13px; color: var(--ink-3); font-size: 10px; line-height: 1.5; }
.question-source summary { width: fit-content; cursor: pointer; }
.question-source p { color: var(--ink-2); margin-bottom: 0; max-width: 58ch; }
.question-source a { color: var(--green-dark); }
.feedback-panel { margin-top: 15px; padding: 15px; display: flex; gap: 11px; border-radius: 15px; }
.feedback-panel.success { background: var(--green-soft); color: var(--green-dark); }
.feedback-panel.error { background: var(--red-soft); color: var(--danger-ink); }
.feedback-icon { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--on-accent); font-size: 12px; font-weight: 900; }
.success .feedback-icon { background: var(--green); }
.error .feedback-icon { background: var(--red); color: var(--on-red); }
.feedback-panel h3 { margin: 1px 0 4px; font-size: 12px; }
.feedback-panel p { margin: 0; color: var(--feedback-copy); font-size: 11px; line-height: 1.55; }
.question-actions { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.skip-button { min-height: 44px; padding: 0 11px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 11px; font-weight: 750; }
.skip-button:hover { color: var(--ink); }
.primary-button, .secondary-button { min-height: 48px; padding: 0 21px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 999px; cursor: pointer; font-weight: 850; transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.primary-button { border: 0; background: var(--green); color: var(--on-accent); box-shadow: 0 8px 17px rgba(20,135,113,.16); }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--button-hover); box-shadow: 0 11px 22px rgba(20,135,113,.2); }
.primary-button:disabled { background: var(--surface-soft); color: var(--ink-3); cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 18px; height: 18px; }
.next-button { min-width: 132px; margin-left: auto; }
.session-score { margin-top: 13px; display: flex; align-items: center; justify-content: center; gap: 16px; color: var(--ink-3); font-size: 9px; }
.session-score > span { display: flex; align-items: center; gap: 5px; }
.session-score strong { color: var(--ink-2); }
.score-dot { width: 6px; height: 6px; border-radius: 50%; }
.correct-dot { background: var(--green); }
.wrong-dot { background: var(--red); }
.neutral-dot { background: var(--neutral-dot); }

.results-view { min-height: 100vh; padding: 32px 16px; display: grid; place-items: center; }
.results-card { width: min(100%, 540px); padding: 42px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.result-symbol { width: 62px; height: 62px; margin: 0 auto 19px; display: grid; place-items: center; border-radius: 20px; background: var(--yellow); color: var(--on-yellow); transform: rotate(-3deg); }
.result-symbol svg { width: 37px; height: 37px; }
.results-card h1 { margin: 8px 0 7px; font-family: "Aptos Display", "Trebuchet MS", sans-serif; font-size: 30px; letter-spacing: -1.2px; }
.result-message { min-height: 20px; margin: 0; color: var(--ink-2); font-size: 12px; }
.result-score { margin: 28px auto 18px; display: flex; align-items: center; justify-content: center; gap: 22px; text-align: left; }
.score-ring { --score: 0%; width: 112px; height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: radial-gradient(circle closest-side, var(--surface) 74%, transparent 76%), conic-gradient(var(--green) var(--score), var(--green-soft) 0); }
.score-ring strong { font-family: "Aptos Display", "Trebuchet MS", sans-serif; font-size: 26px; }
.score-ring span { color: var(--ink-3); font-size: 9px; }
.score-details { display: grid; gap: 2px; }
.score-details strong { font-size: 21px; }
.score-details span { color: var(--ink-3); font-size: 10px; }
.result-breakdown { margin-bottom: 22px; padding: 14px; display: flex; align-items: center; justify-content: center; gap: 20px; border-radius: 15px; background: var(--surface-soft); }
.breakdown-item { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 9px; }
.breakdown-item strong { color: var(--ink); font-size: 13px; }
.result-actions { display: grid; gap: 9px; }
.wide-button { width: 100%; }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: none; }
.secondary-button:hover { transform: translateY(-1px); border-color: var(--line-hover); }

.sheet-backdrop { position: fixed; z-index: 60; inset: 0; padding: 20px; display: grid; place-items: center; background: var(--overlay); backdrop-filter: blur(4px); animation: fade-in .18s ease; }
.filter-sheet { width: min(100%, 580px); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); animation: slide-in .22s ease; }
.sheet-handle { display: none; }
.sheet-heading { margin-bottom: 19px; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.sheet-heading h2 { margin: 6px 0 0; font-family: "Aptos Display", "Trebuchet MS", sans-serif; font-size: 25px; letter-spacing: -.8px; }
.round-button { width: 39px; height: 39px; }
.filter-group { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.filter-label { margin-bottom: 10px; display: block; color: var(--ink-2); font-size: 10px; font-weight: 850; }
.subject-chips, .chip-group { display: flex; flex-wrap: wrap; gap: 7px; }
.subject-chip, .filter-chip { min-height: 37px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 10px; font-weight: 750; transition: color .14s ease, border-color .14s ease, background .14s ease; }
.subject-chip:hover, .filter-chip:hover { border-color: var(--line-hover); color: var(--ink); }
.subject-chip.active, .filter-chip.active { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.subject-chip .mini-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chip-color); }
.sheet-footer { padding-top: 19px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line-soft); }
.sheet-footer > span { color: var(--ink-3); font-size: 10px; }
.sheet-footer .primary-button { min-width: 120px; }
.progress-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.progress-metrics > div { display: grid; gap: 5px; padding: 19px 10px; border-radius: 16px; background: var(--green-soft); text-align: center; }
.progress-metrics strong { font-size: 25px; letter-spacing: -.8px; }
.progress-metrics span { color: var(--ink-2); font-size: 10px; }
.stat-total { text-align: center; color: var(--ink-3); font-size: 11px; margin: 18px 0 24px; }
.subject-progress { display: grid; gap: 15px; }
.subject-progress-label { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }
.subject-progress-label strong { color: var(--green-dark); }
.mini-track { height: 5px; border-radius: 6px; background: var(--track); overflow: hidden; }
.mini-track span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.data-controls { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.data-controls p { color: var(--ink-3); font-size: 11px; line-height: 1.6; }
.data-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.data-actions .secondary-button { min-height: 42px; padding: 0 15px; font-size: 11px; }
.danger-text { color: var(--danger-ink); }
.reset-confirmation { margin-top: 15px; padding: 15px; border-radius: 16px; background: var(--red-soft); }
.reset-confirmation p { margin-top: 0; color: var(--danger-ink); font-size: 11px; line-height: 1.6; }
.progress-sheet .round-button { font-size: 25px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 20px; background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--shadow); font-size: 11px; line-height: 1.5; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, 130%); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }

@media (max-width: 700px) {
  .header-inner, .dashboard-shell { width: min(100% - 28px, 980px); }
  .header-inner { height: 62px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand-mark svg { width: 22px; height: 22px; }
  .brand-name { font-size: 16px; }
  .library-size { padding: 0 10px; }
  .library-size { font-size: 0; }
  .library-size strong { font-size: 11px; }
  .library-size::after { content: " questões"; font-size: 9px; }
  .dashboard-shell { padding: 32px 0 38px; }
  .dashboard-heading { align-items: start; gap: 12px; }
  .dashboard-heading h1 { max-width: 245px; font-size: 31px; letter-spacing: -1.4px; }
  .real-progress > span:last-child { display: none; }
  .goal-ring { width: 46px; height: 46px; }
  .quick-card { min-height: 105px; margin-top: 25px; padding: 18px; gap: 13px; border-radius: 21px; }
  .quick-card::before { right: 40px; }
  .quick-card::after { display: none; }
  .quick-icon { width: 48px; height: 48px; border-radius: 15px; }
  .quick-icon svg { width: 24px; height: 24px; }
  .quick-copy small { font-size: 8px; }
  .quick-copy strong { max-width: 165px; font-size: 15px; line-height: 1.2; }
  .quick-copy > span { font-size: 9px; }
  .quick-action { font-size: 0; }
  .quick-arrow { width: 36px; height: 36px; }
  .subjects-section { margin-top: 29px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2 { font-size: 19px; }
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .subject-card { min-width: 0; min-height: 99px; padding: 14px; display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 9px 10px; }
  .subject-icon { width: 42px; height: 42px; border-radius: 13px; }
  .subject-icon svg { width: 22px; height: 22px; }
  .subject-card h3 { grid-column: 1 / -1; grid-row: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .subject-label { grid-column: 1 / -1; grid-row: 2; gap: 3px; }
  .subject-label strong { font-size: 13px; }
  .subject-label small { font-size: 9px; }
  .card-arrow { grid-column: 2; grid-row: 1; justify-self: end; width: 29px; height: 29px; }
  .content-note { align-items: flex-start; padding: 0 5px; font-size: 9px; line-height: 1.45; }
  .content-note > span { flex: 0 0 auto; }
  .review-section { margin-top: 25px; }
  .review-grid { gap: 10px; }
  .review-card { display: grid; grid-template-columns: 1fr auto; gap: 10px 5px; padding: 13px; }
  .review-symbol { width: 30px; height: 30px; border-radius: 10px; font-size: 24px; }
  .review-copy { grid-column: 1 / -1; grid-row: 2; }
  .review-copy strong { font-size: 12px; }
  .review-copy small { font-size: 9px; }
  .review-count { grid-column: 2; grid-row: 1; }
  .section-hint { font-size: 9px; }

  .quiz-shell { width: min(100% - 24px, 720px); padding-top: 12px; padding-bottom: 35px; }
  .quiz-appbar { position: sticky; z-index: 12; top: 0; height: 58px; background: var(--header-bg); backdrop-filter: blur(12px); }
  .progress-track { margin-top: 4px; margin-bottom: 13px; }
  .question-card { padding: 20px 17px 17px; border-radius: 21px; box-shadow: none; }
  .question-topic { margin-top: 17px; }
  .question-context { padding: 12px 13px; font-size: 11px; }
  .question-text { font-size: 17px; line-height: 1.48; }
  .answer-option { min-height: 55px; padding-right: 11px; }
  .answer-copy { font-size: 11px; }
  .feedback-panel p { font-size: 10px; }
  .question-actions { position: sticky; z-index: 10; bottom: max(10px, env(safe-area-inset-bottom)); margin: 15px -5px -5px; padding: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass-bg); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
  .question-actions:has(.next-button[hidden]) { width: fit-content; margin-left: auto; border-color: transparent; background: transparent; box-shadow: none; }
  .next-button { flex: 1; min-height: 46px; }
  .skip-button { min-height: 40px; }
  .session-score { margin-top: 11px; }

  .results-card { padding: 34px 20px; border-radius: 23px; }
  .results-card h1 { font-size: 27px; }
  .result-score { gap: 18px; }
  .score-ring { width: 102px; height: 102px; }
  .result-breakdown { gap: 12px; }

  .sheet-backdrop { padding: 0; place-items: end center; }
  .filter-sheet { width: 100%; max-height: 90vh; padding: 13px 19px max(20px, env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; }
  .sheet-handle { width: 42px; height: 5px; margin: 0 auto 15px; display: block; border-radius: 999px; background: var(--handle); }
  .sheet-footer { align-items: stretch; flex-direction: column; }
  .sheet-footer > span { text-align: center; }
  .sheet-footer .primary-button { width: 100%; }
}

@media (max-width: 360px) {
  .brand-name { font-size: 14px; }
  .dashboard-heading h1 { font-size: 28px; }
  .quick-copy strong { max-width: 140px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
