:root {
  --bg: #070b12;
  --bg-2: #0b1220;
  --text: #eaf6ff;
  --muted: #8da3b7;
  --cyan: #67f7ff;
  --cyan-2: #18b9d0;
  --line: rgba(145, 206, 230, .22);
  --glass: rgba(13, 24, 39, .72);
  --work-bg: #f4f8fb;
  --work-text: #0f172a;
  --work-muted: #64748b;
  --work-line: #d9e5ef;
  --danger: #dc2626;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(2, 8, 23, .15);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid rgba(103, 247, 255, .55); outline-offset: 3px; }
.btn { border: 0; border-radius: 999px; min-height: 44px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 750; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--cyan), #71a7ff); color: #06111b; box-shadow: 0 12px 35px rgba(103, 247, 255, .22); }
.btn-soft { background: rgba(103, 247, 255, .10); color: #0d5970; border: 1px solid rgba(24, 185, 208, .22); }
.public-page .btn-soft { color: var(--text); }
.btn-outline, .btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: rgba(220, 38, 38, .10); color: var(--danger); border: 1px solid rgba(220, 38, 38, .25); }
.messages { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 10px; width: min(440px, calc(100% - 36px)); pointer-events: none; }
.message { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 12px; align-items: start; padding: 15px 14px 15px 18px; border-radius: 18px; background: rgba(255,255,255,.96); color: #0f172a; box-shadow: 0 20px 65px rgba(15, 23, 42, .22); border: 1px solid #e2e8f0; pointer-events: auto; transform-origin: right bottom; animation: message-slide-in .28s ease both; }
.message span { line-height: 1.45; }
.message.error { border-color: #fecaca; color: #991b1b; background: rgba(255, 247, 247, .97); }
.message.success { border-color: #bbf7d0; color: #166534; background: rgba(240, 253, 244, .97); }
.message.warning { border-color: #fde68a; color: #92400e; background: rgba(255, 251, 235, .97); }
.message.info { border-color: #bae6fd; color: #075985; background: rgba(240, 249, 255, .97); }
.message-close { position: relative; width: 30px; height: 30px; border: 0; border-radius: 999px; padding: 0; background: rgba(15, 23, 42, .06); color: currentColor; cursor: pointer; }
.message-close::before, .message-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 2px; border-radius: 999px; background: currentColor; transform-origin: center; }
.message-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.message-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.message.is-hiding { animation: message-slide-out .22s ease forwards; }
@keyframes message-slide-in { from { opacity: 0; transform: translateY(22px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes message-slide-out { to { opacity: 0; transform: translateY(16px) scale(.98); } }
.public-page { background: radial-gradient(circle at 18% 10%, rgba(24, 185, 208, .20), transparent 34%), radial-gradient(circle at 82% 8%, rgba(99, 102, 241, .18), transparent 32%), #070b12; }
.public-header { position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; padding: 16px clamp(18px, 4vw, 60px); background: rgba(7, 11, 18, .72); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.public-nav { justify-self: center; display: flex; align-items: center; gap: 22px; color: #b8cada; }
.public-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.public-header-actions { justify-self: end; display: flex; align-items: center; }
.public-menu-toggle, .cabinet-menu-toggle { display: none; align-items: center; justify-content: center; gap: 9px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: rgba(255,255,255,.06); color: var(--text); cursor: pointer; font-weight: 850; }
.public-menu-toggle i, .cabinet-menu-toggle i { position: relative; width: 16px; height: 2px; border-radius: 99px; background: currentColor; transition: transform .18s ease, background .18s ease; }
.public-menu-toggle i::before, .public-menu-toggle i::after, .cabinet-menu-toggle i::before, .cabinet-menu-toggle i::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; border-radius: 99px; background: currentColor; transition: transform .18s ease, top .18s ease; }
.public-menu-toggle i::before, .cabinet-menu-toggle i::before { top: -6px; }
.public-menu-toggle i::after, .cabinet-menu-toggle i::after { top: 6px; }
.public-header.menu-open .public-menu-toggle i, .cabinet-nav.menu-open .cabinet-menu-toggle i { background: transparent; }
.public-header.menu-open .public-menu-toggle i::before, .cabinet-nav.menu-open .cabinet-menu-toggle i::before { top: 0; transform: rotate(45deg); }
.public-header.menu-open .public-menu-toggle i::after, .cabinet-nav.menu-open .cabinet-menu-toggle i::after { top: 0; transform: rotate(-45deg); }
.public-nav .public-nav-login { display: none; }
.public-logo, .brand-mini { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: -.02em; }
.public-logo { justify-self: start; min-width: 0; }
.public-logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-logo img, .brand-mini img { width: 38px; height: 38px; object-fit: contain; }
.section-shell { width: min(1160px, calc(100% - 36px)); margin: 0 auto; padding: 92px 0; }
.hero-section { min-height: calc(100vh - 78px); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 58px; padding-top: 72px; }
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .16em; font-size: 13px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
.hero-copy h1 { font-size: clamp(42px, 6vw, 78px); line-height: .94; letter-spacing: -.065em; margin-bottom: 24px; }
.hero-subtitle { color: #b8cada; font-size: clamp(18px, 2vw, 22px); line-height: 1.55; max-width: 720px; }
.hero-actions, .contact-actions, .quick-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.metric-row div, .glass-card, .text-card, .feature-card, .diploma-card { border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(18px); box-shadow: 0 16px 70px rgba(0,0,0,.15); }
.metric-row strong { display: block; font-size: 30px; color: white; }
.metric-row span { color: var(--muted); }
.hero-visual { min-height: 620px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; gap: 14px; }
.portrait-card { position: relative; grid-column: 1 / -1; height: clamp(520px, 48vw, 620px); border-radius: 42px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 35px 120px rgba(0, 0, 0, .42); }
.portrait-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 54%, rgba(7,11,18,.62)); }
.portrait-card picture, .portrait-card img { width: 100%; height: 100%; }
.portrait-card picture { display: block; }
.portrait-card img { object-fit: cover; }
.floating-card { position: relative; border-radius: 24px; border: 1px solid var(--line); background: rgba(8, 20, 32, .80); backdrop-filter: blur(14px); padding: 18px; min-width: 0; box-shadow: 0 20px 70px rgba(0,0,0,.25); }
.floating-card span { display: block; color: var(--muted); font-size: 13px; }
.floating-card b { display: block; margin-top: 6px; color: white; }
.progress-mock { left: auto; right: auto; top: auto; bottom: auto; }
.progress-mock::after { content: ""; display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, rgba(103, 247, 255, .72), rgba(255,255,255,.16)); margin-top: 12px; }
.hw-mock { left: auto; right: auto; top: auto; bottom: auto; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.glass-card h3 { font-size: 24px; }
.glass-card p, .text-card, .section-heading p, details p { color: #b8cada; line-height: 1.65; }
.split { display: grid; grid-template-columns: .86fr 1.14fr; gap: 40px; align-items: start; }
.split h2, .section-heading h2, .contacts h2 { font-size: clamp(34px, 4vw, 56px); line-height: 1; letter-spacing: -.045em; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature-card { min-height: 120px; font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; text-align: center; }
.section-heading { max-width: 760px; margin-bottom: 28px; }
.diploma-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.diploma-card { padding: 14px; color: white; }
.diploma-card[data-diploma-lightbox] { cursor: zoom-in; }
.diploma-card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; border-radius: 16px; margin-bottom: 12px; background: rgba(255,255,255,.05); }
.diploma-card span { display: block; color: var(--muted); margin-top: 4px; }
.faq details { border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 18px; padding: 18px 20px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 800; }
.public-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 34px; border: 1px solid var(--line); border-radius: 32px; background: linear-gradient(135deg, rgba(103, 247, 255, .14), rgba(255,255,255,.05)); box-shadow: 0 20px 80px rgba(0,0,0,.18); }
.public-cta h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.045em; margin-bottom: 14px; }
.public-cta p:not(.eyebrow) { max-width: 760px; color: #b8cada; line-height: 1.65; margin-bottom: 0; }
.public-cta .btn { flex: 0 0 auto; }
.contacts { text-align: center; }
.contacts .contact-actions { justify-content: center; }
.public-footer { padding: 28px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.cabinet-page { background: var(--work-bg); color: var(--work-text); }
.cabinet-nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; justify-content: space-between; padding: 14px 24px; background: rgba(255,255,255,.88); backdrop-filter: blur(16px); border-bottom: 1px solid var(--work-line); }
.cabinet-nav .brand-mini img { width: 34px; height: 34px; }
.cabinet-links { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; color: #334155; font-weight: 700; }
.cabinet-links a { min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; transition: background .18s ease, color .18s ease; }
.cabinet-links a:hover, .cabinet-links a.active { background: #0f172a; color: white; }
.cabinet-links form { margin: 0; }
.cabinet-page .btn-ghost { color: #334155; border-color: var(--work-line); background: white; }
.cabinet-menu-toggle { color: #334155; border-color: var(--work-line); background: white; margin-left: auto; }
.cabinet-shell, .homework-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 80px; }
.cabinet-shell.narrow, .auth-shell .auth-card { max-width: 760px; }
.page-title { margin-bottom: 22px; }
.page-title p { color: var(--cyan-2); text-transform: uppercase; font-size: 13px; letter-spacing: .12em; font-weight: 900; margin-bottom: 6px; }
.page-title h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card, .panel-card, .auth-card, .credentials-box { background: white; border: 1px solid var(--work-line); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.stat-card span { color: var(--work-muted); display: block; margin-bottom: 8px; }
.stat-card strong { font-size: 32px; }
.stat-card i { display: block; height: 8px; margin-top: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--cyan-2) var(--value), #e2e8f0 var(--value)); }
.cabinet-page .quick-actions { margin-bottom: 20px; }
.panel-card { margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-head h2, .panel-card h2 { margin: 0; }
.card-list, .review-list { display: grid; gap: 12px; }
.item-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid #edf2f7; }
.item-card:last-child { border-bottom: 0; }
.item-card p, .muted { color: var(--work-muted); margin-bottom: 0; }
.form-stack, .form-grid { display: grid; gap: 14px; }
.form-grid.horizontal { grid-template-columns: minmax(220px, 1.2fr) minmax(190px, .9fr) minmax(150px, .75fr) minmax(130px, .55fr) auto; align-items: end; }
.form-grid.horizontal > .errorlist { grid-column: 1 / -1; }
.form-grid h2 { margin-top: 12px; }
label { display: grid; gap: 7px; color: #334155; font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--work-line); border-radius: 14px; padding: 12px 14px; background: white; color: var(--work-text); }
.errorlist { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; color: #b91c1c; font-size: 14px; font-weight: 750; }
label:has(.errorlist) input, label:has(.errorlist) textarea, label:has(.errorlist) select { border-color: #fca5a5; background: #fff7f7; }
textarea { resize: vertical; }
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.toolbar input { max-width: 360px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid #e7eef5; vertical-align: top; }
th { color: #475569; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; margin-bottom: 16px; }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--work-line); background: white; }
.tabs a.active { background: #0f172a; color: white; }
.two-column { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; align-items: start; }
.credentials-box { border-color: rgba(24, 185, 208, .35); background: #ecfeff; margin-bottom: 18px; }
.credentials-box code { background: white; padding: 3px 7px; border-radius: 8px; }
.auth-page { background: radial-gradient(circle at 50% 0, rgba(24, 185, 208, .22), transparent 42%), var(--work-bg); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(520px, 100%); }
.progress-overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.progress-groups { display: grid; gap: 16px; }
.progress-groups > .nested-disclosure { margin-top: 0; }
.progress-topic-list { display: grid; gap: 8px; }
.progress-topic-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf2f7; }
.progress-topic-row.readonly { grid-template-columns: 1fr auto auto; }
.progress-topic-row.is-incomplete { background: linear-gradient(90deg, rgba(255, 247, 237, .72), rgba(255,255,255,0)); border-radius: 14px; padding-left: 10px; }
.progress-topic-row.is-complete { opacity: .74; }
.progress-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 16px; align-items: start; }
.progress-search { min-width: 0; align-self: start; display: grid; gap: 8px; }
.progress-legend { display: flex; gap: 10px; align-items: flex-start; color: var(--work-muted); line-height: 1.55; }
.progress-legend strong { flex: 0 0 auto; color: var(--work-text); }
.progress-disclosure { padding: 0; overflow: hidden; }
.progress-disclosure > summary { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, max-content) 18px; align-items: center; column-gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; }
.progress-disclosure > summary::-webkit-details-marker { display: none; }
.progress-group-title { min-width: 0; font-size: 20px; font-weight: 900; color: var(--work-text); }
.progress-group-meta { color: var(--work-muted); font-weight: 750; text-align: right; white-space: nowrap; }
.progress-group-chevron { width: 10px; height: 10px; justify-self: end; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(45deg); transition: transform .18s ease; }
.progress-disclosure[open] > summary .progress-group-chevron { transform: rotate(225deg); }
.progress-disclosure > .progress-topic-list { margin: 0 22px 22px; }
.progress-next-list { display: grid; gap: 10px; }
.progress-next-item { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid #e7eef5; border-radius: 16px; background: #f8fafc; }
.progress-next-item span { color: var(--work-muted); line-height: 1.45; }
.progress-next-actions { display: flex; justify-content: flex-start; margin-top: 4px; }
.inline-check, .check-pill { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; border: 1px solid var(--work-line); padding: 10px 12px; color: #475569; font-weight: 800; }
.inline-check input { width: 18px; height: 18px; }
.check-pill.done { background: #ecfeff; color: #0e7490; border-color: rgba(24,185,208,.25); }
.homework-shell { width: min(1120px, calc(100% - 24px)); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-list { display: grid; gap: 18px; }
.task-card { background: white; border: 1px solid var(--work-line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); overflow-x: auto; }
.task-card h2 { margin-bottom: 18px; }
.task-list + .answer-panel { margin-top: 18px; }
.task-content { line-height: 1.65; color: #111827; }
.task-content table { width: auto; max-width: 100%; border-collapse: collapse; margin: 12px 0; }
.task-content td, .task-content th { border: 1px solid #94a3b8; padding: 8px 10px; }
.task-content img { max-width: 100%; height: auto; cursor: zoom-in; border-radius: 10px; }
.task-image-frame { position: relative; display: inline-flex; max-width: 100%; margin: 8px 0 12px; vertical-align: top; border-radius: 12px; }
.task-image-frame img { margin: 0; }
.task-image-zoomable { transition: box-shadow .18s ease, transform .18s ease; }
.task-image-zoomable:hover, .task-image-zoomable:focus-visible { box-shadow: 0 0 0 3px rgba(24, 185, 208, .28); }
.task-image-zoom-icon { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; background: rgba(15, 23, 42, .78); color: white; font-weight: 900; opacity: 0; transform: translateY(-3px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.task-image-frame:hover .task-image-zoom-icon, .task-image-frame:focus-within .task-image-zoom-icon { opacity: 1; transform: translateY(0); }
.image-lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(2, 6, 23, .88); backdrop-filter: blur(8px); }
.image-lightbox__frame { width: min(1100px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; align-items: center; justify-content: center; }
.image-lightbox__image { width: auto; max-width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border-radius: 18px; box-shadow: 0 28px 90px rgba(0,0,0,.45); background: white; }
.image-lightbox__document { width: min(1100px, 100%); height: min(860px, calc(100vh - 48px)); height: min(860px, calc(100dvh - 48px)); border: 0; border-radius: 18px; box-shadow: 0 28px 90px rgba(0,0,0,.45); background: white; }
.image-lightbox__close { position: fixed; top: 18px; right: 18px; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 0; background: rgba(15, 23, 42, .84); color: white; cursor: pointer; font-size: 0; line-height: 1; font-weight: 650; }
.image-lightbox__close::before, .image-lightbox__close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 19px; height: 2px; border-radius: 999px; background: currentColor; transform-origin: center; }
.image-lightbox__close::before { transform: translate(-50%, -50%) rotate(45deg); }
.image-lightbox__close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.lightbox-open { overflow: hidden; }
.task-content pre, .task-content code, .answer-text { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; }
.task-file { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 8px 0 12px; padding: 8px 12px; border: 1px solid rgba(24, 185, 208, .22); border-radius: 999px; background: rgba(103, 247, 255, .10); color: #0d5970; font-weight: 850; overflow-wrap: anywhere; }
.task-file::before { content: "↧"; font-weight: 900; }
.answer-text { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 14px; overflow-x: auto; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.attachment-list a { padding: 8px 10px; border: 1px solid var(--work-line); border-radius: 999px; }
.homework-submission-list { display: grid; gap: 14px; margin-top: 14px; }
.submission-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 20px; padding: 18px; color: var(--work-text); }
.submission-card h3 { margin: 0 0 12px; }
.submission-card.panel-card { background: white; }
.diagnostics-box { margin-top: 16px; border: 1px solid #e2e8f0; border-radius: 18px; padding: 12px 14px; background: #f8fafc; }
.diagnostics-box summary { cursor: pointer; font-weight: 850; color: #334155; }
.homework-loading-card { display: flex; align-items: flex-start; gap: 16px; }
.homework-loading-card h2 { margin-bottom: 8px; }
.homework-loading-card .btn { margin-top: 4px; }
.homework-loading-indicator { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 8px; border: 3px solid #dbeafe; border-top-color: var(--cyan-2); border-radius: 999px; animation: homework-spin .9s linear infinite; }
@keyframes homework-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .homework-loading-indicator { animation: none; } }
@media (prefers-reduced-motion: reduce) { .message, .message.is-hiding { animation: none; } }
@media (max-width: 920px) {
  .public-header { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; }
  .public-header-actions { display: none; }
  .public-menu-toggle { display: inline-flex; margin-left: auto; }
  .public-nav { justify-self: auto; position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 22px; background: rgba(7, 11, 18, .96); box-shadow: 0 24px 80px rgba(0,0,0,.35); backdrop-filter: blur(18px); transform: translateY(-8px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  .public-header.menu-open .public-nav { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .public-nav a { min-height: 44px; display: flex; align-items: center; border-radius: 14px; padding: 10px 12px; }
  .public-nav a:hover { background: rgba(255,255,255,.08); }
  .public-nav .public-nav-login { display: flex; color: white; border: 1px solid var(--line); }
  .hero-section, .split, .two-column { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: clamp(32px, 10vw, 44px); line-height: 1; letter-spacing: -.045em; margin-bottom: 18px; }
  .hero-section { min-height: auto; padding-top: 42px; }
  .hero-visual { min-height: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .portrait-card { grid-column: 1 / -1; height: clamp(360px, 94vw, 540px); border-radius: 32px; }
  .floating-card { position: relative; min-width: 0; padding: 14px; border-radius: 18px; }
  .progress-mock, .hw-mock { left: auto; right: auto; top: auto; bottom: auto; }
  .grid-3, .diploma-grid, .stats-grid, .progress-overview-grid { grid-template-columns: 1fr; }
  .metric-row, .feature-grid { grid-template-columns: 1fr; }
  .form-grid.horizontal { grid-template-columns: 1fr; }
  .cabinet-nav { align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .cabinet-menu-toggle { display: inline-flex; }
  .cabinet-links { flex: 0 0 100%; display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 0; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; transition: max-height .22s ease, opacity .18s ease, visibility 0s linear .22s; }
  .cabinet-nav.menu-open .cabinet-links { max-height: 72vh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .cabinet-links a, .cabinet-links form .btn { min-height: 44px; width: 100%; justify-content: flex-start; border-radius: 14px; }
  .progress-topic-row, .progress-topic-row.readonly { grid-template-columns: 1fr; }
  .progress-tools { grid-template-columns: 1fr; }
  .progress-legend { display: grid; }
  .progress-disclosure > summary { grid-template-columns: minmax(0, 1fr) 18px; row-gap: 8px; }
  .progress-group-meta { grid-column: 1 / -1; text-align: left; white-space: normal; }
  .public-cta { align-items: stretch; flex-direction: column; padding: 24px; }
  .public-cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: reveal .8s ease both; }
  .glass-card, .feature-card, .diploma-card, .stat-card, .panel-card { transition: transform .22s ease, border-color .22s ease; }
  .glass-card:hover, .feature-card:hover, .diploma-card:hover { transform: translateY(-4px); border-color: rgba(103, 247, 255, .48); }
}
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.contact-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--work-line); border-radius: 999px; padding: 10px 13px; background: rgba(255,255,255,.88); color: #0f172a; font-weight: 750; }
.public-page .contact-chip { background: rgba(255,255,255,.08); border-color: var(--line); color: var(--text); }
.lesson-create-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid #e7eef5; border-radius: 20px; background: #f8fafc; margin-bottom: 16px; }
.lesson-list { display: grid; gap: 12px; padding-bottom: 4px; }
.lesson-list > .muted { margin: 0; padding: 2px 2px 0; }
.lesson-edit-card { display: grid; gap: 10px; padding: 16px; border: 1px solid #e7eef5; border-radius: 20px; background: white; }
.lesson-edit-form { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(160px, .7fr) minmax(130px, .5fr) auto; gap: 12px; align-items: end; }
.lesson-status { display: grid; gap: 5px; color: var(--work-muted); font-weight: 800; }
.lesson-status strong { color: var(--work-text); }
.lesson-status small { font-weight: 700; color: var(--work-muted); }
.lesson-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.diploma-admin-list { display: grid; gap: 18px; }
.diploma-admin-card { display: grid; grid-template-columns: minmax(180px, 260px) 1fr auto; gap: 16px; align-items: start; padding: 16px; border: 1px solid #e7eef5; border-radius: 22px; background: #f8fafc; }
.diploma-admin-preview { display: grid; gap: 10px; color: var(--work-muted); font-weight: 800; }
.diploma-admin-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; border: 1px solid var(--work-line); background: white; }
.diploma-admin-preview a { color: #0e7490; }
.diploma-edit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.topic-admin-group { display: grid; gap: 18px; }
.topic-group-edit-form, .topic-edit-form { display: grid; grid-template-columns: minmax(110px, .55fr) minmax(80px, .35fr) minmax(220px, 1.4fr) minmax(90px, .45fr) auto auto; gap: 10px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid #edf2f7; }
.topic-edit-form { grid-template-columns: minmax(260px, 1.5fr) minmax(95px, .45fr) minmax(95px, .45fr) auto auto; }
.topic-list-admin { display: grid; gap: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.settings-list { display: grid; gap: 10px; }
.settings-list div { display: grid; gap: 5px; padding: 10px 0; border-bottom: 1px solid #edf2f7; }
.settings-list code { white-space: pre-wrap; word-break: break-word; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 10px; }
@media (max-width: 920px) {
  .lesson-create-form, .lesson-edit-form, .diploma-admin-card, .diploma-edit-form, .topic-group-edit-form, .topic-edit-form { grid-template-columns: 1fr; }
  .lesson-actions { justify-content: flex-start; }
}
.danger-zone { margin-top: 14px; border: 1px solid rgba(220, 38, 38, .22); border-radius: 18px; padding: 12px 14px; background: rgba(220, 38, 38, .04); }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 850; }
.danger-zone p { color: var(--work-muted); margin: 10px 0 12px; }
.danger-zone form { display: grid; gap: 12px; }
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.public-review-card { min-height: 260px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(18px); box-shadow: 0 16px 70px rgba(0,0,0,.15); color: white; }
.review-actions { display: flex; justify-content: center; margin-top: 22px; }
.review-actions .btn { min-width: 210px; }
.review-text { color: #d6e4ef; line-height: 1.68; margin: 0 0 22px; }
.review-meta { display: grid; gap: 5px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-meta strong { color: white; }
.review-meta time { color: var(--muted); font-size: 14px; }
.review-admin-list { display: grid; gap: 16px; }
.review-admin-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px; border: 1px solid #e7eef5; border-radius: 22px; background: #f8fafc; }
.review-edit-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(150px, .7fr) minmax(110px, .45fr) max-content; gap: 12px; align-items: end; }
.review-edit-form > .errorlist { grid-column: 1 / -1; }
.review-edit-form label { min-width: 0; }
.review-field-text { grid-column: 1 / -1; }
.review-field-visible { align-self: end; width: 100%; justify-content: center; white-space: nowrap; }
.review-field-visible + .errorlist { grid-column: 1 / -1; }
.review-edit-form .btn { grid-column: 1 / -1; justify-self: start; }
.review-edit-form textarea { min-height: 128px; resize: vertical; }
@media (prefers-reduced-motion: no-preference) {
  .public-review-card { transition: transform .22s ease, border-color .22s ease; }
  .public-review-card:hover { transform: translateY(-4px); border-color: rgba(103, 247, 255, .48); }
  .public-review-card.review-card-enter { animation: review-card-enter .46s ease both; animation-delay: var(--review-enter-delay, 0ms); }
  .public-review-card.review-card-exit { animation: review-card-exit .22s ease both; }
}
@keyframes review-card-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes review-card-exit { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(12px); } }
@media (max-width: 920px) {
  .review-grid, .review-admin-card, .review-edit-form { grid-template-columns: 1fr; }
  .review-field-text, .review-edit-form .btn { grid-column: auto; }
  .review-field-visible { justify-content: flex-start; white-space: normal; }
}

@media (max-width: 720px) {
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar input { max-width: none; }
  .responsive-table { overflow-x: visible; }
  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table th, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr { border: 1px solid #e2e8f0; border-radius: 18px; padding: 10px; margin-bottom: 12px; background: #f8fafc; }
  .responsive-table td { display: flex; justify-content: space-between; gap: 14px; align-items: center; border-bottom: 1px solid #e7eef5; padding: 10px 4px; }
  .responsive-table td:last-child { border-bottom: 0; }
  .responsive-table td::before { content: attr(data-label); color: #64748b; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
  .responsive-table td[colspan]::before { content: none; }
  .item-card, .panel-head { align-items: flex-start; flex-direction: column; }
}
.skip-link { position: fixed; left: 16px; top: 16px; z-index: 200; transform: translateY(-140%); border-radius: 999px; padding: 10px 14px; background: #0f172a; color: white; font-weight: 850; box-shadow: var(--shadow); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }
.page-kicker { color: var(--cyan-2); text-transform: uppercase; font-size: 13px; letter-spacing: .12em; font-weight: 900; margin-bottom: 6px; }
.field-help { color: var(--work-muted); font-size: 14px; font-weight: 650; }
.stat-card small { display: block; margin-top: 10px; color: var(--work-muted); line-height: 1.45; }
.homework-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.homework-header h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.045em; margin-bottom: 8px; }
.task-jump-nav { position: sticky; top: 70px; z-index: 25; display: flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 10px 12px; border: 1px solid var(--work-line); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
@media (min-width: 760px) { .task-jump-nav { width: calc(100% + 48px); margin-left: -24px; margin-right: -24px; } }
.task-jump-nav span { color: var(--work-muted); font-weight: 900; margin-right: 2px; }
.task-jump-list { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.task-jump-nav a { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #dbe7ef; border-radius: 999px; background: #f8fafc; color: #0f172a; font-weight: 850; }
.disclosure-card { padding: 0; overflow: hidden; }
.disclosure-card > summary { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; cursor: pointer; list-style: none; }
.disclosure-card > summary::-webkit-details-marker { display: none; }
.disclosure-card > summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(45deg); transition: transform .18s ease; }
.disclosure-card[open] > summary::after { transform: rotate(225deg); }
.disclosure-card > summary span { font-size: 20px; font-weight: 900; color: var(--work-text); }
.disclosure-card > summary small { color: var(--work-muted); font-weight: 750; }
.disclosure-card > summary + * { margin: 0 22px 22px; }
.disclosure-card > summary + form { margin-top: 0; }
.disclosure-card > .lesson-create-form { margin: 0 22px 16px; }
.disclosure-card > .lesson-list { margin: 0 22px 22px; }
.disclosure-card > .admin-create-grid { margin: 0 22px 22px; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.search-field { min-width: min(420px, 100%); flex: 1; }
.admin-create-grid { align-items: stretch; }
.admin-create-grid form { padding: 16px; border: 1px solid #e7eef5; border-radius: 20px; background: #f8fafc; }
.topic-admin-group { gap: 14px; }
.topic-admin-group > .topic-group-edit-form, .topic-admin-group > .topic-list-admin { margin: 0 22px 18px; }
.topic-list-admin { max-height: 58vh; overflow: auto; padding-right: 4px; }
.nested-disclosure { border: 1px solid #e7eef5; border-radius: 18px; margin-top: 12px; background: #f8fafc; overflow: hidden; }
.nested-disclosure > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; font-weight: 900; color: #334155; list-style: none; }
.nested-disclosure > summary::-webkit-details-marker { display: none; }
.nested-disclosure > :not(summary) { margin: 0 14px 14px; }
.compact-actions form { margin: 0; }
.anchor-tabs { position: sticky; top: 72px; z-index: 20; width: fit-content; max-width: 100%; padding: 8px; border: 1px solid var(--work-line); border-radius: 999px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
@media (max-width: 920px) {
  .homework-header { flex-direction: column; }
  .task-jump-nav, .anchor-tabs { position: static; border-radius: 18px; }
  .anchor-tabs { width: 100%; align-items: stretch; }
  .anchor-tabs a { flex: 1 1 calc(50% - 8px); min-width: 0; justify-content: center; padding: 10px 12px; }
  .task-jump-nav { align-items: flex-start; flex-direction: column; }
  .task-jump-list { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .disclosure-card > summary { align-items: flex-start; flex-direction: column; }
  .disclosure-card > summary::after { position: absolute; right: 22px; top: 26px; }
  .disclosure-card { position: relative; }
  .topic-list-admin { max-height: none; overflow: visible; }
}
@media (max-width: 720px) {
  .messages { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .task-jump-nav a { min-width: 44px; min-height: 44px; }
  .hero-visual { grid-template-columns: 1fr; }
  .portrait-card { height: clamp(330px, 118vw, 470px); }
  .floating-card { width: 100%; }
  .homework-header, .task-card, .stat-card, .panel-card, .auth-card, .credentials-box { border-radius: 20px; }
  .image-lightbox { align-items: center; padding: 78px 16px 24px; }
  .image-lightbox__frame { width: 100%; max-height: calc(100vh - 102px); max-height: calc(100dvh - 102px); }
  .image-lightbox__image { max-width: 100%; max-height: calc(100vh - 102px); max-height: calc(100dvh - 102px); }
  .image-lightbox__document { width: 100%; height: calc(100vh - 102px); height: calc(100dvh - 102px); }
  .image-lightbox__close { top: 12px; right: 12px; }
}

.homework-submit-form { display: grid; gap: 18px; }
.homework-submit-form .task-list { margin: 0; }
.task-answer-field { margin-top: 20px; padding-top: 18px; border-top: 1px solid #e7eef5; }
.task-answer-field span { color: #334155; font-weight: 900; }
.task-answer-field textarea { min-height: 96px; background: #f8fafc; }
.homework-submit-panel { margin-top: 0; }
.homework-submit-panel > .muted { margin: 8px 0 16px; }
.task-list + .homework-submissions-panel, .homework-submit-form + .homework-submissions-panel { margin-top: 18px; }
.homework-submissions-panel .panel-head { margin-bottom: 14px; }

.topic-admin-group > summary { display: grid; grid-template-columns: minmax(0, 1fr) 170px 18px; align-items: center; column-gap: 16px; }
.topic-admin-group > summary span { min-width: 0; }
.topic-admin-group > summary small { justify-self: start; white-space: nowrap; }
.topic-admin-group > summary::after { justify-self: end; }

@media (max-width: 920px) {
  .topic-admin-group > summary { grid-template-columns: minmax(0, 1fr) 18px; row-gap: 8px; }
  .topic-admin-group > summary small { grid-column: 1 / -1; justify-self: start; white-space: normal; }
  .topic-admin-group > summary::after { grid-column: 2; grid-row: 1; }
}
@media (max-width: 920px) {
  .topic-admin-group > summary::after { position: static; right: auto; top: auto; }
}
