* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 400 var(--t-small)/1.6 var(--body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: var(--s4); }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: var(--s4); }
#room:focus { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; }
h1 { font-size: var(--t-page); letter-spacing: -.035em; }
h2 { font-size: var(--t-title); letter-spacing: -.02em; }
h3 { font-size: var(--t-title); }
img, video, iframe { max-width: 100%; }
input, textarea, select { min-width: 0; max-width: 100%; }
.skip-link { position: fixed; z-index: 10; top: var(--s8); left: var(--gutter); padding: var(--s12) var(--s20); background: var(--ink); color: var(--bg); transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.school-brand-credit { display: block; color: var(--muted); font: 400 var(--t-mono)/1.4 var(--body); letter-spacing: .07em; }
.public-links a { display: inline-flex; align-items: center; min-height: 44px; }
.header-join { display: none !important; }
body[data-screen="wall"] .header-signin { display: none; }
body[data-screen="wall"] .header-join { display: inline-flex !important; }
body[data-screen="lapsed"] .public-links { display: none; }
body[data-frame="public"] :is(.app-brand, .school-nav, .school-account) { display: none; }
body[data-frame="app"] :is(.public-brand, .public-links) { display: none; }
.page-intro { min-width: 0; }
.page-intro h1 { max-width: 14ch; }
.page-intro > p { max-width: 36ch; margin-top: var(--s24); color: var(--muted); font-size: var(--t-lede); line-height: 1.6; }
.entry { min-width: 0; padding-top: var(--s8); }
.entry > p, .entry-copy { margin-top: var(--s12); color: var(--muted); overflow-wrap: anywhere; }
.entry-form { margin-top: var(--s24); }
.entry-fields { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: var(--s20); }
.field { display: grid; gap: var(--s8); }
.field label { color: var(--ink); font-weight: 500; }
.field input { width: 100%; min-height: 48px; padding: var(--s12) var(--s16); background: var(--bg2); color: var(--ink); border: 1px solid var(--control-line); border-radius: var(--r-ctl); }
.field input:hover { border-color: var(--muted); }
.field input[aria-invalid="true"] { border-color: var(--muted); }
.field-hint { color: var(--dim); }
.code-input { font-family: var(--mono); font-size: var(--t-title); letter-spacing: .18em; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: var(--s8); min-height: 48px; padding: var(--s12) var(--s20); border: 1px solid var(--control-line); border-radius: var(--r-ctl); background: var(--bg3); color: var(--ink); font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none; }
.button:hover { border-color: var(--muted); text-decoration: none; }
.button-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button:disabled { opacity: .65; }
.text-button { min-height: 44px; padding: var(--s8) 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: var(--s4); text-align: left; }
.text-button:hover { color: var(--ink); }
.entry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s8) var(--s24); margin-top: var(--s12); }
.entry-foot { padding-top: var(--s24); margin-top: var(--s24); border-top: 1px solid var(--line); color: var(--muted); }
.entry-foot a { display: inline-block; min-height: 44px; padding: var(--s8) 0; }
.form-message { margin-top: var(--s16); padding: var(--s12) var(--s16); border-left: 2px solid var(--line2); background: var(--bg3); overflow-wrap: anywhere; }
.form-message:empty { display: none; }
.form-message:focus { outline: none; }
.form-message a { display: inline-block; padding: var(--s8) 0; }
.entry-status { min-height: 24px; margin-top: var(--s12); color: var(--muted); overflow-wrap: anywhere; }
.entry-status:empty { display: none; }
.state-loading { min-height: 96px; background: var(--bg2); }
.state { color: var(--muted); }
.state-failed { padding: var(--s20); border-left: 2px solid var(--line2); background: var(--bg2); }
.noscript-note { padding: var(--s32) var(--gutter); }

