:root {
  --primary: #07c160;
  --primary-hover: #2bd47d;
  --primary-active: #06ad56;
  --primary-soft: rgba(7, 193, 96, 0.08);
  --primary-glow: rgba(7, 193, 96, 0.18);
  --danger: #fa5151;
  --danger-soft: rgba(250, 81, 81, 0.08);
  --warning: #ffc300;
  --warning-soft: rgba(255, 195, 0, 0.1);
  --info: #10aeff;
  --page-bg: #f7f8fa;
  --surface: #fff;
  --border: #e5e7eb;
  --border-soft: #eef2f7;
  --text-title: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 10px 26px rgba(15, 23, 42, 0.1);
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-body);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.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;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  box-shadow: 0 5px 14px var(--primary-glow);
}

.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-copy strong { color: var(--text-title); font-size: 16px; line-height: 1.2; }
.brand-copy small { color: var(--text-muted); font-size: 11px; line-height: 1.2; }

.sync-pill, .user-pill, .auto-badge, .draft-badge, .record-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sync-pill { padding: 7px 11px; color: #078742; background: var(--primary-soft); }
.sync-dot, .user-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.sync-pill[data-state="online"] .sync-dot { box-shadow: 0 0 0 4px rgba(7, 193, 96, 0.12); }
.sync-pill[data-state="offline"] { color: #b45309; background: var(--warning-soft); }
.sync-pill[data-state="offline"] .sync-dot { background: var(--warning); }

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:not(:disabled):active { transform: translateY(1px); }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 5px 13px var(--primary-glow); }
.btn-primary:not(:disabled):hover { background: var(--primary-hover); }
.btn-secondary { color: var(--text-body); background: #fff; border-color: var(--border); }
.btn-secondary:not(:disabled):hover { border-color: #c9d1db; background: #fbfcfd; }
.btn-full { width: 100%; }
.btn-compact { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn-danger-solid { color: #fff; background: var(--danger); }

.btn-text {
  padding: 6px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font-size: 12px;
}
.btn-text:hover { color: var(--text-title); }
.btn-text.danger { color: var(--danger); }

.eyebrow {
  display: inline-block;
  color: #078742;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  color: #fff;
  background: rgba(17, 24, 39, 0.94);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast[data-type="error"] { background: rgba(207, 46, 46, 0.96); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Student page */
.student-page {
  background:
    radial-gradient(circle at 0 0, rgba(7, 193, 96, 0.09), transparent 32%),
    var(--page-bg);
}

.student-shell { width: min(900px, calc(100% - 40px)); margin: 34px auto 72px; }

.student-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 30px;
  color: #fff;
  background:
    linear-gradient(rgba(7, 193, 96, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 193, 96, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, #101c16, #0a0a0a 70%);
  background-size: 40px 40px, 40px 40px, auto;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  position: relative;
}

.student-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -100px;
  border-radius: 50%;
  background: rgba(7, 193, 96, 0.16);
  filter: blur(4px);
}

.student-hero > * { position: relative; z-index: 1; }
.student-hero .eyebrow { color: #67e8a0; }
.student-hero h1 { margin: 7px 0 7px; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; }
.student-hero p { max-width: 540px; margin: 0; color: rgba(255,255,255,.62); font-size: 13px; line-height: 1.65; }

.hero-stat {
  min-width: 114px;
  padding: 16px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
}
.hero-stat strong { display: block; font-size: 26px; }
.hero-stat span { color: rgba(255,255,255,.56); font-size: 11px; }

.board-section { margin-top: 32px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; color: var(--text-title); font-size: 18px; }
.section-heading p { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.auto-badge { padding: 5px 9px; color: #078742; background: var(--primary-soft); }

.empty-state {
  padding: 58px 28px;
  text-align: center;
  background: rgba(255,255,255,.76);
  border: 1px dashed #d7dde5;
  border-radius: var(--radius-lg);
}
.empty-state[hidden] { display: none; }
.empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 14px;
}
.empty-icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h3 { margin: 0; color: var(--text-title); font-size: 15px; }
.empty-state p { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; }

.prompt-list { display: grid; gap: 14px; }
.prompt-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.prompt-card.latest { border-color: rgba(7, 193, 96, 0.52); box-shadow: 0 6px 22px var(--primary-glow); }
.prompt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.prompt-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt-meta time { color: var(--text-faint); font-size: 11px; }
.prompt-number { color: var(--text-title); font-size: 13px; font-weight: 800; }
.latest-badge { padding: 3px 7px; color: #078742; background: var(--primary-soft); border-radius: 999px; font-size: 10px; font-weight: 800; }
.copy-button {
  min-height: 38px;
  padding: 0 15px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}
.copy-button:hover { background: var(--primary-hover); }
.copy-button.copied { background: #078742; }
.prompt-content, .history-content, .preview-wrap pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.prompt-content { padding: 22px 20px 24px; color: #1f2937; font-size: 14px; line-height: 1.82; user-select: text; }
.student-footer { width: min(900px, calc(100% - 40px)); display: flex; justify-content: space-between; margin: 0 auto 30px; color: var(--text-faint); font-size: 11px; }
.student-footer a:hover { color: var(--primary-active); }

/* Login */
.login-page {
  background:
    radial-gradient(circle at 0 0, rgba(7, 193, 96, 0.12), transparent 35%),
    radial-gradient(circle at 100% 100%, rgba(16, 174, 255, 0.1), transparent 40%),
    var(--page-bg);
}
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 0.9fr) minmax(520px, 1.1fr); }
.login-panel { display: grid; place-items: center; padding: 48px; }
.login-form-wrap { width: min(390px, 100%); }
.login-heading { margin: 64px 0 28px; }
.login-heading h1 { margin: 8px 0; color: var(--text-title); font-size: 30px; line-height: 1.2; }
.login-heading p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.65; }
.login-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field > span { color: var(--text-body); font-size: 12px; font-weight: 700; }
.field input, textarea {
  width: 100%;
  color: var(--text-title);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input { height: 44px; padding: 0 13px; }
.field input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.form-error { min-height: 18px; margin: -6px 0 0; color: var(--danger); font-size: 12px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-faint); font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.login-foot { display: flex; justify-content: space-between; margin-top: 28px; color: var(--text-faint); font-size: 11px; }
.login-foot a:hover { color: var(--primary-active); }

.login-showcase {
  min-height: calc(100vh - 32px);
  margin: 16px 16px 16px 0;
  display: grid;
  place-items: center;
  padding: 64px;
  color: #fff;
  background:
    linear-gradient(rgba(7, 193, 96, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 193, 96, 0.06) 1px, transparent 1px),
    linear-gradient(160deg, #0a0a0a, #1a1a1a);
  background-size: 48px 48px, 48px 48px, auto;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}
.showcase-glow { position: absolute; width: 440px; height: 440px; right: -150px; top: -180px; background: rgba(7,193,96,.17); filter: blur(50px); border-radius: 50%; }
.showcase-content { width: min(520px, 100%); position: relative; z-index: 1; }
.showcase-badge { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; }
.showcase-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px rgba(7,193,96,.13); }
.showcase-content h2 { margin: 24px 0 14px; font-size: clamp(34px, 4.2vw, 54px); line-height: 1.15; letter-spacing: -0.02em; }
.showcase-content > p { max-width: 460px; margin: 0; color: rgba(255,255,255,.5); font-size: 14px; line-height: 1.75; }
.chat-preview { display: grid; gap: 12px; margin-top: 46px; }
.chat-bubble { max-width: 350px; padding: 12px 15px; border-radius: 13px; font-size: 13px; line-height: 1.5; }
.chat-user { margin-left: auto; color: #fff; background: var(--primary); border-bottom-right-radius: 4px; }
.chat-system { display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); border-bottom-left-radius: 4px; }
.bubble-check { width: 22px; height: 22px; display: grid; place-items: center; color: var(--primary); background: rgba(7,193,96,.15); border-radius: 50%; font-weight: 900; }
.showcase-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 54px; }
.showcase-status div { padding: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); border-radius: 12px; }
.showcase-status strong, .showcase-status span { display: block; }
.showcase-status strong { font-size: 13px; }
.showcase-status span { margin-top: 4px; color: rgba(255,255,255,.4); font-size: 10px; }

/* Admin */
.admin-nav { display: flex; align-items: center; gap: 12px; }
.user-pill { padding: 7px 10px; color: var(--text-body); background: #f3f4f6; }
.admin-shell { width: min(1120px, calc(100% - 40px)); margin: 34px auto 70px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--text-faint); font-size: 11px; }
.breadcrumb a:hover { color: var(--primary); }
.admin-heading h1 { margin: 0; color: var(--text-title); font-size: 25px; }
.admin-heading p { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; }

.admin-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 120px 120px auto;
  align-items: center;
  gap: 0;
  margin-top: 24px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.summary-main { display: flex; align-items: center; gap: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.summary-main div, .summary-stat { display: grid; gap: 2px; }
.summary-main span, .summary-stat span { color: var(--text-muted); font-size: 10px; }
.summary-main strong { color: var(--text-title); font-size: 14px; }
.summary-stat { min-height: 34px; padding-left: 20px; border-left: 1px solid var(--border-soft); }
.summary-stat strong { color: var(--text-title); font-size: 17px; }
.summary-note { justify-self: end; }

.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-top: 16px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); }
.composer-panel, .guide-panel { padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2 { margin: 0; color: var(--text-title); font-size: 15px; }
.step-number { width: 25px; height: 25px; display: grid; place-items: center; color: #078742; background: var(--primary-soft); border-radius: 8px; font-size: 11px; font-weight: 900; }
.step-number.muted { color: #4f46e5; background: rgba(79,70,229,.08); }
.draft-badge { padding: 4px 8px; color: #b45309; background: var(--warning-soft); }

.composer-panel textarea { min-height: 230px; padding: 15px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.7; }
.textarea-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--text-faint); font-size: 10px; }
.preview-wrap { margin-top: 15px; border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; }
.preview-label { padding: 7px 11px; color: var(--text-muted); background: #fafbfc; border-bottom: 1px solid var(--border-soft); font-size: 10px; font-weight: 700; }
.preview-wrap pre { max-height: 220px; overflow: auto; padding: 13px; color: var(--text-body); font-size: 12px; line-height: 1.7; }
.publish-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.publish-row p { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text-muted); font-size: 10px; }
.publish-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.btn-publish { min-width: 132px; }

.compact-heading { justify-content: flex-start; }
.publish-guide { list-style: none; display: grid; gap: 17px; margin: 23px 0 26px; padding: 0; }
.publish-guide li { display: flex; align-items: center; gap: 11px; position: relative; }
.publish-guide li:not(:last-child)::after { content: ""; width: 1px; height: 16px; position: absolute; left: 13px; top: 29px; background: var(--border); }
.publish-guide li > span { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; color: var(--text-muted); background: #f3f4f6; border-radius: 50%; font-size: 10px; font-weight: 900; }
.publish-guide li.done > span { color: #078742; background: var(--primary-soft); }
.publish-guide li div { display: grid; gap: 2px; }
.publish-guide strong { color: var(--text-body); font-size: 12px; }
.publish-guide small { color: var(--text-faint); font-size: 10px; }
.student-preview-link { display: flex; align-items: center; justify-content: space-between; padding: 12px 13px; color: #078742; background: var(--primary-soft); border-radius: 10px; font-size: 11px; font-weight: 800; }

.history-panel, .archive-panel { margin-top: 16px; padding: 20px; }
.history-heading { align-items: start; }
.history-heading > div { display: block; }
.history-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 10px; }
.record-count { padding: 5px 9px; color: #4b5563; background: #f3f4f6; }
.admin-empty { padding: 38px; text-align: center; border: 1px dashed #d7dde5; border-radius: 12px; }
.admin-empty[hidden] { display: none; }
.admin-empty p { margin: 0; color: var(--text-title); font-size: 13px; font-weight: 700; }
.admin-empty span { display: block; margin-top: 5px; color: var(--text-faint); font-size: 10px; }
.history-list { display: grid; gap: 10px; }
.history-item { padding: 15px; border: 1px solid var(--border); border-radius: 12px; }
.history-item:first-child:not(.withdrawn) { border-color: rgba(7,193,96,.38); }
.history-item.withdrawn { opacity: .62; background: #fafafa; }
.history-item-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.history-item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-item-meta strong { color: var(--text-title); font-size: 12px; }
.history-item-meta time { color: var(--text-faint); font-size: 10px; }
.status-badge { padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.status-badge.published { color: #078742; background: var(--primary-soft); }
.status-badge.withdrawn { color: var(--danger); background: var(--danger-soft); }
.history-actions { display: flex; align-items: center; gap: 7px; }
.history-content { max-height: 220px; overflow: auto; margin-top: 12px; padding: 12px; color: var(--text-body); background: #fafbfc; border-radius: 9px; font-size: 11px; line-height: 1.65; }
.withdrawn .history-content { text-decoration: line-through; }
.updated-label { display: block; margin-top: 7px; color: var(--text-faint); font-size: 9px; }
.archive-list { display: grid; }
.archive-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--border-soft); }
.archive-row div { display: grid; gap: 3px; }
.archive-row strong { color: var(--text-body); font-size: 12px; }
.archive-row span { color: var(--text-faint); font-size: 10px; }
.archive-count { padding: 4px 8px; background: #f3f4f6; border-radius: 999px; }

/* Dialogs */
.modal { width: min(620px, calc(100vw - 32px)); padding: 0; background: transparent; border: 0; overflow: visible; }
.modal::backdrop { background: rgba(15,23,42,.42); backdrop-filter: blur(3px); }
.modal-card { padding: 22px; background: #fff; border-radius: 18px; box-shadow: 0 24px 70px rgba(15,23,42,.25); }
.modal-small { width: min(440px, 100%); margin: auto; text-align: center; }
.modal-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; text-align: left; }
.modal-heading h2 { margin: 5px 0 0; color: var(--text-title); font-size: 19px; }
.icon-button { width: 30px; height: 30px; padding: 0; color: var(--text-muted); background: #f3f4f6; border: 0; border-radius: 8px; font-size: 20px; line-height: 1; }
.modal-notice { margin: 14px 0; padding: 10px 12px; color: var(--text-muted); background: #f8fafc; border-radius: 9px; font-size: 11px; line-height: 1.6; text-align: left; }
.modal textarea { min-height: 220px; padding: 13px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.danger-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 13px; color: var(--danger); background: var(--danger-soft); border-radius: 14px; font-size: 19px; font-weight: 900; }
.modal-small > h2 { margin: 0; color: var(--text-title); font-size: 18px; }
.modal-small > p { margin: 9px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; }
.modal-small .field { margin-top: 17px; text-align: left; }

@media (max-width: 900px) {
  .login-shell { display: block; }
  .login-panel { min-height: 100vh; padding: 36px 24px; }
  .login-showcase { display: none; }
  .login-heading { margin-top: 54px; }
  .admin-layout { grid-template-columns: 1fr; }
  .guide-panel { display: none; }
  .admin-summary { grid-template-columns: 1fr 90px 90px; }
  .summary-note { display: none; }
}

@media (max-width: 640px) {
  .topbar { min-height: 64px; padding: 10px 16px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .brand-copy strong { font-size: 14px; }
  .student-topbar .brand-copy small { display: none; }
  .sync-pill { padding: 6px 8px; font-size: 10px; }
  .student-shell, .admin-shell { width: calc(100% - 24px); margin-top: 20px; }
  .student-hero { align-items: end; padding: 22px 19px; border-radius: 18px; }
  .student-hero p { font-size: 11px; }
  .hero-stat { min-width: 76px; padding: 12px 9px; }
  .hero-stat strong { font-size: 21px; }
  .hero-stat span { font-size: 9px; }
  .board-section { margin-top: 25px; }
  .prompt-card-head { align-items: start; padding: 13px; }
  .prompt-meta { gap: 5px; }
  .prompt-meta time { width: 100%; }
  .copy-button { min-height: 40px; }
  .prompt-content { padding: 18px 15px 20px; font-size: 13px; line-height: 1.75; }
  .student-footer { width: calc(100% - 28px); }

  .admin-nav .btn-secondary, .user-pill { display: none; }
  .admin-heading { align-items: start; }
  .admin-heading h1 { font-size: 21px; }
  .admin-heading p { max-width: 230px; line-height: 1.55; }
  .admin-heading > .btn { min-height: 36px; padding: 0 11px; font-size: 11px; }
  .admin-summary { grid-template-columns: 1fr 64px 64px; padding: 12px; }
  .summary-main { gap: 9px; }
  .summary-stat { padding-left: 12px; }
  .composer-panel, .history-panel, .archive-panel { padding: 15px; }
  .panel-heading { align-items: start; }
  .draft-badge { font-size: 9px; }
  .composer-panel textarea { min-height: 250px; }
  .publish-row { align-items: stretch; flex-direction: column; }
  .publish-row p { justify-content: center; }
  .btn-publish { width: 100%; min-height: 46px; }
  .history-item-head { align-items: start; }
  .history-item-meta time { width: 100%; }
  .history-content { max-height: 280px; }
  .modal-card { padding: 18px; }
}

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