:root {
  --blue: #0758bd;
  --blue-dark: #073b82;
  --blue-light: #e8f2ff;
  --ink: #10223f;
  --muted: #62708a;
  --line: #dbe3ee;
  --surface: #fff;
  --background: #f2f6fb;
  --success: #16804a;
  --danger: #c43737;
  --warning: #8a6200;
  --radius: 18px;
  --shadow: 0 12px 35px rgba(16, 34, 63, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); }
a { color: var(--blue); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
h2 { font-size: 1.35rem; }
button, .button {
  appearance: none; border: 0; border-radius: 12px; background: var(--blue); color: white;
  padding: .85rem 1.15rem; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer;
  display: inline-flex; justify-content: center; align-items: center; gap: .4rem;
}
button:hover, .button:hover { background: var(--blue-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
.button.secondary { color: var(--blue); background: var(--blue-light); }
.button.danger { background: #fff0f0; color: var(--danger); }
.small-button { padding: .6rem .85rem; }
.text-button { color: var(--muted); background: transparent; text-decoration: underline; }
input, select {
  width: 100%; border: 1px solid #c9d4e3; border-radius: 11px; padding: .82rem .9rem;
  background: white; color: var(--ink); font: inherit;
}
textarea {
  width: 100%; border: 1px solid #c9d4e3; border-radius: 11px; padding: .82rem .9rem;
  background: white; color: var(--ink); font: inherit; resize: vertical;
}
textarea:focus { outline: 3px solid rgba(7, 88, 189, .15); border-color: var(--blue); }
input:focus, select:focus { outline: 3px solid rgba(7, 88, 189, .15); border-color: var(--blue); }
label { display: grid; gap: .4rem; color: #31415d; font-weight: 650; }
.stack { display: grid; gap: 1rem; }
.site-header {
  background: linear-gradient(120deg, var(--blue-dark), var(--blue)); color: white; padding: .9rem max(1rem, calc((100vw - 1180px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .75rem; color: white; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand small { opacity: .85; margin-top: .15rem; }
.brand-mark {
  width: 64px; height: 64px; background: white; color: var(--blue-dark); border-radius: 16px;
  display: grid; place-content: center; text-align: center; font-weight: 900; line-height: .8; box-shadow: var(--shadow);
}
.brand-mark span, .brand-mark em { color: #60a4d6; font-style: normal; }
.brand-mark.small { width: 46px; height: 46px; border-radius: 12px; font-size: .85rem; }
.site-header nav { display: flex; align-items: center; gap: .8rem; }
.site-header nav a { color: white; text-decoration: none; font-weight: 650; }
.site-header nav form { margin: 0; }
.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2.2rem 0 4rem; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin-bottom: .25rem; color: var(--blue-dark); }
.heading-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.eyebrow { color: var(--blue); letter-spacing: .12em; font-weight: 850; font-size: .75rem; margin-bottom: .55rem; }
.card { min-width: 0; background: var(--surface); border: 1px solid #e5ebf3; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 1.2rem; margin: 1.2rem 0; }
.teacher-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.2rem 0; }
.metrics article { background: white; border-radius: 16px; border: 1px solid #e3eaf3; padding: 1.1rem; box-shadow: var(--shadow); }
.metrics span, .metrics strong { display: block; }
.metrics span { color: var(--muted); font-size: .85rem; }
.metrics strong { color: var(--blue-dark); font-size: 1.65rem; margin-top: .35rem; }
.metrics small { display: block; color: var(--muted); margin-top: .25rem; }
.student-focus-card {
  display: flex; justify-content: space-between; align-items: center; gap: 1.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
}
.student-focus-card h2 { margin-bottom: .35rem; }
.student-focus-card p { color: var(--muted); margin-bottom: 0; }
.student-focus-actions { min-width: 220px; }
.student-focus-actions form, .student-focus-actions button { width: 100%; }
.focus-number { display: grid; gap: .35rem; padding: 1rem; border-radius: 16px; background: var(--blue-light); }
.focus-number strong { color: var(--blue-dark); font-size: 2.3rem; line-height: 1; }
.focus-number span { color: var(--muted); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .55rem; }
.tag-cloud span { background: #eef4fb; color: var(--blue-dark); border-radius: 999px; padding: .45rem .7rem; font-weight: 750; }
.compact-topic-row { grid-template-columns: minmax(120px, 1.3fr) minmax(80px, 1fr) auto; }
.insight-list { display: grid; gap: .75rem; }
.horizontal-insight-list { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.insight-item {
  display: flex; align-items: center; justify-content: space-between; gap: .85rem;
  padding: .85rem; border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); text-decoration: none; background: #fbfdff;
}
.insight-item:hover { border-color: #b8d2f2; background: var(--blue-light); }
.insight-item span, .insight-item strong, .insight-item small { display: block; }
.insight-item small { color: var(--muted); margin-top: .18rem; }
.score-pill {
  border-radius: 999px; padding: .4rem .65rem; background: #e7f7ee; color: var(--success);
  white-space: nowrap; font-size: .9rem;
}
.score-pill.warning { background: #fff7dd; color: var(--warning); }
.score-pill.danger { background: #fff0f0; color: var(--danger); }
.quick-diagnosis { display: grid; grid-template-columns: minmax(120px, .55fr) minmax(180px, 1fr); gap: 1rem; align-items: start; }
.diagnosis-list { display: grid; gap: .65rem; }
.diagnosis-list p { margin: 0; padding-bottom: .65rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.diagnosis-list strong { color: var(--blue-dark); }
.resume-banner { background: #e9f3ff; border: 1px solid #bedcff; border-radius: 16px; padding: 1rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.resume-banner strong, .resume-banner span { display: block; }
.resume-banner span { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.resume-content { flex: 1; min-width: 0; }
.resume-progress { width: min(460px, 100%); height: 8px; margin-top: .7rem; border: 0; border-radius: 99px; overflow: hidden; background: #d5e4f5; }
.resume-progress::-webkit-progress-bar { background: #d5e4f5; border-radius: 99px; }
.resume-progress::-webkit-progress-value { background: var(--blue); border-radius: 99px; }
.resume-progress::-moz-progress-bar { background: var(--blue); border-radius: 99px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1rem; }
.quick-actions form, .quick-actions button { width: 100%; }
.section-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.section-heading-row > span { color: var(--muted); font-size: .85rem; }
.evolution-card { margin: 1.2rem 0; }
.trend-callout { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-radius: 14px; padding: .85rem 1rem; background: #f2f6fb; }
.trend-callout strong, .trend-callout p { display: block; }
.trend-callout p { color: var(--muted); margin: .2rem 0 0; }
.trend-callout > span { border-radius: 999px; padding: .4rem .65rem; background: white; color: var(--blue-dark); font-weight: 800; white-space: nowrap; }
.trend-callout.improving { background: #e7f7ee; }
.trend-callout.improving > span { color: var(--success); }
.trend-callout.attention { background: #fff7dd; }
.trend-callout.attention > span { color: var(--warning); }
.trend-callout.stable { background: #e8f2ff; }
.score-chart-panel { margin-top: 1rem; }
.score-chart-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: .35rem; color: var(--muted); font-size: .78rem; }
.score-chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.score-chart-legend i { width: 22px; height: 3px; display: inline-block; border-radius: 99px; }
.score-line-key { background: var(--blue); }
.pass-line-key { background: #d96b45; }
.score-chart-canvas { position: relative; width: 100%; height: 270px; }
.score-chart-status { margin: 1rem 0; color: var(--muted); text-align: center; }
.score-chart-panel.is-ready .score-chart-status { display: none; }
.score-chart-help { margin: .35rem 0 0; color: var(--muted); font-size: .8rem; text-align: center; }
.score-chart-details { margin-top: .75rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.score-chart-details summary { width: fit-content; color: var(--blue); cursor: pointer; font-weight: 700; }
.score-chart-details[open] summary { margin-bottom: .65rem; }
.score-chart-table { min-width: 620px; }
.history-filter { display: flex; align-items: flex-end; gap: .7rem; margin-bottom: 1rem; }
.history-filter label { min-width: min(320px, 100%); }
.history-metrics { grid-template-columns: repeat(4, 1fr); }
.history-table-card { margin-top: 1.2rem; }
.history-table { min-width: 1040px; }
.topic-list { display: grid; gap: .9rem; }
.topic-row { display: grid; grid-template-columns: minmax(130px, 1.2fr) minmax(100px, 1fr) auto; align-items: center; gap: .8rem; }
.topic-row small { display: block; color: var(--muted); margin-top: .15rem; }
.progress { width: 100%; height: 9px; border: 0; background: #e6ecf4; border-radius: 99px; overflow: hidden; }
.progress::-webkit-progress-bar { background: #e6ecf4; border-radius: 99px; }
.progress::-webkit-progress-value { background: linear-gradient(90deg, #2c80dc, #36a875); border-radius: 99px; }
.progress::-moz-progress-bar { background: linear-gradient(90deg, #2c80dc, #36a875); border-radius: 99px; }
.danger-progress::-webkit-progress-value { background: linear-gradient(90deg, #f3a43b, var(--danger)); }
.danger-progress::-moz-progress-bar { background: linear-gradient(90deg, #f3a43b, var(--danger)); }
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: .85rem .65rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
td small { display: block; color: var(--muted); margin-top: .15rem; }
.auth-wrap, .auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(145deg, #eaf3ff, #f8fafc 55%, #dcecff); }
.auth-card { width: min(440px, 100%); background: white; padding: 2rem; border-radius: 22px; box-shadow: 0 24px 70px rgba(16, 34, 63, .16); }
.auth-card .brand-mark { margin-bottom: 1.5rem; }
.auth-card .text-link { display: inline-block; margin-top: 1.1rem; }
.auth-links { display: grid; justify-items: start; gap: .65rem; margin-top: 1.1rem; }
.auth-links .text-link { margin-top: 0; }
.site-footer {
  width: min(1180px, calc(100% - 2rem)); margin: -2rem auto 0; padding: 1.25rem 0 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem;
}
.site-footer a { font-weight: 700; }
.privacy-wrap { width: min(960px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 4rem; }
.privacy-header { max-width: 780px; margin-bottom: 1.5rem; }
.privacy-header h1 { color: var(--blue-dark); margin-bottom: .65rem; }
.privacy-header > p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.privacy-header small { color: var(--muted); }
.privacy-card {
  background: white; border: 1px solid #e5ebf3; border-radius: var(--radius);
  padding: clamp(1.15rem, 3vw, 1.6rem); box-shadow: var(--shadow);
}
.privacy-card h2 { color: var(--blue-dark); margin-bottom: .8rem; }
.privacy-card h3 { color: var(--blue-dark); font-size: .95rem; margin-bottom: .35rem; }
.privacy-card p, .privacy-card li { line-height: 1.65; }
.privacy-card ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.privacy-card li + li { margin-top: .45rem; }
.privacy-summary { margin-bottom: 1rem; }
.privacy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.privacy-grid > div { border-left: 3px solid #c9e4ff; padding-left: .85rem; }
.privacy-grid p { margin-bottom: 0; }
.privacy-sections { display: grid; gap: 1rem; }
.privacy-note { margin: 1rem 0 0; padding: .8rem; border-radius: 12px; background: #f3f7fc; color: var(--muted); }
.privacy-more { margin-top: 1rem; }
.privacy-more .button { margin-top: .3rem; }
.alert { width: min(1180px, 100%); border-radius: 12px; padding: .85rem 1rem; margin: 0 auto 1rem; }
.alert.success { background: #e7f7ee; color: #17683f; border: 1px solid #b9e4cc; }
.alert.error { background: #fff0f0; color: #9f2c2c; border: 1px solid #efc3c3; }
.alert.warning { background: #fff7dd; color: #735000; border: 1px solid #ead38b; }
.attempt-shell, .attempt-review-shell { width: min(1120px, 100%); margin: 0 auto; }
.attempt-header { display: grid; gap: .8rem; margin-bottom: 1rem; }
.attempt-header h1 { font-size: 1.8rem; }
.attempt-heading-row, .attempt-progress-label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.attempt-progress-label { color: var(--muted); font-size: .85rem; }
.attempt-progress { width: 100%; height: 10px; border: 0; background: #dfe8f3; border-radius: 99px; overflow: hidden; }
.attempt-progress::-webkit-progress-bar { background: #dfe8f3; border-radius: 99px; }
.attempt-progress::-webkit-progress-value { background: var(--blue); border-radius: 99px; }
.attempt-progress::-moz-progress-bar { background: var(--blue); border-radius: 99px; }
.attempt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.attempt-navigator-panel { position: sticky; top: 1rem; }
.question-card { background: white; border-radius: 20px; padding: clamp(1.1rem, 4vw, 2rem); box-shadow: var(--shadow); }
.question-card h2 { font-size: clamp(1.15rem, 3vw, 1.45rem); line-height: 1.45; }
.question-actions { display: flex; justify-content: flex-end; }
.question-actions form { display: flex; align-items: center; gap: .55rem; }
.icon-button { color: var(--blue-dark); background: #edf4fc; padding: .55rem .8rem; font-size: .85rem; }
.icon-button.marked { color: #7c5900; background: #fff5c9; }
.bookmark-status { color: var(--muted); font-size: .8rem; }
.answer-form { display: grid; gap: .75rem; margin-top: 1.2rem; }
.answer-option { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: .75rem; padding: .9rem; border: 1px solid #d5dfeb; border-radius: 14px; cursor: pointer; }
.answer-option:has(input:checked) { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 2px rgba(7, 88, 189, .08); }
.answer-option input, .blank-option input { width: auto; }
.option-key { width: 30px; height: 30px; display: grid; place-items: center; background: #e8eef7; border-radius: 50%; color: var(--blue-dark); font-weight: 800; }
.blank-option { display: flex; align-items: center; gap: .55rem; padding: .5rem; font-weight: 500; }
.answer-error { color: var(--danger); background: #fff0f0; border: 1px solid #efc3c3; border-radius: 10px; padding: .7rem .85rem; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: .7rem; }
.report-question { border-top: 1px solid var(--line); margin-top: 1.35rem; padding-top: 1rem; }
.report-question summary { color: var(--muted); cursor: pointer; font-weight: 700; }
.report-question[open] summary { color: var(--blue-dark); margin-bottom: 1rem; }
.report-form-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.report-form-actions button { width: auto; }
.success-text { color: var(--success); font-weight: 700; }
.error-text { color: var(--danger); font-weight: 700; }
.status-badge { display: inline-flex; border-radius: 99px; padding: .3rem .6rem; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.status-pending { background: #fff1d6; color: #7b5200; }
.status-reviewing { background: #e7f1ff; color: var(--blue-dark); }
.status-resolved { background: #e3f7eb; color: var(--success); }
.status-dismissed { background: #edf0f4; color: var(--muted); }
.status-active { background: #e3f7eb; color: var(--success); }
.status-inactive { background: #edf0f4; color: var(--muted); }
.report-details { display: grid; gap: .8rem; margin: 1.2rem 0; }
.report-details div { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.report-details dt { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.report-details dd { margin: .2rem 0 0; }
.report-message { background: #f3f7fc; border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.report-message p { margin: .4rem 0 0; white-space: pre-wrap; }
.finish-early { text-align: center; margin-top: 1rem; }
.question-navigator { background: white; border: 1px solid #e5ebf3; border-radius: 18px; padding: 1rem; box-shadow: var(--shadow); }
.card .question-navigator { border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.question-navigator header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.question-navigator header h2 { margin: 0; }
.question-navigator header > span { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.question-nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .45rem; }
.question-nav-link {
  position: relative; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #ccd7e5;
  border-radius: 10px; background: #f5f8fc; color: var(--ink); text-decoration: none; font-weight: 800;
}
.question-nav-link:hover { border-color: var(--blue); background: var(--blue-light); }
.question-nav-link.answered { border-color: #9fcaeb; background: #dff0ff; color: var(--blue-dark); }
.question-nav-link.blank { border-color: #e4c46c; background: #fff5d6; color: #735000; }
.question-nav-link.current { outline: 3px solid var(--blue); outline-offset: 2px; }
.question-nav-link small { position: absolute; top: .05rem; right: .2rem; color: #9a6b00; font-size: .65rem; line-height: 1; }
.question-nav-legend { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .6rem; margin-top: .9rem; color: var(--muted); font-size: .75rem; }
.question-nav-legend span { display: flex; align-items: center; gap: .35rem; }
.question-nav-legend i { width: 11px; height: 11px; border: 1px solid #ccd7e5; border-radius: 3px; background: #f5f8fc; }
.question-nav-legend i.answered { border-color: #9fcaeb; background: #dff0ff; }
.question-nav-legend i.blank { border-color: #e4c46c; background: #fff5d6; }
.review-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: 1rem; }
.review-counts article { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; background: white; box-shadow: var(--shadow); }
.review-counts strong, .review-counts span { display: block; }
.review-counts strong { color: var(--blue-dark); font-size: 1.9rem; }
.review-counts span { color: var(--muted); margin-top: .2rem; }
.review-counts .blank { border-color: #ead38b; background: #fffaf0; }
.review-counts .pending { border-color: #e6c5c5; background: #fff8f8; }
.review-submit-card { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-top: 1rem; }
.review-submit-card p { color: var(--muted); margin-bottom: 0; }
.review-submit-actions { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.review-submit-actions form { margin: 0; }
.result-hero { text-align: center; background: linear-gradient(145deg, #07428c, #0872d4); color: white; border-radius: 22px; padding: 2rem; box-shadow: var(--shadow); }
.result-hero .eyebrow { color: #bce0ff; }
.result-hero h1 { font-size: 4rem; margin-bottom: 0; }
.result-hero > span { opacity: .8; }
.result-feedback { max-width: 720px; margin: 1rem auto 0; }
.result-feedback strong { display: block; font-size: 1.25rem; }
.result-feedback p { margin: .35rem 0 0; color: #dceeff; }
.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.5rem auto; max-width: 700px; }
.result-metrics div { background: rgba(255, 255, 255, .12); padding: .9rem; border-radius: 13px; }
.result-metrics strong, .result-metrics span { display: block; }
.result-metrics strong { font-size: 1.35rem; }
.result-metrics span { font-size: .8rem; opacity: .8; }
.result-hero .button { background: white; color: var(--blue-dark); }
.result-actions { display: flex; justify-content: center; align-items: stretch; gap: .7rem; flex-wrap: wrap; }
.result-actions form { margin: 0; }
.result-actions form, .result-actions .button { min-width: 210px; }
.result-actions .result-primary-action { background: #fff0f0; color: var(--danger); }
.result-analysis-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1.2rem; margin-top: 1.2rem; }
.result-topic-list { display: grid; gap: .75rem; }
.result-topic-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(100px, .8fr) auto; align-items: center; gap: .8rem; padding: .8rem; border: 1px solid var(--line); border-radius: 13px; }
.result-topic-row.weak { border-color: #e5c77c; background: #fffaf0; }
.result-topic-row small { display: block; color: var(--muted); margin-top: .18rem; }
.result-next-step { background: linear-gradient(145deg, #ffffff, #eef6ff); }
.result-next-step p { color: var(--muted); }
.result-next-step form, .result-next-step button { width: 100%; }
.correction-list { margin-top: 1.5rem; }
.correction { background: white; border-radius: 16px; padding: 1.25rem; margin: .9rem 0; border-left: 5px solid var(--line); box-shadow: var(--shadow); }
.correction.correct { border-color: var(--success); }
.correction.wrong { border-color: var(--danger); }
.correction.blank { border-color: #9a7a23; }
.correction header { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); margin-bottom: .8rem; }
.explanation { background: #f3f7fc; padding: .9rem; border-radius: 12px; margin-top: .8rem; }
.explanation p { margin: .35rem 0 0; }
.legal-reference { color: var(--muted); font-size: .9rem; }
.requirements { line-height: 1.8; }
.permission-fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.permission-fieldset legend { color: var(--blue-dark); font-weight: 850; padding: 0 .4rem; }
.permission-part + .permission-part { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .55rem; }
.permission-grid label { display: flex; align-items: center; gap: .45rem; background: #f5f8fc; border-radius: 10px; padding: .6rem; }
.permission-grid input { width: auto; }
.import-summary {
  margin-top: 1rem; border: 1px solid #efc3c3; background: #fff8f8;
  border-radius: 16px; padding: 1rem; color: #6f2323;
}
.import-summary h3 { margin-bottom: .25rem; color: var(--danger); }
.import-summary > p { color: #7d4b4b; margin-bottom: .85rem; }
.import-summary-list { display: grid; gap: .75rem; list-style: none; margin: 0; padding: 0; }
.import-summary-item { background: white; border: 1px solid #f1d1d1; border-radius: 13px; padding: .85rem; }
.import-summary-item strong, .import-summary-item span, .import-summary-item small { display: block; }
.import-summary-item span { color: #7d4b4b; font-size: .9rem; margin-top: .2rem; }
.import-summary-item p { margin: .5rem 0 0; color: var(--ink); }
.import-summary-item small { margin-top: .45rem; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.import-errors { margin-top: 1rem; color: var(--danger); }
.import-errors ul { margin-top: .65rem; }
.import-preview { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.import-preview-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.import-preview-heading h3 { overflow-wrap: anywhere; }
.import-preview-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: 1rem 0; }
.import-preview-metrics div { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; background: #f8fbff; }
.import-preview-metrics span, .import-preview-metrics strong { display: block; }
.import-preview-metrics span { color: var(--muted); font-size: .78rem; }
.import-preview-metrics strong { color: var(--blue-dark); font-size: 1.3rem; margin-top: .25rem; }
.import-preview-distribution { display: grid; gap: 1rem; margin: 1rem 0; }
.import-preview-distribution > div > strong { display: block; margin-bottom: .55rem; }
.import-preview-actions { display: flex; gap: .65rem; align-items: center; }
.import-preview-actions form { margin: 0; }
.filter-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(170px, .35fr) minmax(145px, .28fr) auto; gap: .7rem; margin-bottom: 1rem; }
.filter-actions { display: flex; gap: .55rem; align-items: stretch; }
.filter-actions button, .filter-actions .button { white-space: nowrap; }
.filter-summary { color: var(--muted); margin: -.35rem 0 1rem; font-size: .92rem; }
.bulk-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid #d8e5f4; background: #f7fbff; border-radius: 14px; padding: .9rem 1rem; margin-bottom: 1rem;
}
.bulk-actions strong, .bulk-actions span { display: block; }
.bulk-actions span { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.bulk-actions-controls { display: flex; align-items: center; gap: .65rem; min-width: min(420px, 100%); }
.bulk-actions-controls select { min-width: 220px; }
.checkbox-column { width: 42px; text-align: center; }
.checkbox-column input { width: auto; }
.inline-form { display: inline; margin-left: .45rem; }
.inline-form .text-button { padding: 0; }
.danger-zone { margin-top: 1rem; border: 1px solid #efc3c3; background: #fffafa; }
.danger-zone form { max-width: 34rem; }
.danger-zone .button.danger { border: 1px solid #efc3c3; }
.status-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .85rem; margin-top: 1rem; }
.status-check-card { border: 1px solid var(--line); border-radius: 14px; padding: .95rem; background: #fbfdff; }
.status-check-card strong, .status-check-card small { display: block; }
.status-check-card strong { margin-top: .65rem; color: var(--blue-dark); }
.status-check-card small { margin-top: .25rem; color: var(--muted); line-height: 1.45; }
.system-definition-list { display: grid; gap: .7rem; margin: 1rem 0 0; }
.system-definition-list div { display: grid; grid-template-columns: minmax(130px, .45fr) minmax(0, 1fr); gap: .8rem; border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.system-definition-list dt { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.system-definition-list dd { margin: 0; overflow-wrap: anywhere; }
.system-mail-test { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.activity-filter-row { grid-template-columns: minmax(260px, 1fr) minmax(220px, .55fr) auto; }
.topic-access-filters { grid-template-columns: minmax(220px, 1fr) minmax(170px, .35fr) minmax(170px, .35fr) auto; }
.topic-access-table form { margin: 0; }
.activity-table { min-width: 920px; }
.activity-action { display: inline-flex; border-radius: 999px; padding: .35rem .6rem; font-size: .78rem; font-weight: 800; white-space: nowrap; background: #edf1f6; color: var(--muted); }
.activity-action-question { background: #e7f1ff; color: var(--blue-dark); }
.activity-action-student { background: #e3f7eb; color: var(--success); }
.activity-action-teacher { background: #eef0ff; color: #4741a5; }
.activity-action-report { background: #fff1d6; color: #7b5200; }
.activity-action-mail { background: #f1eaff; color: #6f3ca0; }
.activity-action-topic-content { background: #e6f7f4; color: #137066; }
.muted-text { color: var(--muted); }
.content-table { min-width: 1120px; }
.content-table form { margin-top: .45rem; }
.content-assignment-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.content-assignment-actions form { margin-top: .45rem; }
.content-actions { display: grid; gap: .35rem; }
.content-chip { display: inline-flex; margin: .15rem .2rem .15rem 0; border-radius: 999px; padding: .3rem .55rem; background: var(--blue-light); color: var(--blue-dark); font-size: .72rem; font-weight: 850; }
.topic-progress-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.topic-progress-filters { grid-template-columns: minmax(260px, 1fr) minmax(190px, .4fr) auto; margin-top: 1rem; }
.topic-progress-table { min-width: 1380px; }
.current-material { overflow-wrap: anywhere; }
.content-editor-card { max-width: 900px; margin: 0 auto; }
.content-editor-card label small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.classroom-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .38fr); gap: 1.4rem; margin-bottom: 2rem; background: linear-gradient(145deg, #fff, #eef6ff); border-color: #cfe1f5; }
.classroom-overview-main { min-width: 0; }
.classroom-overview-progress-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.classroom-overview-progress-row h2, .classroom-overview-progress-row p { margin: 0; }
.classroom-overview-progress-row p { color: var(--muted); margin-top: .2rem; }
.classroom-overview-progress-row > strong { color: var(--blue-dark); font-size: 1.8rem; white-space: nowrap; }
.classroom-summary-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: 1rem; }
.classroom-summary-counts > div { border: 1px solid #dce8f5; border-radius: 12px; padding: .7rem; background: rgba(255, 255, 255, .8); }
.classroom-summary-counts strong, .classroom-summary-counts span { display: block; }
.classroom-summary-counts strong { color: var(--blue-dark); font-size: 1.25rem; }
.classroom-summary-counts span { color: var(--muted); font-size: .78rem; margin-top: .1rem; }
.classroom-overview-action { display: grid; align-content: center; gap: .5rem; border-left: 1px solid #d6e5f5; padding-left: 1.4rem; }
.classroom-overview-action > span { color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.classroom-overview-action > strong { line-height: 1.35; }
.classroom-overview-action .button { margin-top: .35rem; text-align: center; }
.classroom-section + .classroom-section { margin-top: 2rem; }
.classroom-section > .section-heading-row { margin-bottom: 1rem; }
.classroom-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.classroom-topic-card { display: flex; flex-direction: column; gap: .9rem; }
.classroom-topic-card.completed { border-color: #b9e4cc; background: linear-gradient(145deg, #fff, #f2fbf6); }
.classroom-topic-card header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.classroom-topic-card h3 { margin: 0; line-height: 1.35; flex: 1; }
.classroom-topic-card .button { width: 100%; margin-top: auto; }
.classroom-card-progress { display: grid; gap: .35rem; }
.classroom-card-progress-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; color: var(--muted); font-size: .78rem; }
.classroom-card-progress-row strong { color: var(--blue-dark); }
.topic-part { color: var(--blue-dark); font-weight: 900; }
.classroom-steps { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .88rem; }
.classroom-steps li { display: flex; align-items: center; gap: .45rem; }
.classroom-steps li::before { content: "○"; color: #9aa8ba; font-size: 1rem; }
.classroom-steps li.done { color: var(--success); font-weight: 700; }
.classroom-steps li.done::before { content: "✓"; }
.topic-introduction { margin-bottom: 1.2rem; background: linear-gradient(145deg, #fff, #f3f8ff); }
.topic-introduction p { margin: 0; line-height: 1.7; }
.classroom-topic-heading { align-items: flex-start; }
.classroom-topic-heading > div { min-width: 0; }
.classroom-topic-heading .button { flex-shrink: 0; white-space: nowrap; }
.classroom-learning-path { display: grid; gap: 1rem; max-width: 960px; margin: 0 auto; }
.learning-step-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 1rem; align-items: start; }
.learning-step-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: 1.15rem; font-weight: 900; }
.learning-step-content { min-width: 0; }
.learning-step-content > p:not(.eyebrow) { color: var(--muted); }
.progress-confirmation { display: block; color: var(--success); font-weight: 750; margin-top: .7rem; }
.vimeo-launcher { display: grid; gap: .7rem; }
.vimeo-launcher > button { width: fit-content; }
.video-editor-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(150px, .7fr) minmax(0, 1.2fr) auto; gap: .7rem; align-items: end; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; }
.document-editor-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(150px, .7fr) minmax(0, 1fr) auto; gap: .7rem; align-items: end; padding: .85rem; border: 1px solid var(--line); border-radius: 12px; }
.topic-document-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; }
.vimeo-frame { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; border-radius: 14px; background: #08152a; }
.vimeo-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.justice-session-file-row { display: grid; gap: .55rem; margin: 0; }
.justice-session-file-name { font-weight: 750; overflow-wrap: anywhere; }
.justice-session-file-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.justice-session-file {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; text-align: left;
}
.justice-session-table { min-width: 0; }
.justice-document-preview { padding: 0; overflow: hidden; }
.justice-document-preview iframe { display: block; width: 100%; height: min(78vh, 1000px); border: 0; }
.justice-teacher-session { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; }
.justice-teacher-session + .justice-teacher-session { border-top: 1px solid var(--line); }
.justice-teacher-session h2 { margin-bottom: .35rem; }
.justice-teacher-session p:not(.eyebrow) { margin-bottom: 0; color: var(--muted); }
.teacher-document-slot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; }
.vimeo-launcher p { margin: 0; font-size: .85rem; }
.test-step-card { border-color: #bedcff; background: linear-gradient(145deg, #fff, #f1f8ff); }
.latest-topic-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .8rem; border: 1px solid #cfe1f5; background: white; border-radius: 13px; padding: .85rem; margin: .9rem 0; }
.latest-topic-result strong, .latest-topic-result span { display: block; }
.latest-topic-result span { color: var(--muted); font-size: .85rem; }
.latest-topic-result a { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.topic-test-resume { display: grid; gap: .75rem; border: 1px solid #cfe1f5; background: white; border-radius: 13px; padding: .9rem; margin-top: .9rem; }
.topic-test-resume-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topic-test-resume-header strong, .topic-test-resume-header span { display: block; }
.topic-test-resume-header span { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.topic-test-resume-header > strong { color: var(--blue-dark); white-space: nowrap; }
.topic-test-resume .button { width: fit-content; }
.pagination { display: flex; justify-content: center; gap: .6rem; margin-top: 1rem; }
.empty-state { text-align: center; padding: 5rem 1rem; }
code { background: #edf1f6; padding: .15rem .35rem; border-radius: 5px; }

@media (max-width: 800px) {
  .site-header { align-items: flex-start; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; }
  .brand small { display: none; }
  .dashboard-grid, .teacher-grid, .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid > .card { grid-column: 1 / -1; }
  .quick-diagnosis { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .student-focus-card { align-items: stretch; flex-direction: column; }
  .student-focus-actions { min-width: 0; width: 100%; }
  .result-analysis-grid { grid-template-columns: 1fr; }
  .attempt-layout { grid-template-columns: 1fr; }
  .attempt-navigator-panel { position: static; }
  .question-nav-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .review-submit-card { align-items: stretch; flex-direction: column; }
  .review-submit-actions { flex-wrap: wrap; }
  .history-filter { align-items: stretch; flex-direction: column; }
  .history-filter label, .history-filter button, .history-filter .button { width: 100%; }
  .classroom-overview { grid-template-columns: 1fr; }
  .classroom-overview-action { border-left: 0; border-top: 1px solid #d6e5f5; padding: 1rem 0 0; }
  .classroom-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .page-shell { width: min(100% - 1rem, 1180px); padding-top: 1.2rem; }
  .site-header { padding: .7rem; align-items: stretch; flex-direction: column; }
  .brand strong { font-size: .85rem; }
  .site-header nav { gap: .35rem .65rem; justify-content: flex-start; }
  .site-header nav a { font-size: .78rem; }
  .small-button { padding: .5rem .65rem; font-size: .78rem; }
  .metrics { grid-template-columns: 1fr 1fr; gap: .55rem; }
  .metrics article { padding: .8rem; }
  .metrics strong { font-size: 1.35rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filter-row { grid-template-columns: 1fr; }
  .activity-filter-row { grid-template-columns: 1fr; }
  .import-preview-metrics { grid-template-columns: 1fr 1fr; }
  .import-preview-actions { align-items: stretch; flex-direction: column; }
  .import-preview-actions form, .import-preview-actions button { width: 100%; }
  .filter-actions { flex-direction: column; }
  .filter-actions button, .filter-actions .button { width: 100%; }
  .bulk-actions { align-items: stretch; flex-direction: column; }
  .bulk-actions-controls { align-items: stretch; flex-direction: column; min-width: 0; }
  .bulk-actions-controls select, .bulk-actions-controls button { width: 100%; }
  .quick-actions, .result-metrics { grid-template-columns: 1fr 1fr; }
  .result-actions { align-items: stretch; flex-direction: column; }
  .result-actions form, .result-actions .button { width: 100%; }
  .result-topic-row { grid-template-columns: 1fr auto; }
  .result-topic-row .progress { grid-column: 1 / -1; grid-row: 2; }
  .topic-row { grid-template-columns: 1fr auto; }
  .topic-row .progress { grid-column: 1 / -1; grid-row: 2; }
  .resume-banner { align-items: stretch; flex-direction: column; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button, .form-actions button { width: 100%; }
  .report-form-actions { align-items: stretch; flex-direction: column; }
  .report-form-actions button { width: 100%; }
  .attempt-heading-row { align-items: flex-start; flex-direction: column; }
  .attempt-heading-row a { align-self: flex-end; }
  .question-nav-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .question-nav-legend { grid-template-columns: 1fr 1fr; }
  .review-counts { grid-template-columns: 1fr 1fr 1fr; gap: .45rem; }
  .review-counts article { padding: .75rem; }
  .review-counts strong { font-size: 1.45rem; }
  .review-counts span { font-size: .75rem; }
  .review-submit-actions { align-items: stretch; flex-direction: column; }
  .review-submit-actions form, .review-submit-actions .button, .review-submit-actions button { width: 100%; }
  .section-heading-row { align-items: flex-start; flex-direction: column; }
  .trend-callout { align-items: flex-start; flex-direction: column; }
  .score-chart-canvas { height: 235px; }
  .score-chart-legend { justify-content: flex-start; }
  .history-metrics { grid-template-columns: 1fr 1fr; }
  .classroom-overview-progress-row { align-items: flex-start; }
  .classroom-summary-counts { gap: .4rem; }
  .classroom-summary-counts > div { padding: .55rem; }
  .classroom-overview-action .button, .topic-test-resume .button { width: 100%; }
  .topic-test-resume-header { align-items: flex-start; }
  .classroom-grid { grid-template-columns: 1fr; }
  .justice-session-table, .justice-session-table tbody, .justice-session-table tr, .justice-session-table td { display: block; width: 100%; }
  .justice-session-table thead { display: none; }
  .justice-session-table tr { padding: 1rem 0; }
  .justice-session-table tr + tr { border-top: 1px solid var(--line); }
  .justice-session-table td { border: 0; padding: .2rem 0; }
  .justice-session-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .2rem; }
  .justice-session-table td a { display: block; overflow-wrap: anywhere; font-weight: 750; line-height: 1.35; }
  .classroom-topic-heading h1 { font-size: clamp(1.75rem, 9vw, 2.35rem); }
  .justice-session-title { font-size: clamp(1.85rem, 9vw, 2.45rem); overflow-wrap: anywhere; }
  .justice-session-file-actions { display: grid; grid-template-columns: 1fr; }
  .justice-session-file { width: 100%; justify-content: flex-start; }
  .justice-document-preview iframe { height: 72vh; min-height: 500px; }
  .justice-teacher-session { align-items: stretch; flex-direction: column; }
  .justice-teacher-session .button { width: 100%; }
  .teacher-document-slot { grid-template-columns: 1fr; }
  .learning-step-card { grid-template-columns: 36px minmax(0, 1fr); padding: 1rem; }
  .learning-step-number { width: 34px; height: 34px; font-size: .95rem; }
  .latest-topic-result { grid-template-columns: 1fr; }
  .latest-topic-result a { grid-column: 1; grid-row: auto; }
  .vimeo-launcher > button { width: 100%; }
  .video-editor-row { grid-template-columns: 1fr; }
  .document-editor-row { grid-template-columns: 1fr; }
  .topic-document-item { align-items: flex-start; flex-direction: column; }
  .auth-card { padding: 1.4rem; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .privacy-wrap { width: min(100% - 1rem, 960px); padding-top: 1.5rem; }
  .privacy-grid { grid-template-columns: 1fr; }
}
