/*
 * Wooshin Tutor — unified interface redesign
 * Loaded after the functional core stylesheet and owns all product visuals.
 * Visual direction: calm, modern student workspace / mobile-first.
 */

:root {
  --ui-brand: #5b5bd6;
  --ui-brand-strong: #4747bd;
  --ui-brand-soft: #eeeeff;
  --ui-mint: #14a894;
  --ui-mint-soft: #e9faf7;
  --ui-coral: #f47458;
  --ui-amber: #f5ad36;
  --ui-danger: #e5484d;
  --ui-success: #16a36a;
  --ui-ink: #182230;
  --ui-text: #344054;
  --ui-muted: #667085;
  --ui-subtle: #98a2b3;
  --ui-line: #e4e7ec;
  --ui-line-strong: #d0d5dd;
  --ui-canvas: #f6f7fb;
  --ui-canvas-blue: #f2f4ff;
  --ui-surface: #ffffff;
  --ui-surface-soft: #fafbff;
  --ui-radius-xs: 8px;
  --ui-radius-sm: 12px;
  --ui-radius-md: 16px;
  --ui-radius-lg: 22px;
  --ui-radius-xl: 28px;
  --ui-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --ui-shadow-sm: 0 7px 20px rgba(16, 24, 40, 0.06);
  --ui-shadow-md: 0 18px 42px rgba(16, 24, 40, 0.10);
  --ui-shadow-brand: 0 12px 28px rgba(91, 91, 214, 0.22);
  --ui-content: 1180px;
  --ui-header-h: 76px;

  --blue: var(--ui-brand);
  --blue-dark: var(--ui-brand-strong);
  --blue-soft: var(--ui-brand-soft);
  --green: var(--ui-success);
  --red: var(--ui-danger);
  --amber: var(--ui-amber);
  --ink: var(--ui-ink);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --line-strong: var(--ui-line-strong);
  --bg: var(--ui-canvas);
  --card: var(--ui-surface);
  --shadow: var(--ui-shadow-md);
  --shadow-soft: var(--ui-shadow-sm);
  --campus-green: var(--ui-brand);
  --campus-green-deep: var(--ui-brand-strong);
  --campus-green-soft: var(--ui-brand-soft);
  --campus-blue: var(--ui-brand);
  --campus-blue-deep: var(--ui-brand-strong);
  --campus-blue-soft: var(--ui-brand-soft);
  --campus-ink: var(--ui-ink);
  --campus-text: var(--ui-text);
  --campus-muted: var(--ui-muted);
  --campus-paper: var(--ui-surface);
  --campus-bg: var(--ui-canvas);
  --campus-line: var(--ui-line);
  --campus-line-strong: var(--ui-line-strong);
  --campus-shadow: var(--ui-shadow-sm);
  --campus-shadow-raised: var(--ui-shadow-md);
  --workspace-blue: var(--ui-brand);
  --workspace-blue-dark: var(--ui-brand-strong);
  --workspace-blue-soft: var(--ui-brand-soft);
  --workspace-ink: var(--ui-ink);
  --workspace-muted: var(--ui-muted);
  --workspace-line: var(--ui-line);
  --workspace-line-soft: #eef0f5;
  --content-width: var(--ui-content);
}

html {
  min-width: 320px;
  background: var(--ui-canvas);
  color-scheme: light;
  scroll-padding-top: calc(var(--ui-header-h) + 20px);
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 7% -8%, rgba(91, 91, 214, 0.10), transparent 29rem),
    radial-gradient(circle at 95% 18%, rgba(20, 168, 148, 0.08), transparent 28rem),
    var(--ui-canvas);
  color: var(--ui-text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.012em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(91, 91, 214, 0.18);
  color: var(--ui-ink);
}

button,
input,
select,
textarea,
summary {
  font: inherit;
}

button,
a,
summary,
[role="button"],
[role="link"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[role="link"][tabindex="0"]:focus-visible,
[role="button"][tabindex="0"]:focus-visible {
  outline: 3px solid rgba(91, 91, 214, 0.22);
  outline-offset: 2px;
}

/* App frame */
.app-shell {
  min-height: 100dvh;
  padding-bottom: 72px;
  background: transparent;
}

.container {
  width: min(var(--ui-content), calc(100% - 40px));
  margin-inline: auto;
  padding: 34px 0 72px;
}

.app-shell:not(.is-mounted),
.auth-wrap:not(.is-mounted) {
  opacity: 0;
}

.app-shell.is-mounted,
.auth-wrap.is-mounted {
  opacity: 1;
  transition: opacity 180ms ease;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: auto;
  border: 0;
  border-bottom: 1px solid rgba(228, 231, 236, 0.88);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ui-brand), var(--ui-mint));
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(175px, auto) minmax(360px, 1fr) minmax(250px, auto);
  align-items: center;
  width: min(calc(var(--ui-content) + 40px), calc(100% - 40px));
  min-height: var(--ui-header-h);
  margin-inline: auto;
  gap: 24px;
  padding: 10px 0;
}

.brand,
.topbar .brand,
.topbar .brand:hover,
.topbar .brand:focus-visible {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  gap: 11px;
  border: 0;
  border-radius: var(--ui-radius-sm);
  background: transparent;
  color: var(--ui-ink);
  padding: 4px 8px 4px 2px;
  box-shadow: none;
  text-align: left;
}

.topbar .brand:hover {
  background: var(--ui-surface-soft);
}

.brand::after {
  display: none;
}

.brand-icons {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.brand img,
.brand-logo,
.topbar .brand .brand-logo.tutor-logo,
.topbar .brand .brand-logo.school-logo {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  margin: auto;
  object-fit: contain;
}

.brand-title {
  position: relative;
  display: block;
  min-width: 102px;
  height: 42px;
  overflow: hidden;
}

.brand-title-main,
.brand-title-school {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  width: 100%;
  height: 42px;
  color: var(--ui-ink);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.brand-title-school {
  color: var(--ui-brand);
  font-size: 16px;
}

.primary-nav,
.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav button,
.primary-nav button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 42px;
  gap: 7px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ui-muted);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav button:hover,
.primary-nav button:hover {
  background: #f4f4fb;
  color: var(--ui-brand);
}

.nav button.active,
.nav button.active:hover,
.primary-nav button.active,
.primary-nav button.active:hover {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.nav button.active::after,
.primary-nav button.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -11px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--ui-brand);
}

.nav .icon,
.primary-nav .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.15;
}

.topbar-right,
.topbar-actions,
.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
}

.topbar-ask-cta,
.topbar-mini,
.topbar-notice-button,
.profile-pill,
.mobile-logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: 7px;
  border-radius: 12px;
  font-weight: 780;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.topbar-ask-cta {
  border: 1px solid var(--ui-brand);
  background: var(--ui-brand);
  color: #fff;
  padding: 0 14px;
  box-shadow: 0 7px 18px rgba(91, 91, 214, 0.20);
}

.topbar-ask-cta:hover {
  background: var(--ui-brand-strong);
  box-shadow: var(--ui-shadow-brand);
  transform: translateY(-1px);
}

.topbar-mini {
  border: 1px solid var(--ui-line);
  background: #fff;
  color: var(--ui-text);
  padding: 0 12px;
}

.topbar-mini:hover {
  border-color: #b9b9ef;
  color: var(--ui-brand);
}

.topbar-notice-button {
  position: relative;
  width: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--ui-line);
  background: #fff;
  color: var(--ui-muted);
}

.topbar-notice-button:hover {
  border-color: #c8c8f4;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

.topbar-notice-button > span {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--ui-coral);
  color: #fff;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 900;
}

.profile-pill,
.guest-login-pill {
  max-width: 190px;
  border: 1px solid var(--ui-line);
  background: #fff;
  color: var(--ui-text);
  padding: 4px 10px 4px 5px;
}

.profile-pill:hover,
.guest-login-pill:hover {
  border-color: #c8c8f4;
  background: var(--ui-surface-soft);
  color: var(--ui-brand);
}

.profile-pill .avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.account-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mobile-logout-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.mobile-logout-button span {
  display: none;
}

/* Page title system */
.workspace-page,
.workspace-subpage,
.detail,
.quiz-editor-wide,
.profile-page,
.admin-workspace,
.notes-workspace,
.community-workspace,
.questions-workspace,
.ask-workspace {
  display: grid;
  gap: 24px;
}

.workspace-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 126px;
  gap: 24px;
  overflow: hidden;
  border: 1px solid rgba(91, 91, 214, 0.12);
  border-radius: var(--ui-radius-xl);
  background:
    radial-gradient(circle at 82% 22%, rgba(20, 168, 148, 0.16), transparent 17rem),
    linear-gradient(135deg, #ffffff 0%, #f6f5ff 58%, #f2fbfa 100%);
  padding: 28px 30px;
  box-shadow: var(--ui-shadow-sm);
}

.workspace-head::after {
  content: "";
  position: absolute;
  right: 34px;
  top: 22px;
  width: 74px;
  height: 74px;
  border: 14px solid rgba(91, 91, 214, 0.07);
  border-radius: 26px;
  transform: rotate(15deg);
  pointer-events: none;
}

.workspace-title-block {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 720px;
  gap: 7px;
}

.workspace-kicker,
.eyebrow,
.crawler-kicker,
.home-task-label {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  color: var(--ui-brand);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.workspace-title-block h1,
.workspace-title-block h2,
.workspace-head h1,
.workspace-head h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.workspace-title-block p,
.workspace-head p {
  max-width: 700px;
  margin: 0;
  color: var(--ui-muted);
  font-size: 15px;
  line-height: 1.65;
}

.workspace-head-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-section-head,
.section-title,
.compact-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 0;
  gap: 14px;
  margin: 0;
}

.workspace-section-head > div,
.section-title > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workspace-section-head h2,
.section-title h2,
.panel h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 19px;
  font-weight: 860;
  line-height: 1.35;
  letter-spacing: -0.035em;
}

.workspace-section-head p,
.section-title p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Universal surfaces */
.panel,
.workspace-content-section,
.question-card,
.answer-card,
.notice-card,
.auth-card,
.tutorial-modal,
.document-viewer-modal,
.admin-pdf-modal,
.event-metric-card,
.inventory-card,
.profile-section-card,
.quiz-start-card,
.post-quiz-gate,
.community-join-gate,
.ask-step-card,
.insert-panel,
.login-required-panel {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--ui-shadow-xs);
}

.panel,
.workspace-content-section,
.profile-section-card,
.login-required-panel {
  padding: 22px;
}

.panel:hover,
.question-card:hover,
.notice-card:hover,
.workspace-content-section:hover {
  border-color: #d8d9ef;
}

.workspace-content-section {
  display: grid;
  min-width: 0;
  gap: 17px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two,
.split {
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-head,
.detail-title,
.public-hidden-head,
.study-room-head,
.insert-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
}

.meta,
.badges,
.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.meta {
  color: var(--ui-muted);
  font-size: 12px;
}

.muted {
  color: var(--ui-muted) !important;
}

.mini {
  font-size: 13px;
}

.tiny {
  font-size: 11px;
}

.badge,
.chip,
.question-status-label,
.shop-status-badge,
.document-type,
.level-badge,
.professional-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  gap: 5px;
  border: 1px solid var(--ui-line);
  border-radius: 999px;
  background: #f8f9fc;
  color: var(--ui-muted);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
}

.badge.waiting,
.badge.status-waiting,
.question-status-label.waiting {
  border-color: #f5d69d;
  background: #fff8e8;
  color: #a76600;
}

.badge.done,
.badge.status-done,
.badge.selected,
.question-status-label.done {
  border-color: #afe5d3;
  background: var(--ui-mint-soft);
  color: #087665;
}

.badge.reserved,
.badge.status-reserved {
  border-color: #c9c8f6;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.empty {
  display: grid;
  gap: 6px;
  border: 1px dashed #cfd4df;
  border-radius: var(--ui-radius-md);
  background: #fbfcfe;
  color: var(--ui-muted);
  padding: 24px;
  text-align: center;
}

.empty strong {
  color: var(--ui-text);
}

.compact-empty {
  padding: 16px;
  text-align: left;
}

/* Buttons */
.primary,
.success,
.danger,
.ghost,
.small-button,
.chip,
.choice-btn,
.media-button,
.icon-ghost,
.square-control,
.icon-only,
.document-button,
.quiz-start-button,
.compose-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  gap: 7px;
  border-radius: 12px;
  padding: 0 15px;
  font-weight: 790;
  line-height: 1.1;
  text-align: center;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.primary,
.compose-submit,
.quiz-start-button {
  border: 1px solid var(--ui-brand);
  background: var(--ui-brand);
  color: #fff;
  box-shadow: 0 7px 17px rgba(91, 91, 214, 0.17);
}

.primary:hover,
.compose-submit:hover,
.quiz-start-button:hover {
  border-color: var(--ui-brand-strong);
  background: var(--ui-brand-strong);
  color: #fff;
  box-shadow: var(--ui-shadow-brand);
  transform: translateY(-1px);
}

.success {
  border: 1px solid var(--ui-success);
  background: var(--ui-success);
  color: #fff;
}

.danger {
  border: 1px solid var(--ui-danger);
  background: var(--ui-danger);
  color: #fff;
}

.ghost,
.small-button,
.chip,
.choice-btn,
.icon-ghost,
.square-control,
.icon-only,
.document-button {
  border: 1px solid var(--ui-line-strong);
  background: #fff;
  color: var(--ui-text);
  box-shadow: none;
}

