:root {
 color-scheme: light;
 font-family: "Segoe UI", system-ui, sans-serif;
 color: #173927;
 --green: #183f2a;
 --green-2: #2a5a3e;
 --paper: #fff9ee;
 --soft: #e1ecce;
 --line: #d7ddca;
 --ink: #173927;
 --muted: #5e6a5a;
 --amber: #fae4bb;
 --red: #a13b23;
 --shadow: 0 12px 32px #192c241a;
 font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 285px; min-height: 100vh; background: #e8eadf; }
.study-theme { background: #484b2e; }
.study-theme::before {
 content: ""; position: fixed; inset: 0; z-index: -2;
 background: linear-gradient(95deg,#14271647,#271c141c),url("/assets/study-room.webp") center 52% / cover no-repeat;
 pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; } }
.admin-theme { background: #f4f4ec; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, select, a.button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: default; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #467d50; outline-offset: 3px; }
svg { width: 1.18em; height: 1.18em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.7rem, 3.5vw, 3.2rem); line-height: 1.12; letter-spacing: -.04em; }
h2 { font-size: clamp(1.12rem, 2.2vw, 1.55rem); line-height: 1.24; letter-spacing: -.02em; }
h3 { font-size: 1.05rem; }
p { line-height: 1.52; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.ok { color: #2e6e42; }
.wrong { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.button, .icon-button { border: 1px solid #b7c7ac; border-radius: 10px; min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: .42rem; padding: .53rem .85rem; color: var(--green); background: #fffcf5; font-weight: 650; text-decoration: none; line-height: 1.2; }
.button:enabled:hover, a.button:hover, .icon-button:enabled:hover { background: #edf2e1; }
.primary { background: var(--green); border-color: var(--green); color: #fffdf4; }
.primary:enabled:hover, a.primary:hover { background: var(--green-2); }
.soft { background: #e1edcf; border-color: #d1e2b8; }
.danger { background: #9b3423; color: white; border-color: #9b3423; }
.danger:enabled:hover { background: #752519; }
.link { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: .2em; width: 100%; font-size: .87rem; min-height: 40px; }
.icon-button { min-width: 43px; padding: .55rem; }
.wide { width: 100%; }
.tile { background: var(--paper); border: 1px solid #e8dfc8; border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.loading { width: fit-content; margin: 12vh auto; padding: 1rem; background: var(--paper); border-radius: 12px; }
.empty { padding: 2rem; text-align: center; }
.empty p { margin-top: .65rem; }
label { display: grid; gap: .43rem; font-weight: 650; min-width: 0; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-width: 0; padding: .72rem .83rem; border: 1px solid #b8c8b2; border-radius: 9px; background: #fffdf8; color: var(--ink); }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 1.12rem; height: 1.12rem; accent-color: var(--green-2); margin: 0; flex-shrink: 0; }
.check { display: flex; align-items: center; gap: .53rem; font-weight: 550; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 3.1rem !important; }
.password-wrap .icon-button { position: absolute; inset: 1px 2px 1px auto; border: 0; background: transparent; min-height: 0; }
.form-error { color: #972e1c; font-size: .86rem; }
.form-error:empty { display: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin: 0; display: grid; gap: .64rem; min-width: 0; }
legend { font-weight: 700; padding: 0 .35rem; }
.login-view { min-height: 100svh; display: grid; place-items: center; padding: 5.3rem 1.1rem 2rem; }
.login-card { width: min(100%, 29rem); border-radius: 24px; background: #fff9eef7; border: 1px solid #e7e2cf; padding: clamp(1.2rem, 4vw, 2.25rem); display: grid; gap: 1.12rem; box-shadow: 0 18px 70px #1e261966; }
.login-card h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); text-align: center; margin: .15rem 0 .65rem; }
.login-card .wide { margin-top: .24rem; }
.login-media { position: absolute; top: .85rem; right: .9rem; }
.media { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.media .button { border-radius: 2rem; font-size: .84rem; white-space: nowrap; padding-inline: .6rem; }
.layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 1rem; max-width: 1800px; margin-inline: auto; padding: 1rem; min-height: 100svh; align-items: start; }
.layout.is-collapsed { grid-template-columns: minmax(0,1fr); }
.sidebar { position: sticky; top: 1rem; max-height: calc(100svh - 2rem); overflow: auto; border-radius: 17px; background: #fff9eef8; border: 1px solid #e6ddc9; padding: .93rem; display: grid; gap: 1rem; box-shadow: var(--shadow); z-index: 6; }
.sidebar[hidden] { display: none; }
.account { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }
.account b { overflow-wrap: anywhere; font-size: .92rem; }
.presence { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.presence div { padding: .55rem; border-radius: 11px; background: #e5efd8; border: 1px solid #c9d9b6; text-align: center; display: grid; }
.presence div+div { background: #f1efe7; border-color: #dbdbd0; }
.presence b { font-size: 1.42rem; line-height: 1.15; }
.sidebar nav { display: grid; gap: .55rem; }
.nav-main, .nav-entry { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .68rem .7rem; border-radius: 10px; background: transparent; color: var(--green); border: 1px solid transparent; text-align: left; text-decoration: none; min-height: 42px; font-size: .9rem; font-weight: 650; }
.nav-main { background: #e3edd9; }
.nav-main svg:last-child { margin-left: auto; }
.nav-sub { padding-left: .36rem; display: grid; gap: .15rem; }
.nav-entry:hover, .nav-entry.active { background: #e9efdd; border-color: #d1ddc3; }
.nav-sub p { padding: .5rem .65rem; font-size: .84rem; }
.calendar { border: 1px solid #e2d7bf; border-radius: 14px; padding: .6rem; margin-top: .35rem; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .15rem; margin-bottom: .35rem; }
.calendar-head strong { font-size: .88rem; }
.calendar-head>div { display: flex; align-items: center; gap: .1rem; }
.calendar-head b { font-size: .74rem; white-space: nowrap; }
.calendar-head .icon-button { min-height: 27px; min-width: 25px; padding: .16rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; gap: .14rem; align-items: center; }
.calendar-grid small { padding: .25rem 0; color: var(--muted); font-weight: 650; }
.day { line-height: 1.8; border-radius: .4rem; font-size: .81rem; }
.level-1 { background: #dcebcf; }
.level-2 { background: #3a7552; color: white; }
.today { outline: 2px solid #d8796b; outline-offset: -2px; }
.calendar-key { margin-top: .55rem; font-size: .69rem; display: flex; gap: .3rem; justify-content: center; align-items: center; color: var(--muted); }
.calendar-key i { width: .64rem; height: .64rem; border-radius: .16rem; background: #dcebcf; }
.calendar-key i:last-of-type { background: #3a7552; margin-left: .17rem; }
.content { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 45px; margin-bottom: .75rem; }
.topbar>.icon-button, .chat-control .icon-button { background: var(--green); color: white; border-color: #e0ead7; box-shadow: var(--shadow); }
.topbar>.icon-button:hover, .chat-control .icon-button:hover { background: var(--green-2); }
.top-label { color: var(--muted); font-size: .85rem; font-weight: 650; }
.clock, .timer { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; background: var(--paper); padding: .4rem .7rem; border-radius: 12px; }
.clock>span { display: grid; text-align: center; line-height: 1.15; }
.clock b, .timer strong { font-variant-numeric: tabular-nums; }
.clock small { font-size: .72rem; }
.hero { text-align: center; padding: clamp(1rem, 3vw, 1.7rem); }
.hero p { font-size: 1.12rem; margin-top: .4rem; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; margin: .9rem 0; }
.stat { padding: .85rem 1rem; display: flex; gap: .8rem; align-items: center; }
.stat-icon { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: .76rem; background: var(--soft); flex-shrink: 0; }
.stat-icon svg { width: 1.4rem; height: 1.4rem; }
.stat.wrong .stat-icon { background: #f9e1cc; }
.stat small { display: block; }
.stat strong { display: block; font-size: clamp(1.15rem,2.5vw,1.9rem); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,190px),1fr)); gap: .85rem; }
@media (min-width: 1100px) {
 .is-collapsed .lesson-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (min-width: 1430px) {
 .lesson-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
.lesson-grid>.empty { grid-column: 1/-1; }
.lesson { display: grid; gap: .76rem; padding: .85rem; }
.lesson-top { display: grid; grid-template-columns: 3.55rem 1fr; align-items: stretch; gap: .55rem; text-align: center; }
.lesson-top>div { display: grid; align-content: center; gap: .13rem; }
.lesson-number { display: grid; place-items: center; background: var(--soft); border-radius: .66rem; font-size: 2.35rem; font-weight: 750; min-height: 3.65rem; font-variant-numeric: tabular-nums; }
.lesson-top span { font-size: .9rem; }
.lesson-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: .32rem; }
.lesson-actions .button { padding-inline: .26rem; font-size: .77rem; }
.progress-label { position: relative; height: 21px; }
.progress-label span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: .76rem; color: #18311e; }
progress { display: block; appearance: none; width: 100%; height: .68rem; overflow: hidden; background: #e3ebd6; border: 0; border-radius: 100px; }
.progress-label progress { height: 100%; }
progress::-webkit-progress-bar { background: #e3ebd6; border-radius: 100px; }
progress::-webkit-progress-value { background: #a9cf8e; border-radius: 100px; }
progress::-moz-progress-bar { background: #a9cf8e; border-radius: 100px; }
.extras { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; margin-top: 1rem; }
.utility { padding: 1rem; display: flex; align-items: flex-start; flex-direction: column; gap: .65rem; }
.utility>.primary { margin-top: auto; }
.utility .link { width: auto; }
.lesson-checks, .wrong-counts { display: grid; grid-template-columns: repeat(2,1fr); width: 100%; gap: .42rem; }
.lesson-checks label, .wrong-counts span { font-size: .85rem; }
.stage { padding: clamp(.85rem,3vw,1.65rem); }
.stage-head { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: 1.3rem; justify-content: space-between; }
.stage-head>div { flex: 1; }
.stage-head h1 { font-size: clamp(1.55rem,3vw,2.5rem); }
.stage-head p { margin-top: .38rem; }
.stage-head .button { white-space: nowrap; }
.history-grid, .exam-grid, .profile-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1rem; }
.history-grid>section { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; min-width: 0; }
.history-grid h2 { padding: .75rem; background: #e7edda; }
.history-detail { text-align: center; }
.history-detail p { margin-top: .55rem; }
.history-detail .button { margin: .75rem; }
.history-detail .result-metrics { padding: .5rem; }
.history-detail .metric { font-size: .82rem; padding: .5rem .1rem; }
.review-summary { background: #e6eddb; border-radius: 12px; padding: .75rem; display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.review-list { margin-top: .6rem; display: grid; gap: .5rem; }
.review-list>div { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: .7rem; align-items: center; border: 1px solid var(--line); padding: .62rem .72rem; border-radius: 10px; }
.mini-number { background: var(--soft); border-radius: .5rem; width: 2rem; height: 2rem; display: grid; place-items: center; font-weight: 750; }
.pill { border-radius: 200px; font-size: .78rem; padding: .25rem .56rem; font-weight: 700; white-space: nowrap; }
.pill.amber { background: #f6e2b8; color: #71380a; }
.pill.green { background: #deebd0; color: #264f31; }
.status-toggle { border: 1px solid transparent; min-height: 32px; min-width: 52px; }
.status-toggle:enabled:hover { border-color: currentColor; }
.status-toggle:disabled { opacity: 1; }
.exercise, .navigator { display: grid; gap: .7rem; border: 1px solid var(--line); border-radius: 14px; padding: .94rem; align-content: start; }
.exercise header { display: flex; align-items: center; gap: .65rem; }
.exercise header b { white-space: nowrap; }
.exercise h2 { overflow-wrap: anywhere; margin-block: .36rem; }
.choices { display: grid; gap: .5rem; }
.choice { display: flex; align-items: center; gap: .55rem; text-align: left; border: 1px solid #c8cbb4; padding: .66rem .7rem; min-height: 44px; border-radius: 10px; background: #fffdf7; color: var(--ink); }
.choice>span:nth-child(3) { flex: 1; overflow-wrap: anywhere; }
.choice:enabled:hover, .choice.picked { background: #eef3e4; border-color: #739a70; }
.choice:disabled { opacity: 1; }
.choice.correct { background: #deedce; border-color: #72a268; }
.choice.incorrect { background: #f9e7de; border-color: #cb8f7c; }
.radio { width: 1.1rem; height: 1.1rem; border: 1.5px solid #758c6e; border-radius: 50%; flex-shrink: 0; }
.choice[aria-pressed=true] .radio { background: var(--green-2); box-shadow: inset 0 0 0 3px #f8fcf1; }
.feedback { background: #e6eed9; border-radius: 10px; padding: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.feedback.incorrect { background: #faead7; color: #823b1a; }
.feedback p { margin-top: .24rem; }
.exercise-footer, .submit-row { display: flex; justify-content: space-between; align-items: center; gap: .65rem; }
.exercise-footer>span { font-size: .83rem; color: var(--muted); }
.exercise-stack { display: grid; gap: .7rem; padding: .9rem; }
.exercise-stack .exercise, .exercise-stack .navigator { border: 0; padding: .18rem; border-radius: 0; }
.exercise-stack .navigator { border-top: 1px solid var(--line); padding-top: .7rem; }
.number-grid { display: grid; grid-template-columns: repeat(10,minmax(0,1fr)); gap: .28rem; }
.number-key { position: relative; min-width: 0; min-height: 38px; padding: .1rem; border: 1px solid #ccd4bb; background: #fffdf6; border-radius: 7px; color: var(--ink); font-weight: 700; }
.number-key.answered { background: #deebcb; }
.number-key[aria-current=step] { outline: 2px solid var(--green-2); outline-offset: -2px; }
.number-key.marked::after { content: ""; position: absolute; top: 2px; right: 3px; width: 6px; height: 9px; background: #b07724; clip-path: polygon(0 0,100% 0,100% 100%,50% 68%,0 100%); }
.timer { background: #e5eed6; white-space: nowrap; }
.timer strong { font-size: 1.32rem; }
.timer small { display: none; }
.dialog-timer { display: flex; justify-content: flex-end; margin: .65rem .9rem 0; }
dialog { width: min(96vw,620px); max-height: 95dvh; border: 1px solid #e6dcc4; border-radius: 19px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 90px #17211977; padding: 0; overflow: auto; }
dialog.wide-dialog { width: min(96vw,860px); }
dialog::backdrop { background: #19231791; }
.dialog-head { padding: .82rem 1.1rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .75rem; position: sticky; top: 0; z-index: 2; background: var(--paper); }
.dialog-head .icon-button { border: 0; background: transparent; min-height: 38px; min-width: 38px; }
.dialog-footer { border-top: 1px solid var(--line); display: flex; justify-content: flex-end; padding: .8rem 1.1rem; gap: .55rem; background: var(--paper); position: sticky; bottom: 0; }
.form-stack, .modal-fields { display: grid; gap: .82rem; }
.modal-fields { padding: 1rem 1.12rem; }
.option-row { display: grid; grid-template-columns: 19px 17px minmax(0,1fr) auto; align-items: center; gap: .42rem; padding: .2rem 0; }
.option-row input[type=radio] { appearance: none; border: 1px solid #789478; border-radius: 4px; background: #fffdf8; display: inline-grid; place-items: center; }
.option-row input[type=radio]:checked { background: var(--green); border-color: var(--green); }
.option-row input[type=radio]:checked::after { content: ""; width: 6px; height: 10px; border: solid #fffdf8; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.option-row .icon-button, .table-actions .icon-button:last-child { color: var(--red); }
.grant-list { display: flex; flex-wrap: wrap; gap: .6rem 1rem; }
.result, .warning { padding: clamp(.8rem, 3vw, 1.45rem); display: grid; gap: .72rem; text-align: center; }
.warning-icon { display: grid; place-items: center; margin: 0 auto; border-radius: 100%; background: var(--amber); color: #8d4b11; width: 3rem; height: 3rem; }
.warning-icon svg { width: 1.55rem; height: 1.55rem; }
.score { display: block; line-height: 1; font-size: clamp(2.8rem,8vw,5.3rem); letter-spacing: -.07em; font-weight: 760; font-variant-numeric: tabular-nums; }
.result-message { min-height: 50px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: .6rem; border-radius: 50px; padding: .36rem .8rem; font-weight: 750; background: var(--soft); }
.result-message.retry { background: #f9e2bb; color: #714015; }
.result-message img { object-fit: contain; width: 39px; height: 39px; mix-blend-mode: multiply; border-radius: .26rem; }
.result-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; }
.metric { padding: .65rem .3rem; display: grid; gap: .25rem; border: 1px solid var(--line); border-radius: 9px; }
.metric strong { font-size: clamp(1rem,2.6vw,1.62rem); }
.result-actions { display: flex; justify-content: center; gap: .55rem; flex-wrap: wrap; }
.admin-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .5rem 0 1.1rem; }
.admin-title h1 { font-size: clamp(1.55rem,3vw,2.45rem); }
.admin-title span { font-size: .83rem; color: var(--muted); }
.admin-card { padding: clamp(.85rem,2vw,1.4rem); background: #fffdf8; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: .65rem; margin: .75rem 0; }
.table-tools label:first-child { display: flex; align-items: center; font-size: .83rem; white-space: nowrap; }
.table-tools select { width: 4.1rem; }
.search { position: relative; width: min(100%,19rem); }
.search svg { position: absolute; top: 50%; left: .6rem; transform: translateY(-50%); }
.search input { padding-left: 2rem !important; }
.scroll-table { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
th, td { padding: .64rem .68rem; border-bottom: 1px solid #e3e8dd; }
th { background: #e6eddc; white-space: nowrap; }
td { overflow-wrap: anywhere; }
[data-table="questions"] tr > :first-child:not([colspan]) { white-space: nowrap; min-width: 5ch; font-variant-numeric: tabular-nums; }
thead th:last-child, td:last-child { text-align: right; }
tbody tr:nth-child(even) { background: #f2f5ec; }
tbody tr.selected { background: #e5eed6; }
.table-actions { display: flex; align-items: center; gap: .24rem; justify-content: flex-end; }
.table-actions .icon-button { min-height: 35px; min-width: 35px; padding: .36rem; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-top: .66rem; color: var(--muted); font-size: .85rem; }
.table-footer>div { display: flex; gap: .3rem; }
.profile-grid { align-items: start; grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.chat-control { position: fixed; right: 1rem; bottom: 1rem; z-index: 5; }
.chat-control .icon-button { border-radius: 50%; }
#notice { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 9; padding: .7rem .95rem; max-width: 92vw; background: var(--green); color: white; border-radius: 11px; box-shadow: var(--shadow); display: none; }
#notice.visible { display: block; }
#notice.error { background: #923721; }
@media (max-width: 1050px) {
 .layout { grid-template-columns: minmax(0,1fr); }
 .sidebar { position: fixed; top: 4.45rem; left: .75rem; width: min(300px,calc(100vw - 1.5rem)); max-height: calc(100dvh - 5.2rem); }
 .login-card { margin-left: 0; }
}
@media (max-width: 760px) {
 .history-grid, .exam-grid, .profile-grid { grid-template-columns: minmax(0,1fr); }
 .stage-head { flex-wrap: wrap; align-items: center; }
 .stage-head>div { flex-basis: 100%; order: 3; }
 .admin-card table { min-width: 620px; }
}
@media (max-width: 520px) {
 .layout { padding: .62rem; gap: .5rem; }
 .stats { gap: .35rem; margin-block: .62rem; }
 .stat { padding: .46rem .4rem; gap: .15rem; flex-direction: column; align-items: flex-start; }
 .stat-icon { width: 1.7rem; height: 1.7rem; }
 .stat-icon svg { width: 1rem; height: 1rem; }
 .stat small { font-size: .68rem; }
 .hero p { font-size: .92rem; }
 .lesson-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .48rem; }
 .lesson { padding: .52rem; gap: .49rem; }
 .lesson-top { grid-template-columns: 2.45rem 1fr; }
 .lesson-number { font-size: 1.5rem; min-height: 3rem; }
 .lesson-top h3 { font-size: .9rem; }
 .lesson-top span, .lesson-top small { font-size: .74rem; }
 .lesson-actions .button { font-size: .67rem; min-height: 39px; }
 .lesson-actions svg { display: none; }
 .link { font-size: .72rem; }
 .extras { grid-template-columns: minmax(0,1fr); }
 .review-list>div { grid-template-columns: auto minmax(0,1fr) auto; gap: .36rem; }
 .review-list>div>.button { grid-column: 2/-1; }
 .review-summary strong { font-size: .85rem; }
 .review-summary .button, .exercise-footer .button { font-size: .78rem; padding-inline: .45rem; }
 .exercise header { flex-wrap: wrap; }
 .exercise header progress { flex: 1; }
 .exercise header .button { min-height: 33px; padding: .3rem .4rem; font-size: .76rem; }
 .number-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
 .exercise, .navigator { padding: .65rem; }
 .choice small { font-size: .58rem; }
 .dialog-head { padding: .55rem .8rem; }
 .exercise-stack { padding: .68rem; }
 .table-tools { flex-wrap: wrap; }
 .table-tools .search { width: 100%; }
 .admin-title span { display: none; }
 .login-view { align-items: end; padding-bottom: max(1.1rem,env(safe-area-inset-bottom)); }
 .login-card { background: #fff9eef9; }
 .study-theme::before { background-position: 28% center; }
}
.account b { flex: 1; }
.account .icon-button { flex-shrink: 0; }
.activity { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.activity::before { content: ""; width: .7rem; height: .7rem; border: 2px solid #89918b; border-radius: 50%; }
.activity.online::before { background: #18763e; border-color: #18763e; }
.last-seen { display: block; margin-left: 1.15rem; color: #576158; white-space: nowrap; }
.recent-results h2 { margin: 0 0 1rem; }
.result-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,18rem),1fr)); gap: 1rem; margin-bottom: 1.25rem; max-width: 54rem; }
.result-filters label { display: grid; gap: .35rem; font-weight: 600; min-width: 0; }
.result-filters select { width: 100%; min-height: 3.25rem; padding: .65rem .9rem; font-size: 1rem; }
.recent-results td { border-bottom: 1px dashed var(--line); }
.chat-panel,.chat-inbox { display:grid; gap:.85rem; padding:1rem; }
.chat-panel>.button { justify-self:start; }
.chat-thread { display:grid; gap:.2rem; text-align:left; padding:.8rem; border:1px solid var(--line); border-radius:.7rem; background:white; min-width:0; }
.chat-thread span { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:var(--muted); }
.chat-log { height:min(45dvh,23rem); overflow:auto; display:flex; flex-direction:column; gap:.7rem; padding:.5rem; }
.chat-bubble { align-self:flex-start; max-width:86%; background:white; border:1px solid var(--line); border-radius:.8rem; padding:.55rem .8rem; }
.chat-bubble.mine { align-self:flex-end; background:var(--soft); }
.chat-bubble small { color:var(--muted); }
.chat-bubble p { white-space:pre-wrap; overflow-wrap:anywhere; margin:.25rem 0 0; }
.chat-panel textarea { width:100%; resize:vertical; margin:.3rem 0; }
.chat-send { display:flex; align-items:center; justify-content:space-between; gap:.5rem; }
