:root {
  color-scheme: light;
  --ink: #18241f;
  --muted: #748079;
  --line: #e4e9e5;
  --paper: #ffffff;
  --canvas: #f2f4f1;
  --green: #1d694b;
  --green-dark: #15553b;
  --green-pale: #eaf4ee;
  --amber: #9b6a20;
  --red: #a94343;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar { height: 72px; padding: 0 max(28px, calc((100% - 1180px) / 2)); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.brand { color: var(--ink); display: flex; align-items: center; gap: 10px; font: 800 19px Manrope, sans-serif; letter-spacing: -.7px; text-decoration: none; line-height: 1; }
.brand-mark { width: 33px; height: 33px; border-radius: 10px; display: grid; place-items: center; color: white; background: var(--green); font-size: 18px; }
.brand-dot { color: #73aa8c; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font: 600 9px 'DM Sans', sans-serif; letter-spacing: 1.4px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.exercise-clock { display: grid; justify-items: end; gap: 2px; }
.clock { color: var(--muted); font-size: 12px; font-weight: 600; }
.elapsed-minutes { color: #89948d; font-size: 9px; font-weight: 600; }
.layout { width: min(1180px, calc(100% - 48px)); margin: 42px auto 72px; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.feed-column { min-width: 0; }
.welcome { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 24px; }
.eyebrow { margin: 0 0 9px; color: #72917f; font-size: 9px; line-height: 1.3; font-weight: 700; letter-spacing: 1.5px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, 'Segoe UI', sans-serif; letter-spacing: -.6px; }
h1 { margin-bottom: 6px; font-size: clamp(27px, 3vw, 35px); line-height: 1.18; }
.subhead { margin: 0; max-width: 520px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.feed-count { margin-bottom: 2px; display: flex; flex-direction: column; align-items: end; color: var(--muted); font-size: 10px; }
.feed-count strong { color: var(--ink); font: 700 20px Manrope, sans-serif; }
.status-banner { height: 34px; margin: 0 0 12px; padding: 0 12px; border: 1px solid #e5e9e5; border-radius: 9px; color: #69756e; background: #fafbf9; display: flex; align-items: center; gap: 8px; font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #aeb8b1; }
.status-banner.is-running .status-dot { background: #42a778; box-shadow: 0 0 0 3px #42a77820; }
.student-card { margin-bottom: 12px; padding: 16px 18px; border: 1px solid #dce8df; border-radius: 12px; background: #f8fbf8; }
.student-register { display: grid; gap: 10px; }
.student-register strong, .student-identity strong { color: #34463b; font-size: 12px; }
.student-register p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.student-register-row { display: flex; gap: 8px; }
.student-register-row .input { max-width: 280px; }
.student-identity { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.student-change { padding: 4px 0; border: 0; color: #668271; background: transparent; font-size: 10px; }
.student-change:hover { color: var(--green-dark); }
.student-compose { display: grid; gap: 8px; }
.student-compose .textarea { min-height: 72px; background: white; }
.student-compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.student-compose-footer span { color: #89948d; font-size: 9px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.feed { display: grid; gap: 10px; }
.post { background: var(--paper); border: 1px solid #e6eae7; border-radius: 12px; padding: 18px 20px 16px; box-shadow: 0 2px 5px #22392b06; animation: appear .25s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.post-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: #386850; background: #eaf1ec; font: 700 12px Manrope, sans-serif; }
.post-author { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; }
.post-author strong { font-size: 12px; font-weight: 700; }
.post-author span { color: #89938d; font-size: 10px; }
.post-time { margin-left: auto; align-self: start; color: #9aa39d; white-space: nowrap; font-size: 10px; }
.post-text { margin: 13px 0 0 46px; color: #36413b; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.post-source { margin: 8px 0 0 46px; color: #819087; font-size: 9px; }
.empty-state { min-height: 205px; border: 1px dashed #d5ddd7; border-radius: 13px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; font-size: 11px; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-icon { margin-bottom: 4px; color: #78a489; font-size: 25px; }
.side-column { display: grid; gap: 14px; }
.side-card { background: var(--paper); border: 1px solid #e5eae6; border-radius: 13px; padding: 22px; box-shadow: 0 2px 5px #22392b06; }
.side-card h2 { margin: 0 0 10px; font-size: 19px; }
.about-card > p:not(.eyebrow) { margin-bottom: 20px; color: #718078; font-size: 11px; line-height: 1.75; }
.privacy-note { padding: 10px 11px; border-radius: 8px; color: #4e775f; background: #f0f6f1; font-size: 10px; }
.privacy-note span { margin-right: 6px; }
.instructor-card { padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.panel-heading h2 { margin-bottom: 0; }
.panel-heading h3 { margin: 0 0 12px; font-size: 14px; }
.panel-heading.compact { margin-bottom: 10px; }
.icon-button, .dialog-close { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; color: #738078; background: transparent; font-size: 22px; line-height: 1; }
.icon-button:hover, .dialog-close:hover { background: #f0f3f0; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 17px 0 16px; }
.control-row .button-danger { grid-column: 1 / -1; }
.button { min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 700; transition: background .15s ease, border .15s ease; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: #325f47; background: #edf4ef; border-color: #e1ece4; }
.button-secondary:hover { background: #e3eee7; }
.button-danger { color: #8c4c4c; background: #fff; border-color: #eadfdf; }
.button-danger:hover { background: #fbf3f3; }
.button-quiet { min-height: 32px; color: #53635a; border-color: var(--line); background: white; }
.button-quiet:hover { background: #f6f8f6; }
.full-width { width: 100%; }
.field-label { display: block; margin: 12px 0 6px; color: #58665e; font-size: 10px; font-weight: 700; }
.input { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid #dfe5e0; border-radius: 7px; outline: none; color: var(--ink); background: #fff; font-size: 11px; }
.input:focus { border-color: #72a187; box-shadow: 0 0 0 3px #72a18720; }
.textarea { resize: vertical; line-height: 1.5; }
.divider { height: 1px; margin: 18px 0; background: #edf0ed; }
.script-list { display: grid; gap: 6px; margin-top: 10px; }
.script-item { display: flex; align-items: start; gap: 8px; padding: 9px; border: 1px solid #edf0ed; border-radius: 8px; }
.script-item-main { min-width: 0; flex: 1; }
.script-item-time { display: block; margin-bottom: 3px; color: #698375; font-size: 9px; font-weight: 700; }
.script-item-text { color: #536059; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.script-item-status { display: block; margin-top: 3px; color: #89948d; font-size: 9px; }
.delete-script { border: 0; border-radius: 5px; color: #8d9891; background: transparent; font-size: 14px; }
.delete-script:hover { color: var(--red); background: #fbf1f1; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0; cursor: pointer; }
.toggle-row span:first-child { display: grid; gap: 3px; }
.toggle-row strong { color: #39463f; font-size: 10px; }
.toggle-row small, .help-text { color: #89948d; font-size: 9px; line-height: 1.5; }
.toggle-row input { position: absolute; right: 0; opacity: 0; width: 34px; height: 20px; cursor: pointer; }
.toggle { position: relative; width: 34px; height: 20px; flex: 0 0 auto; border-radius: 20px; background: #dce2dd; transition: background .2s; }
.toggle:after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .2s; }
.toggle-row input:checked + .toggle { background: #39835d; }
.toggle-row input:checked + .toggle:after { transform: translateX(14px); }
.toggle-row input:focus-visible + .toggle { outline: 3px solid #72a18755; }
.help-text { margin: 7px 0; }
.network-note { margin-top: 16px; padding-top: 11px; border-top: 1px solid #edf0ed; }
.error-message { margin: 10px 0 0; padding: 9px; border-radius: 7px; color: #8d3c3c; background: #fcf0f0; font-size: 10px; line-height: 1.5; }
dialog { width: min(390px, calc(100% - 36px)); padding: 0; border: 1px solid #e3e8e4; border-radius: 14px; color: var(--ink); box-shadow: 0 20px 80px #11251a35; }
dialog::backdrop { background: #15251dcc; backdrop-filter: blur(2px); }
dialog form { position: relative; padding: 28px; }
dialog h2 { margin-bottom: 6px; font-size: 23px; }
.dialog-copy { margin-bottom: 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.dialog-close { position: absolute; top: 13px; right: 13px; }
dialog .button { margin-top: 17px; }
.reply-toggle { margin-top: 12px; padding: 0; border: 0; color: #4c7663; background: transparent; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.reply-toggle:hover { color: #1d694b; }
.reply-toggle:disabled { color: #89948d; cursor: default; }
.reply-list { display: grid; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #edf0ed; }
.reply-item { padding: 10px 12px; border-radius: 9px; background: #f7faf8; border: 1px solid #edf1ee; }
.reply-meta { color: #5f7269; font-size: 9px; font-weight: 700; }
.reply-text { margin: 6px 0 0; color: #3d4d45; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.reply-form { display: grid; gap: 8px; margin-top: 10px; }
.reply-textarea { min-height: 72px; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reply-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; color: #58665e; }
.reply-ai input { accent-color: #1d694b; }
.reply-form .button { min-height: 30px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 9px; color: white; background: #203b2e; box-shadow: 0 5px 20px #172d2240; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: .2s ease; font-size: 11px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }

@media (max-width: 840px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
  .side-card { padding: 18px; }
}
@media (max-width: 690px) {
  .topbar { height: 62px; padding: 0 16px; }
  .clock { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
  .elapsed-minutes { font-size: 9px; }
  .topbar-right { gap: 9px; }
  .layout { width: min(100% - 28px, 540px); margin: 25px auto 44px; grid-template-columns: 1fr; }
  .welcome { margin-bottom: 18px; }
  .subhead { max-width: 330px; font-size: 11px; }
  .side-column { grid-row: 1; }
  .about-card { display: none; }
  .instructor-card { order: 1; }
  .student-register-row { align-items: stretch; }
  .student-register-row .input { min-width: 0; flex: 1; }
  .student-compose-footer span { max-width: 55%; }
}