.ghost:hover,
.small-button:hover,
.chip:hover,
.choice-btn:hover,
.icon-ghost:hover,
.square-control:hover,
.icon-only:hover,
.document-button:hover {
  border-color: #bfc0ee;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.chip.active,
.choice-btn.active,
.tabs button.active,
.workspace-tabs button.active,
.feed-tab-row button.active,
.note-tabs button.active,
.admin-section-tabs button.active,
.community-section-tabs button.active {
  border-color: var(--ui-brand);
  background: var(--ui-brand);
  color: #fff;
}

.icon-only,
.square-control,
.icon-ghost {
  width: 43px;
  min-width: 43px;
  padding: 0;
}

.primary .icon,
.ghost .icon,
.small-button .icon,
.chip .icon,
.icon-ghost .icon,
.square-control .icon,
.icon-only .icon {
  width: 16px;
  height: 16px;
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none !important;
}

/* Forms */
.form,
.compact-form,
.field-block,
.dialog-field,
.admin-user-search,
.user-edit-form {
  display: grid;
  gap: 10px;
}

.field-block > label,
.dialog-field > label,
.form > label,
.compact-form > label,
.community-mobile-picker label {
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 820;
}

.input,
.textarea,
.select,
.search-field,
.home-search-form,
.compose-textarea,
.big-input,
.compact-textarea {
  width: 100%;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--ui-ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.input,
.select {
  min-height: 46px;
  padding: 11px 13px;
}

.textarea,
.compose-textarea,
.big-input,
.compact-textarea {
  min-height: 118px;
  padding: 13px 14px;
  resize: vertical;
}

.input:hover,
.textarea:hover,
.select:hover,
.compose-textarea:hover,
.search-field:hover {
  border-color: #b9bfca;
}

.input:focus,
.textarea:focus,
.select:focus,
.compose-textarea:focus,
.search-field:focus-within,
.home-search-form:focus-within {
  border-color: var(--ui-brand);
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.11);
}

.input::placeholder,
.textarea::placeholder,
.compose-textarea::placeholder {
  color: var(--ui-subtle);
}

.search-field,
.home-search-form {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 9px;
  padding: 0 12px;
}

.search-field input,
.home-search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ui-ink);
  outline: 0;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.form-actions,
.media-actions,
.home-actions,
.home-primary-actions,
.question-followup-actions,
.auto-answer-dataset-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.tabs,
.workspace-tabs,
.note-tabs,
.feed-tab-row,
.community-section-tabs,
.admin-section-tabs,
.profile-navigation-shell {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #f6f7fa;
  padding: 5px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar,
.workspace-tabs::-webkit-scrollbar,
.note-tabs::-webkit-scrollbar,
.feed-tab-row::-webkit-scrollbar,
.community-section-tabs::-webkit-scrollbar,
.admin-section-tabs::-webkit-scrollbar,
.profile-navigation-shell::-webkit-scrollbar {
  display: none;
}

.tabs button,
.workspace-tabs button,
.note-tabs button,
.feed-tab-row button,
.community-section-tabs button,
.admin-section-tabs button,
.profile-primary-tabs button,
.profile-more-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ui-muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.tabs button:hover,
.workspace-tabs button:hover,
.note-tabs button:hover,
.feed-tab-row button:hover,
.community-section-tabs button:hover,
.admin-section-tabs button:hover,
.profile-primary-tabs button:hover,
.profile-more-menu summary:hover {
  background: #fff;
  color: var(--ui-brand);
}

/* Responsive event banner */
.site-event-banner {
  width: min(var(--ui-content), calc(100% - 32px));
  margin: 16px auto 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ui-shadow-md);
}

.event-banner-main {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 1;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: #f3f4fb;
  padding: 0;
}

.event-banner-main img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.event-banner-actions {
  display: flex;
  min-height: 48px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  border-top: 1px solid var(--ui-line);
  background: #fff;
  padding: 7px 10px;
}

.event-banner-actions .event-banner-dismiss {
  min-height: 34px;
  border-color: var(--ui-line);
  background: var(--ui-surface-soft);
}

/* Every admin destination stays visible without horizontal discovery. */
.admin-section-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: visible;
}

.admin-section-tabs button {
  width: 100%;
  min-width: 0;
  white-space: normal;
}

/* Home */
.home-task-board {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.home-primary-task,
.home-today-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-xl);
  background: #fff;
  padding: 27px;
  box-shadow: var(--ui-shadow-sm);
}

.home-primary-task {
  border-color: rgba(91, 91, 214, 0.16);
  background:
    radial-gradient(circle at 95% 5%, rgba(91, 91, 214, 0.13), transparent 16rem),
    linear-gradient(145deg, #fff 0%, #fafaff 100%);
}

.home-primary-task::before {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -58px;
  width: 180px;
  height: 180px;
  border: 30px solid rgba(20, 168, 148, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.home-primary-task h2 {
  position: relative;
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.045em;
}

.home-primary-task p {
  position: relative;
  max-width: 650px;
  margin: 0;
  color: var(--ui-muted);
}

.home-primary-actions,
.home-search-form {
  position: relative;
  z-index: 1;
}

.home-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 0;
  background: transparent;
  padding: 0;
}

.home-search-form .search-field,
.home-search-form > label {
  min-height: 48px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 13px;
  background: #fff;
}

.home-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.home-side-stack,
.home-context-list,
.home-community-list,
.home-question-list,
.home-today-list {
  display: grid;
  gap: 10px;
}

.home-context-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-context-item,
.home-community-row,
.home-notice-row {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #fbfcfe;
  color: inherit;
  padding: 13px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.home-context-item:hover,
.home-community-row:hover,
.home-notice-row:hover {
  border-color: #c9c9f1;
  background: var(--ui-brand-soft);
  transform: translateY(-1px);
}

/* Questions */
.question-list,
.answer-list,
.notice-list,
.admin-user-list,
.log-list,
.profile-activity-list {
  display: grid;
  gap: 10px;
}

.question-row,
.compact-question-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: #fff;
  padding: 16px 17px;
  box-shadow: var(--ui-shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.question-row:hover,
.compact-question-row:hover {
  border-color: #c8c8ef;
  box-shadow: var(--ui-shadow-sm);
  transform: translateY(-1px);
}

.question-row-main,
.question-row-status,
.question-row-count {
  min-width: 0;
}

.question-row-main h3,
.question-card h3,
.notice-card strong,
.answer-card strong {
  margin: 0;
  color: var(--ui-ink);
  font-weight: 830;
  line-height: 1.45;
}

.question-card,
.answer-card,
.notice-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 17px;
}

.question-card[role="link"],
.notice-card[role="link"],
.question-row[role="link"],
.profile-row-card[role="link"] {
  cursor: pointer;
}

.question-detail-heading,
.question-detail-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.question-detail-title-copy {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.question-detail-title-copy h1 {
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(25px, 4vw, 36px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.045em;
}

.content-box {
  color: var(--ui-text);
  white-space: pre-wrap;
  line-height: 1.78;
}

.question-image,
.image-preview img,
.note-preview-card img,
.quiz-question-image {
  max-width: 100%;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #fff;
  object-fit: cover;
}

.question-image-action {
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
}

.question-image-action span {
  border-radius: 10px;
  background: rgba(24, 34, 48, 0.84);
  backdrop-filter: blur(6px);
}

.question-followup-form,
.ai-followup-guide,
.ai-solution-section {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: #fbfcff;
  padding: 18px;
}

.ask-step-card {
  display: grid;
  gap: 16px;
  padding: 21px;
}

.ask-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ask-step-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
}

.choice-grid,
.subject-grid,
.category-grid,
.answer-type-grid,
.course-grid,
.unit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.media-button {
  min-height: 64px;
  border: 1px dashed #b8b9e8;
  background: #f9f9ff;
  color: var(--ui-brand);
}

.media-button:hover {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
}

.ask-submit-bar {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--ui-shadow-md);
  backdrop-filter: blur(14px);
}

/* Question composer: optional settings stay quiet until they are needed. */
.ask-form .ask-advanced-fields {
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
  padding: 0;
  box-shadow: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.ask-form .ask-advanced-fields[open] {
  display: block;
  border-color: #b9d0ff;
  background: #fbfcfe;
}

.ask-form .ask-advanced-fields > summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 12px;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 15px;
  background: #fff;
  color: #263449;
  cursor: pointer;
  list-style: none;
}

.ask-form .ask-advanced-fields > summary::-webkit-details-marker {
  display: none;
}

.ask-form .ask-advanced-fields > summary > .icon {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #eef4ff;
  color: #1769ff;
  padding: 10px;
}

.ask-form .ask-advanced-fields > summary > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.ask-form .ask-advanced-fields > summary strong {
  color: #1d2939;
  font-size: 15px;
  line-height: 1.35;
}

.ask-form .ask-advanced-fields > summary small {
  max-width: none;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
}

.ask-form .ask-advanced-fields > summary::after,
.quiz-card-more > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 150ms ease;
}

.ask-form .ask-advanced-fields[open] > summary {
  border-bottom: 1px solid #dfe7f3;
  background: #f6f9ff;
  color: #1259c3;
}

.ask-form .ask-advanced-fields[open] > summary::after,
.quiz-card-more[open] > summary::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.ask-form .ask-advanced-fields > summary:focus-visible,
.quiz-card-more > summary:focus-visible {
  outline: 3px solid rgba(23, 105, 255, 0.22);
  outline-offset: -3px;
}

.ask-form .ask-advanced-fields > .field-block {
  display: grid;
  gap: 10px;
  margin: 0 16px;
  padding: 16px 0;
}

.ask-form .ask-advanced-fields > .field-block + .field-block {
  border-top: 1px solid #e7ebf1;
}

.ask-form .ask-advanced-fields > .field-block > strong {
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
}

.ask-form .ask-advanced-fields .choice-grid {
  gap: 8px;
}

.ask-form .ask-advanced-fields .choice-btn {
  min-height: 44px;
  border-radius: 8px;
}

.ask-form .ask-advanced-fields .ask-optional-copy {
  margin: 0 16px 16px;
  border-top: 1px solid #e7ebf1;
  padding: 16px 0 0;
}

/* Quiz */
.quiz-code-entry,
.quiz-help,
.quiz-start,
.quiz-play,
.quiz-result,
.quiz-review,
.quiz-live-stage,
.korean-quiz-app,
.wordmaster-shell {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-xl);
  background: #fff;
  box-shadow: var(--ui-shadow-sm);
}

.quiz-code-entry,
.quiz-help,
.quiz-start,
.quiz-result,
.quiz-review,
.korean-quiz-app,
.wordmaster-shell {
  padding: 24px;
}

.quiz-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: #fff;
  padding: 18px;
  box-shadow: var(--ui-shadow-xs);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.quiz-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--ui-brand), var(--ui-mint));
}

.quiz-card:hover {
  border-color: #c7c7ed;
  box-shadow: var(--ui-shadow-sm);
  transform: translateY(-2px);
}

/* Quiz card actions expand in place, so controls never cover card content. */
.quiz-card-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.quiz-card-actions > .quiz-card-more {
  grid-column: 1 / -1;
}

.quiz-card-more {
  position: static;
  display: block;
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.quiz-card-more[open] {
  border-color: #b9d0ff;
  background: #f6f9ff;
}

.quiz-card-more > summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 10px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #475467;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.quiz-card-more > summary .icon {
  width: 17px;
  height: 17px;
}

.quiz-card-more > summary span {
  display: block;
}

.quiz-card-more[open] > summary {
  color: #1259c3;
}

.quiz-card-more > div {
  position: static;
  inset: auto;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  border: 0;
  border-top: 1px solid #dfe7f3;
  border-radius: 0;
  background: #fff;
  padding: 8px;
  box-shadow: none;
  animation: compact-details-in 150ms ease both;
}

.quiz-card-more > div > button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  justify-content: center;
  border-radius: 7px;
}

.quiz-card-more > div > button:only-child,
.quiz-card-more > div > button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

@keyframes compact-details-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quiz-answer {
  min-height: 62px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 15px;
  background: #fff;
  color: var(--ui-text);
  padding: 12px 14px;
  font-weight: 760;
  text-align: left;
}

.quiz-answer:hover {
  border-color: #bfc0ef;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.quiz-answer.selected,
.quiz-answer.correct {
  border-color: var(--ui-mint);
  background: var(--ui-mint-soft);
  color: #087665;
}

.quiz-play-top,
.quiz-progress,
.quiz-stage-meta,
.quiz-live-control-row,
.korean-quiz-toolbar,
.korean-quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quiz-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef4;
}

.quiz-progress > span,
.quiz-progress > i {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ui-brand), var(--ui-mint));
}

.quiz-timer,
.quiz-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7d7f6;
  border-radius: 12px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
  padding: 8px 11px;
  font-weight: 900;
}

/* Community */
.community-hero,
.community-board-browser,
.community-feed,
.community-study-room,
.post-detail-card,
.minimal-compose {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: #fff;
  box-shadow: var(--ui-shadow-xs);
}

.community-board-browser:not(.is-open) {
  display: none;
}

.community-board-browser.is-open {
  display: block;
}

.community-mobile-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.community-mobile-picker label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.community-mobile-picker .icon-only {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
}

.community-hero,
.community-board-browser,
.community-study-room,
.minimal-compose {
  padding: 20px;
}

.community-board-card,
.enhanced-board-row,
.community-post-card,
.study-seat,
.study-rank,
.desk-note {
  border: 1px solid var(--ui-line);
  border-radius: 15px;
  background: #fff;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.community-board-card:hover,
.enhanced-board-row:hover,
.community-post-card:hover {
  border-color: #c8c8ef;
  background: #fcfcff;
  transform: translateY(-1px);
}

.community-post-card,
.enhanced-board-row,
.study-seat,
.study-rank,
.desk-note {
  padding: 15px;
}

.community-board-browser.is-open {
  box-shadow: var(--ui-shadow-sm);
}

.class-board-note {
  border-radius: 3px 3px 12px 3px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.14);
}

