:root {
  color-scheme: light;
  --paper: #f6f6f0;
  --surface: #fff;
  --ink: #203b32;
  --forest: #214d40;
  --deep: #1c493d;
  --muted: #606e65;
  --line: #dbe1d7;
  --lime: #dff39a;
  --gap: clamp(1rem, 2.6vw, 2.5rem);
  font: 100%/1.55 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .57; }
button, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 3px solid #5c86b4; }
button { border: 0; background: none; }
h1, h2, h3, p { margin: 0; }
button, h1, h2, h3, label { word-break: keep-all; }
[hidden] { display: none !important; }
.symbol-library { display: block; position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { display: block; width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.site-head { border-bottom: 1px solid var(--line); }
.head-inner { width: min(100% - clamp(2rem, 9vw, 9rem), 1232px); height: 5.2rem; margin: auto; display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.72rem; font-weight: 800; letter-spacing: -.085em; color: #203e32; white-space: nowrap; line-height: 1; }
.brand-logo { display: block; width: 2.45rem; height: 2.45rem; flex: 0 0 auto; }
.brand-sub { margin-left: 1.15rem; padding-left: 1.1rem; border-left: 1px solid #c9d0c5; color: #556459; font-weight: 600; font-size: .92rem; line-height: 1.15; letter-spacing: -.04em; }
.school-label { margin-left: auto; display: inline-flex; align-items: center; gap: .52rem; color: #58675b; font-size: .9rem; font-weight: 600; letter-spacing: -.04em; }
.school-label .icon { width: 1.12rem; height: 1.12rem; margin-right: .1rem; }
.school-label i { width: 3px; height: 3px; border-radius: 50%; background: #909d8d; }
.entry-main, .entry-extras, .lobby-main { width: min(100% - clamp(2rem, 9vw, 9rem), 1110px); margin-inline: auto; }
.entry-main { display: grid; grid-template-columns: 1.12fr 1fr; align-items: stretch; gap: 1.35rem; margin-top: clamp(2.25rem, 6vh, 4.5rem); }
.story-card, .entry-card { border-radius: 1.75rem; min-width: 0; }
.story-card { isolation: isolate; position: relative; display: flex; flex-direction: column; overflow: hidden; min-height: 31.2rem; background-color: var(--deep); background-image: radial-gradient(ellipse at 86% 12%, #275644 0, transparent 63%); color: #fff; }
.story-intro { padding: clamp(2.05rem, 3.7vw, 3.35rem) 2.5rem 0 clamp(2.1rem, 4.15vw, 3.65rem); position: relative; z-index: 1; }
.story-intro h1 { color: #fffef3; font-size: clamp(2.4rem, 3.75vw, 3.35rem); font-weight: 780; letter-spacing: -.08em; line-height: 1.24; }
.story-intro h1 em { color: var(--lime); font-style: normal; }
.story-intro p { color: #d2e2d5; font-weight: 500; font-size: 1.04rem; line-height: 1.65; letter-spacing: -.033em; margin-top: 1.05rem; }
.story-art { width: 100%; height: auto; display: block; margin-top: auto; flex: 0 0 auto; }
.entry-card { background: #fff; border: 1px solid var(--line); padding: clamp(1.9rem, 3.75vw, 3.1rem) clamp(1.9rem, 3.4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.entry-heading h2 { font-size: clamp(1.8rem, 2.55vw, 2.28rem); line-height: 1.3; color: #253a2f; font-weight: 780; letter-spacing: -.085em; }
.entry-heading p { margin-top: .35rem; color: #626e62; font-size: 1rem; letter-spacing: -.045em; }
.role-tabs { display: flex; gap: .16rem; background: #f2f4ec; border: 1px solid #e4e7dd; border-radius: .88rem; padding: .28rem; margin: 1.7rem 0 1.45rem; }
.role-tabs button { display: flex; justify-content: center; align-items: center; flex: 1; gap: .47rem; min-height: 2.65rem; border-radius: .62rem; color: #677264; font-weight: 650; letter-spacing: -.045em; }
.role-tabs button:hover { color: var(--ink); }
.role-tabs button[aria-selected="true"] { color: var(--forest); background: white; box-shadow: 0 1px 4px #253c281c, 0 0 0 1px #dbe0d55c; font-weight: 750; }
.role-tabs .icon { width: 1.25rem; height: 1.25rem; }
#joinForm, #createForm { display: flex; flex-direction: column; align-items: stretch; gap: 1.02rem; }
.field { display: flex; flex-direction: column; gap: .42rem; font-size: .91rem; color: #34483c; font-weight: 700; letter-spacing: -.035em; min-width: 0; }
input, select, .app-dialog textarea { width: 100%; min-width: 0; background: #fdfefa; border: 1px solid #d5dccf; border-radius: .7rem; padding: .73rem .89rem; font-size: 1rem; line-height: 1.35; font-weight: 450; letter-spacing: -.03em; box-shadow: none; }
input, select { height: 3rem; }
input::placeholder, textarea::placeholder { color: #778375; opacity: 1; }
input:focus, select:focus, .app-dialog textarea:focus { border-color: #819d83; }
.field-row { display: grid; grid-template-columns: .9fr 1.3fr; align-items: start; gap: .8rem; }
.key-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#chooseKey { color: var(--forest); font-size: .875rem; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }
.select-wrap { display: block; position: relative; }
.select-wrap::after { position: absolute; content: ""; right: 1.1rem; top: 50%; width: .4rem; height: .4rem; border: solid #62735f; border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select { appearance: none; padding-right: 2rem; cursor: pointer; }
select:invalid { color: #778375; }
select option { color: var(--ink); }
.primary-button, .soft-button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border-radius: .75rem; font-weight: 700; letter-spacing: -.045em; }
.primary-button { background: var(--forest); color: white; padding: .8rem 1.1rem; }
.primary-button:not(:disabled):hover, .send-button:not(:disabled):hover { background: #15392e; }
.soft-button { background: #eff3e9; color: #34503e; border: 1px solid #dbe2d4; padding: .55rem .85rem; }
.soft-button:hover { background: #e4ecd9; }
.entry-submit { width: 100%; min-height: 3.15rem; margin-top: .38rem; font-weight: 700; }
.entry-submit .icon { width: 1.2rem; height: 1.2rem; }
.error-text { margin-top: .75rem; border-radius: .5rem; background: #fff3ec; color: #9a402c; font-size: .9rem; padding: .5rem .65rem; }
.error-text:empty { display: none; }
.heading-row, .workspace-controls { display: flex; align-items: center; gap: .65rem; }
.heading-row { justify-content: space-between; }
.site-status { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; padding: .29rem .65rem; border-radius: 1rem; border: 1px solid #d7dcd2; color: #53624f; background: #edf0e8; font-size: .8rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.5; }
.site-status::before { content: ""; width: .47rem; height: .47rem; border-radius: 50%; background: #7d897a; }
.site-status.is-on { background: #e3f2d1; border-color: #c8e3a7; color: #295d32; }
.site-status.is-on::before { background: #3a873d; }
.entry-submit:disabled { background: #e5e9e0; color: #627160; opacity: 1; }
.key-help { font-size: .84rem; color: var(--muted); line-height: 1.55; }
.resume-seat { margin-top: .6rem; }
.entry-extras { display: grid; align-items: start; grid-template-columns: 1.12fr 1fr; gap: 1.35rem; margin-top: 1.1rem; margin-bottom: 2.25rem; }
.rules-card { border: 1px solid #dce3d6; border-radius: 1.05rem; background: #edf1e5; color: #415541; letter-spacing: -.03em; }
.rules-card summary { display: flex; align-items: center; gap: .65rem; list-style: none; cursor: pointer; padding: 1rem 1.15rem; border-radius: 1.05rem; }
.rules-card summary::-webkit-details-marker { display: none; }
.rules-card summary:hover { background: #e7eddd; }
.rules-card summary strong { font-size: .95rem; color: #35513c; font-weight: 750; white-space: nowrap; }
.summary-action { display: inline-flex; align-items: center; gap: .62rem; margin-left: auto; font-size: .82rem; color: #52674f; }
.summary-action::after { content: ""; width: .39rem; height: .39rem; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: translateY(-.1rem) rotate(45deg); margin-right: .12rem; }
.rules-card[open] .summary-action::after { transform: translateY(.1rem) rotate(225deg); }
.rules-card ul { margin: 0; padding: 0 1.25rem 1.15rem 2.65rem; font-size: .95rem; }
.rules-card li + li { margin-top: .42rem; }
.directory-card { background: #f4f4ed; }
.directory-card .promise-icon { background: #e2e5d6; }
.directory-content { padding: 0 1.2rem 1.1rem; color: #536451; font-size: .93rem; }
.directory-content p { margin-top: .28rem; }
.promise-icon { display: inline-grid; place-items: center; color: #456440; width: 1.95rem; height: 1.95rem; border-radius: .62rem; background: #dce9c8; flex-shrink: 0; }
.promise-icon .icon { width: 1.12rem; height: 1.12rem; }

#workspace { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; }
#workspace .head-inner { height: 4.5rem; }
.messenger { width: min(100% - clamp(2rem, 9vw, 9rem), 1232px); margin: clamp(1rem, 3.3vh, 2rem) auto; display: grid; grid-template-columns: clamp(15rem, 23vw, 19rem) minmax(0,1fr); flex: 1; min-height: 0; background: #fff; border: 1px solid #d9e0d5; border-radius: 1.35rem; overflow: hidden; position: relative; }
.sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); background: #fafbf6; }
.room-info { padding: 1.45rem 1.4rem 1.25rem; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sidebar-title h2 { font-size: 1.48rem; font-weight: 760; letter-spacing: -.07em; }
.list-subtitle { margin-top: .25rem; color: #657461; font-size: .85rem; letter-spacing: -.035em; }
.workspace-controls { margin-left: auto; }
.teacher-switch { display: inline-flex; align-items: center; gap: .48rem; min-height: 2.45rem; border: 1px solid #a9b4a6; border-radius: .75rem; padding: .42rem .72rem; background: #f9faf6; color: #304b37; font-weight: 750; font-size: .88rem; white-space: nowrap; }
.teacher-switch::before { content: ""; flex: 0 0 auto; width: 1.75rem; height: 1.05rem; border-radius: 1rem; background: radial-gradient(circle at .54rem 50%, white .33rem, transparent .36rem), #788574; }
.teacher-switch[aria-checked="true"] { background: #e8f3d7; border-color: #a3ba8e; }
.teacher-switch[aria-checked="true"]::before { background: radial-gradient(circle at 1.21rem 50%, white .33rem, transparent .36rem), #427043; }
.lobby-home { margin-left: auto; font-size: .87rem; font-weight: 650; }
.lobby-main { display: grid; grid-template-columns: .86fr 1.14fr; align-items: start; gap: 1.15rem; margin-top: clamp(1.75rem, 6vh, 4.5rem); margin-bottom: 2rem; }
.lobby-welcome { padding: clamp(1.45rem, 3.5vw, 2.6rem); color: white; background: var(--deep); border-radius: 1.5rem; }
.lobby-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.lobby-room-icon, .history-icon { display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: .95rem; }
.lobby-room-icon { color: var(--lime); background: #396551; }
.lobby-room-icon .icon { width: 1.6rem; height: 1.6rem; }
.lobby-welcome h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); letter-spacing: -.075em; margin-top: 1.4rem; line-height: 1.25; color: #fbffee; }
.lobby-person { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .72rem; color: #e4f1d6; }
.lobby-person strong { font-size: 1.13rem; }
.lobby-person span { color: #c1d2bc; font-size: .88rem; }
.lobby-hint { margin-top: 1.4rem; color: #d9e7ce; font-size: .98rem; letter-spacing: -.03em; }
#lobbyEnter { width: 100%; margin-top: 1.25rem; color: #234632; background: var(--lime); }
#lobbyEnter:not(:disabled):hover { background: #d2ef87; }
#lobbyEnter:disabled { opacity: 1; color: #d0dfcf; background: #446855; }
#lobbyTeacherSwitch { margin-top: .65rem; width: 100%; justify-content: center; }
.history-card { padding: clamp(1.45rem, 3vw, 2.3rem); border: 1px solid var(--line); border-radius: 1.5rem; background: var(--surface); min-height: 20rem; }
.history-icon { background: #e8f0d5; color: #41623f; }
.history-card h2 { font-size: 1.65rem; letter-spacing: -.07em; margin: .8rem 0 .25rem; }
.history-card > p, #lobbyHistory > p { font-size: .94rem; color: #657263; letter-spacing: -.04em; }
#lobbyHistory { margin-top: 1.2rem; display: grid; gap: .45rem; }
#lobbyHistory .member-item { border: 1px solid var(--line); background: #f9fbf5; }
#lobbyHistory button.member-item:hover { background: #edf4e3; }
.lobby-rules { grid-column: 1 / -1; }
.icon-button { display: inline-grid; place-items: center; padding: 0; color: #526754; background: transparent; border-radius: .65rem; width: 2.6rem; height: 2.6rem; flex-shrink: 0; }
.icon-button:hover { background: #eaf0e1; }
.icon-button.compact { width: 2rem; height: 2rem; }
.icon-button.compact .icon { width: 1rem; height: 1rem; }
.mobile-only, .sidebar-scrim { display: none; }
.channel-scroll { overflow: auto; flex: 1; min-height: 0; padding: .25rem .8rem 1rem; scrollbar-width: thin; scrollbar-color: #c4cfbf transparent; }
.list-heading { font-size: .85rem; font-weight: 700; letter-spacing: -.03em; color: #677364; margin: .25rem .65rem .5rem; }
.dm-heading { margin-top: 1.6rem; }
.member-item { display: flex; width: 100%; padding: .6rem .68rem; min-height: 3.45rem; text-align: left; gap: .66rem; align-items: center; color: #253e30; border-radius: .82rem; }
.member-item:hover { background-color: #eff3e8; }
.member-item.active, .member-item[aria-current="true"], .member-item[aria-pressed="true"] { background-color: #e5efcf; }
.avatar { width: 2.42rem; height: 2.42rem; flex: 0 0 auto; display: inline-flex; justify-content: center; align-items: center; font-size: 1.07rem; font-weight: 720; background: #dfeccf; color: #365340; border-radius: .85rem; overflow: hidden; letter-spacing: -.045em; }
.group-avatar, #channelAvatar.group-avatar { background: #315c47; color: #e5f8ab; }
.group-avatar .icon { width: 1.42rem; height: 1.42rem; }
.member-copy { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.member-name { font-size: .98rem; font-weight: 700; letter-spacing: -.045em; }
.member-detail { color: #5c6b59; font-size: .8rem; letter-spacing: -.03em; }
.member-name, .member-detail, #meName, #meBadge, #channelTitle { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.list-empty { font-size: .9rem; color: #637261; letter-spacing: -.03em; padding: .4rem .65rem; }
.self-info { display: flex; align-items: center; gap: .65rem; padding: .88rem 1.2rem; border-top: 1px solid var(--line); min-width: 0; }
.self-info > div { min-width: 0; }
.self-info strong, .self-info small { display: block; line-height: 1.45; }
.self-info strong { font-size: .95rem; }
.self-info small { font-size: .8rem; color: var(--muted); }
.self-info .icon-button { margin-left: auto; }
.conversation { background: white; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.conversation-head { display: flex; align-items: center; gap: .75rem; padding: 1.15rem var(--gap); border-bottom: 1px solid #e0e5dc; }
.channel-title-wrap { min-width: 0; }
.conversation-head h2 { font-size: 1.22rem; letter-spacing: -.06em; font-weight: 750; }
.conversation-head p { font-size: .82rem; color: var(--muted); letter-spacing: -.025em; }
.people-meta { display: inline-flex; align-items: center; gap: .35rem; margin-left: auto; color: #52644f; font-size: .87rem; white-space: nowrap; }
.people-meta .icon { width: 1.1rem; height: 1.1rem; }
.topic-banner { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; border-radius: .85rem; background: #f0f4e6; margin: 1rem var(--gap) .25rem; }
.topic-icon { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .72rem; background: #e0eacb; color: #537043; flex-shrink: 0; }
.topic-icon .icon { width: 1.1rem; height: 1.1rem; }
.topic-banner > div { min-width: 0; }
.topic-banner strong { display: block; font-size: .81rem; font-weight: 720; color: #526640; letter-spacing: -.03em; }
.topic-banner p { font-size: .97rem; color: #354b36; overflow-wrap: anywhere; letter-spacing: -.035em; white-space: pre-wrap; }
.topic-banner .icon-button { margin-left: auto; }
#messages { display: flex; flex-direction: column; gap: .88rem; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 1.15rem var(--gap); scrollbar-width: thin; scrollbar-color: #c4cfbf transparent; }
.empty-chat { margin: auto; text-align: center; display: flex; align-items: center; flex-direction: column; max-width: 25rem; padding: 1rem; }
.empty-icon { display: grid; place-items: center; width: 3.65rem; height: 3.65rem; border-radius: 1.2rem; background: #e9f0d3; color: #466344; font-size: 1.75rem; margin-bottom: .8rem; }
.empty-icon svg { width: 1.8rem; height: 1.8rem; }
.empty-chat strong { font-size: 1.13rem; letter-spacing: -.05em; }
.empty-chat p { color: #657262; font-size: .93rem; margin-top: .3rem; letter-spacing: -.035em; }
.message-row { display: flex; align-items: flex-start; gap: .55rem; min-width: 0; }
.message-row > .avatar { width: 2.05rem; height: 2.05rem; font-size: .92rem; border-radius: .68rem; }
.message-stack { max-width: min(83%, 39rem); display: flex; flex-direction: column; align-items: flex-start; }
.message-author { font-size: .82rem; color: #52654f; font-weight: 650; margin-bottom: .19rem; }
.message-line { display: flex; align-items: flex-end; gap: .4rem; max-width: 100%; }
.message-bubble { background: #eff2ec; color: #253e2e; border-radius: .22rem .95rem .95rem .95rem; padding: .57rem .85rem; font-size: 1rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; letter-spacing: -.025em; }
.message-time { white-space: nowrap; color: #6a7768; font-size: .75rem; flex: 0 0 auto; }
.message-row.mine { justify-content: flex-end; }
.mine .message-stack { align-items: flex-end; }
.mine .message-bubble { background: #315b46; color: white; border-radius: .95rem .22rem .95rem .95rem; }
.mine .message-time { order: -1; }
.older-messages { margin: .2rem auto; font-size: .85rem; }
.message-day { align-self: center; margin: .2rem 0; color: #647460; font-size: .76rem; letter-spacing: -.025em; background: #f5f7f0; padding: .22rem .7rem; border-radius: 2rem; }
.unread-indicator, #groupButton.unread::after { flex-shrink: 0; margin-left: auto; color: #fff; background: #476444; }
.unread-indicator { display: inline-grid; place-items: center; padding: .13rem .42rem; border-radius: 1rem; font-size: .75rem; }
#groupButton.unread::after { content: ""; width: .6rem; height: .6rem; border-radius: 50%; }
.chat-status { color: #765b35; font-size: .86rem; padding: .2rem var(--gap); }
.chat-status:empty { display: none; }
.composer-wrap { padding: .7rem var(--gap) 1.05rem; }
#composeForm { display: flex; align-items: flex-end; gap: .6rem; border: 1px solid #ced8ca; border-radius: 1.05rem; padding: .42rem; background: #fbfcf8; }
#composeForm:focus-within { border-color: #779477; }
#composeForm textarea { width: 100%; background: transparent; border: 0; outline: none; resize: none; field-sizing: content; max-height: 8rem; min-height: 2.55rem; align-self: center; line-height: 1.5; padding: .45rem .6rem; font-size: 1rem; letter-spacing: -.03em; }
.send-button { background: var(--forest); color: white; border-radius: .7rem; width: 2.55rem; height: 2.55rem; display: grid; place-items: center; flex-shrink: 0; }
.app-dialog { width: min(90vw, 27rem); max-height: 85dvh; border: 1px solid #cfdbca; border-radius: 1.15rem; color: var(--ink); padding: 1.5rem; box-shadow: 0 16px 55px #14352724; }
.app-dialog::backdrop { background: #21372e66; }
.app-dialog form { display: flex; flex-direction: column; gap: .85rem; }
.app-dialog h2, .app-dialog h3 { font-size: 1.25rem; letter-spacing: -.045em; }
.app-dialog p { color: var(--muted); }
.app-dialog textarea { resize: vertical; }
.app-dialog button + button { margin-left: .3rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .35rem; }
.dialog-error { color: #91402b; font-size: .88rem; }
@media (min-width: 1600px) { .entry-main { margin-top: min(10vh, 7rem); } }
@media (max-width: 900px) and (min-width: 701px) {
  .head-inner, .entry-main, .entry-extras, .lobby-main, .messenger { width: calc(100% - 2.5rem); }
  .entry-main { grid-template-columns: 1fr 1fr; gap: .9rem; }
  .story-intro, .entry-card { padding-inline: 1.7rem; }
  .story-card { min-height: 28rem; }
  .story-art { width: 108%; max-width: none; margin-left: -4%; }
  .messenger { grid-template-columns: 13rem minmax(0,1fr); }
  .room-info { padding-inline: 1rem; }
}
@media (max-width: 700px) {
  .head-inner { width: calc(100% - 2rem); height: 4.35rem; }
  .brand { font-size: 1.48rem; gap: .45rem; }
  .brand-logo { width: 2.1rem; height: 2.1rem; }
  .brand-sub { font-size: .83rem; margin-left: .75rem; padding-left: .75rem; }
  .school-label { font-size: .8rem; gap: .3rem; }
  .school-label .icon { display: none; }
  .entry-main, .entry-extras, .lobby-main { width: min(100% - 2rem, 32rem); }
  .entry-main { grid-template-columns: 1fr; gap: .85rem; margin-top: 1.15rem; }
  .story-card, .entry-card { border-radius: 1.22rem; }
  .story-card { min-height: 10.5rem; }
  .story-intro { padding: 1.3rem 1.3rem 1.25rem; max-width: 58%; }
  .story-intro h1 { font-size: clamp(1.55rem, 5.3vw, 2.3rem); letter-spacing: -.075em; }
  .story-intro p { font-size: .85rem; line-height: 1.55; margin-top: .55rem; word-break: keep-all; }
  .story-art { position: absolute; bottom: .35rem; right: -4%; width: 52%; }
  .entry-card { padding: 1.5rem; }
  .entry-heading h2 { font-size: 1.65rem; }
  .entry-heading p { font-size: .95rem; }
  .role-tabs { margin: 1.15rem 0; }
  .entry-extras, .lobby-main { grid-template-columns: 1fr; gap: .7rem; margin-top: .85rem; margin-bottom: 1.2rem; }
  .rules-card summary { padding: .75rem .9rem; }
  .history-card { min-height: 0; }
  .lobby-welcome h1 { margin-top: 1rem; }
  .promise-icon { width: 1.55rem; height: 1.55rem; }
  #workspace .head-inner { height: 3.5rem; }
  #workspace .head-inner:has(#teacherSwitch:not([hidden])) .brand-sub { display: none; }
  .workspace-controls { flex-shrink: 0; gap: .4rem; }
  .workspace-controls .teacher-switch { font-size: .82rem; padding: .36rem .5rem; }
  .workspace-controls .site-status { padding-inline: .46rem; }
  .messenger { width: 100%; border: 0; border-radius: 0; margin: 0; display: flex; }
  .conversation { width: 100%; }
  .conversation-head { padding: .68rem .78rem; gap: .48rem; }
  .conversation-head h2 { font-size: 1.02rem; }
  .conversation-head > .avatar { width: 2.22rem; height: 2.22rem; }
  .people-meta { font-size: .8rem; }
  .mobile-only { display: inline-grid; }
  .conversation-head .mobile-only { width: 2rem; }
  .sidebar { display: none; position: absolute; left: 0; top: 0; bottom: 0; width: min(84%, 20rem); z-index: 3; box-shadow: 8px 0 30px #21342422; }
  .sidebar-open .sidebar { display: flex; }
  .sidebar-open .sidebar-scrim { display: block; position: absolute; inset: 0; z-index: 2; background: #1c352e65; }
  .room-info { padding-top: .8rem; }
  .topic-banner { margin: .67rem .75rem 0; padding: .55rem .63rem; }
  .topic-banner p { font-size: .91rem; }
  .topic-icon { width: 2rem; height: 2rem; }
  #messages { padding: .9rem .75rem; gap: .7rem; }
  .message-stack { max-width: 82%; }
  .message-time { font-size: .72rem; }
  .composer-wrap { padding: .45rem .65rem max(.55rem, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .head-inner { width: calc(100% - 1.5rem); }
  .school-label { font-size: .74rem; }
  .brand-sub { margin-left: .5rem; padding-left: .5rem; }
  #entry .brand-sub { display: none; }
  .entry-main, .entry-extras, .lobby-main { width: calc(100% - 1.25rem); }
  .entry-card { padding: 1.15rem; }
  .story-intro { padding-left: 1.1rem; max-width: 63%; }
  .story-art { width: 49%; right: -5%; }
  .field-row { gap: .55rem; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s ease, color .15s ease; }
}
