@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;450;500;550;600;650;700;750;800&display=swap');

:root {
  color-scheme: light dark;
  --page_bg: #f4f6fb;
  --surface: #ffffff;
  --surface_soft: #eef1f8;
  --surface_hover: #e5eaf5;
  --text: #20283d;
  --muted: #657089;
  --subtle: #748099;
  --border: #dfe4ef;
  --accent: #4f5fe5;
  --accent_hover: #3b49c9;
  --on_accent: #ffffff;
  --accent_soft: #e9ecff;
  --accent_text: #4553c4;
  --banner_start: #e7ebff;
  --banner_end: #f0f2fc;
  --art: #7b86ce;
  --paper: #fcfcff;
  --warm: #d19b78;
  --warm_soft: #f9e9df;
  --error: #a44830;
  --success: #465bc5;
  --glass: #ffffffcc;
  --shadow: 0 5px 24px #25345c08;
  --shadow_hover: 0 14px 35px #25345c14;
  --sidebar_width: 248px;
  font-family: 'Golos Text', Arial, sans-serif;
  color: var(--text);
  background: var(--page_bg);
  font-synthesis: none;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page_bg: #10131d;
    --surface: #191e2d;
    --surface_soft: #232a3c;
    --surface_hover: #2d3650;
    --text: #e9edf8;
    --muted: #abb5cf;
    --subtle: #99a7c4;
    --border: #343f58;
    --accent: #a6b2ff;
    --accent_hover: #c2cbff;
    --on_accent: #141d4a;
    --accent_soft: #2b365a;
    --accent_text: #bdc6ff;
    --banner_start: #2b365b;
    --banner_end: #232c44;
    --art: #a6b1ed;
    --paper: #374469;
    --warm: #dbab89;
    --warm_soft: #4a3328;
    --error: #ffb49c;
    --success: #a9baff;
    --glass: #191e2ddb;
    --shadow: 0 5px 24px #00000012;
    --shadow_hover: 0 14px 35px #00000030;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 90px; scrollbar-color: var(--subtle) var(--page_bg); }
body { margin: 0; min-width: 280px; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; border: 0; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
button:active { transform: scale(.97); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, b, code { overflow-wrap: anywhere; }
h1 { font-size: clamp(25px, 2.25vw, 37px); letter-spacing: -1.3px; font-weight: 600; line-height: 1.22; margin-bottom: 12px; text-wrap: balance; }
h2 { font-size: 20px; font-weight: 550; letter-spacing: -.6px; }
h3 { font-size: 17px; letter-spacing: -.3px; }
p { color: var(--muted); line-height: 1.75; }
small { font-size: 11px; }
::selection { background: var(--accent); color: var(--on_accent); }
.brand { font-size: 36px; letter-spacing: -1.5px; font-weight: 750; display: inline-block; }
.brand > span:first-child { color: var(--accent); }
.brand_dot { color: var(--warm); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar_width); background: var(--surface); border-right: 1px solid var(--border); padding: 32px 20px 22px; display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.sidebar .brand { padding: 0 15px; }
.workspace_badge { display: flex; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 13px; margin: 32px 0; padding: 12px; background: var(--surface_soft); }
.workspace_icon { background: var(--accent_soft); color: var(--accent_text); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.workspace_badge b, .user_profile b { font-size: 12px; font-weight: 550; display: block; }
.workspace_badge small, .user_profile small { color: var(--subtle); display: block; margin-top: 5px; font-size: 10px; }
.nav_label { font-size: 9px; color: var(--subtle); letter-spacing: 1.4px; padding: 0 13px; margin-bottom: 16px; }
.nav_item { display: flex; align-items: center; width: 100%; text-align: left; gap: 12px; padding: 14px 13px; background: transparent; border-radius: 11px; color: var(--muted); margin-bottom: 7px; font-size: 12px; min-height: 48px; }
.nav_item > span { display: flex; width: 21px; flex-shrink: 0; }
.nav_item svg { width: 21px; height: 21px; }
.nav_item.selected { background: var(--accent_soft); color: var(--accent_text); font-weight: 550; box-shadow: inset 3px 0 var(--accent); }
.nav_item em { margin-left: auto; font-style: normal; background: var(--surface); border-radius: 6px; padding: 3px 7px; font-size: 10px; }
.sidebar_bottom { margin-top: auto; padding-top: 28px; }
.help_card { background: var(--surface_soft); padding: 18px 15px; border-radius: 14px; margin-bottom: 22px; }
.help_card > span { display: block; color: var(--art); font-size: 26px; margin-bottom: 12px; }
.help_card b { font-size: 12px; }
.help_card p { font-size: 11px; margin: 8px 0 0; }
.user_profile { border-top: 1px solid var(--border); padding-top: 18px; display: flex; align-items: center; gap: 10px; }
.user_profile > div { min-width: 0; }
.avatar { width: 37px; height: 37px; display: inline-grid; place-items: center; flex-shrink: 0; background: var(--warm_soft); color: var(--warm); border-radius: 12px; font-weight: 550; }
.user_profile button { margin-left: auto; flex-shrink: 0; background: none; color: var(--muted); font-size: 22px; min-height: 44px; min-width: 36px; border-radius: 8px; }
main { margin-left: var(--sidebar_width); min-width: 0; }
header { min-height: 78px; border-bottom: 1px solid var(--border); padding: 15px clamp(24px, 3vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 11px; }
.header_actions { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.mobile_logout { display: none; background: var(--surface_soft); color: var(--accent_text); border-radius: 9px; padding: 10px 13px; min-height: 44px; }
.muted { color: var(--subtle); }
.header_tag { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.header_tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--art); box-shadow: 0 0 0 4px var(--accent_soft); }
.main_content { padding: 40px clamp(24px, 3vw, 56px) 50px; min-height: calc(100svh - 145px); max-width: 1580px; margin: auto; }
.eyebrow { font-size: 10px; letter-spacing: 1.7px; color: var(--subtle); margin-bottom: 13px; font-weight: 500; }
.page_heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 30px; }
.page_heading > div { min-width: 0; }
.page_heading p { font-size: 12px; margin-bottom: 0; max-width: 650px; }
.page_heading h1 span { color: var(--art); display: inline-block; font-size: 28px; margin-left: 6px; }
.primary { background: var(--accent); color: var(--on_accent); border-radius: 12px; padding: 14px 20px; min-height: 46px; font-weight: 550; font-size: 12px; flex-shrink: 0; box-shadow: 0 4px 12px #25345c18; }
.wide { width: 100%; }
.welcome_banner { background: radial-gradient(ellipse at 75% 15%, var(--surface_hover), transparent 60%), linear-gradient(115deg, var(--banner_start), var(--banner_end)); border: 1px solid var(--border); min-height: 286px; border-radius: 22px; padding: 34px 38px; position: relative; isolation: isolate; overflow: hidden; display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.welcome_banner::after { content: ''; position: absolute; width: 400px; height: 400px; border: 1px solid var(--border); border-radius: 50%; right: -130px; top: -140px; z-index: -1; }
.banner_label { font-size: 9px; color: var(--accent_text); letter-spacing: 1.7px; }
.welcome_banner h2 { font-size: clamp(28px, 2.6vw, 40px); line-height: 1.13; font-weight: 500; margin: 18px 0 14px; letter-spacing: -1.4px; }
.welcome_banner p { font-size: 12px; color: var(--muted); line-height: 1.8; }
.banner_link { background: none; padding: 10px 0; min-height: 44px; color: var(--accent_text); font-size: 12px; font-weight: 600; }
.banner_art { width: 300px; position: relative; flex-shrink: 0; align-self: center; height: 220px; }
.art_circle { position: absolute; width: 235px; height: 235px; border: 1px solid var(--art); opacity: .23; border-radius: 50%; top: -9px; left: 28px; }
.art_letter { position: absolute; font-size: 230px; font-family: Georgia, serif; font-style: italic; top: -48px; left: 2px; color: var(--art); transform: rotate(-12deg); }
.art_paper { position: absolute; top: 10px; right: 6px; transform: rotate(12deg); background: var(--paper); width: 144px; height: 183px; padding: 22px 14px; color: var(--muted); box-shadow: 0 15px 35px #18244320; font-size: 8px; letter-spacing: 1px; border: 1px solid var(--border); border-radius: 9px; }
.art_paper b { display: block; font-family: Georgia, serif; font-size: 79px; font-weight: 400; line-height: 1.4; letter-spacing: -6px; color: var(--accent_text); }
.art_paper small { font-size: 6px; letter-spacing: 1px; }
.art_star { position: absolute; right: -5px; top: 130px; color: var(--warm); font-size: 70px; }
.stats_grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 36px; }
.stat_card, .assignment_card { background: var(--surface); border: 1px solid var(--border); border-radius: 17px; padding: 23px; box-shadow: var(--shadow); min-width: 0; transition: transform .25s, box-shadow .25s, border-color .25s; }
.stat_card > span { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.stat_card i { font-style: normal; font-size: 18px; color: var(--art); }
.stat_card strong { font-size: 37px; display: block; font-weight: 500; margin: 17px 0 8px; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.stat_card strong em { font-style: normal; font-size: 22px; color: var(--subtle); margin-left: 3px; }
.stat_card small { font-size: 10px; color: var(--subtle); line-height: 1.6; display: block; }
.section_heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section_heading h2 { font-size: 20px; margin: 0; }
.section_heading h2 span { display: inline-block; background: var(--surface_soft); border: 1px solid var(--border); border-radius: 7px; padding: 4px 8px; font-size: 10px; color: var(--subtle); vertical-align: middle; margin-left: 7px; }
.text_button { background: none; color: var(--accent_text); padding: 10px 0; min-height: 44px; font-size: 12px; }
.assignments_grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.card_top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 23px; }
.task_icon { background: var(--surface_soft); color: var(--accent_text); border: 1px solid var(--border); border-radius: 13px; padding: 12px; font-family: Georgia, serif; font-size: 22px; }
.pill { font-size: 10px; border-radius: 20px; background: var(--accent_soft); color: var(--accent_text); padding: 7px 11px; display: inline-block; }
.assignment_card h3 { font-size: 16px; margin-bottom: 9px; }
.assignment_card p { font-size: 11px; }
.assignment_meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: 11px; color: var(--subtle); margin: 22px 0 18px; }
.progress_label { display: flex; justify-content: space-between; color: var(--subtle); font-size: 10px; margin-bottom: 10px; }
.progress_label b { color: var(--accent_text); font-weight: 500; }
.progress_track { background: var(--surface_soft); height: 6px; border-radius: 8px; overflow: hidden; }
.progress_track i { height: 100%; display: block; background: var(--art); border-radius: 8px; transform-origin: left; }
.secondary { background: var(--accent_soft); color: var(--accent_text); padding: 13px; min-height: 44px; border-radius: 10px; font-size: 12px; margin-top: 20px; }
.empty_state { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border); border-radius: 18px; text-align: center; padding: 40px 22px; }
.empty_state > span { font-size: 32px; color: var(--art); }
.empty_state h3 { margin: 15px 0 10px; font-size: 16px; }
.empty_state p { font-size: 12px; margin: 0; }
footer { min-height: 65px; border-top: 1px solid var(--border); display: flex; align-items: center; padding: 16px clamp(24px, 3vw, 56px); gap: 15px; font-weight: 700; color: var(--art); font-size: 14px; }
footer span { font-weight: 400; font-size: 10px; color: var(--subtle); }
footer span:last-child { margin-left: auto; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 18px; }
input, textarea { display: block; width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 13px; min-height: 46px; margin-top: 9px; color: var(--text); outline: none; font-size: 14px; transition: border-color .2s, box-shadow .2s; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:focus, textarea:focus { border-color: var(--art); box-shadow: 0 0 0 3px var(--accent_soft); }
input[type=checkbox] { accent-color: var(--accent); }
textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.table_card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; min-width: 0; box-shadow: var(--shadow); }
.table_toolbar { display: flex; padding: 23px; gap: 18px; justify-content: space-between; align-items: center; }
.table_toolbar h2 { margin: 0; }
.table_toolbar input { width: 250px; margin: 0; }
.table_scroll { overflow: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { font-size: 11px; color: var(--subtle); background: var(--surface_soft); font-weight: 500; padding: 16px 22px; white-space: nowrap; }
td { padding: 19px 22px; border-top: 1px solid var(--border); }
.student_name { display: flex; align-items: center; gap: 10px; }
.student_name b { font-weight: 500; }
.mini { width: 100px; margin-top: 9px; }
.number_badge { background: var(--warm_soft); border-radius: 5px; padding: 4px 7px; margin: 2px; display: inline-block; color: var(--error); }
.empty_cell { text-align: center; color: var(--subtle); padding: 50px; }
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 22px; width: 460px; max-width: calc(100vw - 32px); padding: 29px; box-shadow: 0 30px 120px #00000035; max-height: calc(100dvh - 48px); overscroll-behavior: contain; scrollbar-gutter: stable; }
dialog::backdrop { background: #10172e80; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.modal_heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal_heading h2 { margin-bottom: 8px; }
.modal_heading button { background: var(--surface_soft); border-radius: 50%; width: 44px; height: 44px; flex-shrink: 0; font-size: 25px; color: var(--muted); }
dialog p { font-size: 12px; }
.credentials { background: var(--surface_soft); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin: 20px 0; }
.credentials p { margin: 12px 0 0; }
.large_modal { width: 760px; }
.form_grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.student_checks { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 24px; }
.student_checks label { background: var(--surface_soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; display: flex; gap: 9px; align-items: center; margin: 0; min-height: 44px; cursor: pointer; }
.student_checks label:has(:checked) { border-color: var(--art); background: var(--accent_soft); color: var(--accent_text); }
.student_checks input { width: 17px; height: 17px; min-height: 0; margin: 0; flex-shrink: 0; }
.editor_tasks details { border: 1px solid var(--border); border-radius: 12px; margin: 12px 0; padding: 16px; background: var(--surface_soft); }
.editor_tasks summary { cursor: pointer; font-size: 13px; color: var(--accent_text); font-weight: 550; min-height: 28px; padding: 5px 0; }
.editor_tasks details[open] summary { margin-bottom: 18px; }
.editor_tasks textarea { min-height: 180px; max-height: 560px; field-sizing: content; }
.analytics_card { padding: 27px; margin-bottom: 24px; }
.heatmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(68px, 1fr)); gap: 10px; margin-top: 26px; }
.heat_cell { background: var(--surface_soft); padding: 19px 6px; border-radius: 12px; text-align: center; border: 1px solid var(--border); }
.heat_cell.has_errors { background: color-mix(in srgb, var(--warm_soft) 80%, var(--surface)); border-color: var(--warm); }
.heat_cell.has_errors::after { content: ''; display: block; height: 3px; border-radius: 5px; background: var(--warm); margin: 10px 8px 0; opacity: var(--intensity); }
.heat_cell b { font-size: 20px; display: block; margin-bottom: 12px; font-weight: 500; }
.heat_cell small { display: block; font-size: 10px; line-height: 1.7; color: var(--muted); }
.error_row { display: flex; align-items: center; gap: 24px; padding: 18px 0; font-size: 12px; }
.error_row .progress_track { flex: 1; }
.error_row span { color: var(--muted); }
.task_layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 23px; }
.task_card, .task_navigation { padding: 28px; }
.task_card h2 { margin-top: 24px; line-height: 1.5; }
.task_text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.9; margin: 27px 0 36px; }
.task_numbers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 24px 0; }
.task_numbers button { min-height: 38px; border-radius: 9px; background: var(--surface_soft); color: var(--muted); }
.task_numbers .correct { background: var(--accent_soft); color: var(--success); }
.task_numbers .incorrect { background: var(--warm_soft); color: var(--error); }
.task_numbers .current { outline: 2px solid var(--accent); outline-offset: 2px; font-weight: 650; }
.task_navigation { align-self: start; position: sticky; top: 24px; }
.task_navigation p { font-size: 11px; line-height: 2; }
.error { color: var(--error); font-size: 12px; margin-bottom: 15px; }
.success { color: var(--success); }
.login_layout { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; }
.login_story { background: radial-gradient(ellipse at 10% 75%, var(--surface_hover), transparent 65%), linear-gradient(145deg, var(--banner_start), var(--banner_end)); border-right: 1px solid var(--border); padding: clamp(32px, 4.5vw, 80px); display: flex; flex-direction: column; justify-content: space-between; gap: 36px; overflow: hidden; position: relative; }
.login_story h1 { font-size: clamp(32px, 3.8vw, 62px); font-weight: 500; line-height: 1.12; letter-spacing: -2px; margin: 20px 0; }
.login_story p { max-width: 380px; color: var(--muted); font-size: 14px; }
.login_story small { color: var(--subtle); }
.letter_art { font-size: clamp(100px, 11vw, 180px); color: var(--art); font-family: Georgia, serif; font-style: italic; margin: 25px 0; line-height: 1; white-space: nowrap; }
.letter_art span { font-size: .85em; color: var(--art); opacity: .6; margin-left: 20px; }
.letter_art i { color: var(--warm); margin-left: 20px; }
.login_form { display: grid; place-items: center; padding: 40px; }
.login_card { width: 390px; max-width: 100%; padding: 30px 0; }
.login_card h2 { font-size: 34px; letter-spacing: -1.3px; margin: 22px 0 12px; font-weight: 550; }
.login_card > p { margin-bottom: 36px; font-size: 13px; }
.login_card .primary { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.login_note { border-top: 1px solid var(--border); margin-top: 30px; padding-top: 24px; color: var(--subtle); font-size: 12px; line-height: 1.9; }
#toast { position: fixed; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 20px); width: max-content; max-width: calc(100vw - 32px); padding: 16px 24px; border-radius: 13px; background: var(--accent); color: var(--on_accent); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; font-size: 13px; box-shadow: var(--shadow_hover); }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: var(--accent_hover); transform: translateY(-2px); box-shadow: var(--shadow_hover); }
  .nav_item:hover:not(.selected), .secondary:hover, .user_profile button:hover, .mobile_logout:hover { background: var(--surface_hover); color: var(--accent_text); }
  .stat_card:hover, .assignment_card:hover { transform: translateY(-4px); border-color: var(--art); box-shadow: var(--shadow_hover); }
  .text_button:hover, .banner_link:hover { color: var(--art); }
  .task_numbers button:hover { box-shadow: inset 0 0 0 1px var(--art); transform: translateY(-2px); }
}

@media (prefers-reduced-motion: no-preference) {
  .main_content > *, .login_card, .login_story > * { animation: enter_up .5s both; }
  .main_content > :nth-child(2) { animation-delay: .05s; }
  .main_content > :nth-child(3) { animation-delay: .1s; }
  .main_content > :nth-child(4) { animation-delay: .15s; }
  .stat_card, .assignment_card { animation: enter_up .5s backwards; }
  .stat_card:nth-child(2), .assignment_card:nth-child(2) { animation-delay: .08s; }
  .stat_card:nth-child(3), .assignment_card:nth-child(3) { animation-delay: .14s; }
  .stat_card:nth-child(4) { animation-delay: .2s; }
  .progress_track i { animation: fill_progress .65s ease-out both; }
  dialog[open] { animation: modal_enter .25s ease-out both; }
  dialog[open]::backdrop { animation: fade_in .25s both; }
  .art_paper { animation: paper_float 7s ease-in-out infinite; }
  .art_star { animation: star_turn 18s linear infinite; }
  .login_story .letter_art { animation: enter_up .8s .12s both; }
  @keyframes enter_up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes fill_progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes modal_enter { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
  @keyframes fade_in { from { opacity: 0; } to { opacity: 1; } }
  @keyframes paper_float { 0%, 100% { transform: translateY(0) rotate(12deg); } 50% { transform: translateY(-9px) rotate(9deg); } }
  @keyframes star_turn { to { transform: rotate(360deg); } }
}

@media (min-width: 1800px) {
  :root { --sidebar_width: 270px; }
  .main_content { padding-top: 52px; }
  .welcome_banner { min-height: 325px; padding: 42px; }
  .banner_art { margin-right: 65px; }
}

@media (max-width: 1200px) {
  :root { --sidebar_width: 220px; }
  .sidebar { padding: 27px 14px 20px; }
  .stats_grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page_heading { align-items: flex-start; }
  .page_heading h1 { font-size: 28px; }
  .banner_art { width: 230px; }
  .art_paper { right: -5px; }
  .task_layout { grid-template-columns: minmax(0, 1fr); }
  .task_navigation { grid-row: 1; position: static; }
  .task_numbers { grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); }
}

@media (max-width: 900px) {
  .page_heading { flex-direction: column; gap: 18px; }
  .welcome_banner { padding: 28px; }
  .banner_art { position: absolute; right: -28px; bottom: 25px; width: 190px; opacity: .25; z-index: -1; }
  .banner_art .art_paper { display: none; }
  .header_tag { display: none; }
  .table_toolbar { flex-wrap: wrap; }
  .table_toolbar input { width: 100%; }
  .login_story { padding: 32px; }
  .login_form { padding: 30px; }
  .login_story h1 { font-size: 34px; }
  .form_grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 700px) {
  .sidebar { position: static; width: 100%; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .sidebar .brand { font-size: 30px; padding: 0; align-self: flex-start; }
  .workspace_badge, .nav_label, .sidebar_bottom { display: none; }
  nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 17px; gap: 5px; }
  nav:has(.nav_item:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav_item { width: 100%; padding: 10px 4px; font-size: 10px; line-height: 1.4; margin: 0; gap: 7px; flex-direction: column; justify-content: center; min-height: 66px; text-align: center; border-radius: 12px; }
  .nav_item.selected { box-shadow: inset 0 -2px var(--accent); }
  .nav_item em { display: none; }
  main { margin: 0; }
  header { min-height: 60px; padding: 8px max(18px, env(safe-area-inset-right)) 8px max(18px, env(safe-area-inset-left)); gap: 12px; font-size: 10px; }
  header > span { min-width: 0; line-height: 1.7; }
  .mobile_logout { display: block; font-size: 11px; }
  .main_content { padding: 28px max(18px, env(safe-area-inset-right)) 36px max(18px, env(safe-area-inset-left)); min-height: calc(100svh - 280px); }
  .page_heading h1 { font-size: clamp(25px, 6vw, 34px); letter-spacing: -.9px; }
  .page_heading p { font-size: 12px; }
  .page_heading > .primary { width: 100%; }
  .welcome_banner { padding: 27px 24px; min-height: 270px; border-radius: 18px; }
  .welcome_banner h2 { font-size: 32px; }
  .welcome_banner p { max-width: 300px; }
  .banner_art { width: 150px; right: -25px; bottom: 12px; }
  .art_letter { font-size: 195px; top: 0; }
  .art_star { font-size: 55px; top: 135px; right: 12px; }
  .stats_grid { gap: 12px; margin-bottom: 29px; }
  .stat_card { padding: 18px 15px; border-radius: 14px; }
  .stat_card > span { font-size: 11px; align-items: flex-start; }
  .stat_card strong { font-size: 32px; }
  .stat_card small { font-size: 10px; }
  .section_heading h2 { font-size: 18px; }
  .text_button { font-size: 11px; }
  .assignments_grid { grid-template-columns: minmax(0, 1fr); }
  .assignment_card { padding: 23px; }
  .empty_state { padding: 32px 20px; }
  .table_toolbar { padding: 20px; }
  .table_toolbar h2 { font-size: 18px; }
  .table_scroll { padding: 0 16px 16px; overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 14px; }
  tr { border: 1px solid var(--border); border-radius: 13px; overflow: hidden; background: var(--surface); }
  td { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 15px; text-align: right; }
  td::before { content: attr(data-label); font-size: 11px; color: var(--subtle); margin-right: auto; text-align: left; }
  td:first-child { background: var(--surface_soft); border-top: 0; text-align: left; }
  td:first-child::before { display: none; }
  td .student_name { min-width: 0; }
  td .student_name b { min-width: 0; }
  td .mini { width: 100%; margin: 0; }
  td.empty_cell { display: block; text-align: center; padding: 24px; }
  td.empty_cell::before { display: none; }
  td code { max-width: 100%; }
  footer { padding: 18px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  footer span { font-size: 9px; }
  footer span:last-child { display: none; }
  .analytics_card { padding: 22px 18px; }
  .heatmap { grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 8px; }
  .heat_cell { padding: 15px 4px; }
  .heat_cell small { font-size: 9px; }
  .error_row { display: grid; grid-template-columns: 1fr auto; gap: 12px; font-size: 11px; }
  .error_row .progress_track { grid-column: 1 / -1; grid-row: 2; }
  .task_numbers { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .task_numbers button { min-height: 44px; }
  .task_card, .task_navigation { padding: 22px; }
  .task_card h2 { font-size: 18px; }
  .task_card .primary { width: 100%; }
  input, textarea { font-size: 16px; }
  .login_layout { grid-template-columns: minmax(0, 1fr); }
  .login_story { padding: max(25px, env(safe-area-inset-top)) 25px 28px; min-height: 265px; gap: 28px; border-right: 0; border-bottom: 1px solid var(--border); }
  .login_story h1 { font-size: clamp(29px, 7vw, 40px); margin: 15px 0; letter-spacing: -1.3px; }
  .login_story p { font-size: 12px; margin-bottom: 0; max-width: 350px; }
  .login_story small, .letter_art { display: none; }
  .login_form { padding: 34px 25px max(34px, env(safe-area-inset-bottom)); }
  .login_card { padding: 0; width: 100%; max-width: 410px; }
  .login_card h2 { font-size: 30px; }
  dialog { border-radius: 18px; padding: 22px; max-height: calc(100dvh - 24px); max-width: calc(100vw - 20px); }
  .modal_heading { align-items: flex-start; }
  .modal_heading h2 { font-size: 20px; padding-top: 8px; }
  #toast { font-size: 12px; bottom: max(18px, env(safe-area-inset-bottom)); }
}

@media (max-width: 360px) {
  .main_content { padding-inline: 12px; }
  .nav_item { font-size: 9px; }
  .stats_grid { gap: 9px; }
  .stat_card { padding: 15px 12px; }
  .stat_card i { display: none; }
  .stat_card small { font-size: 9px; }
  .welcome_banner { padding: 24px 19px; }
  .welcome_banner h2 { font-size: 29px; }
  .task_numbers { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .section_heading { gap: 8px; }
  .section_heading h2 { font-size: 16px; }
}

@media (max-height: 760px) and (min-width: 701px) {
  .help_card { display: none; }
  .workspace_badge { margin: 22px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.heading_actions { display: flex; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
.bank_catalog { padding: 25px; margin-bottom: 28px; }
.bank_catalog_heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.bank_catalog_heading h2 { margin: 0; }
.bank_numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 9px; }
.bank_numbers button { min-height: 70px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface_soft); color: var(--text); }
.bank_numbers button[aria-pressed=true] { background: var(--accent_soft); border-color: var(--art); color: var(--accent_text); }
.bank_numbers b { display: block; font-size: 19px; font-weight: 550; }
.bank_numbers small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.bank_note { margin: 20px 0 0; font-size: 12px; }
.bank_results { display: grid; gap: 18px; }
.bank_results[aria-busy=true] { opacity: .6; }
.bank_task { padding: 26px; }
.bank_task_heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.bank_task_heading code { color: var(--subtle); font-size: 10px; }
.bank_task_text, .bank_explanation { white-space: pre-wrap; overflow-wrap: anywhere; }
.bank_task_text { line-height: 1.9; font-size: 14px; }
.bank_solution { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.bank_solution summary { min-height: 44px; padding: 10px 0; color: var(--accent_text); cursor: pointer; }
.bank_solution p { font-size: 12px; }
.bank_solution small { color: var(--subtle); line-height: 1.7; }
.bank_pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 24px; font-size: 12px; }
.bank_pagination .secondary { margin-top: 0; padding-inline: 20px; }
.heading_actions .secondary { margin: 0; width: auto; padding-inline: 18px; }
.generator_panel { background: var(--surface_soft); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 26px; }
.generator_heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; }
.generator_heading h3 { margin-bottom: 6px; }
.generator_heading p { margin: 0; }
.generator_panel > p { font-size: 12px; margin-bottom: 15px; }
.generator_panel .generation_status { margin: 16px 0 0; color: var(--accent_text); overflow-wrap: anywhere; }
.generation_status:empty { display: none; }
.bank_import { border-top: 1px solid var(--border); padding-top: 15px; }
.bank_import summary { cursor: pointer; color: var(--accent_text); font-size: 12px; padding: 8px 0; }
.bank_import p { margin-top: 12px; }
.bank_actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.bank_actions .secondary { margin: 0; background: var(--surface); padding-inline: 14px; }
.import_label { margin: 0; font-size: 12px; }
.import_label input { max-width: 260px; padding: 8px; font-size: 12px; }
#import_status { display: block; margin-top: 12px; color: var(--accent_text); font-size: 12px; overflow-wrap: anywhere; }
.editor_heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.editor_heading h3 { margin: 0; }
.editor_heading span { font-size: 12px; }
.variant_switch_label { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--accent_soft); }
.variant_switch_label[hidden] { display: none; }
.variant_switch_label small { display: block; color: var(--muted); line-height: 1.7; margin-top: 10px; }
select { display: block; width: 100%; min-height: 48px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font: inherit; margin-top: 10px; }
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 700px) { select { font-size: 16px; } }
button:disabled { opacity: .6; cursor: wait; transform: none; }
@media (max-width: 1200px) { .page_heading:has(.heading_actions) { flex-direction: column; } }
@media (max-width: 700px) {
  nav:has(.nav_item:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .bank_catalog, .bank_task { padding: 18px; }
  .bank_catalog_heading { align-items: flex-start; flex-direction: column; }
  .bank_numbers { grid-template-columns: repeat(auto-fit, minmax(45px, 1fr)); gap: 7px; }
  .bank_task_heading { flex-wrap: wrap; }
  .heading_actions { width: 100%; }
  .heading_actions > button { width: 100%; }
  .generator_panel { padding: 16px; }
  .generator_heading { flex-direction: column; align-items: stretch; }
  .bank_actions { align-items: stretch; flex-direction: column; }
  .import_label input { max-width: 100%; }
}
.profile_notice, .profile_work { padding: 24px; margin-bottom: 22px; }
.profile_metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:20px 0; }
.profile_metrics > div { background:var(--surface_soft); padding:16px; border-radius:12px; }
.profile_metrics small { display:block; color:var(--muted); line-height:1.5; }
.profile_metrics b { display:block; font-size:21px; margin-top:8px; }
.profile_task { padding:16px 0; border-bottom:1px solid var(--border); }
.profile_task summary, .profile_work > details > summary { cursor:pointer; padding:12px 0; font-weight:550; line-height:1.6; }
.profile_journal { margin-top:12px; }
.profile_journal p { border-bottom:1px solid var(--border); padding:10px 0; font-size:12px; }
.activity_notice { font-size:12px; max-width:650px; }
@media(max-width:700px) { .profile_metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .profile_work,.profile_notice { padding:18px; } .profile_metrics b { font-size:17px; } }
.assignment_options { padding:18px 0; border-bottom:1px solid var(--border); margin-bottom:20px; }
.assignment_options .section_heading { gap:16px; flex-wrap:wrap; }
.check_control { display:flex; align-items:center; gap:9px; margin:0; }
.assignment_task_checks { display:grid; grid-template-columns:repeat(auto-fit,minmax(62px,1fr)); gap:9px; margin:16px 0; }
.assignment_task_checks label { display:flex; align-items:center; justify-content:center; gap:6px; background:var(--surface_soft); border:1px solid var(--border); border-radius:10px; padding:10px 5px; margin:0; }
.assignment_task_checks label:has(input:checked) { background:var(--accent_soft); border-color:var(--accent); }
.assignment_task_checks input,.check_control input { width:16px; min-height:16px; margin:0; accent-color:var(--accent); }
.editor_tasks details[hidden] { display:none; }
.work_timer { padding:16px 20px; border:1px solid var(--border); border-radius:14px; background:var(--surface_soft); flex-shrink:0; }
.work_timer small { display:block; color:var(--muted); line-height:1.6; }
.work_timer b { display:block; font-size:28px; font-variant-numeric:tabular-nums; margin:5px 0; color:var(--accent); }
.work_timer.running_out b { color:var(--error); }
@media(max-width:700px) { .work_timer { width:100%; } }
.finish_actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }
.finish_actions button { flex:1; min-width:150px; }
#finish_work { margin-top:16px; }
.clickable_assignment { cursor:pointer; }
.guide_layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:28px; align-items:start; }
.guide_contents { position:sticky; top:24px; display:grid; gap:7px; }
.guide_contents .nav_label { margin:0 0 10px; }
.guide_contents a { display:flex; gap:12px; padding:12px 10px; border-radius:9px; color:var(--muted); text-decoration:none; font-size:12px; line-height:1.6; }
.guide_contents a:hover { background:var(--accent_soft); color:var(--accent_text); }
.guide_contents a span { color:var(--accent_text); font-variant-numeric:tabular-nums; }
.guide_sections { display:grid; gap:20px; min-width:0; }
.guide_section { padding:30px; scroll-margin-top:24px; overflow-wrap:anywhere; }
.guide_section_heading { display:flex; align-items:center; gap:14px; margin-bottom:20px; }
.guide_section_heading > span { display:grid; place-items:center; width:38px; height:38px; flex-shrink:0; background:var(--accent_soft); color:var(--accent_text); border-radius:11px; font-size:13px; }
.guide_section_heading h2 { margin:0; font-size:21px; line-height:1.4; }
.guide_section p,.guide_section li,.guide_definitions dd { color:var(--muted); font-size:14px; line-height:1.85; }
.guide_section ol { padding-left:22px; margin:0 0 20px; }
.guide_section li { padding-left:5px; margin-bottom:10px; }
.guide_section li::marker { color:var(--accent_text); font-weight:600; }
.guide_section .guide_note { padding:16px 18px; background:var(--surface_soft); border-left:3px solid var(--accent); border-radius:0 10px 10px 0; }
.guide_section .text_button { margin-top:10px; min-height:44px; text-align:left; }
.guide_definitions { margin:0; }
.guide_definitions dt { font-size:14px; font-weight:600; margin-top:22px; line-height:1.6; }
.guide_definitions dd { margin:8px 0 0; }
.guide_legend { display:grid; gap:12px; margin:20px 0; }
.guide_legend > span { display:flex; align-items:center; gap:12px; font-size:13px; color:var(--muted); line-height:1.6; }
@media(max-width:1100px) { .guide_layout { grid-template-columns:minmax(0,1fr); } .guide_contents { position:static; grid-template-columns:repeat(2,minmax(0,1fr)); } .guide_contents .nav_label { grid-column:1 / -1; } }
@media(max-width:700px) { nav:has(.nav_item:nth-child(6)) { grid-template-columns:repeat(3,minmax(0,1fr)); } .guide_section { padding:20px; } .guide_section_heading h2 { font-size:18px; } .guide_section p,.guide_section li,.guide_definitions dd { font-size:13px; } .guide_contents { gap:4px; } .guide_contents a { padding:10px 6px; font-size:11px; gap:8px; } }
.clickable_assignment:hover { border-color:var(--accent); }
.results_legend { display:flex; gap:20px; flex-wrap:wrap; margin:20px 0; color:var(--muted); font-size:12px; }
.results_legend > span { display:flex; align-items:center; gap:8px; }
.results_students { display:grid; gap:18px; }
.results_student { padding:22px; overflow:visible; }
.results_student_heading,.results_name { display:flex; gap:12px; align-items:center; }
.results_student_heading { justify-content:space-between; flex-wrap:wrap; }
.results_name .text_button { font-size:17px; text-align:left; }
.results_squares { display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; }
.result_square { width:35px; height:35px; display:inline-flex; align-items:center; justify-content:center; border-radius:7px; font-size:12px; font-style:normal; font-weight:600; border:1px solid var(--border); flex-shrink:0; }
.result_square.correct { background:var(--accent_soft); color:var(--accent_text); border-color:var(--accent); }
.result_square.incorrect,.result_square.skipped { background:var(--warm_soft); color:var(--warm); border-color:var(--warm); }
.result_square.pending { background:var(--surface_soft); color:var(--muted); }
.results_legend .result_square { width:17px; height:17px; border-radius:4px; }
.result_square:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.result_square.needs_review { box-shadow:0 0 0 2px var(--warm); }
.results_summary { font-size:12px; margin:10px 0; }
.review_flag { position:relative; width:28px; height:28px; border-radius:50%; background:var(--warm_soft); color:var(--warm); border:1px solid var(--warm); font-weight:750; font-size:17px; flex-shrink:0; }
.review_hint { display:none; position:absolute; top:calc(100% + 8px); left:0; width:min(280px,70vw); z-index:30; text-align:left; padding:12px; background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow_hover); font-size:12px; line-height:1.6; font-weight:400; pointer-events:none; }
.review_flag:hover .review_hint,.review_flag:focus-visible .review_hint { display:block; }
.review_reasons { padding:16px; background:var(--surface_soft); border-radius:10px; margin:16px 0; }
.review_reasons[hidden] { display:none; }
.review_reasons p { margin:10px 0; }
.review_action { margin-top:8px; font-size:12px; }
@media(max-width:700px) { .results_student { padding:16px; } .results_name .text_button { font-size:15px; } .results_squares { gap:7px; } }

.protected_work .task_text { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }

.task_text, .bank_task_text { white-space:normal; overflow-wrap:break-word; word-break:normal; }
.task_line { white-space:pre-wrap; }
.task_gap { height:.85em; }
.task_gap + .task_gap { display:none; }
.task_option { display:grid; grid-template-columns:2.3em minmax(0,1fr); gap:.4em; margin:.7em 0; align-items:baseline; }
.task_option > div { white-space:pre-wrap; min-width:0; }
.task_option_number { white-space:nowrap; font-variant-numeric:tabular-nums; color:var(--accent_text); font-weight:600; }
.sentence_start { white-space:nowrap; }
.task_card, .task_text, .bank_task_text { min-width:0; }
@media(max-width:700px) { .task_text { font-size:15px; line-height:1.8; } .task_option { grid-template-columns:1.8em minmax(0,1fr); gap:.3em; } }

.admin_context { padding:16px clamp(18px,3vw,56px); background:var(--accent_soft); color:var(--accent_text); font-size:13px; line-height:1.6; }

.access_entry { padding:14px 0; border-bottom:1px solid var(--border); overflow-wrap:anywhere; font-size:13px; line-height:1.7; }

.student_work_heading { display:flex; align-items:center; gap:14px; cursor:pointer; list-style:none; min-height:44px; }
.student_work_heading::-webkit-details-marker { display:none; }
.student_work_heading:focus-visible { outline:2px solid var(--accent); outline-offset:6px; border-radius:5px; }
.student_work_title { flex:1; min-width:0; font-size:19px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
.student_work_chevron { font-size:22px; color:var(--accent_text); transition:transform .2s; }
.student_work[open] > summary .student_work_chevron { transform:rotate(180deg); }
@media(max-width:700px) { .student_work_heading { flex-wrap:wrap; gap:10px; } .student_work_title { flex-basis:100%; font-size:17px; } .student_work_chevron { margin-left:auto; } }