/* Profile */
.profile-page .profile-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-xl);
  background: #fff;
  padding: 0;
  box-shadow: var(--ui-shadow-sm);
}

.profile-cover-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: normal;
  gap: 18px;
  overflow: hidden;
  border-right: 1px solid var(--ui-line);
  background: #f8faff;
  padding: 24px;
}

.profile-cover-main::after {
  display: none;
}

.profile-identity {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 17px;
}

.profile-edit-button {
  position: relative;
  z-index: 1;
  justify-self: end;
}

.profile-identity .avatar,
.profile-cover .avatar {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border: 4px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.profile-stat-grid,
.stats,
.compact-stats,
.workspace-metrics,
.activity-stats,
.tutor-summary-metrics,
.korean-quiz-stats,
.wordmaster-stat-grid,
.profile-shop-summary,
.event-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-page .profile-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: auto;
  max-width: none;
  align-self: center;
  justify-self: stretch;
  margin: 20px;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
}

.profile-page .profile-stat-grid > div {
  justify-items: start;
  border: 0;
  border-right: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.profile-page .profile-stat-grid > div:last-child {
  border-right: 0;
}

.profile-stat-grid > div,
.stat,
.workspace-metrics > div,
.activity-stats > div,
.tutor-summary-metrics > div,
.korean-quiz-stats > div,
.profile-shop-summary > div,
.event-metric-card {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 13px;
}

.profile-stat-grid strong,
.stat strong,
.workspace-metrics strong,
.activity-stats strong,
.tutor-summary-metrics strong,
.profile-shop-summary strong {
  color: var(--ui-ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
}

.profile-stat-grid span,
.stat span,
.workspace-metrics span,
.activity-stats span,
.tutor-summary-metrics span,
.profile-shop-summary span {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 760;
}

.profile-page .profile-stat-grid span {
  overflow: visible;
  width: auto;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

.profile-page .profile-cover.has-profile-banner {
  gap: 12px;
  padding: 16px;
}

.profile-page .profile-cover.has-profile-banner .profile-cover-main {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
}

.profile-page .profile-cover.has-profile-banner .profile-stat-grid {
  margin: 0;
}

.profile-navigation-shell {
  position: relative;
  z-index: 5;
  align-items: center;
  margin-top: -1px;
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--ui-line);
  border-radius: 0;
  background: #fff;
  padding: 8px 12px;
}

.profile-primary-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
}

.profile-primary-tabs button.active,
.profile-more-menu summary.active {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.profile-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.profile-more-menu > summary {
  cursor: pointer;
  list-style: none;
}

.profile-more-menu > summary::-webkit-details-marker {
  display: none;
}

.profile-more-menu[open] {
  z-index: 40;
}

.profile-more-menu[open] > summary {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.profile-more-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  display: grid;
  width: 320px;
  max-height: min(420px, 60vh);
  overflow-y: auto;
  gap: 10px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  box-shadow: var(--ui-shadow-md);
}

.profile-more-group {
  display: grid;
  gap: 4px;
}

.profile-more-group + .profile-more-group {
  border-top: 1px solid var(--ui-line);
  padding-top: 9px;
}

.profile-more-group > strong {
  color: var(--ui-subtle);
  padding: 2px 8px;
  font-size: 11px;
}

.profile-more-group > div {
  display: grid;
  gap: 2px;
}

.profile-more-group button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-text);
  padding: 8px 10px;
  text-align: left;
}

.profile-more-group button:hover,
.profile-more-group button.active {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.profile-more-group button > .icon:last-child {
  width: 15px;
  height: 15px;
  color: var(--ui-subtle);
}

.profile-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-shortcut-card,
.profile-community-card,
.trophy-card,
.inventory-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: #fff;
  color: inherit;
  padding: 15px;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.profile-shortcut-card:hover,
.profile-community-card:hover,
.trophy-card:hover,
.inventory-card:hover {
  border-color: #c8c8ef;
  box-shadow: var(--ui-shadow-sm);
  transform: translateY(-1px);
}

.profile-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

/* Notes, shop, tutor, admin */
.note-card,
.note-preview-card,
.shop-item,
.shop-banner-card,
.admin-user-card,
.admin-priority-item,
.tutor-motivation-card,
.reward-box,
.auto-answer-dataset,
.server-status,
.storage-meter,
.log-row {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: #fff;
  box-shadow: var(--ui-shadow-xs);
}

.note-card,
.note-preview-card,
.shop-item,
.shop-banner-card,
.admin-user-card,
.admin-priority-item,
.tutor-motivation-card,
.reward-box,
.auto-answer-dataset,
.server-status,
.storage-meter {
  padding: 16px;
}

.note-card:hover,
.shop-item:hover,
.shop-banner-card:hover,
.admin-user-card:hover,
.admin-priority-item:hover {
  border-color: #c8c8ef;
}

.note-workspace-layout,
.shop-layout,
.admin-workspace-layout,
.tutor-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.admin-panel-grid,
.reward-box-grid,
.inventory-grid,
.shop-grid,
.trophy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-priority-item {
  position: relative;
  overflow: hidden;
}

.admin-priority-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--ui-brand);
}

.table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.table th,
.table td {
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  padding: 12px 13px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.table th {
  background: #f7f8fb;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.03em;
}

.table tr:last-child td {
  border-bottom: 0;
}

/* Auth / dialogs / viewer */
.auth-wrap {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(91, 91, 214, 0.16), transparent 26rem),
    radial-gradient(circle at 88% 82%, rgba(20, 168, 148, 0.13), transparent 26rem),
    var(--ui-canvas);
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  box-shadow: var(--ui-shadow-md);
}

.auth-card .brand {
  margin-bottom: 18px;
}

.auth-invite-notice {
  border: 1px solid #c9c8f5;
  border-radius: 13px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
  padding: 12px 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  background: rgba(16, 24, 40, 0.46);
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tutorial-modal,
.document-viewer-modal,
.admin-pdf-modal {
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.24);
}

.tutorial-modal {
  width: min(440px, 100%);
  padding: 23px;
}

.document-viewer-modal {
  width: min(1160px, 100%);
  height: min(860px, calc(100dvh - 40px));
  padding: 14px;
}

.document-viewer-frame {
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: #f5f6fa;
}

.admin-pdf-modal {
  border-radius: var(--ui-radius-lg);
  background: #f7f8fb;
}

.admin-pdf-stage {
  border-radius: var(--ui-radius-md);
}

.toast {
  position: fixed;
  top: calc(var(--ui-header-h) + 12px);
  right: 18px;
  z-index: 300;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(24, 34, 48, 0.94);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--ui-shadow-md);
  backdrop-filter: blur(14px);
}

.level-up-pop {
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-md);
}

.welcome-moment {
  position: fixed;
  z-index: 460;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 20, 35, 0.28);
  animation: welcome-backdrop-in 180ms ease both;
}

.welcome-moment.is-leaving {
  animation: welcome-backdrop-out 180ms ease both;
}

.welcome-moment-panel {
  position: relative;
  width: min(360px, 100%);
  overflow: hidden;
  border: 1px solid #e5eaf1;
  border-radius: 8px;
  background: #fff;
  padding: 30px 24px 24px;
  box-shadow: 0 20px 54px rgba(18, 34, 56, 0.2);
  color: #152236;
  text-align: center;
  animation: welcome-panel-in 420ms cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

.welcome-moment-check {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #1769ff;
  color: #fff;
  animation: welcome-check-in 520ms cubic-bezier(0.16, 1.2, 0.3, 1) both;
}

.welcome-moment-check svg {
  width: 29px;
  height: 29px;
  stroke-width: 3;
}

.welcome-moment-panel > strong {
  display: block;
  font-size: 23px;
  line-height: 1.3;
}

.welcome-moment-panel > p {
  margin: 8px 0 20px;
  color: #59687c;
  font-size: 14px;
  line-height: 1.55;
}

.welcome-moment-panel > button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: #1769ff;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.welcome-moment-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  transform-origin: left;
  background: #75e6a4;
  animation: welcome-progress 3.2s linear both;
}

@keyframes welcome-backdrop-in { from { opacity: 0; } }
@keyframes welcome-backdrop-out { to { opacity: 0; } }
@keyframes welcome-panel-in {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes welcome-check-in {
  0% { opacity: 0; transform: scale(0.55) rotate(-12deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes welcome-progress { to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .welcome-moment,
  .welcome-moment.is-leaving,
  .welcome-moment-panel,
  .welcome-moment-check,
  .welcome-moment-progress,
  .quiz-card-more > div,
  .student-card-scanline {
    animation: none;
  }
}

/* Floating / bottom navigation */
.bottom-ask {
  right: max(18px, calc((100vw - var(--ui-content)) / 2));
  bottom: 20px;
  border-radius: 15px;
  box-shadow: var(--ui-shadow-brand);
}

.mobile-tabbar {
  display: none;
}

/* Boot screen */
.crawler-home.boot-home {
  display: grid;
  width: min(760px, calc(100% - 32px));
  min-height: 100dvh;
  align-content: center;
  gap: 16px;
  margin-inline: auto;
  padding: 30px 0;
}

.boot-card,
.crawler-grid article {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-lg);
  background: #fff;
  padding: 22px;
  box-shadow: var(--ui-shadow-sm);
}

.boot-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef4;
}

.boot-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ui-brand), var(--ui-mint));
  animation: tutor-loading 1.2s ease-in-out infinite alternate;
}

@keyframes tutor-loading {
  from { transform: translateX(-18%); }
  to { transform: translateX(155%); }
}