/* Portal frame and shared room primitives. */
html, body { height: 100%; overflow: hidden; }
body { height: 100dvh; }
h1,h2,h3 { font-weight: 500; line-height: 1.25; }
.school-column { display: flex; flex-direction: column; height: 100dvh; min-width: 0; margin-left: var(--sidebar); }
.school-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 12px 8px; background: var(--card); }
.school-side-panel { height: 100%; display: flex; flex-direction: column; gap: 24px; }
.school-side-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.school-brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; min-height: 44px; gap: 4px; color: inherit; text-decoration: none; font-size: 16px; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; }
.school-brand-name { overflow-wrap: anywhere; }
.school-brand-credit { font-size: 12px; letter-spacing: .07em; }
.school-side-head .school-brand { font-size: 15px; }
.school-side-head .school-brand-credit { font-size: 11px; letter-spacing: .035em; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: var(--r-control); background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--tint); color: var(--ink); }
.school-nav { display: flex; flex-direction: column; gap: 4px; border: 0; }
.school-nav .side-item,.side-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 10px 12px; border: 0; border-radius: var(--r-control); background: transparent; color: var(--muted); font: inherit; text-align: left; text-decoration: none; width: 100%; }
.side-item:hover { background: var(--tint); color: var(--ink); }
.school-nav a[aria-current="page"],.side-item[aria-current="page"] { background: var(--tint-strong); color: var(--ink); }
.school-nav a[aria-current="page"]::after { display: none; }
.nav-count { margin-left: auto; }
.school-side-foot { margin-top: auto; display: grid; gap: 4px; }
.school-side-person { padding: 0 12px 8px; color: var(--dim); overflow-wrap: anywhere; }
.school-topbar { display: flex; align-items: center; flex: none; gap: 16px; min-height: var(--navh); padding: 6px var(--gutter); border-bottom: 1px solid var(--line); }
.school-place { color: var(--muted); }
.public-links { margin-left: auto; }
.school-menu,.topbar-brand { display: none; }
body[data-frame="public"] .school-sidebar,body[data-frame="public"] :is(.school-menu,.topbar-brand,.school-place) { display: none; }
body[data-frame="public"] .school-column { margin-left: 0; }
body[data-frame="app"] .public-brand { display: none; }
.school-room { width: 100%; max-width: none; margin: 0; padding: 32px var(--gutter); flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
body[data-frame="app"][data-sidebar="collapsed"] .school-column { margin-left: var(--rail); }
body[data-sidebar="collapsed"] .school-sidebar { width: var(--rail); }
body[data-sidebar="collapsed"] .school-sidebar :is(.app-brand,.side-label,.school-side-person,.nav-count) { display: none; }
body[data-sidebar="collapsed"] .school-sidebar .side-item { justify-content: center; padding: 10px; }
body[data-sidebar="collapsed"] .school-side-head { justify-content: center; }
.page-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { font-size: var(--t-page); }
.page-header p { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.soft-panel,.panel { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--card); min-width: 0; }
.soft-card,.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); min-width: 0; }
.soft-row { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r-row); background: var(--tint); min-width: 0; }
.chevron { display: inline-block; width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); flex: none; margin-left: auto; }
[open] > summary .chevron { transform: rotate(225deg); }
.button { min-height: var(--control); padding: 8px 16px; background: var(--tint); border-color: var(--line2); font-weight: 500; }
.button-primary { background: var(--accent); border-color: var(--accent); }
.field input { min-height: 40px; background: var(--field); border-color: var(--line2); }
.school-sheet { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(300px,85vw); height: 100dvh; max-height: none; max-width: none; padding: 16px; border: 0; background: var(--bg2); color: var(--ink); }
.school-sheet::backdrop { background: #0008; }
.school-sheet .school-side-panel { overflow-y: auto; }
@media(max-width: 767px) {
 .school-sidebar { display: none; }
 .school-column,body[data-frame="app"][data-sidebar="collapsed"] .school-column { margin-left: 0; }
 .school-menu { display: inline-flex; }
 .school-place { display: none; }
 .topbar-brand { display: flex; min-width: 0; }
 .school-topbar { gap: 8px; }
 .school-brand-credit { font-size: 11px; }
 .school-side-head .school-brand-credit { font-size: 11px; }
 .school-room { padding: 20px var(--gutter); }
 .soft-panel,.panel { padding: 20px; }
 .page-header { flex-wrap: wrap; gap: 8px 16px; }
 .page-header > p { flex-basis: 100%; margin-top: 0; }
 .entry { border: 0; padding-top: 0; }
 .icon-button { width: 44px; height: 44px; }
 .school-sheet .school-side-toggle { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
