:root {
    color-scheme: light;
    font: 16px/1.55 system-ui, sans-serif;
    color: #182232;
    background: #f3f6f8;
    --primary: #12634f;
    --muted: #526274;
    --line: #d8e1e7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(1280px, 94%); margin: auto; }
.top { background: #172a36; color: white; }
.top-inner, .top nav, .actions, .join-card, .toolbar {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.top-inner { justify-content: space-between; min-height: 66px; padding: .5rem 0; }
.top a { color: white; }
.top-inner > a:first-child { font-size: 1.15rem; font-weight: 750; text-decoration: none; }
main { padding: 2rem 0 3rem; }
h1, h2, h3, p { margin: 0 0 .8rem; }
h1 { font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.12; margin-bottom: 1.4rem; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1rem; margin-top: 1rem; }
a { color: var(--primary); text-underline-offset: .18em; }
.panel { background: white; border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 2.5vw, 1.6rem); min-width: 0; }
.narrow { max-width: 35rem; margin: 3vh auto 0; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.watch-head { margin-bottom: 1rem; }
.watch-grid { grid-template-columns: 2fr 1fr; }
.student-grid { grid-template-columns: 4fr 6fr; }
label { display: block; margin-bottom: .85rem; font-weight: 650; }
label .muted { display: block; font-weight: normal; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
input, textarea, .editor {
    display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem;
    border: 1px solid #a9b9c4; border-radius: 7px; color: inherit; background: white; font: inherit;
}
button, .button {
    border: 1px solid var(--primary); border-radius: 8px; display: inline-block;
    font: inherit; font-weight: 700; padding: .52rem .9rem; background: var(--primary); color: white;
    text-decoration: none; cursor: pointer;
}
.secondary, .toolbar button { background: #fff; border-color: #b8c8cd; color: #16352f; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #3879b6; outline-offset: 3px; }
.muted, small { color: var(--muted); font-size: .9rem; }
small { display: block; overflow-wrap: anywhere; }
.notice { padding: .85rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.error { background: #fff0e8; color: #832d1b; border: 1px solid #e5b4a5; }
.statement-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.editor { min-height: 320px; margin: .65rem 0 1rem; overflow-wrap: anywhere; }
.editor[contenteditable=false] { background: #f7f9fa; }
.toolbar { gap: .35rem; }
.toolbar button, .compact { padding: .28rem .5rem; font-size: .88rem; }
.exam-state { margin-bottom: 1rem; }
#timer, .code { font-variant-numeric: tabular-nums; font-weight: 750; font-size: 1.35rem; }
.code { letter-spacing: .12em; }
#annex-frame { width: 100%; min-height: 450px; margin-top: 1rem; border: 1px solid var(--line); }
.events, .sessions { list-style: none; margin: 0; padding: 0; }
.events { max-height: 380px; overflow: auto; }
.events li, .sessions li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.sessions li { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); }
td form { padding-top: .3rem; }
@media (max-width: 800px) {
    .columns { grid-template-columns: 1fr; }
    main { padding-top: 1.2rem; }
}
@media (max-width: 440px) {
    .pair { grid-template-columns: 1fr; gap: 0; }
}