/* Tablet */
@media (max-width: 1100px) {
  .topbar-inner {
    grid-template-columns: minmax(160px, auto) minmax(300px, 1fr) auto;
    width: calc(100% - 30px);
    gap: 12px;
  }

  .nav button,
  .primary-nav button {
    min-width: 68px;
    padding-inline: 10px;
  }

  .account-label,
  .mobile-logout-button {
    display: none;
  }

  .profile-pill {
    width: 42px;
    min-width: 42px;
    padding: 4px;
  }

  .home-task-board,
  .home-dashboard-grid,
  .profile-overview-layout,
  .note-workspace-layout,
  .shop-layout,
  .admin-workspace-layout,
  .tutor-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel-grid,
  .reward-box-grid,
  .inventory-grid,
  .shop-grid,
  .trophy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-section-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile / small tablet */
@media (max-width: 820px) {
  :root {
    --ui-header-h: 66px;
  }

  html {
    background: #f8f9fc;
  }

  body {
    background:
      radial-gradient(circle at 4% -6%, rgba(91, 91, 214, 0.10), transparent 18rem),
      #f8f9fc;
    font-size: 14px;
  }

  .app-shell {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .container {
    width: min(100% - 24px, var(--ui-content));
    padding: 18px 0 34px;
  }

  .topbar::before {
    width: 3px;
  }

  .topbar {
    padding-top: env(safe-area-inset-top);
  }

  .topbar-inner {
    display: flex;
    width: calc(100% - 24px);
    min-height: var(--ui-header-h);
    gap: 8px;
    padding: 8px 0;
  }

  .brand,
  .topbar .brand,
  .topbar .brand:hover,
  .topbar .brand:focus-visible {
    box-sizing: border-box;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    flex: 0 0 46px;
    min-height: 48px;
    contain: none;
    overflow: hidden;
    padding: 2px;
    transform: none;
  }

  .brand-icons,
  .brand img,
  .brand-logo,
  .topbar .brand .brand-logo.tutor-logo,
  .topbar .brand .brand-logo.school-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .topbar .brand-icons {
    min-width: 40px;
    max-width: 40px;
    margin: 0 auto;
    transform: none;
  }

  .brand-title {
    min-width: 96px;
    height: 38px;
  }

  .brand-title-main,
  .brand-title-school {
    height: 38px;
    font-size: 16px;
  }

  .brand-title-school {
    font-size: 14px;
  }

  .primary-nav,
  .nav {
    display: none;
  }

  .topbar-right {
    margin-left: auto;
  }

  .topbar-actions {
    display: none;
  }

  .topbar-notice-button,
  .profile-pill,
  .guest-login-pill {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 12px;
  }

  .profile-pill {
    padding: 3px;
  }

  .profile-pill .avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .mobile-tabbar {
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 160;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(calc(100% - 22px), 560px);
    min-height: 66px;
    transform: translateX(-50%);
    overflow: hidden;
    border: 1px solid rgba(216, 219, 229, 0.94);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    padding: 5px;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.17);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  .mobile-tabbar button {
    position: relative;
    display: grid;
    grid-template-rows: 23px 13px;
    min-width: 0;
    min-height: 54px;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 0;
    border-radius: 15px;
    background: transparent;
    color: var(--ui-muted);
    padding: 4px 2px;
    font-size: 10px;
    font-weight: 780;
    line-height: 1;
  }

  .mobile-tabbar button .icon {
    display: block;
    width: 22px;
    min-width: 22px;
    max-width: 22px;
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    margin: 0;
    aspect-ratio: 1;
  }

  .mobile-tabbar button > span {
    display: block;
    width: 100%;
    min-height: 13px;
    overflow: hidden;
    line-height: 13px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tabbar button.active {
    background: var(--ui-brand-soft);
    color: var(--ui-brand-strong);
  }

  .mobile-tabbar button.active::before {
    content: "";
    position: absolute;
    top: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ui-brand);
  }

  .workspace-page,
  .workspace-subpage,
  .detail,
  .quiz-editor-wide,
  .profile-page,
  .admin-workspace,
  .notes-workspace,
  .community-workspace,
  .questions-workspace,
  .ask-workspace {
    gap: 16px;
  }

  .workspace-head {
    min-height: 0;
    align-items: flex-start;
    border-radius: 20px;
    padding: 21px 19px;
  }

  .workspace-head::after {
    right: -8px;
    top: 4px;
    width: 62px;
    height: 62px;
    border-width: 11px;
    opacity: 0.8;
  }

  .workspace-title-block {
    gap: 6px;
  }

  .workspace-title-block h1,
  .workspace-title-block h2,
  .workspace-head h1,
  .workspace-head h2 {
    max-width: calc(100% - 34px);
    font-size: 25px;
  }

  .workspace-title-block p,
  .workspace-head p {
    font-size: 13px;
    line-height: 1.55;
  }

  .workspace-head-actions {
    align-self: stretch;
  }

  .workspace-head-actions .primary,
  .workspace-head-actions .ghost {
    flex: 1 1 auto;
  }

  .panel,
  .workspace-content-section,
  .profile-section-card,
  .login-required-panel {
    border-radius: 18px;
    padding: 17px;
  }

  .grid.two,
  .grid.three,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-primary-task,
  .home-today-panel {
    border-radius: 20px;
    padding: 20px;
  }

  .home-primary-task h2 {
    font-size: 26px;
  }

  .home-task-board,
  .home-dashboard-grid {
    gap: 14px;
  }

  .home-side-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-search-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-search-form > button {
    width: 100%;
  }

  .home-context-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-row,
  .compact-question-row {
    border-radius: 15px;
    padding: 14px;
  }

  .question-card,
  .answer-card,
  .notice-card {
    border-radius: 15px;
    padding: 14px;
  }

  .question-detail-heading,
  .question-detail-toolbar,
  .card-head,
  .detail-title {
    align-items: flex-start;
  }

  .question-detail-title-copy h1 {
    font-size: 24px;
  }

  .choice-grid,
  .subject-grid,
  .category-grid,
  .answer-type-grid,
  .course-grid,
  .unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .quiz-answer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .quiz-code-entry,
  .quiz-help,
  .quiz-start,
  .quiz-result,
  .quiz-review,
  .korean-quiz-app,
  .wordmaster-shell {
    border-radius: 20px;
    padding: 18px;
  }

  .profile-page .profile-cover {
    grid-template-columns: minmax(0, 1fr);
    border-radius: 20px;
  }

  .profile-cover-main {
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
    padding: 20px 17px;
  }

  .profile-page .profile-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 12px 16px 16px;
  }

  .profile-page .profile-cover.has-profile-banner {
    gap: 10px;
    padding: 12px;
  }

  .profile-page .profile-cover.has-profile-banner .profile-cover-main {
    border-bottom: 0;
  }

  .profile-identity .avatar,
  .profile-cover .avatar {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }

  .profile-stat-grid,
  .stats,
  .compact-stats,
  .workspace-metrics,
  .activity-stats,
  .tutor-summary-metrics,
  .korean-quiz-stats,
  .profile-shop-summary,
  .event-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-navigation-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 4px;
    padding: 6px;
  }

  .profile-primary-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }

  .profile-primary-tabs button,
  .profile-more-menu summary {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 4px 2px;
    font-size: 11px;
  }

  .profile-primary-tabs button:last-child {
    grid-column: auto;
  }

  .profile-primary-tabs button,
  .profile-more-menu summary {
    display: grid;
    grid-template-rows: 20px 14px;
    place-items: center;
    align-content: center;
    gap: 3px;
  }

  .profile-primary-tabs button .icon,
  .profile-more-menu summary .icon {
    width: 19px;
    height: 19px;
  }

  .profile-primary-tabs button span,
  .profile-more-menu summary span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .profile-more-menu {
    position: static;
    width: 100%;
  }

  .profile-more-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-height: min(480px, calc(100dvh - 190px));
  }

  .profile-more-group > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-shortcut-grid,
  .admin-panel-grid,
  .reward-box-grid,
  .inventory-grid,
  .shop-grid,
  .trophy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-event-banner {
    width: calc(100% - 20px);
    margin-top: 10px;
    border-radius: 16px;
  }

  .event-banner-actions {
    justify-content: stretch;
  }

  .event-banner-actions > button {
    flex: 1 1 132px;
  }

  .document-viewer-backdrop,
  .admin-pdf-backdrop {
    padding: 8px;
  }

  .document-viewer-modal,
  .admin-pdf-modal {
    width: 100%;
    height: calc(100dvh - 16px);
    border-radius: 18px;
    padding: 9px;
  }

  .toast {
    top: 76px;
    right: 12px;
    left: 12px;
    max-width: none;
  }

  .bottom-ask {
    display: none;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .profile-cover-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-edit-button {
    width: 100%;
    justify-self: stretch;
  }

  .container {
    width: min(100% - 20px, var(--ui-content));
  }

  .workspace-head {
    display: grid;
    gap: 15px;
  }

  .workspace-head-actions {
    justify-content: stretch;
  }

  .workspace-section-head,
  .section-title,
  .compact-title {
    align-items: flex-start;
  }

  .workspace-section-head > .ghost,
  .workspace-section-head > button,
  .section-title > button {
    flex: 0 0 auto;
  }

  .home-context-list,
  .profile-shortcut-grid,
  .admin-panel-grid,
  .reward-box-grid,
  .inventory-grid,
  .shop-grid,
  .trophy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-section-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-primary-actions,
  .form-actions,
  .question-followup-actions,
  .media-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-primary-actions > button,
  .form-actions > button,
  .question-followup-actions > button,
  .media-actions > * {
    width: 100%;
  }

  .question-row,
  .compact-question-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
  }

  .question-row-status {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .question-detail-heading,
  .detail-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .question-detail-toolbar {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .profile-stat-grid > div,
  .stat,
  .workspace-metrics > div,
  .activity-stats > div,
  .tutor-summary-metrics > div,
  .profile-shop-summary > div {
    padding: 11px;
  }

  .profile-stat-grid strong,
  .stat strong,
  .workspace-metrics strong,
  .activity-stats strong,
  .tutor-summary-metrics strong,
  .profile-shop-summary strong {
    font-size: 18px;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .auth-wrap {
    padding: 12px;
  }

  .auth-card {
    padding: 22px 18px;
  }
}

@media (max-width: 390px) {
  .brand-title {
    min-width: 82px;
  }

  .brand-title-main {
    font-size: 15px;
  }

  .brand-title-school {
    font-size: 12px;
  }

  .topbar-notice-button {
    display: none;
  }

  .workspace-title-block h1,
  .workspace-title-block h2,
  .workspace-head h1,
  .workspace-head h2 {
    font-size: 23px;
  }

  .choice-grid,
  .subject-grid,
  .category-grid,
  .answer-type-grid,
  .course-grid,
  .unit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-tabbar {
    width: calc(100% - 16px);
    border-radius: 18px;
  }

  .mobile-tabbar button {
    min-height: 52px;
    font-size: 9px;
  }
}

@media (hover: none), (pointer: coarse) {
  .primary,
  .ghost,
  .small-button,
  .chip,
  .choice-btn,
  .media-button,
  .topbar-ask-cta,
  .profile-pill,
  .topbar-notice-button {
    min-height: 44px;
  }

  .question-row:hover,
  .compact-question-row:hover,
  .quiz-card:hover,
  .profile-shortcut-card:hover,
  .community-board-card:hover {
    transform: none;
  }
}

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

/* AI answers are an explicit, student-controlled request. */
.ask-ai-request-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  margin-top: 16px;
  border-top: 1px solid var(--campus-line, #e4e9f0);
  padding-top: 16px;
  color: var(--campus-ink, #152033);
  cursor: pointer;
}

.ask-ai-request-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.ask-ai-request-control {
  grid-row: 1;
  grid-column: 1;
  width: 22px;
  height: 22px;
  border: 1.5px solid #aeb8c7;
  border-radius: 6px;
  background: #fff;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.ask-ai-request-option > input:checked + .ask-ai-request-control {
  border-color: #1769ff;
  background: #1769ff;
  box-shadow: inset 0 0 0 5px #1769ff;
}

.ask-ai-request-option > input:checked + .ask-ai-request-control::after {
  content: "";
  display: block;
  width: 6px;
  height: 11px;
  margin: 3px 0 0 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

.ask-ai-request-option > input:focus-visible + .ask-ai-request-control {
  outline: 3px solid rgba(23, 105, 255, 0.2);
  outline-offset: 2px;
}

.ask-ai-request-copy {
  grid-column: 2;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ask-ai-request-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}

.ask-ai-request-copy strong svg {
  width: 17px;
  height: 17px;
  color: #1769ff;
}

.ask-ai-request-copy small {
  color: var(--campus-muted, #667085);
  font-size: 12px;
  line-height: 1.45;
}

.ai-answer-request-button {
  color: #1557c0;
  border-color: #b8cef2;
  background: #f5f8ff;
}

.ai-answer-request-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #1557c0;
  font-size: 13px;
  font-weight: 750;
}

.ai-answer-request-state.error {
  color: #b42318;
}

.ai-answer-request-state svg {
  width: 17px;
  height: 17px;
}

/* Managed accounts and live student-card activation */
.auth-signup-closed {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0 18px;
  color: #344054;
  border-bottom: 1px solid #e4e9f0;
}

.auth-signup-closed svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #1769ff;
}

.auth-signup-closed span {
  display: grid;
  gap: 3px;
  font-size: 13px;
  line-height: 1.45;
}

.student-card-auth-wrap {
  min-height: 100svh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: #07111f;
  color: #f8fafc;
}

.student-card-activation-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
}

.student-card-activation-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 8px 0 18px;
}

.student-card-activation-head > div {
  min-width: 0;
}

.student-card-activation-head h1 {
  margin: 5px 0 4px;
  color: #fff;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: 0;
}

.student-card-activation-head p {
  margin: 0;
  color: #aebbd0;
  font-size: 14px;
  line-height: 1.55;
}

.activation-step-label,
.managed-account-eyebrow {
  color: #72a7ff;
  font-size: 12px;
  font-weight: 800;
}

.student-card-activation-head .icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid #344258;
  border-radius: 50%;
  background: #101d2e;
  color: #fff;
}

.student-card-activation-head .icon-button svg {
  width: 20px;
  height: 20px;
}

.student-card-camera {
  position: relative;
  min-height: min(72svh, 760px);
  overflow: hidden;
  border: 1px solid #27364c;
  border-radius: 8px;
  background: #02070e;
}

.student-card-camera video,
.student-card-camera-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.student-card-camera video {
  object-fit: cover;
  opacity: 0;
  transition: opacity 180ms ease;
}

.student-card-camera.is-live video {
  opacity: 1;
}

.student-card-camera-idle {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 45%;
  display: grid;
  width: min(88%, 360px);
  justify-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.student-card-camera-idle svg {
  width: 34px;
  height: 34px;
  color: #75e6a4;
}

.student-card-camera-idle strong {
  font-size: 18px;
}

.student-card-camera-idle span {
  color: #b7c4d6;
  font-size: 13px;
  line-height: 1.5;
}

.student-card-camera.is-live .student-card-camera-idle {
  display: none;
}

.student-card-camera-shade {
  pointer-events: none;
  background: rgba(2, 7, 14, 0.46);
}

.student-card-hud {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(42vw, 330px);
  aspect-ratio: 0.63;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 0 0 120vmax rgba(2, 7, 14, 0.43);
}

.student-card-hud .corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #75e6a4;
  border-style: solid;
}

.student-card-hud .top-left { left: -2px; top: -2px; border-width: 3px 0 0 3px; }
.student-card-hud .top-right { right: -2px; top: -2px; border-width: 3px 3px 0 0; }
.student-card-hud .bottom-left { left: -2px; bottom: -2px; border-width: 0 0 3px 3px; }
.student-card-hud .bottom-right { right: -2px; bottom: -2px; border-width: 0 3px 3px 0; }

.student-card-scanline {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 10%;
  height: 2px;
  background: #75e6a4;
  box-shadow: 0 0 10px rgba(117, 230, 164, 0.8);
  animation: student-card-scan 2.4s ease-in-out infinite alternate;
}

@keyframes student-card-scan {
  to { top: 89%; }
}

.student-card-hud-copy {
  position: absolute;
  left: 50%;
  bottom: -66px;
  width: min(88vw, 420px);
  transform: translateX(-50%);
  text-align: center;
}

.student-card-hud-copy strong,
.student-card-hud-copy small {
  display: block;
}

.student-card-hud-copy strong {
  color: #fff;
  font-size: 14px;
}

.student-card-hud-copy small {
  margin-top: 4px;
  color: #aebbd0;
  font-size: 12px;
}

.student-card-camera-actions {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 74px 1fr;
  align-items: center;
  padding: 0 20px;
}

.camera-start-button {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #1769ff;
  border-radius: 8px;
  background: #1769ff;
  color: #fff;
  padding: 10px 18px;
  box-shadow: 0 8px 22px rgba(23, 105, 255, 0.28);
}

.camera-start-button > span,
.camera-start-button strong,
.camera-start-button small {
  display: block;
}

.camera-start-button > span {
  text-align: left;
}

.camera-start-button strong {
  font-size: 15px;
}

.camera-start-button small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 650;
}

.camera-start-button svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}

.student-card-camera:not(.is-live) .student-card-camera-actions {
  grid-template-columns: minmax(0, 1fr);
}

.student-card-camera:not(.is-live) .camera-start-button {
  grid-column: 1;
  width: min(100%, 330px);
  justify-self: center;
}

.student-card-camera:not(.is-live) .student-card-shutter,
.student-card-camera.is-live .camera-start-button {
  display: none;
}

.student-card-shutter {
  grid-column: 2;
  width: 68px;
  height: 68px;
  padding: 5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: transparent;
}

.student-card-shutter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  transition: transform 100ms ease, background-color 100ms ease;
}

.student-card-shutter:active span {
  transform: scale(0.88);
  background: #75e6a4;
}

.student-card-security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px 0;
  color: #aebbd0;
  font-size: 12px;
}

.student-card-security-note svg {
  width: 16px;
  height: 16px;
  color: #75e6a4;
}

.student-card-activation-shell.review-step {
  width: min(100%, 760px);
}

.student-card-capture-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.student-card-capture-review figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid #314158;
  border-radius: 8px;
  background: #101d2e;
}

.student-card-capture-review img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.student-card-capture-review figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  color: #dbe4f1;
  font-size: 13px;
}

.student-card-capture-review figcaption button {
  border: 0;
  background: transparent;
  color: #7eb0ff;
  font: inherit;
  font-weight: 750;
}

.student-card-activation-form {
  padding: 20px;
  border: 1px solid #314158;
  border-radius: 8px;
  background: #fff;
  color: #152033;
}

.student-current-class-box,
.student-card-legacy-claim {
  padding: 14px;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #f7f9fc;
}

.student-current-class-box > p {
  margin: 4px 0 12px;
  color: #667085;
  font-size: 12px;
}

.student-card-legacy-claim summary {
  cursor: pointer;
  font-weight: 780;
}

.student-card-legacy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 12px;
}

.student-card-legacy-fields[hidden] {
  display: none;
}

.compact-legal-box {
  margin: 0;
}

.required-password-card {
  width: min(100%, 480px);
}

.archived-account-notice,
.archived-readonly-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #d5dce7;
  border-radius: 8px;
  background: #f5f7fa;
  color: #344054;
}

.archived-account-notice svg,
.archived-readonly-panel svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #667085;
}

.archived-readonly-panel h2,
.archived-readonly-panel p {
  margin: 0;
}

.archived-readonly-panel p {
  margin-top: 4px;
  color: #667085;
}

.managed-account-console {
  display: grid;
  gap: 14px;
}

.managed-account-overview,
.managed-account-section {
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
}

.managed-account-overview {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(340px, 1fr);
}

.managed-account-policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  align-items: center;
  padding: 18px;
  border-right: 1px solid #dfe5ee;
}

.managed-account-policy .managed-account-eyebrow {
  grid-column: 1 / -1;
}

.managed-account-policy strong,
.managed-account-section h3 {
  color: #162033;
}

.managed-account-policy p,
.managed-account-section p {
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.managed-account-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.managed-account-counts > div {
  display: grid;
  place-content: center;
  min-height: 94px;
  text-align: center;
}

.managed-account-counts strong {
  color: #1769ff;
  font-size: 22px;
}

.managed-account-counts span {
  color: #667085;
  font-size: 11px;
}

.managed-account-section {
  padding: 18px;
}

.managed-account-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.managed-account-section-head span {
  color: #1769ff;
  font-size: 11px;
  font-weight: 800;
}

.managed-account-section h3 {
  margin: 3px 0 0;
  font-size: 17px;
}

.roster-cohort-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.roster-cohort-strip > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-left: 3px solid #1769ff;
  background: #f5f8ff;
}

.roster-cohort-strip span,
.roster-cohort-strip small {
  color: #667085;
  font-size: 11px;
}

.managed-account-footnote {
  padding-top: 12px;
}

.managed-account-details > summary {
  cursor: pointer;
  font-weight: 800;
}

.managed-account-details[open] > summary {
  margin-bottom: 16px;
}

.managed-account-field-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.managed-account-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.inline-managed-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 14px;
}

.danger-zone-soft {
  border-color: #f0d0cc;
  background: #fffafa;
}

.danger-zone-soft > .danger {
  margin-top: 14px;
}

.teacher-account-lines {
  min-height: 126px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 760px) {
  .ask-form .ask-advanced-fields > summary {
    grid-template-columns: 36px minmax(0, 1fr) 10px;
    min-height: 64px;
    gap: 10px;
    padding: 9px 11px;
  }

  .ask-form .ask-advanced-fields > summary > .icon {
    width: 36px;
    height: 36px;
    padding: 9px;
  }

  .ask-form .ask-advanced-fields > summary small {
    max-width: none;
    text-align: left;
  }

  .ask-form .ask-advanced-fields > .field-block {
    margin-inline: 12px;
    padding-block: 14px;
  }

  .ask-form .ask-advanced-fields .ask-optional-copy {
    margin: 0 12px 14px;
    padding-top: 14px;
  }

  .quiz-card .quiz-card-more > summary span {
    display: block;
  }

  .student-card-auth-wrap {
    padding-inline: 10px;
  }

  .student-card-camera {
    min-height: calc(100svh - 142px);
  }

  .student-card-hud {
    top: 43%;
    width: min(62vw, 280px);
  }

  .student-card-camera-actions {
    grid-template-columns: 1fr 70px 1fr;
    padding-inline: 12px;
  }

  .student-card-camera:not(.is-live) .camera-start-button {
    width: 100%;
    min-width: 0;
    min-height: 62px;
  }

  .student-card-capture-review,
  .student-card-legacy-fields,
  .managed-account-overview,
  .managed-account-two-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .student-card-activation-form {
    padding: 14px;
  }

  .managed-account-policy {
    border-right: 0;
    border-bottom: 1px solid #dfe5ee;
  }

  .managed-account-counts > div {
    min-height: 76px;
  }

  .managed-account-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roster-cohort-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .managed-account-section-head {
    display: grid;
  }

  .inline-managed-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Teacher learning network and guided setup */
:root {
  --teacher-green: #176b4a;
  --teacher-green-dark: #0f5037;
  --teacher-green-soft: #edf7f2;
  --teacher-line: #cfe2d8;
  --teacher-warm: #a85d16;
  --teacher-warm-soft: #fff6e9;
}

.guided-shell {
  display: grid;
  min-height: calc(100dvh - var(--ui-header-h) - 140px);
  place-items: start center;
  padding-top: clamp(12px, 5vh, 56px);
}

.guided-panel,
.guided-complete-panel {
  width: min(720px, 100%);
  border: 1px solid var(--ui-line);
  border-top: 4px solid var(--ui-brand);
  border-radius: 8px;
  background: #fff;
  padding: clamp(22px, 5vw, 44px);
  box-shadow: var(--ui-shadow-sm);
}

.teacher-guided-shell .guided-panel {
  border-top-color: var(--teacher-green);
}

.guided-progress {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(30px, 6vw, 52px);
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 750;
}

.guided-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #edf0f4;
}

.guided-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ui-brand);
  transition: width 220ms ease;
}

.teacher-guided-shell .guided-progress-track i {
  background: var(--teacher-green);
}

.guided-content {
  display: grid;
  gap: 12px;
}

.guided-content h1,
.guided-complete-panel h1 {
  max-width: 620px;
  margin: 0;
  color: var(--ui-ink);
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.25;
  letter-spacing: 0;
}

.guided-lead,
.guided-complete-panel > p {
  max-width: 600px;
  margin: 0;
  color: var(--ui-muted);
  font-size: 17px;
  line-height: 1.7;
}

.guided-form {
  display: grid;
  gap: 26px;
  margin-top: 18px;
}

.guided-choice-stack,
.guided-choice-grid,
.guided-time-grid,
.teacher-setup-summary,
.account-setting-links {
  display: grid;
  gap: 10px;
}

.guided-choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guided-radio-choice,
.guided-check-choice {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.guided-radio-choice > input,
.guided-check-choice > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.guided-radio-choice > span,
.guided-check-choice > span {
  display: flex;
  min-height: 66px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ui-text);
  padding: 14px 16px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.guided-check-choice > span {
  min-height: 54px;
  justify-content: center;
  padding: 10px 12px;
}

.guided-radio-choice > span > .icon,
.guided-check-choice > span > .icon {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  color: var(--ui-muted);
}

.guided-radio-choice span span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.guided-radio-choice strong,
.guided-check-choice strong {
  color: var(--ui-ink);
  font-size: 16px;
  line-height: 1.4;
}

.guided-radio-choice small {
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.5;
}

.guided-radio-choice > input:checked + span,
.guided-check-choice > input:checked + span {
  border-color: var(--ui-brand);
  background: var(--ui-brand-soft);
  box-shadow: inset 0 0 0 1px var(--ui-brand);
}

.teacher-guided-shell .guided-radio-choice > input:checked + span,
.teacher-guided-shell .guided-check-choice > input:checked + span {
  border-color: var(--teacher-green);
  background: var(--teacher-green-soft);
  box-shadow: inset 0 0 0 1px var(--teacher-green);
}

.guided-radio-choice > input:focus-visible + span,
.guided-check-choice > input:focus-visible + span {
  outline: 3px solid rgba(91, 91, 214, 0.22);
  outline-offset: 2px;
}

.guided-choice-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.guided-choice-fieldset legend {
  margin-bottom: 10px;
  color: var(--ui-ink);
  font-size: 14px;
  font-weight: 780;
}

.guided-time-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guided-time-grid label,
.guided-text-field {
  display: grid;
  gap: 7px;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 720;
}

.guided-actions {
  display: grid;
  justify-items: stretch;
  gap: 10px;
  margin-top: 4px;
}

.guided-actions-row {
  grid-template-columns: minmax(110px, auto) minmax(180px, 1fr);
  align-items: center;
}

.guided-actions .guided-next,
.guided-actions > .ghost,
.guided-actions > .text-button {
  min-height: 54px;
}

.guided-actions .guided-next {
  justify-content: center;
}

.guided-actions .text-button {
  color: var(--ui-muted);
}

.teacher-guided-shell .primary,
.teacher-hub .primary,
.teacher-room-page .primary,
.teacher-thread-page .primary {
  border-color: var(--teacher-green);
  background: var(--teacher-green);
  color: #fff;
  box-shadow: none;
}

.teacher-guided-shell .primary:hover,
.teacher-hub .primary:hover,
.teacher-room-page .primary:hover,
.teacher-thread-page .primary:hover {
  border-color: var(--teacher-green-dark);
  background: var(--teacher-green-dark);
}

.teacher-setup-summary {
  border-top: 1px solid var(--teacher-line);
  border-bottom: 1px solid var(--teacher-line);
  padding: 8px 0;
}

.teacher-setup-profile-preview {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--teacher-line);
  border-radius: 10px;
  background: #f8fcfa;
  padding: 14px;
}

.teacher-setup-profile-preview > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.teacher-setup-profile-preview > div > span,
.teacher-setup-profile-preview small {
  color: var(--ui-muted);
  font-size: 12px;
}

.teacher-setup-profile-preview strong {
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-setup-profile-preview > button {
  min-height: 42px;
  white-space: nowrap;
}

.teacher-setup-summary > div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 4px;
}

.teacher-setup-summary span {
  color: var(--ui-muted);
}

.teacher-setup-summary strong {
  color: var(--ui-ink);
}

.teacher-room-toggle {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--teacher-line);
  border-radius: 8px;
  background: var(--teacher-green-soft);
  padding: 14px 16px;
}

.teacher-room-toggle input {
  width: 22px;
  height: 22px;
  accent-color: var(--teacher-green);
}

.teacher-room-toggle span {
  display: grid;
  gap: 2px;
}

.teacher-room-toggle small {
  color: var(--ui-muted);
}

.guided-complete-panel {
  display: grid;
  justify-items: start;
  gap: 13px;
}

.guided-complete-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--ui-mint-soft);
  color: var(--ui-success);
}

.teacher-hub,
.teacher-room-page,
.teacher-thread-page {
  --teacher-accent: var(--teacher-green);
}

.teacher-hub > *,
.teacher-room-page > *,
.teacher-thread-page > *,
.teacher-guided-shell > * {
  min-width: 0;
}

.teacher-hub,
.teacher-room-page {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.teacher-room-page > .back-link,
.teacher-thread-page > .back-link {
  display: inline-flex;
  width: max-content;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 7px;
  color: var(--ui-muted);
  padding: 0 4px;
  text-align: left;
}

.teacher-room-page > .back-link:hover,
.teacher-thread-page > .back-link:hover {
  color: var(--teacher-green-dark);
}

.teacher-room-page .visually-hidden,
.teacher-thread-page .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: -1px !important;
  border: 0 !important;
  padding: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.teacher-hub > .workspace-head {
  min-height: 102px;
  border-color: var(--teacher-line);
  border-left-color: var(--teacher-green);
}

.teacher-hub .workspace-kicker,
.teacher-room-page .workspace-kicker,
.teacher-thread-page .workspace-kicker {
  color: var(--teacher-green);
}

.teacher-setup-callout {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--teacher-line);
  border-left: 4px solid var(--teacher-green);
  border-radius: 8px;
  background: var(--teacher-green-soft);
  padding: 16px;
}

.teacher-setup-callout > .icon {
  width: 28px;
  height: 28px;
  color: var(--teacher-green);
}

.teacher-setup-callout p {
  margin: 2px 0 0;
  color: var(--ui-muted);
}

.teacher-priority-section {
  display: grid;
  gap: 10px;
  border: 1px solid #efd5b3;
  border-left: 4px solid var(--teacher-warm);
  border-radius: 10px;
  background: var(--teacher-warm-soft);
  padding: 16px 18px;
}

.teacher-priority-section .workspace-section-head p {
  color: #80512a;
}

.teacher-priority-count {
  color: var(--teacher-warm);
  font-size: 13px;
  font-weight: 800;
}

.teacher-priority-list {
  gap: 8px;
  border-top: 0;
}

.teacher-priority-list .teacher-question-row {
  border: 1px solid #efdcc3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 14px;
}

.teacher-directory-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.3fr);
  gap: 8px;
  border: 1px solid #e2eae6;
  border-radius: 10px;
  background: #f7faf8;
  padding: 9px;
}

.teacher-search-field,
.teacher-subject-filter {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
}

.teacher-search-field:focus-within,
.teacher-subject-filter:focus-within {
  border-color: var(--teacher-green);
  box-shadow: 0 0 0 3px rgba(23, 107, 74, 0.12);
}

.teacher-search-field > .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--ui-muted);
}

.teacher-search-field input,
.teacher-subject-filter select {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ui-ink);
  outline: 0;
}

.teacher-search-field button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
  padding: 0;
}

.teacher-search-field input:placeholder-shown + button {
  visibility: hidden;
}

.teacher-search-field button:hover {
  background: #f1f3f5;
}

.teacher-search-field button .icon {
  width: 16px;
  height: 16px;
}

.teacher-subject-filter > span {
  color: var(--ui-subtle);
  font-size: 12px;
  font-weight: 800;
}

.teacher-empty {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-height: 96px;
  align-content: center;
  text-align: left;
}

.teacher-empty strong {
  color: var(--ui-text);
}

.teacher-empty span {
  color: var(--ui-muted);
}

.teacher-directory-section,
.teacher-latest-section,
.teacher-room-questions,
.teacher-thread-messages {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--ui-line);
  padding-top: 20px;
}

.teacher-directory-list,
.teacher-question-list,
.teacher-thread-messages {
  display: grid;
  gap: 8px;
}

.teacher-directory-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.teacher-directory-list > .teacher-empty {
  grid-column: 1 / -1;
}

.teacher-room-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 58px 18px;
  align-items: center;
  min-height: 104px;
  min-width: 0;
  gap: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  padding: 14px;
  text-align: left;
  box-shadow: none;
}

.teacher-room-row:hover {
  border-color: var(--teacher-line);
  background: #fbfdfc;
}

.teacher-room-row:focus-visible,
.teacher-question-row:focus-visible {
  outline: 3px solid rgba(23, 107, 74, 0.2);
  outline-offset: 2px;
}

.teacher-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--teacher-line);
  border-radius: 50%;
  background: var(--teacher-green-soft);
  color: var(--teacher-green);
  object-fit: cover;
}

.teacher-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-avatar:not(.image-avatar) {
  font-size: 16px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
}

.teacher-avatar.large:not(.image-avatar) {
  font-size: 21px;
}

.teacher-avatar.large {
  width: 68px;
  height: 68px;
}

.teacher-room-main,
.teacher-room-name,
.teacher-question-copy {
  display: flex;
  min-width: 0;
}

.teacher-room-main,
.teacher-question-copy {
  flex-direction: column;
  gap: 5px;
}

.teacher-room-name {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-room-main strong,
.teacher-question-copy strong {
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 16px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-room-main > span:not(.teacher-room-name):not(.teacher-room-meta),
.teacher-question-copy > span {
  overflow: hidden;
  color: var(--ui-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-room-subject {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-weight: 720;
}

.teacher-room-subject > small {
  flex: 0 0 auto;
  color: var(--teacher-green);
  font-size: 11px;
  font-weight: 780;
}

.teacher-room-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.teacher-room-meta > small,
.teacher-room-identity p > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.teacher-room-meta .icon,
.teacher-room-identity p .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--teacher-green);
}

.teacher-room-main small,
.teacher-question-copy small {
  color: var(--ui-muted);
}

.teacher-room-state,
.teacher-question-status {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border: 1px solid var(--teacher-line);
  border-radius: 5px;
  background: var(--teacher-green-soft);
  color: var(--teacher-green-dark);
  padding: 3px 7px;
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.4;
}

.teacher-room-state.paused,
.teacher-question-status.status-resolved {
  border-color: var(--ui-line);
  background: #f4f5f7;
  color: var(--ui-muted);
}

.teacher-question-status.status-waiting,
.teacher-question-status.status-followUp {
  border-color: #efd5b3;
  background: var(--teacher-warm-soft);
  color: var(--teacher-warm);
}

.teacher-room-count {
  display: grid;
  min-height: 52px;
  align-content: center;
  justify-items: center;
  border-left: 1px solid var(--ui-line);
  color: var(--ui-muted);
  padding-left: 10px;
}

.teacher-room-count strong {
  color: var(--teacher-green);
  font-size: 19px;
}

.teacher-room-count small {
  font-size: 11px;
}

.teacher-question-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto 18px;
  align-items: center;
  min-width: 0;
  min-height: 74px;
  gap: 13px;
  border-bottom: 1px solid var(--ui-line);
  color: inherit;
  padding: 14px 3px;
  cursor: pointer;
}

.teacher-question-row:last-child {
  border-bottom: 0;
}

.teacher-question-row:hover .teacher-question-copy strong {
  color: var(--teacher-green);
}

.teacher-question-stats {
  color: var(--ui-muted);
  font-size: 12px;
  white-space: nowrap;
}

.teacher-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--teacher-line);
  padding: 8px 0 18px;
}

.teacher-room-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.teacher-room-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.teacher-room-identity > div {
  min-width: 0;
}

.teacher-room-identity h1 {
  margin: 3px 0;
  color: var(--ui-ink);
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: 0;
}

.teacher-room-identity p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  color: var(--ui-muted);
}

.teacher-owner-tools {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--teacher-line);
  border-radius: 8px;
  background: #f8fcfa;
  padding: 0;
}

.teacher-owner-tools > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.teacher-owner-tools > summary::-webkit-details-marker {
  display: none;
}

.teacher-owner-tools > summary > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.teacher-owner-tools > summary > span > .icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--teacher-green);
}

.teacher-owner-tools > summary > span > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.teacher-owner-tools > summary > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--ui-muted);
  transition: transform 150ms ease;
}

.teacher-owner-tools[open] > summary > .icon {
  transform: rotate(90deg);
}

.teacher-owner-tools strong {
  color: var(--teacher-green-dark);
  font-size: 13px;
}

.teacher-owner-tools small {
  color: var(--ui-muted);
  font-size: 12px;
}

.teacher-owner-tool-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--teacher-line);
  padding: 11px 14px 13px;
}

.teacher-owner-tool-actions > button {
  min-height: 40px;
  white-space: nowrap;
}

.teacher-room-settings-link {
  color: var(--teacher-green-dark);
}

.teacher-room-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.teacher-room-notice,
.teacher-room-closed,
.teacher-waiting-answer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--teacher-line);
  border-radius: 8px;
  background: var(--teacher-green-soft);
  padding: 14px 16px;
}

.teacher-room-notice .icon,
.teacher-room-closed .icon,
.teacher-waiting-answer .icon {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  color: var(--teacher-green);
}

.teacher-room-notice p,
.teacher-room-closed p,
.teacher-waiting-answer p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.teacher-room-notice p strong,
.teacher-room-closed p strong {
  color: var(--teacher-green-dark);
  font-size: 13px;
}

.teacher-room-notice p span,
.teacher-room-closed p span {
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.5;
}

.teacher-question-composer {
  border: 1px solid var(--teacher-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.teacher-question-composer > summary {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 14px;
  color: var(--teacher-green-dark);
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.teacher-question-composer > summary::-webkit-details-marker {
  display: none;
}

.teacher-question-composer > summary > .icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 8px;
  background: var(--teacher-green-soft);
  padding: 9px;
}

.teacher-question-composer > summary > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.teacher-question-composer > summary strong,
.teacher-question-composer > summary small {
  overflow-wrap: anywhere;
}

.teacher-question-composer > summary small {
  color: var(--ui-muted);
}

.teacher-question-composer[open] > summary {
  border-bottom: 1px solid var(--teacher-line);
  background: var(--teacher-green-soft);
}

.teacher-question-composer > form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.teacher-question-composer > form > label:not(.inline-check) {
  display: grid;
  gap: 6px;
  color: var(--ui-text);
  font-weight: 720;
}

.teacher-list-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.teacher-list-toolbar h2,
.teacher-list-toolbar p {
  margin: 0;
}

.teacher-list-toolbar p {
  color: var(--ui-muted);
}

.teacher-status-filter {
  flex: 0 0 auto;
}

.teacher-status-filter button {
  min-height: 42px;
  gap: 6px;
}

.teacher-status-filter button b {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  background: rgba(16, 24, 40, 0.07);
  font-size: 11px;
}

.teacher-status-filter button.active b {
  background: rgba(23, 107, 74, 0.13);
  color: var(--teacher-green-dark);
}

.teacher-thread-page {
  width: min(850px, 100%);
  margin-inline: auto;
}

.teacher-thread-question {
  border: 1px solid var(--ui-line);
  border-top: 4px solid var(--teacher-green);
  border-radius: 10px;
  background: #fff;
  padding: 24px;
}

.teacher-thread-head,
.teacher-thread-actions,
.teacher-thread-section-title,
.teacher-message-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teacher-thread-head {
  justify-content: space-between;
  color: var(--ui-muted);
}

.teacher-thread-question h1 {
  margin: 18px 0 5px;
  color: var(--ui-ink);
  font-size: clamp(25px, 4vw, 34px);
  letter-spacing: 0;
}

.teacher-thread-author {
  margin: 0 0 20px;
  color: var(--ui-muted);
}

.teacher-thread-body {
  color: var(--ui-text);
  font-size: 16px;
  line-height: 1.85;
}

.teacher-thread-actions {
  flex-wrap: wrap;
  margin-top: 20px;
}

.teacher-same-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teacher-green);
  font-weight: 750;
}

.teacher-thread-section-title {
  justify-content: space-between;
}

.teacher-thread-section-title h2 {
  margin: 0;
  color: var(--ui-ink);
  font-size: 21px;
}

.teacher-thread-section-title span {
  color: var(--ui-muted);
}

.teacher-thread-message {
  position: relative;
  border: 1px solid var(--ui-line);
  border-left: 4px solid var(--ui-line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.teacher-thread-message.from-teacher {
  border-color: var(--teacher-line);
  border-left-color: var(--teacher-green);
  background: #fbfdfc;
}

.teacher-message-author {
  margin-bottom: 14px;
}

.teacher-message-author > div {
  display: grid;
  margin-right: auto;
}

.teacher-message-author small {
  color: var(--ui-muted);
}

.teacher-message-author em {
  border-radius: 4px;
  background: var(--teacher-green-soft);
  color: var(--teacher-green-dark);
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
}

.teacher-message-role {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #f0f2f5;
  color: var(--ui-muted);
}

.from-teacher .teacher-message-role {
  background: var(--teacher-green-soft);
  color: var(--teacher-green);
}

.teacher-message-report {
  margin-top: 12px;
  color: var(--ui-muted);
  font-size: 12px;
}

.teacher-message-form {
  display: grid;
  gap: 13px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.teacher-message-form > div:first-child strong,
.teacher-message-form > div:first-child p {
  display: block;
  margin: 0;
}

.teacher-message-form > div:first-child p {
  color: var(--ui-muted);
}

.teacher-thread-images {
  margin-top: 14px;
}

.teacher-thread-images .question-image {
  max-height: 520px;
  object-fit: contain;
}

.account-setting-links {
  margin-top: 4px;
}

.account-workspace {
  width: min(920px, 100%);
  margin-inline: auto;
}

.account-settings-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

.account-settings-index button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 13px;
  font-weight: 760;
}

.account-settings-index button:hover,
.account-settings-index button:focus-visible {
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.account-settings-index .icon {
  width: 19px;
  height: 19px;
}

.account-settings-stack {
  display: grid;
  gap: 14px;
}

.account-settings-stack > *,
.account-settings-stack [id] {
  scroll-margin-top: calc(var(--ui-header-h) + 18px);
}

.account-profile-panel,
.account-guidance-panel,
.account-storage-panel {
  padding: 22px;
}

.account-profile-form {
  gap: 16px;
}

.account-avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--ui-line);
  padding-bottom: 18px;
}

.account-avatar-editor > div:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.account-avatar-editor small {
  color: var(--ui-muted);
}

.account-avatar-editor .chips {
  margin-top: 6px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
}

.account-form-grid > label,
.account-disclosure-body > label,
.account-password-fields > label {
  display: grid;
  gap: 6px;
  color: var(--ui-text);
  font-weight: 720;
}

.account-bio-field {
  min-width: 0;
}

.account-disclosure {
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: #fff;
}

.account-disclosure > summary,
.account-disclosure-panel > summary {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ui-text);
  padding: 12px 15px;
  cursor: pointer;
  list-style: none;
}

.account-disclosure > summary::-webkit-details-marker,
.account-disclosure-panel > summary::-webkit-details-marker {
  display: none;
}

.account-disclosure > summary > span,
.account-disclosure-panel > summary > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.account-disclosure > summary > span > span,
.account-disclosure-panel > summary > span > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-disclosure summary .icon,
.account-disclosure-panel summary .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--ui-brand);
}

.account-disclosure summary > .icon:last-child,
.account-disclosure-panel summary > .icon:last-child {
  width: 16px;
  height: 16px;
  color: var(--ui-subtle);
  transition: transform 140ms ease;
}

.account-disclosure[open] summary > .icon:last-child,
.account-disclosure-panel[open] summary > .icon:last-child {
  transform: rotate(90deg);
}

.account-disclosure summary small,
.account-disclosure-panel summary small {
  overflow: hidden;
  color: var(--ui-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-disclosure-body,
.account-disclosure-panel-body {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--ui-line);
  background: #fafbfc;
  padding: 15px;
}

.account-password-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--ui-line);
  padding-top: 16px;
}

.account-save-row > span {
  color: var(--ui-muted);
  font-size: 12px;
}

.account-secondary-settings {
  display: grid;
  gap: 8px;
}

.account-disclosure-panel {
  overflow: hidden;
  padding: 0;
}

.account-disclosure-panel > summary > em {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: #f1f3f6;
  color: var(--ui-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.account-storage-panel .card-head {
  gap: 12px;
}

.account-setting-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  background: transparent;
  color: var(--ui-text);
  padding: 14px 2px;
  text-align: left;
}

.account-setting-link:last-child {
  border-bottom: 0;
}

.account-setting-link > .icon:first-child {
  width: 23px;
  height: 23px;
  color: var(--ui-brand);
}

.account-setting-link > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-setting-link strong {
  color: var(--ui-ink);
}

.account-setting-link small {
  color: var(--ui-muted);
  line-height: 1.45;
}

.home-context-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .guided-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-directory-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-context-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .guided-shell {
    min-height: auto;
    padding-top: 0;
  }

  .guided-panel,
  .guided-complete-panel {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 22px 16px 26px;
    box-shadow: none;
  }

  .guided-progress {
    margin-bottom: 30px;
  }

  .guided-content h1,
  .guided-complete-panel h1 {
    font-size: 27px;
  }

  .guided-lead,
  .guided-complete-panel > p {
    font-size: 16px;
  }

  .guided-choice-grid,
  .guided-time-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guided-radio-choice > span {
    min-height: 72px;
  }

  .guided-actions-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  }

  .teacher-setup-summary > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .teacher-setup-profile-preview {
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 13px;
  }

  .teacher-setup-profile-preview > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .teacher-setup-callout {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .teacher-setup-callout > button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .teacher-priority-section {
    overflow: hidden;
    padding: 14px;
  }

  .teacher-priority-list {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 1px 26px 4px 1px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
  }

  .teacher-priority-list::-webkit-scrollbar {
    display: none;
  }

  .teacher-priority-list .teacher-question-row {
    flex: 0 0 calc(100% - 28px);
    scroll-snap-align: start;
  }

  .teacher-directory-tools {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px;
  }

  .teacher-search-field,
  .teacher-subject-filter {
    min-height: 50px;
  }

  .teacher-room-row {
    grid-template-columns: 44px minmax(0, 1fr) 44px 16px;
    min-height: 104px;
    gap: 11px;
    padding: 13px 12px;
  }

  .teacher-room-row > .teacher-avatar {
    width: 44px;
    height: 44px;
  }

  .teacher-room-count {
    display: grid;
    width: 42px;
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    background: var(--teacher-green-soft);
    padding: 0;
  }

  .teacher-room-count strong {
    font-size: 14px;
    line-height: 1;
  }

  .teacher-room-count small {
    display: block;
    font-size: 0;
    line-height: 1;
  }

  .teacher-room-count small::after {
    content: "대기";
    font-size: 9px;
  }

  .teacher-room-main {
    gap: 4px;
  }

  .teacher-room-subject > small {
    display: none;
  }

  .teacher-room-meta {
    gap: 3px 8px;
  }

  .teacher-question-row {
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 8px;
    padding: 14px 2px;
  }

  .teacher-priority-list .teacher-question-row {
    padding: 12px;
  }

  .teacher-question-row .teacher-question-status {
    grid-column: 1;
    margin-bottom: 1px;
  }

  .teacher-question-row .teacher-question-copy {
    grid-column: 1;
  }

  .teacher-question-row .teacher-question-stats {
    grid-column: 1;
  }

  .teacher-question-row > .icon {
    grid-column: 2;
    grid-row: 1 / span 3;
  }

  .teacher-room-page {
    gap: 13px;
  }

  .teacher-room-page > .back-link {
    min-height: 34px;
  }

  .teacher-room-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0 13px;
  }

  .teacher-room-header-actions {
    width: auto;
    justify-content: flex-start;
    margin-left: 60px;
  }

  .teacher-room-header-actions .teacher-room-state {
    margin-right: auto;
  }

  .teacher-owner-tools {
    padding: 0;
  }

  .teacher-owner-tool-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 10px;
  }

  .teacher-owner-tool-actions > button {
    width: 100%;
    min-width: 0;
    padding-inline: 9px;
  }

  .teacher-room-identity {
    align-items: center;
    gap: 12px;
  }

  .teacher-avatar.large {
    width: 48px;
    height: 48px;
  }

  .teacher-room-identity h1 {
    margin: 1px 0 3px;
    font-size: 22px;
    line-height: 1.32;
  }

  .teacher-room-identity .workspace-kicker {
    font-size: 11px;
  }

  .teacher-room-identity p {
    gap: 4px 10px;
    font-size: 12px;
  }

  .teacher-room-context {
    grid-template-columns: minmax(0, 1fr);
  }

  .teacher-room-notice,
  .teacher-room-closed {
    gap: 10px;
    padding: 11px 12px;
  }

  .teacher-room-notice .icon,
  .teacher-room-closed .icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
  }

  .teacher-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .teacher-status-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .teacher-status-filter button {
    min-width: 0;
    padding-inline: 6px;
  }

  .teacher-thread-question {
    padding: 20px 16px;
  }

  .teacher-thread-actions > button {
    min-height: 44px;
  }

  .teacher-thread-message {
    padding: 15px 13px;
  }

  .teacher-message-form {
    padding: 15px;
  }

  .teacher-message-author {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .teacher-message-author em {
    margin-left: 44px;
  }

  .account-settings-index {
    gap: 2px;
    padding: 5px;
  }

  .account-settings-index button {
    display: grid;
    grid-template-rows: 21px 14px;
    min-height: 52px;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 3px 2px;
    font-size: 11px;
  }

  .account-settings-index .icon {
    width: 20px;
    height: 20px;
  }

  .account-profile-panel,
  .account-guidance-panel,
  .account-storage-panel {
    padding: 17px;
  }

  .account-avatar-editor {
    align-items: flex-start;
    gap: 13px;
  }

  .account-form-grid,
  .account-password-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-disclosure > summary,
  .account-disclosure-panel > summary {
    min-height: 64px;
    padding: 12px;
  }

  .account-disclosure summary small,
  .account-disclosure-panel summary small {
    white-space: normal;
  }

  .account-disclosure-body,
  .account-disclosure-panel-body {
    padding: 13px;
  }

  .account-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-save-row .primary {
    width: 100%;
  }

  .account-setting-link {
    grid-template-columns: 25px minmax(0, 1fr) 16px;
    min-height: 66px;
    gap: 10px;
    padding: 12px 0;
  }

  .home-context-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-tabbar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Focused login mode: no empty signup rail when self-signup is disabled. */
.auth-wrap.auth-login-only {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  background: #f5f7fa;
}

.auth-card.auth-card-login-only {
  width: min(100%, 420px);
  margin: 0;
  padding: 30px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.09);
}

.auth-card-login-only .auth-brand,
.auth-card-login-only .auth-heading {
  justify-content: center;
  text-align: center;
}

.auth-card-login-only .auth-heading {
  margin: 18px 0 24px;
}

.auth-card-login-only .auth-heading h1 {
  margin-bottom: 7px;
  font-size: 28px;
  line-height: 1.25;
}

.auth-card-login-only .form,
.auth-card-login-only .form > button {
  width: 100%;
}

/* The handwriting editor is its own application surface. */
.app-shell.has-note-editor {
  width: 100%;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: #e9edf3;
}

.has-note-editor .note-editor-backdrop {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: block;
  min-height: 100dvh;
  padding: 0;
  background: #e9edf3;
}

.has-note-editor .note-editor {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #eef1f5;
  box-shadow: none;
}

.has-note-editor .note-editor-top {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 68px;
  padding: 9px 16px;
  border: 0;
  border-bottom: 1px solid #dfe4eb;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.has-note-editor .note-editor-leading,
.has-note-editor .note-editor-actions,
.has-note-editor .note-header-history {
  display: flex;
  align-items: center;
}

.has-note-editor .note-editor-leading {
  min-width: 0;
  gap: 10px;
}

.has-note-editor .note-document-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.has-note-editor .note-document-copy > span {
  color: #7a8596;
  font-size: 11px;
  font-weight: 700;
}

.has-note-editor .note-title-input {
  width: min(34vw, 360px);
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: transparent;
  color: #172033;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-note-editor .note-editor-back-button,
.has-note-editor .note-header-history .icon-ghost {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 6px;
}

.has-note-editor .note-save-status {
  justify-self: center;
  min-width: 76px;
  color: #687386;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
}

.has-note-editor .note-save-status[data-status="saving"] {
  color: #1664d9;
}

.has-note-editor .note-save-status[data-status="saved"] {
  color: #16834a;
}

.has-note-editor .note-editor-actions {
  justify-self: end;
  min-width: 0;
  gap: 8px;
}

.has-note-editor .note-header-history {
  gap: 3px;
  padding-right: 8px;
  border-right: 1px solid #e4e8ef;
}

.has-note-editor .note-save-button,
.has-note-editor .note-share-button,
.has-note-editor .note-copy-button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 6px;
}

.has-note-editor .note-editor-body {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.has-note-editor .note-toolrail {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 10px 8px;
  overflow: hidden auto;
  border: 0;
  border-right: 1px solid #dfe4eb;
  background: #fff;
  scrollbar-width: thin;
}

.has-note-editor .note-tool-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.has-note-editor .note-toolrail .note-tool-group {
  width: 100%;
  flex-direction: column;
}

.has-note-editor .note-toolrail .note-tool-group + .note-tool-group {
  padding-top: 11px;
  border-top: 1px solid #edf0f4;
}

.has-note-editor .note-toolrail button {
  position: relative;
  display: grid;
  width: 56px;
  min-width: 56px;
  height: 48px;
  min-height: 48px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4f5d70;
  box-shadow: none;
}

.has-note-editor .note-toolrail button:hover {
  background: #f0f4f9;
}

.has-note-editor .note-toolrail button.active,
.has-note-editor .note-toolrail button[aria-pressed="true"] {
  background: #e8f1ff;
  color: #1769dc;
  box-shadow: inset 3px 0 #1769dc;
}

.has-note-editor .note-toolrail button svg {
  width: 22px;
  height: 22px;
}

.has-note-editor .note-rail-actions {
  margin-top: auto;
}

.has-note-editor .note-workbench {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.has-note-editor .note-tool-inspector {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 64px;
  padding: 9px 16px;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid #dfe4eb;
  background: rgba(255, 255, 255, 0.98);
  scrollbar-width: thin;
}

.has-note-editor .note-active-tool-state {
  display: grid;
  flex: 0 0 auto;
  min-width: 74px;
  gap: 1px;
}

.has-note-editor .note-active-tool-state span,
.has-note-editor .note-size-wrap > span {
  color: #7a8596;
  font-size: 11px;
  font-weight: 700;
}

.has-note-editor .note-active-tool-state strong {
  color: #172033;
  font-size: 14px;
}

.has-note-editor .note-colors {
  flex: 0 0 auto;
  padding: 0 12px;
  border-inline: 1px solid #e4e8ef;
}

.has-note-editor .note-colors button {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #cfd6e1;
}

.has-note-editor .note-colors button.active {
  box-shadow: 0 0 0 2px #1769dc;
}

.has-note-editor .note-size-wrap {
  display: grid;
  grid-template-columns: auto minmax(90px, 150px) 38px;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  margin: 0;
}

.has-note-editor .note-size-wrap output {
  color: #536074;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.has-note-editor .shape-detail-tools {
  flex: 0 0 auto;
}

.has-note-editor .shape-detail-tools > button,
.has-note-editor .pen-only-button {
  width: auto;
  min-width: 42px;
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #dfe4eb;
  border-radius: 6px;
  background: #fff;
  color: #4f5d70;
  box-shadow: none;
}

.has-note-editor .shape-detail-tools > button.active,
.has-note-editor .pen-only-button.active {
  border-color: #9ec4fb;
  background: #eaf3ff;
  color: #1769dc;
}

.has-note-editor .note-editor:not([data-active-tool="line"]):not([data-active-tool="arrow"]):not([data-active-tool="rect"]):not([data-active-tool="ellipse"]):not([data-active-tool="triangle"]):not([data-active-tool="diamond"]) .shape-detail-tools {
  display: none;
}

.has-note-editor .note-editor[data-active-tool="eraser"] .note-colors,
.has-note-editor .note-editor[data-active-tool="eraser"] .pen-only-button {
  display: none;
}

.has-note-editor .hand-canvas-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: clamp(18px, 3vw, 42px);
  background-color: #e9edf3;
  background-image: radial-gradient(#cbd2dd 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  overscroll-behavior: contain;
}

.has-note-editor #handCanvas {
  display: block;
  max-width: none;
  margin: auto;
  border: 1px solid #d7dce4;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.12);
}

/* Student verification keeps the whole 30-second flow in three clear scenes. */
.student-card-photo-consent,
.student-activation-consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid #314158;
  border-radius: 8px;
  background: #152338;
  color: #f7f9fc;
}

.student-card-photo-consent input,
.student-activation-consent input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #2b78ed;
}

.student-card-photo-consent span {
  display: grid;
  gap: 3px;
}

.student-card-photo-consent small {
  color: #b8c4d5;
  line-height: 1.45;
}

.student-card-inline-error {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #ffb4ac;
  border-radius: 7px;
  background: #fff1ef;
  color: #a3312a;
  font-size: 13px;
  line-height: 1.5;
}

.student-card-inline-error svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.student-card-processing {
  display: grid;
  width: min(100%, 520px);
  min-height: 330px;
  place-items: center;
  align-content: center;
  gap: 13px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid #314158;
  border-radius: 8px;
  background: #101b2c;
  color: #f7f9fc;
  text-align: center;
}

.student-card-processing-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 50%;
  background: #173e72;
  color: #83b8ff;
}

.student-card-processing-mark svg {
  width: 32px;
  height: 32px;
}

.student-card-processing > span:not(.student-card-processing-mark) {
  color: #aebbd0;
  font-size: 13px;
}

.student-card-processing > i {
  width: min(100%, 280px);
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 3px;
  background: #26364d;
}

.student-card-processing > i b {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #5ba0ff;
  animation: student-card-progress 1.2s ease-in-out infinite alternate;
}

@keyframes student-card-progress {
  from { transform: translateX(-10%); }
  to { transform: translateX(145%); }
}

.student-card-activation-shell.details-step {
  width: min(100%, 560px);
}

.student-card-verified-summary,
.student-card-retention-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 8px;
}

.student-card-verified-summary {
  margin-bottom: 12px;
  border: 1px solid #aee7c4;
  background: #ecfbf2;
  color: #17653c;
}

.student-card-verified-summary > span {
  display: grid;
  gap: 2px;
}

.student-card-verified-summary small {
  color: #4f7a61;
}

.student-card-verified-summary svg,
.student-card-retention-result svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.student-card-retention-result {
  border: 1px solid #dce3ed;
  background: #f5f7fa;
  color: #536074;
  font-size: 12px;
  line-height: 1.5;
}

.student-activation-consent {
  margin: 0;
  border-color: #dce3ed;
  background: #fff;
  color: #344054;
}

.student-current-id-input {
  min-height: 56px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.student-password-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.student-activation-submit {
  width: 100%;
  min-height: 54px;
  font-size: 16px;
}

@media (max-width: 760px) {
  .auth-card.auth-card-login-only {
    padding: 24px 20px;
  }

  .has-note-editor .note-editor {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .has-note-editor .note-editor-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: calc(62px + env(safe-area-inset-top));
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  }

  .has-note-editor .note-save-status {
    position: absolute;
    left: 60px;
    bottom: 7px;
    justify-self: auto;
    min-width: 0;
    font-size: 10px;
  }

  .has-note-editor .note-document-copy > span {
    display: none;
  }

  .has-note-editor .note-title-input {
    width: min(46vw, 260px);
    padding-bottom: 13px;
    font-size: 15px;
  }

  .has-note-editor .note-header-history {
    display: none;
  }

  .has-note-editor .note-editor-actions {
    gap: 5px;
  }

  .has-note-editor .note-save-button,
  .has-note-editor .note-share-button,
  .has-note-editor .note-copy-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .has-note-editor .note-save-button span,
  .has-note-editor .note-share-button span,
  .has-note-editor .note-copy-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .has-note-editor .note-editor-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 64px;
  }

  .has-note-editor .note-toolrail {
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 7px max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    overflow: auto hidden;
    border-right: 0;
    border-top: 1px solid #dfe4eb;
  }

  .has-note-editor .note-toolrail .note-tool-group {
    width: auto;
    flex-direction: row;
    flex: 0 0 auto;
  }

  .has-note-editor .note-toolrail .note-tool-group + .note-tool-group {
    padding: 0 0 0 8px;
    border-top: 0;
    border-left: 1px solid #e4e8ef;
  }

  .has-note-editor .note-toolrail button {
    width: 48px;
    min-width: 48px;
    height: 46px;
    min-height: 46px;
  }

  .has-note-editor .note-toolrail button.active,
  .has-note-editor .note-toolrail button[aria-pressed="true"] {
    box-shadow: inset 0 -3px #1769dc;
  }

  .has-note-editor .note-rail-actions {
    margin-top: 0;
  }

  .has-note-editor .note-workbench {
    grid-row: 1;
    grid-template-rows: 58px minmax(0, 1fr);
  }

  .has-note-editor .note-tool-inspector {
    min-height: 58px;
    gap: 10px;
    padding: 7px 10px;
  }

  .has-note-editor .note-active-tool-state {
    min-width: 62px;
  }

  .has-note-editor .note-colors {
    padding: 0 9px;
  }

  .has-note-editor .note-size-wrap {
    grid-template-columns: auto 88px 34px;
  }

  .has-note-editor .hand-canvas-stage {
    padding: 14px;
  }

  .student-card-auth-wrap {
    align-items: start;
    padding: max(14px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
  }

  .student-card-activation-head h1 {
    font-size: 24px;
  }

  .student-card-camera {
    min-height: min(62dvh, 560px);
  }

  .student-card-hud {
    width: min(58vw, 280px);
  }

  .student-card-processing {
    min-height: min(54dvh, 400px);
    padding: 24px 18px;
  }

  .student-password-fields,
  .student-card-legacy-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 440px) {
  .has-note-editor .note-active-tool-state,
  .has-note-editor .shape-detail-tools > button span,
  .has-note-editor .pen-only-button span {
    display: none;
  }

  .has-note-editor .note-colors button {
    width: 25px;
    min-width: 25px;
    height: 25px;
  }

  .has-note-editor .note-title-input {
    width: min(42vw, 170px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-card-processing > i b {
    animation: none;
    transform: none;
    width: 70%;
  }
}

/* Product refinement layer: this file is the sole visual authority. */
body,
h1,
h2,
h3,
h4,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

.workspace-head {
  min-height: 106px;
  border-left: 4px solid var(--ui-brand);
  background: var(--ui-surface);
  padding: 22px 24px;
  box-shadow: var(--ui-shadow-xs);
}

.workspace-head::after {
  display: none;
}

.workspace-title-block h1,
.workspace-title-block h2,
.workspace-head h1,
.workspace-head h2 {
  font-size: clamp(27px, 2.6vw, 34px);
  letter-spacing: 0;
}

.community-section-tabs > button {
  width: auto;
  min-width: 0;
  flex: 1 1 0;
}

.community-section-tabs b:empty {
  display: none;
}

.home-task-board {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.home-quick-search {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: var(--ui-surface);
  padding: 15px 17px;
  box-shadow: var(--ui-shadow-xs);
}

.home-quick-search-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.home-quick-search-copy strong {
  overflow: hidden;
  color: var(--ui-ink);
  font-size: 15px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-quick-search .search-field {
  min-width: 0;
  min-height: 46px;
}

.home-quick-search > button {
  min-width: 72px;
}

.home-context-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-context-item {
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 82px;
  gap: 10px;
}

.home-context-item.attention {
  box-shadow: inset 3px 0 0 var(--ui-amber);
}

.home-context-item.live {
  box-shadow: inset 3px 0 0 var(--ui-mint);
}

.home-context-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #d8d9ef;
  border-radius: 10px;
  background: #fff;
  color: var(--ui-brand);
}

.home-context-copy,
.home-context-copy small,
.home-context-copy strong,
.home-context-copy span {
  display: block;
  min-width: 0;
}

.home-context-copy small {
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 760;
}

.home-context-copy strong,
.home-context-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-context-copy strong {
  margin-top: 1px;
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 850;
}

.home-context-copy span {
  margin-top: 1px;
  color: var(--ui-muted);
  font-size: 10px;
}

.question-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 11px;
  padding: 16px 18px;
}

.question-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  gap: 8px;
}

.question-search-field {
  min-width: 0;
  min-height: 46px;
}

.question-search-row > .question-search-field {
  grid-column: 1;
  grid-row: 1;
}

.question-search-row > .question-sort-menu {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  min-width: 0;
  justify-self: end;
}

.question-sort-menu {
  position: relative;
}

.question-sort-menu > summary {
  display: inline-flex;
  min-width: 84px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ui-text);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.question-sort-menu > summary::-webkit-details-marker {
  display: none;
}

.question-sort-menu > label {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: min(240px, calc(100vw - 32px));
  gap: 7px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-shadow: var(--ui-shadow-md);
}

.question-sort-menu > label > span {
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 780;
}

.question-filter-subjects,
.question-filter-subjects .chips {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.question-filter-subjects::-webkit-scrollbar,
.question-filter-subjects .chips::-webkit-scrollbar {
  display: none;
}

.question-filter-subjects .chip {
  flex: 0 0 auto;
}

.question-status-tabs {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  border-top: 1px solid var(--ui-line);
  padding-top: 10px;
  scrollbar-width: none;
}

.question-status-tabs::-webkit-scrollbar {
  display: none;
}

.question-status-tabs button {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ui-muted);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.question-status-tabs button:hover {
  background: var(--ui-surface-soft);
  color: var(--ui-ink);
}

.question-status-tabs button.active {
  border-color: #d7d7f1;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-strong);
}

.ai-answer-card {
  gap: 14px;
  border-color: #d7d7f1;
  border-left: 4px solid var(--ui-brand);
  background: #fff;
}

.ai-answer-card .answer-content {
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-md);
  background: #fff;
  padding: 0;
}

.ai-solution-column {
  display: grid;
  gap: 0;
}

.ai-solution-section {
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 18px;
}

.ai-solution-final {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  background: var(--ui-brand-soft);
}

.ai-solution-work {
  border-top: 1px solid var(--ui-line);
}

.ai-solution-label {
  color: var(--ui-brand-strong);
  font-size: 12px;
  font-weight: 900;
}

.ai-solution-copy {
  min-width: 0;
  color: var(--ui-ink);
  line-height: 1.75;
}

.ai-followup-guide {
  background: var(--ui-surface-soft);
  padding: 14px 16px;
}

@media (max-width: 760px) {
  .workspace-head {
    min-height: 0;
    border-left-width: 3px;
    padding: 17px;
  }

  .workspace-title-block h1,
  .workspace-title-block h2,
  .workspace-head h1,
  .workspace-head h2 {
    max-width: none;
    font-size: 23px;
  }

  .home-quick-search {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
    padding: 13px;
  }

  .home-quick-search-copy {
    grid-column: 1 / -1;
  }

  .home-quick-search-copy strong {
    white-space: normal;
  }

  .home-context-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .home-context-item {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-height: 104px;
    gap: 6px;
    padding: 10px;
  }

  .home-context-item > .icon:last-child,
  .home-context-copy span {
    display: none;
  }

  .home-context-copy strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .question-filter-panel {
    gap: 9px;
    padding: 12px;
  }

  .question-status-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .question-status-tabs button {
    min-width: 0;
    padding: 0 4px;
    white-space: nowrap;
  }

  .questions-workspace .workspace-head p {
    max-width: 34rem;
  }

  .community-section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .community-section-tabs > button {
    width: 100%;
  }

  .community-control-head {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .community-control-head p {
    display: none;
  }

  .community-create-menu,
  .community-create-menu > summary.primary {
    width: auto;
    min-width: 86px;
  }

  .community-create-menu > summary.primary {
    min-height: 42px;
    padding-inline: 12px;
  }

  .ai-answer-card {
    border-left-width: 3px;
    padding: 13px;
  }

  .ai-solution-section {
    padding: 15px;
  }

  .ai-solution-final {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
}

@media (max-width: 380px) {
  .question-status-tabs button {
    font-size: 11px;
  }

  .question-status-tabs .status-dot {
    display: none;
  }
}

/* Quiz app restoration
 * Restores the focused quiz skin from the retired campus stylesheet without
 * loading that stylesheet's page-wide legacy overrides.
 */
.quiz-workspace .quiz-toolbar,
.quiz-workspace .quiz-section-tabs {
  border-top: 3px solid var(--campus-green);
}

.quiz-workspace .quiz-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(520px, 100%);
}

.quiz-grid .quiz-card {
  --quiz-accent: var(--campus-blue);
  min-height: 216px;
  border: 1px solid var(--campus-line);
  border-top: 4px solid var(--quiz-accent);
  border-radius: 8px;
  background: #fff;
  color: var(--campus-ink);
  box-shadow: none;
  text-shadow: none;
}

.quiz-grid .quiz-card::before {
  height: 3px;
  background: var(--quiz-accent);
}

.quiz-grid .quiz-theme-neon {
  --quiz-accent: #7c3aed;
}

.quiz-grid .quiz-theme-fire {
  --quiz-accent: #d85b2d;
}

.quiz-grid .quiz-theme-ocean {
  --quiz-accent: #0f7b8f;
}

.quiz-grid .quiz-card h3,
.quiz-grid .quiz-card p,
.quiz-grid .quiz-card .quiz-card-meta span {
  color: var(--campus-ink);
  text-shadow: none;
}

.quiz-grid .quiz-card p,
.quiz-grid .quiz-card .quiz-card-meta span {
  color: var(--campus-muted);
}

.quiz-grid .quiz-card .quiz-code {
  border: 1px solid color-mix(in srgb, var(--quiz-accent) 28%, var(--campus-line));
  background: color-mix(in srgb, var(--quiz-accent) 9%, #fff);
  color: color-mix(in srgb, var(--quiz-accent) 82%, #111);
  box-shadow: none;
  text-shadow: none;
}

.quiz-grid .quiz-card .badge {
  border-color: var(--campus-line);
  background: #f5f7f6;
  color: var(--campus-text);
}

.quiz-grid .quiz-card .quiz-mini-rank {
  border: 1px solid var(--campus-line);
  border-radius: 6px;
  background: #f7f9f8;
  color: var(--campus-text);
  text-shadow: none;
}

.quiz-grid .quiz-card .quiz-mini-rank strong,
.quiz-grid .quiz-card .quiz-mini-rank span {
  color: var(--campus-text);
}

.quiz-grid .quiz-card .ghost,
.quiz-grid .quiz-card .quiz-card-more > summary {
  border-color: var(--campus-line-strong);
  background: #fff;
  color: var(--campus-text);
}

.quiz-grid .quiz-card:hover {
  border-color: #aec6b6;
  box-shadow: none;
  transform: none;
}

.quiz-answer,
.quiz-option,
.signup-quiz-option {
  border-radius: 7px;
}

.quiz-answer:hover,
.quiz-option:hover {
  transform: none;
}

@media (max-width: 760px) {
  .quiz-workspace .quiz-section-tabs {
    width: 100%;
  }

  .quiz-workspace .quiz-toolbar.workspace-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .quiz-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
