/* Generated by scripts/build_startup_styles.js; edit source CSS, then rebuild. */

/* Source: /ui-polish.css?v=23 */
/*
 * Wooshin Tutor product UI layer
 * Loaded last. This file owns the shared visual grammar and responsive polish.
 */

:root {
  --ui-header-h: 64px;
  --polish-mobile-tab-h: 60px;
  --brand: #087454;
  --brand-hover: #066247;
  --brand-strong: #054d3a;
  --brand-soft: #edf7f3;
  --brand-soft-strong: #dcefe7;
  --bg: #f7f9f8;
  --surface: #ffffff;
  --surface-subtle: #f2f5f3;
  --text: #18211d;
  --text-2: #66736d;
  --border: #dfe7e3;
  --border-strong: #cbd8d1;
  --info: #2563eb;
  --info-soft: #edf3ff;
  --danger: #d6453d;
  --danger-soft: #fff1f0;
  --warning: #b36a00;
  --warning-soft: #fff7e8;
  --radius-control: 10px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --shadow-lifted: 0 12px 30px rgba(20, 45, 34, .08);
  --campus-green: var(--brand);
  --campus-green-deep: var(--brand-hover);
  --campus-green-soft: var(--brand-soft);
  --campus-bg: var(--bg);
  --campus-paper: var(--surface);
  --campus-ink: var(--text);
  --campus-text: var(--text);
  --campus-muted: var(--text-2);
  --campus-line: var(--border);
  --campus-line-strong: var(--border-strong);
}

.app-shell,
.auth-wrap,
.app-shell.is-mounted,
.auth-wrap.is-mounted {
  opacity: 1;
  transform: none;
  transition: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  background: var(--bg);
  font-size: 16px;
  scroll-padding-top: calc(var(--ui-header-h) + 16px);
  scroll-padding-bottom: 24px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea,
summary {
  font: inherit;
  letter-spacing: 0;
}

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

:where(button, a, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(8, 116, 84, .2);
  outline-offset: 2px;
}

:where(button, .primary, .ghost, .small-button, .chip):disabled {
  cursor: not-allowed;
  opacity: .5;
}

img,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.app-shell,
.app-shell > *,
.workspace-page,
.workspace-subpage,
.workspace-page > *,
.workspace-subpage > *,
.home-workspace > *,
.questions-workspace > *,
.quiz-workspace > *,
.question-detail-page > *,
.notice-detail-page > *,
.profile-page > *,
.community-shell,
.community-shell > *,
.class-hub > *,
.ask-workspace > * {
  min-width: 0;
}

.container,
.app-shell > .container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  padding-top: 28px;
  padding-bottom: 64px;
}

.home-workspace,
.quiz-workspace,
.profile-page {
  width: min(1040px, 100%);
  margin-inline: auto;
}

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

.question-detail-page,
.notice-detail-page {
  width: min(840px, 100%);
  margin-inline: auto;
}

.workspace-page,
.workspace-subpage,
.detail,
.profile-page,
.home-workspace,
.questions-workspace,
.quiz-workspace,
.ask-workspace,
.class-hub,
.admin-workspace,
.notes-workspace,
.community-workspace {
  display: grid;
  gap: var(--space-6);
}

.workspace-title-block h1,
.workspace-title-block h2,
.workspace-head h1,
.workspace-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
}

.workspace-title-block p,
.workspace-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

.workspace-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.workspace-head {
  display: flex;
  min-height: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 16px;
  box-shadow: none;
}

.workspace-head::before,
.workspace-head::after {
  display: none;
}

.workspace-title-block {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workspace-head-actions {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
}

.workspace-section-head,
.section-title,
.compact-title {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  border: 0;
}

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

.workspace-section-head h2,
.workspace-section-head h3,
.section-title h2,
.section-title h3,
.panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.workspace-section-head p,
.section-title p,
.compact-title p {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.workspace-content-section {
  display: grid;
  min-width: 0;
  gap: var(--space-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.panel,
.workspace-section,
.profile-section-card,
.login-required-panel,
.auth-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px;
  box-shadow: none;
}

.panel.workspace-section {
  padding: 18px;
}

.empty,
.compact-empty {
  display: grid;
  min-width: 0;
  min-height: 112px;
  place-content: center;
  gap: 5px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  padding: 20px;
  color: var(--text-2);
  text-align: center;
}

.empty strong,
.compact-empty strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.empty span,
.compact-empty span {
  font-size: 13px;
  line-height: 1.5;
}

.meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

/* Controls: one primary color, one control radius. */
:where(.primary, .ghost, .small-button, .chip, .choice-btn, .media-button, .danger, .success, .workspace-primary-cta, .icon-button, .icon-only, .topbar-mini) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-control);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  box-shadow: none;
}

:where(.primary, .ghost, .small-button, .chip, .choice-btn, .media-button, .danger, .success, .workspace-primary-cta, .icon-button, .icon-only) .icon {
  flex: 0 0 auto;
}

.primary,
.workspace-primary-cta,
.success {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary:hover,
.workspace-primary-cta:hover,
.success:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.ghost,
.small-button,
.chip,
.choice-btn,
.media-button,
.icon-button,
.icon-only,
.topbar-mini {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.ghost:hover,
.small-button:hover,
.chip:hover,
.choice-btn:hover,
.media-button:hover,
.icon-button:hover,
.icon-only:hover,
.topbar-mini:hover {
  border-color: #aebfb6;
  background: var(--surface-subtle);
}

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

.danger:hover {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.icon-only,
.icon-button {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.input,
.select,
.textarea,
.searchbox,
.search-field,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
  color: var(--text);
  border-color: var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: none;
}

.input,
.select,
.searchbox,
.search-field,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
  min-height: 46px;
}

.textarea,
textarea {
  min-height: 112px;
  padding: 12px 14px;
  line-height: 1.6;
}

:where(.input, .select, .textarea, .searchbox, .search-field):focus-within,
:where(input, select, textarea):focus {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(8, 116, 84, .1);
}

.badge,
.workspace-count,
.question-status-label,
.question-subject-label,
.question-kind-label {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  padding: 3px 9px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.badge.selected,
.badge.active,
.question-status-label.resolved,
.question-status-label.selected,
.question-status-label.answered {
  border-color: #b8d8ca;
  background: var(--brand-soft);
  color: var(--brand);
}

.workspace-tabs,
.segmented,
.question-status-tabs,
.school-feed-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-subtle);
  padding: 4px;
  box-shadow: none;
}

:where(.workspace-tabs, .segmented, .question-status-tabs, .school-feed-tabs) > button {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

:where(.workspace-tabs, .segmented, .question-status-tabs, .school-feed-tabs) > button.active,
:where(.workspace-tabs, .segmented, .question-status-tabs, .school-feed-tabs) > button[aria-selected="true"] {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(20, 45, 34, .08);
}

/* Top bar */
.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.topbar::before {
  display: none;
}

.topbar-inner {
  display: grid;
  width: min(1180px, calc(100% - 40px));
  min-height: var(--ui-header-h);
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-inline: auto;
  padding: 7px 0;
}

.brand,
.topbar .brand {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  padding: 0 4px;
  color: var(--brand-strong);
  box-shadow: none;
}

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

.brand-icons,
.brand img,
.brand-logo {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}

.brand-icons {
  display: grid;
  place-items: center;
  overflow: visible;
  line-height: 0;
}

.brand-icons .brand-logo {
  display: block;
  margin: 0;
  object-position: center;
}

.brand-title {
  min-width: 0;
  color: var(--brand-strong);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

img.image-load-failed {
  display: none !important;
}

/* Identical decoded images are moved across string-render updates by app.js,
   so this state is only used for genuinely new sources. Keep their geometry
   stable with a soft placeholder, then reveal once decoding completes. */
img[data-wt-image-state="loading"] {
  opacity: .08;
  background-color: #edf4f0;
}

img[data-wt-image-state="ready"] {
  animation: wt-image-source-ready 180ms ease-out both;
}

@keyframes wt-image-source-ready {
  from { opacity: .08; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  img[data-wt-image-state="ready"] {
    opacity: 1;
    animation: none;
  }
}

.image-load-fallback {
  display: flex;
  width: 100%;
  min-height: 104px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: var(--text-2, #66736d);
  background: var(--surface-subtle, #f2f5f3);
  text-align: left;
}

.image-load-fallback > .icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.image-load-fallback span {
  display: grid;
  gap: 3px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.image-load-fallback small {
  color: var(--text-2, #66736d);
  font-size: 11px;
  font-weight: 450;
}

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

.nav button,
.primary-nav button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  padding: 0 12px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

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

.topbar-right,
.topbar-actions,
.account {
  display: flex;
  min-width: 0;
  align-items: center;
}

.topbar-right {
  gap: 9px;
}

.topbar-actions {
  gap: 15px;
}

.account {
  gap: 8px;
}

.topbar-ask-cta {
  display: inline-flex;
  min-width: 104px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-control);
  background: var(--brand);
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

.topbar-ask-cta:hover,
.topbar-ask-cta.active {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.topbar-notice-button,
.profile-pill,
.guest-login-pill,
.mobile-logout-button,
.topbar-mini {
  min-height: 40px;
  border-radius: var(--radius-control);
  box-shadow: none;
}

.topbar-notice-button {
  position: relative;
  display: grid;
  width: 40px;
  min-width: 40px;
  border: 0;
  background: transparent;
  padding: 0;
  place-items: center;
  color: var(--text-2);
  line-height: 0;
}

.topbar-notice-button > .icon {
  width: 20px;
  height: 20px;
  margin: 0;
}

.topbar-notice-button:hover {
  background: var(--surface-subtle);
  color: var(--brand);
}

.topbar-notice-button > span {
  position: absolute;
  top: 1px;
  right: -1px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: var(--radius-pill);
  background: #ee4d4d;
  padding-inline: 3px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.profile-pill,
.guest-login-pill {
  display: inline-flex;
  max-width: 190px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 3px 10px 3px 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.profile-pill .avatar {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  box-shadow: none;
}

.profile-pill .account-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

/* Authentication shares the same school-green product language. */
.auth-brand {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-brand .brand-icons.school-brand-icons {
  width: 46px;
  min-width: 46px;
  height: 46px;
}

.auth-brand .brand-icons .school-logo-only {
  width: 42px !important;
  min-width: 42px;
  height: 42px !important;
}

.auth-brand .brand-title.school-brand-title {
  display: block !important;
  width: auto !important;
  min-width: 0;
  height: auto;
  overflow: visible;
  color: var(--brand-strong);
  font-size: 20px;
  font-weight: 750;
}

.auth-brand .brand-title .school-title-only {
  position: static !important;
  display: block !important;
  width: auto !important;
  height: auto;
  overflow: visible;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
}

.auth-card .form > .primary,
.auth-card button.primary {
  border: 1px solid var(--brand);
  border-radius: var(--radius-control);
  background: var(--brand);
  color: #fff;
  box-shadow: none;
  font-weight: 700;
}

.auth-card .form > .primary:hover,
.auth-card button.primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.signup-student-confirm,
.legal-box .inline-check {
  min-height: 48px;
  align-items: flex-start;
  cursor: pointer;
}

.signup-student-confirm > input,
.legal-box .inline-check > input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

/* Home */
.home-workspace {
  gap: var(--space-4);
}

.home-welcome {
  display: grid;
  gap: 4px;
  padding: 2px 2px 4px;
}

.home-welcome > span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.home-welcome h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
}

.home-ask-hero,
.quiz-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.home-ask-hero {
  display: grid;
  min-height: 172px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 29%);
  align-items: center;
  padding: 22px 26px;
  text-align: left;
}

.home-ask-hero::after,
.quiz-hero::after {
  position: absolute;
  z-index: -1;
  right: -70px;
  bottom: -100px;
  width: 250px;
  height: 250px;
  border: 46px solid rgba(255, 255, 255, .06);
  border-radius: 50%;
  content: "";
}

.home-ask-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.home-ask-copy small {
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  font-weight: 500;
}

.home-ask-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

.home-ask-copy strong .icon {
  width: 24px;
  height: 24px;
}

.home-ask-copy em {
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
  font-style: normal;
  line-height: 1.5;
}

.home-ask-hero > img {
  position: absolute;
  right: 12px;
  bottom: -20px;
  width: 190px;
  height: 190px;
  object-fit: contain;
  pointer-events: none;
}

.home-search-panel,
.home-school-life,
.home-notice-panel,
.home-class-summary,
.home-school-feed,
.home-club-summary {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px;
  box-shadow: none;
}

.home-search-panel,
.home-school-life,
.home-school-feed {
  padding: 14px;
}

.home-search-panel {
  display: grid;
  gap: 10px;
}

.home-search-panel > header,
.home-school-life-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-search-panel h2,
.home-school-life-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
}

.home-search-panel > header .icon-only {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
}

.home-quick-search,
.home-search-form {
  display: block;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.home-quick-search .search-field,
.home-search-form .search-field {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
}

.home-quick-search input,
.home-search-form input {
  min-width: 0;
  min-height: 0 !important;
  flex: 1 1 auto;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.home-search-terms {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.home-search-terms button {
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  padding: 4px 10px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.home-search-terms button:hover {
  border-color: #b8d8ca;
  background: var(--brand-soft);
  color: var(--brand);
}

.home-search-terms .home-search-more {
  width: 30px;
  min-width: 30px;
  padding: 0;
}

.home-school-life {
  display: grid;
  gap: 10px;
}

.home-school-life-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-school-life-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
}

.home-school-life-head > button {
  min-height: 38px;
  border: 0;
  padding-inline: 6px;
  color: var(--text-2);
}

.home-school-life-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.home-school-life-grid > button {
  display: grid;
  min-width: 0;
  min-height: 106px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 10px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 12px;
  color: var(--text);
  text-align: left;
}

.home-school-life-grid > button:last-child {
  border-right: 0;
}

.home-school-life-grid > button:hover {
  background: var(--surface-subtle);
}

.home-school-life-grid > button > .icon:last-child {
  display: none;
}

.home-school-life-grid > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.home-school-life-grid small,
.home-school-life-grid strong,
.home-school-life-grid em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-school-life-grid small {
  color: var(--text-2);
  font-size: 11px;
}

.home-school-life-grid strong {
  display: -webkit-box;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-school-life-grid em {
  display: -webkit-box;
  color: var(--text-2);
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-school-life-icon,
.home-context-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
  color: var(--brand);
}

.home-school-life-icon.meal-icon {
  background: var(--info-soft);
  color: var(--info);
}

.home-school-life-icon.event-icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.home-context-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.home-context-item {
  min-width: 0;
  min-height: 86px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 13px;
}

.home-context-item:nth-child(2n) {
  border-right: 0;
}

.home-context-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.home-context-item:hover {
  background: var(--surface-subtle);
}

.notice-feature-card,
.notice-mini,
.home-community-row {
  border-radius: var(--radius-control);
}

.home-notice-panel.is-single {
  display: block;
  overflow: hidden;
  padding: 0;
}

.home-notice-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 62px;
  grid-template-columns: auto minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 14px;
  color: var(--text);
  text-align: left;
}

.home-notice-row:hover {
  background: var(--surface-subtle);
}

.home-notice-row-label {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  padding: 2px 8px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.home-notice-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-notice-row time {
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}

.home-notice-row > .icon {
  width: 18px;
  height: 18px;
  color: var(--text-2);
}

/* Home/public feed: one list surface, not a card grid inside cards. */
.home-school-feed {
  display: grid;
  gap: 10px;
}

.school-feed-section-head {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.school-feed-tabs {
  width: min(260px, 100%);
}

.school-feed-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.school-feed-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto auto;
  gap: 6px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  color: var(--text);
  box-shadow: none;
}

.school-feed-card:last-child {
  border-bottom: 0;
}

.school-feed-card::before {
  display: none;
}

.school-feed-card:hover {
  transform: none;
  background: var(--surface-subtle);
}

.school-feed-author-row,
.school-feed-author,
.school-feed-meta,
.school-feed-metrics {
  display: flex;
  min-width: 0;
  align-items: center;
}

.school-feed-author-row {
  justify-content: space-between;
  gap: 10px;
}

.school-feed-author {
  gap: 9px;
}

.school-feed-avatar {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

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

.school-feed-author > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.school-feed-author strong,
.school-feed-author small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-feed-author strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.school-feed-author small {
  color: var(--text-2);
  font-size: 11px;
}

.school-feed-save {
  display: grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  padding: 0;
  color: var(--text-2);
}

.school-feed-save:hover,
.school-feed-save.is-saved {
  background: var(--brand-soft);
  color: var(--brand);
}

.school-feed-content.has-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: start;
  gap: 10px;
}

.school-feed-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
}

.school-feed-labels {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
}

.school-feed-labels > span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  padding: 2px 7px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.school-feed-labels .school-feed-kind {
  background: var(--info-soft);
  color: var(--info);
}

.school-feed-card.is-post .school-feed-labels .school-feed-kind,
.school-feed-labels .is-resolved {
  background: var(--brand-soft);
  color: var(--brand);
}

.school-feed-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.school-feed-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.school-feed-thumbnail {
  width: 92px;
  height: 68px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  object-fit: cover;
}

.school-feed-meta {
  gap: 8px;
  border-top: 0;
  padding-top: 0;
  color: var(--text-2);
  font-size: 11px;
}

.school-feed-metrics {
  gap: 10px;
}

.school-feed-metrics > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.school-feed-meta time {
  margin-left: auto;
  white-space: nowrap;
}

.school-feed-empty {
  border: 0;
}

.school-feed-skeleton {
  cursor: default;
}

.school-feed-skeleton > span {
  height: 12px;
  border-radius: 5px;
  background: #e7ece9;
}

/* Guest home: keep the public explanation compact and use the site brand for entry actions. */
.guest-site-intro {
  border-color: var(--border);
  border-top-width: 1px;
  border-radius: var(--radius-card);
}

.guest-intro-main {
  gap: 24px;
  padding: 34px 32px;
}

.guest-intro-heading h1,
.guest-access-gate h1 {
  font-weight: 700;
}

.guest-intro-actions {
  margin-top: 20px;
}

.guest-intro-actions .primary,
.guest-quiz-entry .primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.guest-intro-actions .primary:hover,
.guest-quiz-entry .primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.guest-service-row {
  padding: 18px;
}

.guest-quiz-entry {
  padding: 20px 32px;
}

.guest-privacy-note {
  padding: 10px 32px;
}

/* Question list */
.question-filter-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.question-search-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
}

.question-search-field input {
  min-width: 0;
  min-height: 0 !important;
  flex: 1 1 auto;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.question-sort-menu {
  position: relative;
}

.question-sort-menu > summary {
  display: inline-flex;
  min-width: 90px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 0 12px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}

.question-sort-menu > summary::-webkit-details-marker {
  display: none;
}

.question-filter-subjects,
.question-filter-subjects .chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.question-filter-subjects .chip {
  min-height: 34px;
  border-radius: var(--radius-pill);
  padding-inline: 11px;
  font-size: 12px;
  font-weight: 550;
}

.question-filter-subjects .chip.active {
  border-color: #b8d8ca;
  background: var(--brand-soft);
  color: var(--brand);
}

.question-status-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row;
}

.question-results-section {
  gap: 14px;
}

.question-list,
.question-results-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.question-card,
.question-feed-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px;
  color: var(--text);
  box-shadow: none;
}

.question-card::before,
.question-feed-card::before,
.question-card::after,
.question-feed-card::after {
  display: none !important;
}

.question-card:hover,
.question-feed-card:hover {
  transform: none;
  border-color: #b8c8bf;
  background: #fcfefd;
  box-shadow: none;
}

.question-card-author {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.question-card-author > * {
  min-width: 0;
}

.question-card-author > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-card-route {
  display: grid;
  min-width: 0;
  gap: 11px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.question-card-route:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.question-card-labels {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.question-card-labels > span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-subtle);
  padding: 4px 9px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.question-card-labels .question-kind-label {
  border-color: #c9d8f7;
  background: var(--info-soft);
  color: var(--info);
}

.question-card-labels .question-status-label {
  border-color: #b8d8ca;
  background: var(--brand-soft);
  color: var(--brand);
}

.question-card-content {
  display: block;
  min-width: 0;
}

.question-card-content.has-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: start;
  gap: 16px;
}

.question-card-content > div {
  min-width: 0;
}

.question-card-content h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.question-card-content p {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.question-card-content small {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
}

.question-card-content > img {
  width: 126px;
  height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  object-fit: cover;
}

.question-card-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  border-top: 1px solid var(--border);
  padding-top: 11px;
  color: var(--text-2);
  font-size: 12px;
}

.question-card-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.question-card-meta time {
  margin-left: auto;
  white-space: nowrap;
}

.question-feed-card.is-compact {
  gap: 8px;
  padding: 14px;
}

/* Quiz */
.quiz-workspace {
  gap: var(--space-4);
}

.quiz-hero {
  display: grid;
  min-height: 210px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 32%);
  align-items: center;
  padding: 26px 30px;
}

.quiz-hero > div {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.quiz-hero > div > span {
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}

.quiz-hero h1 {
  margin: 0;
  color: #fff;
  font-size: 31px;
  font-weight: 700;
  line-height: 1.2;
}

.quiz-hero p {
  max-width: 440px;
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 14px;
  line-height: 1.55;
}

.quiz-hero > div > .quiz-hero-join {
  display: inline-flex;
  width: fit-content;
  min-width: 178px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: #fff;
  padding: 0 18px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
}

.quiz-hero > img {
  position: absolute;
  right: 14px;
  bottom: -22px;
  width: 225px;
  height: 225px;
  object-fit: contain;
  pointer-events: none;
}

.quiz-workspace .quiz-section-tabs.workspace-tabs {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row;
}

.quiz-workspace .quiz-section-tabs > button {
  min-height: 44px;
}

.quiz-workspace .quiz-section-tabs > button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.quiz-toolbar.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.quiz-toolbar .search-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
}

.quiz-toolbar .search-field input {
  min-width: 0;
  min-height: 0 !important;
  flex: 1 1 auto;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.quiz-list-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 2px;
}

.quiz-list-head strong {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.quiz-list-head select {
  width: auto;
  min-height: 36px;
  border-radius: var(--radius-control);
  padding-inline: 10px 28px;
  font-size: 12px;
}

.quiz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.quiz-grid .quiz-card,
.quiz-card {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  align-content: start;
  gap: 9px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 16px;
  color: var(--text);
  box-shadow: none;
}

.quiz-grid .quiz-card:hover,
.quiz-card:hover {
  transform: none;
  border-color: #b8c8bf;
  box-shadow: none;
}

.quiz-cover-image {
  width: 100%;
  max-height: 152px;
  border-radius: var(--radius-control);
  object-fit: cover;
}

.quiz-card-head,
.quiz-card-meta,
.quiz-card-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.quiz-code {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  border: 1px solid #b8d8ca;
  border-radius: 8px;
  background: var(--brand-soft);
  padding: 4px 9px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.quiz-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.quiz-card > p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 0;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.quiz-card-meta {
  color: var(--text-2);
  font-size: 12px;
}

.quiz-card-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.quiz-mini-rank {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface-subtle);
  padding: 8px 10px;
  color: var(--text-2);
  font-size: 12px;
}

.quiz-card-actions {
  margin-top: 2px;
  border-top: 1px solid var(--border);
  padding-top: 11px;
}

.quiz-card-actions > button {
  flex: 1 1 110px;
}

.quiz-card-more {
  position: relative;
  flex: 0 0 auto;
}

.quiz-card-more > summary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 0 12px;
  list-style: none;
}

.quiz-card-more > summary::-webkit-details-marker {
  display: none;
}

.quiz-grid .quiz-list-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 42px 20px;
  align-items: center;
  gap: 14px;
  overflow: visible;
  padding: 16px 18px;
}

.quiz-list-code {
  display: grid;
  width: 94px;
  min-width: 94px;
  min-height: 72px;
  place-content: center;
  gap: 4px;
  border: 1px solid #9ac9b7;
  border-radius: var(--radius-control);
  background: #f7fcfa;
  color: var(--brand);
  text-align: center;
}

.quiz-list-code small {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.quiz-list-code strong {
  max-width: 82px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-list-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.quiz-list-copy .quiz-card-head {
  min-height: 0;
}

.quiz-list-copy h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-list-copy > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.quiz-list-copy .quiz-card-meta {
  margin-top: 3px;
}

.quiz-list-card .quiz-card-more {
  grid-column: 3;
}

.quiz-list-card .quiz-card-more > summary {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.quiz-list-card .quiz-card-more > div {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 132px;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 7px;
  box-shadow: var(--shadow-lifted);
}

.quiz-list-card .quiz-card-more > div > button {
  width: 100%;
  justify-content: flex-start;
}

.quiz-list-open {
  display: grid;
  width: 20px;
  height: 32px;
  place-items: center;
  color: var(--text-2);
}

.quiz-list-open .icon {
  width: 18px;
  height: 18px;
}

/* Question detail and long-form answers */
.question-detail-page,
.notice-detail-page {
  gap: 16px;
}

.detail-appbar {
  display: grid;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.detail-appbar > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-appbar > span:last-child {
  display: block;
  width: 44px;
}

.detail-appbar .icon-only {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  border-color: transparent;
  background: transparent;
}

.question-detail-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
}

.question-detail-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 20px;
}

.question-detail-heading {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  border: 0;
  padding: 0 0 14px;
}

.question-detail-heading::before,
.question-detail-heading::after {
  display: none !important;
}

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

.question-detail-context {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.question-detail-context > span {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  padding: 3px 9px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.question-detail-title-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.question-object-menu {
  position: relative;
}

.question-object-menu > summary {
  list-style: none;
}

.question-object-menu > summary::-webkit-details-marker {
  display: none;
}

.question-body,
.question-detail-card > .content-box,
.answer-card > .content-box,
.notice-card > .content-box {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
}

.question-body,
.answer-content,
.notice-body-copy,
.prose,
.forum-rendered-document {
  min-width: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) p {
  margin: 0 0 12px;
}

:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) p:last-child {
  margin-bottom: 0;
}

:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) h2 {
  margin: 28px 0 10px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) h3 {
  margin: 22px 0 8px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
}

:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) ul,
:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) ol {
  margin: 10px 0 14px;
  padding-left: 1.5em;
}

:where(.question-body, .answer-content, .notice-body-copy, .prose, .forum-rendered-document) li + li {
  margin-top: 5px;
}

.question-image,
.question-image-action,
.hand-image-list {
  max-width: 100%;
}

.question-image-action {
  overflow: hidden;
  border-radius: var(--radius-control);
}

.question-image-action .question-image,
.question-detail-card > .image-preview .question-image {
  width: 100%;
  max-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  object-fit: contain;
}

.question-attempt-box {
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  padding: 14px 16px;
}

.question-attempt-box h3 {
  margin: 0 0 7px;
  font-size: 14px;
  font-weight: 650;
}

.question-detail-actions,
.answer-card .chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.answer-list {
  display: grid;
  gap: 12px;
}

.answer-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px;
  box-shadow: none;
}

.answer-card::before,
.answer-card::after {
  display: none !important;
}

.answer-card .card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.answer-card .card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.ai-answer-card {
  border-color: #cddfd7;
  background: var(--surface);
}

.ai-answer-badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  padding: 4px 9px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 650;
}

.ai-answer-card .answer-content {
  border: 0;
  background: transparent;
  padding: 0;
  white-space: normal;
}

.ai-solution-column {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.ai-solution-section {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 16px 18px;
}

.ai-solution-final {
  border-bottom: 1px solid #b8d8ca;
  background: var(--brand-soft);
}

.ai-solution-label {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.ai-solution-copy {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.72;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-solution-final .ai-solution-copy {
  color: var(--brand-strong);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.55;
}

.ai-solution-work .ai-solution-copy {
  max-width: 76ch;
}

.ai-solution-legacy {
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 16px 18px;
}

.math-content,
[data-math-render],
[data-ai-math-render] {
  min-width: 0;
}

.math-content .katex-display,
[data-math-render] .katex-display,
.prose .katex-display {
  max-width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 6px;
  text-align: left;
  -webkit-overflow-scrolling: touch;
}

.katex-display > .katex {
  min-width: max-content;
  text-align: left;
}

.ai-followup-guide {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 10px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  padding: 13px 0 0;
  color: var(--text-2);
}

.ai-followup-guide > div {
  display: grid;
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.ai-followup-guide p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.ai-followup-guide strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.ai-followup-guide span,
.ai-followup-guide small {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ai-followup-guide small {
  grid-column: 2;
}

.ai-graph-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.ai-graph-canvas {
  max-width: 100%;
  overflow-x: auto;
}

/* Notice */
.notice-card,
.school-notice-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 18px;
  box-shadow: none;
}

.notice-card:hover,
.school-notice-card:hover {
  transform: none;
  border-color: #b8c8bf;
  box-shadow: none;
}

.notice-card::before,
.notice-card::after,
.school-notice-card::before,
.school-notice-card::after {
  display: none !important;
}

.notice-card-banner {
  width: calc(100% + 36px);
  max-width: none;
  max-height: 330px;
  margin: -18px -18px 2px;
  border-radius: 0;
  object-fit: cover;
}

.notice-card .card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.notice-card h3 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.notice-card-summary .notice-body-copy {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.notice-card-expanded {
  gap: 18px;
  padding: 22px;
}

.notice-card-expanded .notice-card-banner {
  width: calc(100% + 44px);
  margin: -22px -22px 2px;
}

.notice-card-expanded h3 {
  font-size: 24px;
}

.notice-card-open {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
}

.notice-interaction,
.notice-html-panel,
.notice-quiz-gate {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  padding: 16px;
}

/* Profile: no fixed-width tab or trophy can escape its page. */
.profile-page,
.profile-page > *,
.profile-cover,
.profile-cover-main,
.profile-identity,
.profile-identity > *,
.profile-stat-grid,
.profile-navigation-shell,
.profile-primary-tabs,
.profile-more-menu,
.profile-more-popover,
.profile-shortcut-grid,
.profile-section-card,
.profile-achievement-card,
.trophy-mini-row,
.trophy-grid,
.trophy-card {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-page {
  gap: 16px;
}

.profile-cover {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: none;
}

.profile-cover::before,
.profile-cover::after {
  display: none !important;
}

.profile-cover-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: transparent;
  padding: 20px;
}

.profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.profile-identity h1 {
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.profile-identity p {
  margin: 0 0 5px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.profile-edit-button {
  flex: 0 0 auto;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.profile-stat-grid > div {
  display: grid;
  min-width: 0;
  min-height: 72px;
  place-content: center;
  gap: 2px;
  border-right: 1px solid var(--border);
  padding: 10px;
  text-align: center;
}

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

.profile-stat-grid strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.profile-stat-grid span {
  color: var(--text-2);
  font-size: 11px;
}

.profile-navigation-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(86px, 1fr);
  gap: 4px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 4px;
  box-shadow: none;
}

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

.profile-primary-tabs button,
.profile-more-menu > summary {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  padding: 6px 8px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}

.profile-primary-tabs button span,
.profile-more-menu > summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-primary-tabs button.active,
.profile-more-menu.active > summary {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}

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

.profile-more-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(360px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 120px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-lifted);
}

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

.profile-shortcut-card {
  display: grid;
  min-width: 0;
  min-height: 76px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 12px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.profile-shortcut-card:hover {
  transform: none;
  border-color: #b8c8bf;
  background: var(--surface-subtle);
}

.profile-shortcut-card > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.profile-shortcut-card strong,
.profile-shortcut-card small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-shortcut-card strong {
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.profile-shortcut-card small {
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
}

.profile-achievement-card .trophy-mini-row,
.profile-page .trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}

.profile-overview-side,
.profile-achievement-card,
.profile-achievement-card > *,
.profile-achievement-card .workspace-section-head {
  overflow: visible;
}

.profile-achievement-card .workspace-section-head {
  min-height: 78px;
  align-items: center;
}

.profile-achievement-card .workspace-section-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.profile-achievement-art {
  display: block;
  width: clamp(72px, 7vw, 88px);
  min-width: clamp(72px, 7vw, 88px);
  height: clamp(72px, 7vw, 88px);
  flex: 0 0 auto;
  object-fit: contain;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(20, 45, 34, .12));
}

.trophy-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 12px;
}

/* Notifications are compact action rows, not nested cards. */
.notification-list {
  display: grid;
  min-width: 0;
  gap: 0;
  overflow: hidden;
  border-block: 1px solid var(--border);
}

.notification-card {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  grid-template-columns: 44px minmax(0, 1fr) 10px 20px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 8px 8px 8px 4px;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.notification-card:last-child {
  border-bottom: 0;
}

.notification-card:hover,
.notification-card:focus-visible {
  background: var(--brand-soft);
  box-shadow: none;
  transform: none;
}

.notification-card.is-read {
  color: var(--text-2);
}

.notification-card.is-opening,
.notification-card.is-opening:disabled {
  opacity: 1;
  cursor: wait;
  background: var(--surface-subtle);
}

.notification-type-icon {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  color: var(--brand);
}

.notification-card.is-read .notification-type-icon {
  color: var(--text-2);
}

.notification-type-icon .icon,
.notification-card > .icon:last-child {
  width: 18px;
  height: 18px;
}

.notification-list {
  display: grid;
  gap: 18px;
}

.notification-content-section {
  scroll-margin-top: calc(var(--polish-topbar-h) + 12px);
}

.notification-load-state,
.notification-target-alert {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 12px 14px;
  color: var(--text-2);
}

.notification-load-state.is-compact {
  margin-bottom: 2px;
  border-inline: 0;
  border-radius: 0;
  background: transparent;
  padding-inline: 4px;
}

.notification-load-state.is-error,
.notification-target-alert.is-error,
.notification-target-alert.is-unavailable {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  color: var(--text);
}

.notification-load-state > div,
.notification-target-alert > div:not(.notification-target-actions) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notification-load-state strong,
.notification-target-alert strong {
  color: var(--text);
  font-size: 14px;
}

.notification-load-state small,
.notification-target-alert small {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}

.notification-target-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.notification-load-state button,
.notification-target-actions button {
  min-height: 40px;
}

.notification-opening-spinner {
  width: 16px;
  height: 16px;
  justify-self: end;
}

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

.notification-group > h3 {
  margin: 0;
  padding: 0 4px 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
}

.notification-group > div {
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: var(--surface);
}

.notification-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.notification-copy strong,
.notification-copy small {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.notification-copy strong {
  color: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.notification-copy small {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.notification-unread-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--brand);
}

.notification-card > .icon:last-child {
  justify-self: end;
  color: var(--text-2);
}

.trophy-card img,
.trophy-card .trophy-art,
.trophy-art {
  width: 58px;
  min-width: 58px;
  height: 58px;
  object-fit: contain;
}

.trophy-card > * {
  min-width: 0;
}

.trophy-card strong,
.trophy-card p,
.trophy-card span {
  display: block;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

/* Keep complex tools usable while sharing the same restraint. */
.community-modern .community-shell {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.community-modern .community-control-panel,
.community-modern .community-board-browser,
.community-modern .community-main-panel > *,
.community-modern .feed-tab-panel,
.community-modern .community-hero {
  border-radius: var(--radius-card);
  box-shadow: none;
}

.community-modern .community-section-tabs {
  gap: 4px;
  border-radius: 12px;
  padding: 4px;
}

.community-modern .community-section-tabs > button {
  min-height: 42px;
  border-radius: 9px;
}

.class-notice-section > .workspace-section-head {
  display: flex;
  min-height: 0;
  align-items: center;
}

.class-notice-filters {
  display: flex;
  width: auto;
  flex-flow: row nowrap;
  gap: 4px;
}

.class-notice-filters button {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-section-tabs {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  overflow: visible;
}

.admin-section-tabs button {
  min-height: 42px;
  white-space: normal;
}

.forum-editor,
.forum-editor-toolbar,
.forum-editor-content,
.forum-editor-surface,
.quiz-editor,
.quiz-question-editor-list,
.quiz-question-editor {
  min-width: 0;
}

.forum-editor-toolbar {
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.toast,
.toast-panel,
.notification-toast {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-control) !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-lifted) !important;
}

.notification-peek-layer {
  position: fixed;
  z-index: 1400;
  inset: 0;
  pointer-events: none;
}

.notification-peek-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.notification-peek {
  position: absolute;
  top: calc(var(--topbar-height, 64px) + 8px);
  right: max(16px, calc((100vw - 1180px) / 2));
  width: min(390px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgb(18 38 28 / 16%);
  pointer-events: auto;
}

.notification-peek > header,
.notification-peek > footer {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px 14px;
}

.notification-peek > header {
  border-bottom: 1px solid var(--border);
}

.notification-peek > footer {
  border-top: 1px solid var(--border);
}

.notification-peek > footer button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
}

.notification-peek-row {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  padding: 8px 12px;
  color: var(--text);
  text-align: left;
}

.notification-peek-row:hover,
.notification-peek-row:focus-visible {
  background: var(--surface-subtle);
}

.notification-peek-row > span:nth-child(2) {
  min-width: 0;
}

.notification-peek-row strong,
.notification-peek-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-peek-row strong {
  font-size: 13px;
  font-weight: 650;
}

.notification-peek-row small {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 11px;
}

.notification-peek-row .icon:last-child {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.notification-peek-empty,
.notification-peek-loading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
}

@media (max-width: 760px) {
  .notification-peek {
    top: calc(56px + env(safe-area-inset-top));
    right: 8px;
    width: calc(100vw - 16px);
    border-radius: 12px;
  }

  .notification-peek-row {
    min-height: 50px;
  }
}

/* Tablet */
@media (min-width: 761px) and (max-width: 1050px) {
  .topbar-inner {
    width: calc(100% - 28px);
    gap: 9px;
  }

  .topbar .brand {
    width: auto;
    min-width: 132px;
    max-width: none;
    justify-content: flex-start;
    overflow: visible;
  }

  .topbar .brand-title {
    display: block;
  }

  .nav button,
  .primary-nav button {
    padding-inline: 8px;
    font-size: 12px;
  }

  .profile-pill .account-label {
    display: none;
  }

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

  .community-modern .community-shell {
    grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  }
}

/* Mobile: recomposed instead of scaled down. */
.profile-settings-page {
  max-width: 760px;
  margin-inline: auto;
}

.account-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.account-appbar {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  margin-bottom: 2px;
}

.account-appbar > strong {
  text-align: center;
  font-size: 19px;
}

.account-settings-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.account-settings-index button {
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
}

.account-settings-index button:last-child {
  border-right: 0;
}

.account-settings-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.account-settings-stack > .panel,
.account-secondary-settings > .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: none;
}

.account-avatar-editor .profile-photo-preview {
  inline-size: 76px;
  min-inline-size: 76px;
  max-inline-size: 76px;
  block-size: 76px;
  min-block-size: 76px;
  max-block-size: 76px;
  aspect-ratio: 1 / 1;
  flex: 0 0 76px;
  padding: 0;
  border-radius: 50%;
}

.account-avatar-editor .profile-photo-preview > img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  aspect-ratio: 1 / 1;
  border-radius: inherit;
  object-fit: cover;
}

.account-readonly-school {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
}

.account-readonly-school > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--border);
}

.account-readonly-school > span:last-child {
  border-right: 0;
}

.account-readonly-school small,
.account-identity-current span,
.account-change-preview span {
  color: var(--text-2);
  font-size: 12px;
}

.account-readonly-school strong,
.account-identity-current strong,
.account-change-preview strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.account-student-number-settings,
.account-password-form,
.account-inline-form,
.account-confirm-form,
.account-correction-form {
  display: grid;
  gap: 12px;
}

.account-identity-current {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
  color: var(--brand-hover);
}

.account-inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.account-inline-form button,
.account-password-form button,
.account-correction-form button {
  min-height: 48px;
}

.account-change-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.account-change-preview > div {
  display: grid;
  gap: 4px;
}

.account-change-preview > p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}

.account-change-preview.is-unavailable {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: color-mix(in srgb, var(--danger) 4%, white);
}

.account-change-arrow {
  display: grid;
  place-items: center;
}

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

.account-password-form > .account-password-submit {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
}

.account-logout-row {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  color: var(--danger);
  background: var(--surface);
  text-align: left;
}

.notice-detail-page {
  max-width: 820px;
  margin-inline: auto;
}

.notice-article {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.notice-article-banner {
  width: 100%;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.notice-article-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
}

.notice-article-head,
.notice-article-body,
.notice-article > .notice-html-panel,
.notice-article > .post-quiz-gate,
.notice-article > .notice-interaction {
  margin-inline: clamp(18px, 4vw, 42px);
}

.notice-article-head {
  padding: clamp(24px, 5vw, 42px) 0 22px;
  border-bottom: 1px solid var(--border);
}

.notice-article-head h1 {
  margin: 12px 0 14px;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.3;
  letter-spacing: 0;
}

.notice-article-head .meta {
  gap: 6px 14px;
}

.notice-article-body {
  min-height: 160px;
  padding: 28px 0 36px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.notice-article > .notice-html-panel,
.notice-article > .post-quiz-gate,
.notice-article > .notice-interaction {
  margin-bottom: 24px;
}

.notice-article > .notice-action {
  margin: 0 clamp(18px, 4vw, 42px) 32px;
}

.notice-article .notice-html-panel iframe {
  height: min(70dvh, 720px) !important;
  min-height: 360px;
}

.notice-object-menu {
  position: relative;
}

.notice-object-menu > summary {
  list-style: none;
}

.notice-object-menu > summary::-webkit-details-marker {
  display: none;
}

.notice-object-menu > div {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: 0;
  width: min(260px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 45, 34, .12);
}

.notice-object-menu .notice-manage-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.notice-object-menu .notice-manage-actions > * {
  width: 100%;
  justify-content: flex-start;
}

@media (max-width: 820px) {
  :root {
    --ui-header-h: 58px;
    --polish-mobile-tab-h: 60px;
  }

  html {
    scroll-padding-top: 68px;
    scroll-padding-bottom: calc(var(--polish-mobile-tab-h) + env(safe-area-inset-bottom) + 14px);
  }

  body {
    padding-bottom: 0;
  }

  .app-shell {
    padding-bottom: calc(var(--polish-mobile-tab-h) + env(safe-area-inset-bottom));
  }

  .container,
  .app-shell > .container {
    width: calc(100% - 28px);
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .workspace-page,
  .workspace-subpage,
  .detail,
  .profile-page,
  .home-workspace,
  .questions-workspace,
  .quiz-workspace,
  .ask-workspace,
  .class-hub {
    gap: 16px;
  }

  .topbar-inner {
    width: calc(100% - 24px);
    min-height: var(--ui-header-h);
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 5px 0;
  }

  .primary-nav,
  .teacher-festival-role {
    display: none;
  }

  .topbar-actions {
    display: flex;
    gap: 0;
  }

  .topbar-actions .topbar-ask-cta {
    display: none;
  }

  .brand,
  .topbar .brand {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    inline-size: auto !important;
    min-inline-size: 0 !important;
    max-inline-size: none !important;
    flex: none !important;
    min-height: 46px;
    contain: none !important;
    gap: 7px;
    overflow: visible !important;
    padding-inline: 2px;
  }

  .brand-icons,
  .brand img,
  .brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .topbar .brand-title.school-brand-title {
    display: block !important;
    max-width: 108px;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
  }

  .topbar-right {
    grid-column: 3;
  }

  .account {
    gap: 4px;
  }

  .notification-card {
    min-height: 60px;
    grid-template-columns: 44px minmax(0, 1fr) 8px 18px;
    gap: 8px;
    padding-right: 4px;
  }

  .notification-load-state,
  .notification-target-alert {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notification-load-state > button,
  .notification-target-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .notification-load-state > button,
  .notification-target-actions button {
    flex: 1;
  }

  .topbar-notice-button,
  .profile-pill,
  .guest-login-pill,
  .mobile-logout-button {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: var(--radius-control);
    padding: 0;
  }

  .profile-pill {
    border: 0;
    background: transparent;
  }

  .profile-pill .avatar {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .app-shell:not(.is-festival-teacher) .mobile-logout-button {
    display: none;
  }

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

  .account-password-form > .account-password-submit {
    grid-column: auto;
    width: 100%;
  }

  .profile-pill .account-label,
  .guest-login-pill .account-label {
    display: none;
  }

  .workspace-head {
    display: grid;
    align-items: start;
    gap: 12px;
    padding: 2px 0 14px;
  }

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

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

  .workspace-head-actions {
    width: 100%;
  }

  .workspace-head-actions > button,
  .workspace-head-actions > .primary,
  .workspace-head-actions > .ghost,
  .workspace-head-actions > details {
    width: 100%;
    flex: 1 1 100%;
  }

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

  .workspace-section-head h2,
  .workspace-section-head h3,
  .section-title h2,
  .section-title h3,
  .panel h2 {
    font-size: 19px;
  }

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

  .home-welcome {
    padding-inline: 1px;
  }

  .home-welcome h1 {
    font-size: 25px;
  }

  .home-ask-hero {
    min-height: 166px;
    grid-template-columns: minmax(0, 1fr) 126px;
    padding: 20px;
  }

  .home-ask-copy {
    position: relative;
    z-index: 2;
    max-width: calc(100% - 92px);
  }

  .home-ask-copy small {
    font-size: 12px;
  }

  .home-ask-copy strong {
    font-size: 27px;
  }

  .home-ask-copy em {
    font-size: 12px;
  }

  .home-ask-hero > img {
    right: -10px;
    bottom: -7px;
    width: 155px;
    height: 155px;
    opacity: .96;
  }

  .home-search-panel,
  .home-school-life {
    padding: 14px;
  }

  .home-notice-panel,
  .home-school-feed {
    padding: 12px;
  }

  .home-notice-panel.is-single {
    padding: 0;
  }

  .home-class-summary,
  .home-club-summary {
    padding: 15px;
  }

  .home-notice-row {
    min-height: 58px;
    grid-template-columns: auto minmax(0, 1fr) 18px;
    gap: 8px;
    padding: 9px 12px;
  }

  .home-notice-row time {
    display: none;
  }

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

  .home-school-life-grid > button {
    min-height: 96px;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 9px 8px;
  }

  .home-school-life-grid strong {
    font-size: 13px;
  }

  .home-school-life-grid em {
    display: none;
  }

  .home-school-life-icon {
    width: 32px;
    height: 32px;
  }

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

  .school-feed-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .school-feed-tabs {
    width: 100%;
    min-height: 44px;
    padding: 3px;
  }

  .school-feed-tabs > button {
    min-height: 38px;
    padding: 5px 8px;
  }

  .school-feed-card {
    gap: 4px;
    padding: 6px 0;
  }

  .school-feed-author-row {
    gap: 6px;
  }

  .school-feed-author {
    gap: 7px;
  }

  .school-feed-avatar {
    width: 30px;
    min-width: 30px;
    height: 30px;
  }

  .school-feed-author strong {
    font-size: 12px;
    line-height: 1.25;
  }

  .school-feed-author small {
    font-size: 10px;
    line-height: 1.25;
  }

  .school-feed-save {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  .school-feed-content.has-media {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }

  .school-feed-copy {
    gap: 3px;
  }

  .school-feed-labels {
    gap: 4px;
  }

  .school-feed-labels > span {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .school-feed-thumbnail {
    width: 72px;
    height: 54px;
  }

  .school-feed-copy h3 {
    font-size: 15px;
    -webkit-line-clamp: 1;
  }

  .school-feed-copy p {
    display: none;
  }

  .school-feed-meta,
  .school-feed-metrics {
    gap: 7px;
  }

  .guest-intro-main {
    gap: 18px;
    padding: 22px 18px;
  }

  .guest-intro-heading h1,
  .guest-access-gate h1 {
    font-size: 26px;
  }

  .guest-service-row {
    padding: 14px 16px;
  }

  .guest-quiz-entry {
    gap: 12px;
    padding: 18px 16px;
  }

  .guest-privacy-note {
    padding: 10px 16px;
  }

  .question-filter-panel {
    padding: 12px;
  }

  .question-sort-menu > summary {
    width: 46px;
    min-width: 46px;
    padding: 0;
    font-size: 0;
  }

  .question-sort-menu > summary .icon {
    width: 18px;
    height: 18px;
  }

  .question-filter-subjects {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .question-filter-subjects::-webkit-scrollbar {
    display: none;
  }

  .question-filter-subjects .chips {
    flex-wrap: nowrap;
  }

  .question-filter-subjects .chip {
    flex: 0 0 auto;
  }

  .question-status-tabs > button {
    padding-inline: 4px;
    font-size: 11px;
  }

  .question-card,
  .question-feed-card {
    gap: 10px;
    padding: 15px;
  }

  .question-card-content.has-media {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 11px;
  }

  .question-card-content h3 {
    font-size: 17px;
  }

  .question-card-content p {
    font-size: 13px;
  }

  .question-card-content > img {
    width: 96px;
    height: 78px;
  }

  .question-card-meta {
    gap: 5px 9px;
  }

  .quiz-hero {
    min-height: 210px;
    grid-template-columns: minmax(0, 1fr) 132px;
    padding: 21px;
  }

  .quiz-hero > div {
    position: relative;
    z-index: 2;
    max-width: calc(100% - 76px);
  }

  .quiz-hero h1 {
    font-size: 28px;
  }

  .quiz-hero p {
    font-size: 13px;
  }

  .quiz-hero > div > .quiz-hero-join {
    min-width: 164px;
    min-height: 44px;
  }

  .quiz-hero > img {
    right: -13px;
    bottom: -4px;
    width: 168px;
    height: 168px;
  }

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

  .quiz-toolbar-actions {
    display: none;
  }

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

  .quiz-card {
    padding: 15px;
  }

  .quiz-grid .quiz-list-card {
    grid-template-columns: 78px minmax(0, 1fr) 38px 16px;
    gap: 10px;
    padding: 13px;
  }

  .quiz-list-code {
    width: 78px;
    min-width: 78px;
    min-height: 68px;
  }

  .quiz-list-code strong {
    max-width: 68px;
    font-size: 13px;
  }

  .quiz-list-copy h3 {
    font-size: 16px;
  }

  .quiz-list-copy > p {
    font-size: 12px;
  }

  .quiz-list-copy .quiz-card-meta {
    gap: 4px 8px;
    font-size: 11px;
  }

  .quiz-list-card .quiz-card-more > summary {
    width: 38px;
    min-width: 38px;
    min-height: 40px;
  }

  .quiz-list-open,
  .quiz-list-open .icon {
    width: 16px;
  }

  .detail-appbar {
    min-height: 46px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    padding-bottom: 8px;
  }

  .question-detail-card,
  .answer-card,
  .notice-card,
  .school-notice-card {
    padding: 15px;
  }

  .question-detail-heading {
    gap: 10px;
  }

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

  .question-body,
  .answer-content,
  .notice-body-copy,
  .prose,
  .forum-rendered-document {
    font-size: 15px;
    line-height: 1.68;
  }

  .answer-card .card-head {
    gap: 8px;
  }

  .ai-solution-section {
    padding: 14px;
  }

  .ai-solution-copy {
    font-size: 14px;
    line-height: 1.68;
  }

  .ai-solution-final .ai-solution-copy {
    font-size: 16px;
  }

  .notice-card-banner {
    width: calc(100% + 30px);
    margin: -15px -15px 2px;
  }

  .notice-card-expanded {
    padding: 16px;
  }

  .notice-card-expanded .notice-card-banner {
    width: calc(100% + 32px);
    margin: -16px -16px 2px;
  }

  .notice-card-expanded h3 {
    font-size: 21px;
  }

  .profile-cover-main {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

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

  .profile-identity h1 {
    font-size: 23px;
  }

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

  .profile-navigation-shell {
    grid-template-columns: minmax(0, 4fr) minmax(64px, 1fr);
    gap: 2px;
  }

  .profile-primary-tabs {
    gap: 2px;
  }

  .profile-primary-tabs button,
  .profile-more-menu > summary {
    min-height: 48px;
    flex-direction: column;
    gap: 3px;
    padding: 5px 2px;
    font-size: 10px;
  }

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

  .profile-more-backdrop {
    position: fixed;
    z-index: 46;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(15, 25, 20, .34);
  }

  .profile-more-popover {
    position: fixed;
    z-index: 47;
    top: auto;
    right: 10px;
    bottom: calc(var(--polish-mobile-tab-h) + env(safe-area-inset-bottom) + 8px);
    left: 10px;
    width: auto;
    max-height: min(70vh, 560px);
    border-radius: var(--radius-card);
    padding: 16px;
  }

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

  .profile-shortcut-card {
    min-height: 74px;
    padding: 10px;
  }

  .profile-achievement-card .trophy-mini-row,
  .profile-page .trophy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-achievement-card .workspace-section-head {
    min-height: 64px;
  }

  .profile-achievement-art {
    width: clamp(58px, 17vw, 68px);
    min-width: clamp(58px, 17vw, 68px);
    height: clamp(58px, 17vw, 68px);
  }

  .profile-achievement-card .trophy-mini-row,
  .profile-page .trophy-grid {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profile-achievement-card .trophy-card,
  .profile-page .trophy-card {
    width: 100%;
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .community-modern .community-shell {
    display: block;
  }

  .community-modern .community-mobile-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 7px;
    padding: 10px;
  }

  .community-modern .community-mobile-picker > button {
    width: 44px;
    min-width: 44px;
    padding: 0;
  }

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

  .class-notice-section > .workspace-section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .class-notice-filters {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .class-notice-filters button {
    width: 100%;
    min-width: 0;
    padding-inline: 4px;
  }

  .forum-editor-toolbar {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .forum-tool-button {
    flex: 0 0 42px;
  }

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

  .mobile-tabbar {
    position: fixed;
    z-index: 50;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: grid;
    width: 100% !important;
    max-width: none !important;
    height: calc(var(--polish-mobile-tab-h) + env(safe-area-inset-bottom));
    min-height: calc(var(--polish-mobile-tab-h) + env(safe-area-inset-bottom));
    grid-template-columns: repeat(var(--mobile-tab-count, 5), minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: initial;
    overflow: visible !important;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .98);
    padding: 2px 6px env(safe-area-inset-bottom) !important;
    box-shadow: 0 -4px 16px rgba(20, 45, 34, .06);
    backdrop-filter: blur(14px);
    transform: none;
  }

  .mobile-tabbar > button {
    position: relative;
    display: grid;
    width: 100%;
    min-width: 0;
    height: 56px;
    min-height: 56px;
    place-content: center;
    gap: 2px;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 4px 2px 3px;
    color: #707b75;
    font-size: 10px;
    font-weight: 550;
  }

  .mobile-tabbar > button::before {
    display: none;
  }

  .mobile-tabbar > button .icon {
    width: 21px;
    height: 21px;
    margin-inline: auto;
  }

  .mobile-tabbar > button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tabbar > button.active {
    background: transparent;
    color: var(--brand);
  }

  .toast {
    right: 14px;
    bottom: calc(var(--polish-mobile-tab-h) + env(safe-area-inset-bottom) + 12px);
    left: 14px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .container,
  .app-shell > .container {
    width: calc(100% - 24px);
  }

  .home-ask-hero {
    padding: 18px;
  }

  .home-ask-copy {
    max-width: calc(100% - 72px);
  }

  .home-ask-copy em {
    max-width: 210px;
  }

  .home-search-panel > header .icon-only {
    width: 40px;
    min-width: 40px;
  }

  .home-school-life-head > button {
    font-size: 12px;
  }

  .home-school-life-grid > button {
    padding-inline: 7px;
  }

  .home-school-life-grid small,
  .home-school-life-grid strong {
    overflow-wrap: anywhere;
  }

  .school-feed-content.has-media {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .school-feed-thumbnail {
    width: 72px;
    height: 54px;
  }

  .school-feed-meta time {
    margin-left: 0;
  }

  .question-card-content.has-media {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .question-card-content > img {
    width: 84px;
    height: 72px;
  }

  .question-card-meta time {
    width: 100%;
    margin-left: 0;
  }

  .quiz-hero > div {
    max-width: calc(100% - 62px);
  }

  .quiz-grid .quiz-list-card {
    grid-template-columns: 72px minmax(0, 1fr) 36px 14px;
    gap: 8px;
    padding: 12px 10px;
  }

  .quiz-list-code {
    width: 72px;
    min-width: 72px;
    min-height: 64px;
  }

  .quiz-list-code strong {
    max-width: 62px;
  }

  .quiz-list-copy > p {
    display: none;
  }

  .quiz-list-copy .quiz-card-meta > span:nth-child(3) {
    display: none;
  }

  .profile-stat-grid > div {
    padding-inline: 5px;
  }

  .profile-primary-tabs button,
  .profile-more-menu > summary {
    font-size: 9px;
  }

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

@media (max-width: 360px) {
  .home-ask-hero {
    grid-template-columns: minmax(0, 1fr) 104px;
    padding: 18px 16px;
  }

  .home-ask-copy {
    max-width: none;
  }

  .home-ask-copy strong {
    white-space: nowrap;
    font-size: 25px;
  }

  .home-ask-copy em {
    max-width: 150px;
  }

  .home-ask-hero > img {
    right: -12px;
    width: 132px;
    height: 132px;
  }

  .topbar .brand-title {
    display: none !important;
  }

  .topbar .brand {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    inline-size: 42px !important;
    min-inline-size: 42px !important;
    max-inline-size: 42px !important;
  }

  .account-settings-index button span {
    display: none;
  }

  .account-change-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-change-arrow {
    transform: rotate(90deg);
  }
}

@media (min-width: 600px) and (max-width: 820px) {
  .guest-site-intro {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .guest-intro-main {
    grid-template-columns: minmax(0, 1fr) 190px !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .question-card:hover,
  .question-feed-card:hover,
  .notice-card:hover,
  .school-notice-card:hover,
  .school-feed-card:hover,
  .profile-shortcut-card:hover,
  .quiz-card:hover {
    transform: none;
  }

  button:hover,
  summary:hover {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Quiz QA fixes: keep the quiz surface dense and stable without touching shared components. */
.quiz-workspace.section-browse {
  gap: 14px;
}

.quiz-workspace.section-browse .quiz-toolbar.panel {
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px;
}

.quiz-workspace.section-browse .quiz-toolbar .search-field {
  min-height: 38px;
  border: 0;
  background: transparent;
}

.quiz-grid {
  gap: 10px;
}

.quiz-grid .quiz-card::before {
  display: none !important;
  content: none !important;
}

.quiz-grid .quiz-list-card {
  grid-template-columns: 82px minmax(0, 1fr) 18px;
  gap: 12px;
  border-color: var(--border);
  padding: 12px 14px;
}

.quiz-grid .quiz-list-card.can-manage {
  grid-template-columns: 82px minmax(0, 1fr) 40px 18px;
}

.quiz-list-code {
  width: 82px;
  min-width: 82px;
  min-height: 66px;
}

.quiz-list-code strong {
  max-width: 72px;
  font-size: 13px;
}

.quiz-list-copy {
  gap: 3px;
}

.quiz-list-copy .quiz-card-head:empty {
  display: none;
}

.quiz-list-copy h3 {
  font-size: 16px;
  line-height: 1.35;
}

.quiz-list-copy > p {
  font-size: 12px;
  line-height: 1.4;
}

.quiz-list-copy .quiz-card-meta {
  gap: 4px 8px;
  margin-top: 1px;
  font-size: 11px;
}

.quiz-list-card .quiz-card-more > summary {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
}

.quiz-list-card .quiz-list-open {
  grid-column: -1;
}

.quiz-play {
  grid-template-rows: auto auto auto minmax(150px, auto) !important;
  overflow: visible;
}

.quiz-play .quiz-feedback-slot {
  min-height: 150px;
  align-items: stretch;
  overflow: visible;
}

.quiz-play .quiz-feedback-slot .quiz-feedback {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.quiz-play .quiz-feedback-slot .quiz-feedback p {
  max-height: none;
  overflow: visible;
}

@media (max-width: 760px) {
  .quiz-workspace.section-browse {
    gap: 12px;
  }

  .quiz-workspace.section-browse .quiz-toolbar.panel {
    min-height: 48px;
    padding: 5px 7px;
  }

  .quiz-workspace.section-create {
    gap: 12px;
  }

  .quiz-workspace.section-create .quiz-hero {
    height: 72px;
    min-height: 72px;
    grid-template-columns: minmax(0, 1fr) 72px;
    overflow: hidden;
    padding: 12px 15px;
  }

  .quiz-workspace.section-create .quiz-hero > div {
    max-width: none;
    gap: 0;
  }

  .quiz-workspace.section-create .quiz-hero > div > span,
  .quiz-workspace.section-create .quiz-hero p,
  .quiz-workspace.section-create .quiz-hero-join {
    display: none;
  }

  .quiz-workspace.section-create .quiz-hero h1 {
    font-size: 22px;
  }

  .quiz-workspace.section-create .quiz-hero > img {
    right: 0;
    bottom: -13px;
    width: 86px;
    height: 86px;
  }

  .quiz-grid .quiz-list-card {
    grid-template-columns: 68px minmax(0, 1fr) 14px;
    gap: 8px;
    padding: 10px 11px;
  }

  .quiz-grid .quiz-list-card.can-manage {
    grid-template-columns: 68px minmax(0, 1fr) 36px 14px;
  }

  .quiz-list-code {
    width: 68px;
    min-width: 68px;
    min-height: 60px;
  }

  .quiz-list-code strong {
    max-width: 60px;
    font-size: 12px;
  }

  .quiz-list-copy h3 {
    font-size: 15px;
  }

  .quiz-list-copy .quiz-card-meta > span:nth-child(3) {
    display: inline-flex;
  }

  .quiz-list-card .quiz-card-more > summary {
    width: 36px;
    min-width: 36px;
    min-height: 38px;
  }

  .quiz-play {
    grid-template-rows: auto auto auto minmax(186px, auto) !important;
  }

  .quiz-play .quiz-feedback-slot {
    min-height: 186px;
  }

  .quiz-play .quiz-feedback-slot .quiz-feedback {
    align-content: center;
    padding: 14px;
  }

  .quiz-play .quiz-feedback-slot .quiz-feedback > button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .quiz-live-host .quiz-live-host-main {
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .quiz-live-host .quiz-live-question-stage {
    display: grid;
    min-height: auto;
    flex: 0 0 auto;
    grid-template-rows: auto auto auto auto;
    overflow: visible;
  }

  .quiz-live-host .quiz-live-host-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-live-host .quiz-live-host-option {
    min-height: 64px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 10px;
  }

  .quiz-live-host .quiz-live-host-option > em {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .quiz-live-host .quiz-live-side-rail {
    min-height: 0;
    flex: 0 0 auto;
  }
}

/* Final cross-screen QA: keep shared chrome and solo quiz surfaces predictable. */
.topbar .brand-title.school-brand-title {
  display: flex !important;
  height: 22px !important;
  min-height: 22px !important;
  align-items: center;
  overflow: visible !important;
  line-height: 22px !important;
}

.topbar .brand-title .school-title-only {
  display: inline-flex !important;
  height: 22px !important;
  min-height: 22px !important;
  align-items: center;
  overflow: visible !important;
  line-height: 22px !important;
}

.profile-more-menu[open] > .profile-more-backdrop {
  z-index: 1290;
}

.profile-more-menu[open] > .profile-more-popover {
  z-index: 1301;
}

.quiz-list-card .quiz-card-more > summary::after {
  display: none !important;
  content: none !important;
}

.app-shell .primary:not(.danger),
.app-shell button.primary:not(.danger),
.app-shell .button-primary:not(.danger),
.app-shell .workspace-primary-cta {
  border-color: var(--brand) !important;
  background: var(--brand) !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: none !important;
}

.app-shell .primary:not(.danger):hover,
.app-shell button.primary:not(.danger):hover,
.app-shell .button-primary:not(.danger):hover,
.app-shell .workspace-primary-cta:hover {
  border-color: var(--brand-hover) !important;
  background: var(--brand-hover) !important;
}

.app-shell .chip.active,
.app-shell .chip[aria-selected="true"] {
  box-shadow: none !important;
}

.quiz-start,
.quiz-play,
.quiz-result {
  --quiz-accent: var(--brand);
  --quiz-accent-strong: var(--brand-hover);
  --quiz-game-bg: var(--surface);
  border-color: var(--border);
  background: var(--bg);
  color: var(--text);
  box-shadow: none;
}

.quiz-start-card,
.quiz-result-card {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.quiz-start-card :is(h1, p, label),
.quiz-result-card :is(h1, p),
.quiz-result-card .hero-kicker,
.quiz-start-card > p,
.quiz-result-card > p {
  color: inherit;
}

.quiz-start-card .quiz-code,
.quiz-result-card .quiz-code,
.quiz-start-card .quiz-start-meta span {
  border-color: var(--border);
  background: var(--surface-subtle);
  color: var(--text-2);
}

.quiz-start-card .input {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.quiz-start-card .primary,
.quiz-result-card .primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.quiz-start-card .primary:hover,
.quiz-result-card .primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.quiz-start-card .ghost,
.quiz-result-card .ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.quiz-start-card .ghost:hover,
.quiz-result-card .ghost:hover {
  border-color: #b8d8ca;
  background: var(--brand-soft);
  color: var(--brand);
}

.quiz-play {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.quiz-play .quiz-play-top .ghost,
.quiz-play .quiz-code,
.quiz-play .badge {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-2);
}

.quiz-play .quiz-question-stage {
  border-color: var(--border);
  background: var(--surface);
}

.quiz-play .quiz-question-stage h1,
.quiz-play .quiz-help {
  color: var(--text);
}

.quiz-play .quiz-progress,
.quiz-play .quiz-timer {
  background: var(--surface-subtle);
}

.quiz-play .quiz-progress span,
.quiz-play .quiz-timer span {
  background: var(--brand);
}

.quiz-play .quiz-answer,
.quiz-play .quiz-answer.answer-1,
.quiz-play .quiz-answer.answer-2,
.quiz-play .quiz-answer.answer-3 {
  min-height: 72px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.quiz-play .quiz-answer :is(span, strong) {
  color: inherit;
}

.quiz-play .quiz-answer:hover,
.quiz-play .quiz-answer.selected {
  border-color: var(--brand);
  outline: 0;
  background: var(--brand-soft);
  color: var(--brand);
  filter: none;
  transform: none;
}

.quiz-play .quiz-answer.correct {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.quiz-play .quiz-answer.wrong {
  border-color: #e8b7b3;
  background: #fff4f3;
  color: var(--danger);
}

.quiz-play .quiz-feedback .primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.quiz-play .quiz-feedback .primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

@media (max-width: 760px) {
  .topbar .brand-title.school-brand-title,
  .topbar .brand-title .school-title-only {
    max-width: 112px;
    font-size: 14px;
    white-space: nowrap;
  }

  .home-school-life {
    gap: 7px;
    padding: 11px 12px;
  }

  .home-school-life-head p {
    display: none;
  }

  .home-school-life-head > button {
    min-height: 32px;
  }

  .home-school-life-grid > button {
    min-height: 76px;
    gap: 4px;
    padding: 8px 6px;
  }

  .home-school-life-icon {
    width: 29px;
    height: 29px;
  }

  .home-school-life-grid small {
    font-size: 10px;
  }

  .home-school-life-grid strong {
    font-size: 12px;
    line-height: 1.3;
  }

  .quiz-start,
  .quiz-result {
    gap: 12px;
    padding: 0;
    background: transparent;
  }

  .quiz-start-card,
  .quiz-result-card {
    padding: 18px;
  }

  .quiz-play {
    gap: 12px;
    padding: 12px;
  }

  .quiz-play .quiz-answer-grid {
    gap: 8px;
  }

  .quiz-play .quiz-answer,
  .quiz-play .quiz-answer.answer-1,
  .quiz-play .quiz-answer.answer-2,
  .quiz-play .quiz-answer.answer-3 {
    min-height: 60px;
  }
}

/* Compact global feedback: keep save/error messages out of the content area. */
.toast {
  position: fixed !important;
  z-index: 3200 !important;
  top: calc(env(safe-area-inset-top) + 8px) !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  display: block !important;
  width: max-content !important;
  max-width: min(620px, calc(100vw - 24px)) !important;
  min-height: 36px !important;
  max-height: 40px !important;
  margin: 0 !important;
  padding: 7px 13px !important;
  overflow: hidden !important;
  border: 1px solid rgb(11 116 84 / 20%) !important;
  border-radius: 10px !important;
  background: rgb(255 255 255 / 98%) !important;
  box-shadow: 0 8px 24px rgb(18 38 28 / 14%) !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 24px !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  text-shadow: none !important;
  white-space: nowrap !important;
  transform: translateX(-50%) !important;
  backdrop-filter: blur(12px) saturate(145%);
  animation: compact-toast-in 160ms ease-out both;
}

@keyframes compact-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 680px) {
  .toast {
    top: calc(env(safe-area-inset-top) + 6px) !important;
    max-width: calc(100vw - 20px) !important;
    min-height: 34px !important;
    max-height: 38px !important;
    padding: 5px 11px !important;
    font-size: 12.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}


/* Source: /home-feed-detail-reference.css?v=9 */
/*
 * Wooshin Tutor home and public-feed finishing pass.
 * Load after ui-polish.css. This file intentionally changes presentation only.
 */

:root {
  --home-detail-line: color-mix(in srgb, var(--border) 88%, transparent);
  --home-detail-muted: var(--text-2);
  --home-detail-hover: color-mix(in srgb, var(--brand-soft) 58%, #fff);
  --home-detail-control: 10px;
  --home-detail-card: 16px;
}

/* Page rhythm */
.home-workspace {
  width: min(100%, 1040px);
  gap: 18px;
  overflow: visible;
}

.home-workspace > * {
  min-width: 0;
  max-width: 100%;
}

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

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

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

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

.home-workspace .home-context-list[class*="home-context-count-"] .home-context-item {
  border-right: 1px solid var(--border);
  border-bottom: 0;
}

.home-workspace .home-context-list[class*="home-context-count-"] .home-context-item:last-child {
  border-right: 0;
}

@media (max-width: 900px) {
  .home-workspace .home-context-list.home-context-count-3,
  .home-workspace .home-context-list.home-context-count-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-workspace .home-context-list[class*="home-context-count-"] .home-context-item {
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .home-workspace .home-context-list[class*="home-context-count-"] .home-context-item:nth-child(2n) {
    border-right: 0;
  }

  .home-workspace .home-context-list.home-context-count-3 .home-context-item:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .home-workspace .home-context-list.home-context-count-1 .home-context-item,
  .home-workspace .home-context-list.home-context-count-2 .home-context-item,
  .home-workspace .home-context-list.home-context-count-3 .home-context-item:last-child,
  .home-workspace .home-context-list.home-context-count-4 .home-context-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 700px) {
  .home-workspace .home-context-list[class*="home-context-count-"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-workspace .home-context-list[class*="home-context-count-"] .home-context-item,
  .home-workspace .home-context-list[class*="home-context-count-"] .home-context-item:nth-child(2n) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .home-workspace .home-context-list[class*="home-context-count-"] .home-context-item:last-child {
    grid-column: auto;
    border-bottom: 0;
  }
}

.home-welcome {
  gap: 2px;
  padding: 1px 2px 0;
}

.home-welcome > span {
  color: var(--home-detail-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.home-welcome h1 {
  max-width: 22ch;
  font-size: clamp(25px, 3vw, 30px);
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.25;
}

.home-workspace .home-announcement-bar {
  position: relative;
  display: block;
  width: 100%;
  min-height: 52px;
  overflow: hidden;
  border: 1px solid var(--home-detail-line);
  border-radius: 15px;
  background: var(--surface);
  padding: 0;
  color: var(--text);
  box-shadow: 0 5px 18px rgba(10, 74, 52, .06);
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.home-workspace .home-announcement-viewport {
  display: grid;
  min-width: 0;
  overflow: hidden;
}

.home-workspace .home-announcement-slide {
  grid-area: 1 / 1;
  min-width: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.home-workspace .home-announcement-slide.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.home-workspace .home-announcement-slide.is-transition-source,
.home-workspace .home-announcement-slide.is-transition-target {
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

.home-workspace .home-announcement-carousel.is-dragging .home-announcement-slide {
  transition: none;
}

.home-workspace .home-announcement-carousel.is-settling .home-announcement-slide.is-transition-source,
.home-workspace .home-announcement-carousel.is-settling .home-announcement-slide.is-transition-target {
  transition: transform 280ms cubic-bezier(.22, .8, .3, 1);
}

.home-workspace .home-announcement-link {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 9px 12px 9px 14px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.home-workspace .home-announcement-link:hover,
.home-workspace .home-announcement-link:focus-visible {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 25%, var(--surface));
}

.home-workspace .home-announcement-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -3px;
}

.home-workspace .home-announcement-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: var(--brand-soft);
  padding: 5px 8px;
  color: var(--brand-strong, var(--brand));
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.home-workspace .home-announcement-bar-label .icon {
  width: 14px;
  height: 14px;
}

.home-workspace .home-announcement-link strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-announcement-bar-date {
  color: var(--home-detail-muted);
  font-size: 11px;
  white-space: nowrap;
}

.home-workspace .home-announcement-bar-action {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.home-workspace .home-announcement-bar-action .icon {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

/* Primary question entry */
.home-workspace .home-ask-hero {
  min-height: 168px;
  grid-template-columns: minmax(0, 1fr) 210px;
  border-radius: var(--home-detail-card);
  padding: 22px 26px;
  box-shadow: none;
}

.home-workspace .home-ask-hero::after {
  right: -92px;
  bottom: -122px;
  width: 270px;
  height: 270px;
  border-width: 42px;
  opacity: .72;
}

.home-workspace .home-ask-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  gap: 6px;
}

.home-workspace .home-ask-copy small,
.home-workspace .home-ask-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-ask-copy small {
  font-size: 13px;
  font-weight: 520;
}

.home-workspace .home-ask-copy strong {
  width: fit-content;
  gap: 6px;
  font-size: 28px;
  font-weight: 720;
}

.home-workspace .home-ask-copy strong .icon {
  width: 22px;
  height: 22px;
}

.home-workspace .home-ask-copy em {
  max-width: 38ch;
  font-size: 13px;
  line-height: 1.45;
}

.home-workspace .home-ask-hero > img {
  right: 16px;
  bottom: -14px;
  width: 184px;
  height: 184px;
  object-position: center bottom;
}

/* Search is a compact tool surface, not another hero card. */
.home-workspace .home-search-panel {
  gap: 9px;
  border-color: var(--home-detail-line);
  border-radius: var(--home-detail-card);
  padding: 14px;
}

.home-workspace .home-search-panel > header {
  min-height: 32px;
  gap: 8px;
}

.home-workspace .home-search-panel h2 {
  font-size: 16px;
  font-weight: 680;
}

.home-workspace .home-search-panel > header .icon-only {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 9px;
}

.home-workspace .home-quick-search .search-field {
  min-height: 44px;
  gap: 8px;
  border-color: var(--home-detail-line);
  border-radius: var(--home-detail-control);
  padding-inline: 12px;
}

.home-workspace .home-quick-search .search-field > .icon {
  width: 18px;
  height: 18px;
  color: var(--home-detail-muted);
}

.home-workspace .home-quick-search input {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
}

.home-workspace .home-search-terms {
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.home-workspace .home-search-terms::-webkit-scrollbar {
  display: none;
}

.home-workspace .home-search-terms button {
  min-height: 27px;
  flex: 0 0 auto;
  border-color: var(--home-detail-line);
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.home-workspace .home-search-terms .home-search-more {
  width: 28px;
  min-width: 28px;
  padding: 0;
}

/* Today at school */
.home-workspace .home-school-life {
  gap: 8px;
  border-color: var(--home-detail-line);
  border-radius: var(--home-detail-card);
  padding: 14px;
}

.home-workspace .home-school-life-head {
  min-height: 38px;
  align-items: center;
  gap: 10px;
}

.home-workspace .home-school-life-head > div {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 8px;
  row-gap: 0;
}

.home-workspace .home-school-life-head .workspace-kicker {
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 1.35;
}

.home-workspace .home-school-life-head h2 {
  overflow: hidden;
  font-size: 16px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-school-life-head p {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-school-life-head > button {
  min-width: fit-content;
  min-height: 34px;
  gap: 3px;
  padding-inline: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.home-workspace .home-class-entry {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--home-detail-line);
  border-radius: 11px;
  background: var(--surface);
  padding: 8px 12px;
  color: var(--text);
  text-align: left;
}

.home-workspace .home-class-entry:hover,
.home-workspace .home-class-entry:focus-visible {
  border-color: var(--brand);
  background: var(--home-detail-hover);
}

.home-workspace .home-class-entry > span {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 7px;
}

.home-workspace .home-class-entry strong {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.home-workspace .home-class-entry small {
  overflow: hidden;
  color: var(--home-detail-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-class-entry > .icon {
  width: 17px;
  height: 17px;
  color: var(--brand);
}

.home-workspace .home-timetable-guide {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--home-detail-line);
  border-radius: 12px;
  background: var(--surface);
}

.home-workspace .home-next-class {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--home-detail-line);
  border-radius: 0;
  background: color-mix(in srgb, var(--brand-soft) 52%, var(--surface));
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
}

.home-workspace .home-next-class:hover {
  background: color-mix(in srgb, var(--brand-soft) 78%, var(--surface));
}

.home-workspace .home-next-class > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-workspace .home-next-class small,
.home-workspace .home-next-class strong,
.home-workspace .home-next-class em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-next-class small {
  color: var(--brand);
  font-size: 10px;
  font-weight: 680;
}

.home-workspace .home-next-class strong {
  font-size: 15px;
  font-weight: 720;
}

.home-workspace .home-next-class em {
  color: var(--home-detail-muted);
  font-size: 10px;
  font-style: normal;
}

.home-workspace .home-next-class > b {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand);
  font-size: 11px;
  white-space: nowrap;
}

.home-workspace .home-next-class > b .icon {
  width: 15px;
  height: 15px;
}

.home-workspace .home-timetable-strip {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.home-workspace .home-timetable-period {
  display: grid;
  min-width: 92px;
  min-height: 68px;
  flex: 1 0 92px;
  align-content: center;
  gap: 2px;
  border: 0;
  border-right: 1px solid var(--home-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 8px 9px;
  color: var(--text);
  text-align: left;
}

.home-workspace .home-timetable-period:last-child {
  border-right: 0;
}

.home-workspace .home-timetable-period:hover {
  background: var(--home-detail-hover);
}

.home-workspace .home-timetable-period small,
.home-workspace .home-timetable-period strong,
.home-workspace .home-timetable-period em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-timetable-period small {
  color: var(--home-detail-muted);
  font-size: 9px;
  font-weight: 600;
}

.home-workspace .home-timetable-period strong {
  font-size: 11px;
  font-weight: 650;
}

.home-workspace .home-timetable-period em {
  color: var(--home-detail-muted);
  font-size: 9px;
  font-style: normal;
}

.home-workspace .home-timetable-period.is-current {
  background: color-mix(in srgb, var(--brand-soft) 76%, var(--surface));
  box-shadow: inset 0 3px 0 var(--brand);
}

.home-workspace .home-timetable-period.is-next {
  background: color-mix(in srgb, var(--info-soft) 74%, var(--surface));
  box-shadow: inset 0 3px 0 var(--info);
}

.home-workspace .home-timetable-period.is-current small,
.home-workspace .home-timetable-period.is-next small {
  color: var(--brand);
}

.home-workspace .home-timetable-period.is-done {
  opacity: .58;
}

.home-workspace .home-next-class:focus-visible,
.home-workspace .home-timetable-period:focus-visible {
  z-index: 1;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.home-workspace .home-school-life-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top-color: var(--home-detail-line);
}

.home-workspace .home-school-life-grid > button {
  min-height: 96px;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  border-right-color: var(--home-detail-line);
  padding: 11px 10px;
}

.home-workspace .home-school-life-grid > button:focus-visible {
  z-index: 1;
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.home-workspace .home-school-life-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.home-workspace .home-school-life-icon .icon {
  width: 17px;
  height: 17px;
}

.home-workspace .home-school-life-grid > button > span:nth-child(2) {
  gap: 2px;
}

.home-workspace .home-school-life-grid small {
  font-size: 10px;
  font-weight: 550;
}

.home-workspace .home-school-life-grid strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.36;
}

.home-workspace .home-school-life-grid em {
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 700px) {
  .home-workspace .home-announcement-link {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .home-workspace .home-announcement-link strong {
    font-size: 13px;
  }

  .home-workspace .home-announcement-bar-date,
  .home-workspace .home-announcement-bar-action {
    display: none;
  }
}

/* Public feed */
.home-workspace .home-school-feed {
  gap: 8px;
  border-color: var(--home-detail-line);
  border-radius: var(--home-detail-card);
  padding: 14px;
}

.home-workspace .school-feed-section-head {
  align-items: end;
  gap: 12px;
}

.home-workspace .school-feed-section-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.home-workspace .school-feed-section-head .workspace-kicker {
  font-size: 10px;
}

.home-workspace .school-feed-section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 690;
  line-height: 1.35;
}

.home-workspace .school-feed-section-head p {
  margin: 0;
  color: var(--home-detail-muted);
  font-size: 11px;
  line-height: 1.45;
}

.home-workspace .school-feed-tabs {
  width: min(244px, 100%);
  min-height: 40px;
  padding: 3px;
}

.home-workspace .school-feed-tabs > button {
  min-height: 34px;
  border-radius: 8px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 610;
}

.home-workspace .school-feed-list {
  border-top: 1px solid var(--home-detail-line);
}

.home-workspace .school-feed-card {
  grid-template-rows: auto auto auto;
  gap: 5px;
  border-bottom-color: var(--home-detail-line);
  padding: 12px 2px;
}

.home-workspace .school-feed-card:hover {
  border-radius: 8px;
}

.home-workspace .school-feed-author-row {
  gap: 8px;
}

.home-workspace .school-feed-author {
  min-width: 0;
  flex: 1 1 auto;
  gap: 8px;
}

.home-workspace .school-feed-avatar {
  width: 30px;
  min-width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-color: var(--home-detail-line);
  font-size: 11px;
}

.home-workspace .school-feed-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-position: center;
}

.home-workspace .school-feed-author > span:last-child {
  max-width: 100%;
}

.home-workspace .school-feed-author strong {
  max-width: min(34ch, 60vw);
  font-size: 12px;
  line-height: 1.3;
}

.home-workspace .school-feed-author small {
  max-width: min(42ch, 66vw);
  font-size: 10px;
  line-height: 1.35;
}

.home-workspace .school-feed-save {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
}

.home-workspace .school-feed-save .icon {
  width: 18px;
  height: 18px;
}

.home-workspace .school-feed-content {
  min-width: 0;
}

.home-workspace .school-feed-content.has-media {
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
}

.home-workspace .school-feed-copy {
  gap: 3px;
}

.home-workspace .school-feed-labels {
  gap: 4px;
}

.home-workspace .school-feed-labels > span {
  min-height: 19px;
  padding: 1px 6px;
  font-size: 9.5px;
  line-height: 1;
}

.home-workspace .school-feed-copy h3 {
  font-size: 15px;
  font-weight: 660;
  line-height: 1.42;
  -webkit-line-clamp: 1;
}

.home-workspace .school-feed-copy p {
  font-size: 12px;
  line-height: 1.5;
  -webkit-line-clamp: 1;
}

.home-workspace .school-feed-thumbnail {
  display: block;
  width: 88px;
  height: 64px;
  align-self: center;
  border-color: var(--home-detail-line);
  border-radius: 9px;
  object-position: center;
}

.home-workspace .school-feed-meta {
  min-width: 0;
  gap: 7px;
  font-size: 10px;
  line-height: 1.3;
}

.home-workspace .school-feed-metrics {
  min-width: 0;
  gap: 9px;
}

.home-workspace .school-feed-metrics > span {
  gap: 3px;
}

.home-workspace .school-feed-metrics .icon {
  width: 14px;
  height: 14px;
}

.home-workspace .school-feed-meta time {
  max-width: 14ch;
  overflow: hidden;
  flex: 0 1 auto;
  text-overflow: ellipsis;
}

.home-workspace .school-feed-open {
  display: none;
}

.home-workspace .school-feed-more {
  display: flex;
  justify-content: center;
  padding-top: 3px;
}

.home-workspace .school-feed-more > button {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 12px;
}

.home-workspace .school-feed-empty {
  min-height: 132px;
  border: 0;
  background: transparent;
  padding: 18px 12px;
}

.home-workspace .school-feed-skeleton {
  border-radius: 0;
}

/* Home community rows keep one author image and clip metadata safely. */
.home-workspace .home-community-row {
  width: 100%;
  min-width: 0;
  border-color: var(--home-detail-line);
  border-radius: 10px;
}

.home-workspace .home-community-main,
.home-workspace .home-community-copy,
.home-workspace .home-community-meta {
  min-width: 0;
}

.home-workspace .home-community-main > .mini-avatar {
  width: 30px;
  min-width: 30px;
  height: 30px;
  flex: 0 0 30px;
}

.home-workspace .home-community-copy strong,
.home-workspace .home-community-board {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-workspace .home-community-meta {
  overflow: hidden;
  flex-wrap: nowrap;
}

.home-workspace .home-community-meta > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Directory icons remain a true square to the left of each community. */
.community-directory-page .enhanced-board-list .community-board {
  grid-template-columns: 64px minmax(0, 1fr) 40px;
  align-items: center;
}

.community-directory-page .enhanced-board-list .board-type-icon {
  display: grid;
  width: 64px;
  min-width: 64px;
  height: 64px;
  place-items: center;
  align-self: center;
  overflow: hidden;
  border: 1px solid var(--home-detail-line);
  border-radius: 11px;
  background: var(--surface-subtle);
}

.community-directory-page .enhanced-board-list .board-type-icon > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.community-directory-page .enhanced-board-list .board-type-icon > .icon {
  width: 24px;
  height: 24px;
  color: var(--board-color, var(--brand));
}

@media (hover: hover) {
  .home-workspace .home-school-life-grid > button:hover,
  .home-workspace .school-feed-card:hover,
  .home-workspace .home-community-row:hover {
    background: var(--home-detail-hover);
  }
}

@media (max-width: 700px) {
  .home-workspace {
    gap: 14px;
  }

  .home-welcome {
    padding-inline: 0;
  }

  .home-welcome > span {
    font-size: 11px;
  }

  .home-welcome h1 {
    font-size: 24px;
  }

  .home-workspace .home-ask-hero {
    min-height: 148px;
    grid-template-columns: minmax(0, 1fr) 116px;
    padding: 17px 16px;
  }

  .home-workspace .home-ask-copy {
    width: calc(100% - 72px);
    max-width: none;
  }

  .home-workspace .home-ask-copy small {
    font-size: 11px;
  }

  .home-workspace .home-ask-copy strong {
    font-size: 23px;
  }

  .home-workspace .home-ask-copy strong .icon {
    width: 19px;
    height: 19px;
  }

  .home-workspace .home-ask-copy em {
    max-width: 23ch;
    font-size: 11px;
  }

  .home-workspace .home-ask-hero > img {
    right: -5px;
    bottom: -5px;
    width: 136px;
    height: 136px;
  }

  .home-workspace .home-search-panel,
  .home-workspace .home-school-life,
  .home-workspace .home-school-feed {
    padding: 12px;
  }

  .home-workspace .home-search-panel h2,
  .home-workspace .home-school-life-head h2 {
    font-size: 15px;
  }

  .home-workspace .home-quick-search .search-field {
    min-height: 42px;
  }

  .home-workspace .home-school-life-head > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-workspace .home-school-life-head p {
    display: none;
  }

  .home-workspace .home-school-life-head > button {
    font-size: 11px;
  }

  .home-workspace .home-next-class {
    gap: 8px;
    padding: 11px 12px;
  }

  .home-workspace .home-next-class strong {
    font-size: 14px;
  }

  .home-workspace .home-timetable-period {
    min-width: 96px;
    min-height: 64px;
    flex-basis: 96px;
  }

  .home-workspace .home-school-life-grid {
    grid-template-areas:
      "time time"
      "meal meal"
      "event event";
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-workspace .home-school-life-grid > button {
    min-height: 76px;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
  }

  .home-workspace .home-school-life-grid > button:nth-child(1) {
    grid-area: time;
  }

  .home-workspace .home-school-life-grid > button:nth-child(2) {
    grid-area: meal;
    border-right: 0;
  }

  .home-workspace .home-school-life-grid > button:nth-child(3) {
    grid-area: event;
    border-top: 1px solid var(--home-detail-line);
  }

  .home-workspace .home-school-life-grid strong {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .home-workspace .home-school-life-grid em {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .home-workspace .school-feed-section-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 7px;
  }

  .home-workspace .school-feed-section-head p {
    display: none;
  }

  .home-workspace .school-feed-tabs {
    width: 100%;
    min-height: 38px;
  }

  .home-workspace .school-feed-tabs > button {
    min-height: 32px;
    padding-inline: 7px;
    font-size: 11px;
  }

  .home-workspace .school-feed-card {
    gap: 4px;
    padding: 10px 0;
  }

  .home-workspace .school-feed-author {
    gap: 7px;
  }

  .home-workspace .school-feed-avatar {
    width: 28px;
    min-width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .home-workspace .school-feed-author strong {
    max-width: calc(100vw - 126px);
  }

  .home-workspace .school-feed-author small {
    max-width: calc(100vw - 126px);
  }

  .home-workspace .school-feed-save {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    flex-basis: 30px;
  }

  .home-workspace .school-feed-content.has-media {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }

  .home-workspace .school-feed-copy h3 {
    font-size: 14px;
  }

  .home-workspace .school-feed-copy p {
    display: none;
  }

  .home-workspace .school-feed-thumbnail {
    width: 72px;
    height: 54px;
  }

  .home-workspace .school-feed-meta {
    gap: 5px;
  }

  .home-workspace .school-feed-metrics {
    gap: 7px;
  }

  .home-workspace .school-feed-meta time {
    max-width: 9ch;
  }

  .home-workspace .home-community-meta > span:first-child {
    overflow: hidden;
    max-width: 14ch;
    text-overflow: ellipsis;
  }

  .community-directory-page .enhanced-board-list .community-board {
    grid-template-columns: 56px minmax(0, 1fr) 34px;
    gap: 10px;
  }

  .community-directory-page .enhanced-board-list .board-type-icon {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-radius: 10px;
  }
}

@media (max-width: 390px) {
  .home-workspace .home-ask-hero {
    min-height: 142px;
  }

  .home-workspace .home-ask-copy {
    width: calc(100% - 64px);
  }

  .home-workspace .home-ask-copy strong {
    font-size: 22px;
  }

  .home-workspace .home-ask-copy em {
    max-width: 20ch;
  }

  .home-workspace .home-ask-hero > img {
    right: -11px;
    width: 130px;
    height: 130px;
  }

  .home-workspace .home-school-life-grid > button {
    padding-inline: 6px;
  }

  .home-workspace .home-next-class > b {
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-workspace .home-school-life-grid strong {
    font-size: 11px;
  }

  .home-workspace .school-feed-labels > span {
    padding-inline: 5px;
  }
}

@media (min-width: 900px) {
  .home-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .home-workspace .home-ask-hero,
  .home-workspace .home-search-panel,
  .home-workspace .home-school-life,
  .home-workspace .home-school-feed,
  .home-workspace .home-class-summary,
  .home-workspace .home-club-summary {
    width: 100%;
  }

  .home-workspace .school-feed-card {
    padding-inline: 4px;
  }

  .home-workspace .school-feed-content.has-media {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .home-workspace .school-feed-thumbnail {
    width: 104px;
    height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-workspace .home-ask-hero,
  .home-workspace .school-feed-card,
  .home-workspace .home-school-life-grid > button {
    transition: none;
  }

  .home-workspace .home-announcement-slide,
  .home-workspace .home-announcement-carousel.is-settling .home-announcement-slide.is-transition-source,
  .home-workspace .home-announcement-carousel.is-settling .home-announcement-slide.is-transition-target {
    transition: none;
  }
}


/* Source: /quiz-reference.css?v=8 */
/*
 * Quiz browse list refinement.
 * Load this file after the existing quiz styles so it can act as the final,
 * intentionally narrow presentation layer for the current DOM structure.
 */

.quiz-workspace.section-browse {
  --quiz-reference-line: var(--border, #e2e8e5);
  --quiz-reference-text: var(--text, #18211d);
  --quiz-reference-muted: var(--text-2, #68736e);
  --quiz-reference-brand: var(--brand, #087454);
  --quiz-reference-brand-soft: var(--brand-soft, #edf7f3);
  --quiz-reference-surface: var(--surface, #fff);
  gap: 10px;
}

/* The reference uses a short intro, thin tabs, and one clear action hierarchy. */
.quiz-workspace.section-browse .quiz-hero {
  min-height: 168px;
  grid-template-columns: minmax(0, 1fr) 160px;
  border-radius: 12px;
  padding: 20px 24px;
}

.quiz-workspace.section-browse .quiz-hero > div {
  gap: 4px;
}

.quiz-workspace.section-browse .quiz-hero > div > span {
  font-size: 12px;
}

.quiz-workspace.section-browse .quiz-hero h1 {
  font-size: 27px;
}

.quiz-workspace.section-browse .quiz-hero p {
  max-width: 360px;
  font-size: 13px;
  line-height: 1.45;
}

.quiz-workspace.section-browse .quiz-hero > div > .quiz-hero-join {
  min-width: 148px;
  min-height: 40px;
  margin-top: 5px;
  border-radius: 9px;
  padding: 0 14px;
  font-size: 13px;
}

.quiz-workspace.section-browse .quiz-hero > img {
  right: 5px;
  bottom: -14px;
  width: 166px;
  height: 166px;
}

.quiz-workspace.section-browse .quiz-section-tabs.workspace-tabs {
  min-height: 46px;
  margin-top: 0;
  border: 1px solid var(--quiz-reference-line);
  border-radius: 10px;
  background: #f4f6f5;
  padding: 3px;
}

.quiz-workspace.section-browse .quiz-section-tabs.workspace-tabs > button {
  min-width: 0;
  min-height: 38px;
  gap: 5px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 650;
}

.quiz-workspace.section-browse .quiz-section-tabs.workspace-tabs > button .icon {
  width: 16px;
  height: 16px;
}

.quiz-workspace.section-browse .quiz-section-tabs.workspace-tabs > button.active {
  background: var(--quiz-reference-surface);
  color: var(--quiz-reference-brand);
  box-shadow: 0 1px 3px rgb(17 35 27 / 8%);
}

.quiz-workspace.section-browse .quiz-toolbar.panel {
  min-height: 46px;
  margin: 0;
  border: 1px solid var(--quiz-reference-line);
  border-radius: 10px;
  background: var(--quiz-reference-surface);
  padding: 4px 8px;
  box-shadow: none;
}

.quiz-workspace.section-browse .quiz-toolbar .search-field {
  min-height: 36px;
  padding: 0 8px;
}

.quiz-workspace.section-browse .quiz-toolbar .search-field .icon {
  width: 17px;
  height: 17px;
}

.quiz-workspace.section-browse .quiz-toolbar .search-field input {
  font-size: 13px;
}

.quiz-workspace.section-browse .quiz-list-head {
  min-height: 30px;
  padding: 0 2px;
}

.quiz-workspace.section-browse .quiz-list-head strong,
.quiz-workspace.section-browse .quiz-list-head span {
  color: var(--quiz-reference-muted);
  font-size: 11px;
  font-weight: 600;
}

/* A single scan-friendly list replaces the repeated floating-card effect. */
.quiz-workspace.section-browse .quiz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  overflow: visible;
  border: 1px solid var(--quiz-reference-line);
  border-radius: 12px;
  background: var(--quiz-reference-surface);
  padding: 0 16px;
  box-shadow: none;
}

.quiz-workspace.section-browse .quiz-grid > .empty {
  border: 0;
  background: transparent;
}

.quiz-workspace.section-browse .quiz-grid .quiz-list-card {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px 18px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 86px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--quiz-reference-line);
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  box-shadow: none;
  transform: none;
}

.quiz-workspace.section-browse .quiz-grid .quiz-list-card:not(.can-manage) {
  grid-template-columns: 72px minmax(0, 1fr) 18px;
}

.quiz-workspace.section-browse .quiz-grid .quiz-list-card:last-child {
  border-bottom: 0;
}

.quiz-workspace.section-browse .quiz-grid .quiz-list-card:hover {
  border-color: var(--quiz-reference-line);
  background: #f8faf9;
  box-shadow: none;
  transform: none;
}

.quiz-workspace.section-browse .quiz-grid .quiz-list-code {
  width: 72px;
  min-width: 72px;
  min-height: 58px;
  border: 1px solid #b8d5ca;
  border-radius: 9px;
  background: #f8fcfa;
  color: var(--quiz-reference-brand);
}

.quiz-workspace.section-browse .quiz-list-code small {
  font-size: 9px;
  font-weight: 600;
}

.quiz-workspace.section-browse .quiz-list-code strong {
  max-width: 62px;
  font-size: 12px;
  font-weight: 700;
}

.quiz-workspace.section-browse .quiz-list-copy {
  gap: 2px;
}

.quiz-workspace.section-browse .quiz-list-copy h3 {
  margin: 0;
  color: var(--quiz-reference-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.quiz-workspace.section-browse .quiz-list-copy > p {
  margin: 0;
  color: var(--quiz-reference-muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-line-clamp: 1;
}

.quiz-workspace.section-browse .quiz-list-copy .quiz-card-meta {
  gap: 4px 8px;
  margin-top: 2px;
  color: var(--quiz-reference-muted);
  font-size: 11px;
  line-height: 1.35;
}

/* Keep management visually subordinate to opening or playing the quiz. */
.quiz-workspace.section-browse .quiz-list-card .quiz-card-more {
  position: relative;
  z-index: 2;
  display: block;
  grid-column: auto;
  width: 40px;
  min-width: 40px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more[open] {
  z-index: 30;
  border: 0;
  background: transparent;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #77827d;
  padding: 0;
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease, color 140ms ease;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary::-webkit-details-marker,
.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary::marker {
  display: none;
  content: "";
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary > .icon,
.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary > span {
  display: none;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary::after {
  display: none;
  content: none;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary::before {
  display: block;
  content: "\22EE";
  color: currentColor;
  font-family: system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary:hover {
  background: #f1f4f2;
  color: var(--quiz-reference-text);
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more[open] > summary {
  background: var(--quiz-reference-brand-soft);
  color: var(--quiz-reference-brand);
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary:focus-visible {
  outline: 2px solid var(--quiz-reference-brand);
  outline-offset: 2px;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more:not([open]) > div {
  display: none !important;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more[open] > div {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  bottom: auto;
  display: grid !important;
  width: 148px;
  min-width: 148px;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--quiz-reference-line);
  border-radius: 10px;
  background: var(--quiz-reference-surface);
  padding: 5px;
  box-shadow: 0 10px 24px rgb(17 35 27 / 12%);
  animation: none;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > div > button,
.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > div > button:only-child,
.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > div > button:last-child:nth-child(odd) {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  grid-column: auto;
  justify-content: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 0 10px;
  color: var(--quiz-reference-text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > div > button:hover,
.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > div > button:focus-visible {
  background: #f2f5f3;
}

.quiz-workspace.section-browse .quiz-list-card .quiz-card-more > div > button.danger {
  color: var(--danger, #d6453d);
}

.quiz-workspace.section-browse .quiz-list-card .quiz-list-open {
  grid-column: auto;
  width: 18px;
  height: 32px;
  color: #8a948f;
}

@media (max-width: 640px) {
  .quiz-workspace.section-browse {
    gap: 8px;
  }

  .quiz-workspace.section-browse .quiz-hero {
    min-height: 134px;
    grid-template-columns: minmax(0, 1fr) 112px;
    border-radius: 10px;
    padding: 14px 16px;
  }

  .quiz-workspace.section-browse .quiz-hero > div {
    max-width: calc(100% - 14px);
  }

  .quiz-workspace.section-browse .quiz-hero > div > span {
    display: none;
  }

  .quiz-workspace.section-browse .quiz-hero h1 {
    font-size: 22px;
  }

  .quiz-workspace.section-browse .quiz-hero p {
    max-width: 220px;
    font-size: 11px;
    line-height: 1.4;
  }

  .quiz-workspace.section-browse .quiz-hero > div > .quiz-hero-join {
    min-width: 128px;
    min-height: 38px;
    margin-top: 3px;
    padding: 0 11px;
    font-size: 12px;
  }

  .quiz-workspace.section-browse .quiz-hero > img {
    right: -7px;
    bottom: -9px;
    width: 120px;
    height: 120px;
  }

  .quiz-workspace.section-browse .quiz-section-tabs.workspace-tabs {
    min-height: 44px;
  }

  .quiz-workspace.section-browse .quiz-section-tabs.workspace-tabs > button {
    min-height: 36px;
    padding-inline: 4px;
    font-size: 12px;
  }

  .quiz-workspace.section-browse .quiz-toolbar.panel {
    min-height: 44px;
    padding: 3px 7px;
  }

  .quiz-workspace.section-browse .quiz-toolbar .search-field {
    min-height: 36px;
  }

  .quiz-workspace.section-browse .quiz-grid {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 0;
  }

  .quiz-workspace.section-browse .quiz-grid .quiz-list-card,
  .quiz-workspace.section-browse .quiz-grid .quiz-list-card.can-manage {
    grid-template-columns: minmax(0, 1fr) 40px 14px;
    gap: 8px;
    min-height: 66px;
    padding: 8px 2px;
  }

  .quiz-workspace.section-browse .quiz-grid .quiz-list-card:not(.can-manage) {
    grid-template-columns: minmax(0, 1fr) 14px;
  }

  .quiz-workspace.section-browse .quiz-grid .quiz-list-code {
    display: none;
  }

  .quiz-workspace.section-browse .quiz-list-copy h3 {
    font-size: 14px;
  }

  .quiz-workspace.section-browse .quiz-list-copy > p {
    display: none;
  }

  .quiz-workspace.section-browse .quiz-list-copy .quiz-card-meta {
    margin-top: 3px;
    font-size: 10px;
  }

  .quiz-workspace.section-browse .quiz-list-card .quiz-card-more[open] > div {
    top: 42px;
    right: 0;
  }
}

@media (hover: none) {
  .quiz-workspace.section-browse .quiz-grid .quiz-list-card:hover {
    background: transparent;
  }

  .quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary:hover {
    background: transparent;
    color: #77827d;
  }

  .quiz-workspace.section-browse .quiz-list-card .quiz-card-more[open] > summary {
    background: var(--quiz-reference-brand-soft);
    color: var(--quiz-reference-brand);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-workspace.section-browse .quiz-list-card .quiz-card-more > summary {
    transition: none;
  }
}

/* Join mode shares the same quiet, white surface as the quiz list. */
.quiz-workspace.section-join .quiz-code-entry.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 12px;
  background: var(--surface, #fff);
  box-shadow: none;
}

.quiz-workspace.section-join .quiz-code-copy {
  gap: 5px;
}

.quiz-workspace.section-join .quiz-code-copy .workspace-kicker {
  color: var(--brand, #087454);
}

.quiz-workspace.section-join .quiz-code-copy :is(h2, p) {
  color: var(--text, #18211d);
}

.quiz-workspace.section-join .quiz-code-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.quiz-workspace.section-join .quiz-code-input,
.quiz-workspace.section-join .quiz-start-button {
  min-height: 44px;
  border-radius: 10px;
  box-shadow: none;
}

.quiz-workspace.section-join .quiz-start-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand, #087454) 30%, transparent);
  outline-offset: 2px;
}

@media (max-width: 680px) {
  .quiz-workspace.section-join .quiz-code-entry.panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .quiz-workspace.section-join .quiz-code-form {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Source: /quiz-detail-reference.css?v=2 */
/*
 * Quiz route detail pass.
 * Load after quiz-reference.css. No selector intentionally escapes a quiz root.
 */

:is(.quiz-workspace, .quiz-start, .quiz-play, .quiz-result, .quiz-live-show, .quiz-live-join) {
  --quiz-detail-brand: var(--brand, #087454);
  --quiz-detail-brand-strong: #066247;
  --quiz-detail-brand-soft: var(--brand-soft, #edf7f3);
  --quiz-detail-text: var(--text, #18211d);
  --quiz-detail-muted: var(--text-2, #66736d);
  --quiz-detail-line: var(--border, #dfe7e3);
  --quiz-detail-surface: var(--surface, #fff);
  --quiz-detail-subtle: var(--surface-subtle, #f4f7f5);
  min-width: 0;
}

:is(.quiz-workspace, .quiz-start, .quiz-play, .quiz-result, .quiz-live-show, .quiz-live-join) :is(button, input, select, textarea) {
  max-width: 100%;
}

:is(.quiz-workspace, .quiz-start, .quiz-play, .quiz-result, .quiz-live-show, .quiz-live-join) :is(h1, h2, h3, p, span, strong, small, b) {
  overflow-wrap: anywhere;
}

/* Browse list and its settings menu */

.quiz-workspace.section-browse .quiz-list-card {
  isolation: isolate;
}

.quiz-workspace.section-browse :is(.quiz-list-copy, .quiz-card-meta) {
  min-width: 0;
}

.quiz-workspace.section-browse .quiz-card-head:empty {
  display: none;
}

.quiz-workspace.section-browse .quiz-card-head .badge {
  min-height: 22px;
  border: 0;
  background: var(--quiz-detail-brand-soft);
  padding: 0 8px;
  color: var(--quiz-detail-brand);
  font-size: 11px;
  line-height: 22px;
}

.quiz-workspace.section-browse .quiz-card-more > summary {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
}

.quiz-workspace.section-browse .quiz-card-more > summary:hover,
.quiz-workspace.section-browse .quiz-card-more[open] > summary {
  border-color: var(--quiz-detail-line);
  background: var(--quiz-detail-subtle);
  color: var(--quiz-detail-brand);
}

.quiz-workspace.section-browse .quiz-card-more[open] > div {
  max-width: min(176px, calc(100vw - 32px));
}

.quiz-workspace.section-browse .quiz-card-more > div > button {
  white-space: nowrap;
}

.quiz-workspace.section-browse .quiz-list-open {
  display: grid;
  place-items: center;
}

/* Code entry */

.quiz-workspace.section-join .quiz-code-copy h2 {
  margin: 0;
  color: var(--quiz-detail-text);
  font-size: clamp(20px, 3vw, 25px);
  line-height: 1.35;
}

.quiz-workspace.section-join .quiz-code-copy p {
  margin: 0;
  color: var(--quiz-detail-muted);
  font-size: 14px;
  line-height: 1.55;
}

.quiz-workspace.section-join .quiz-code-input {
  min-width: 0;
  border-color: var(--quiz-detail-line);
  color: var(--quiz-detail-text);
  letter-spacing: 0;
}

.quiz-workspace.section-join .quiz-start-button {
  min-width: 92px;
  border: 0;
  background: var(--quiz-detail-brand);
  color: #fff;
}

.quiz-workspace.section-join .quiz-start-button:hover {
  background: var(--quiz-detail-brand-strong);
}

/* Start screen */

.quiz-start {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: start;
  gap: 16px;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--quiz-detail-text);
  box-shadow: none;
}

.quiz-start :is(.quiz-start-card, .quiz-leaderboard.panel) {
  min-width: 0;
  border: 1px solid var(--quiz-detail-line);
  border-radius: 12px;
  background: var(--quiz-detail-surface);
  color: var(--quiz-detail-text);
  box-shadow: none;
}

.quiz-start .quiz-start-card {
  min-height: 0;
  align-content: start;
  gap: 14px;
  padding: 24px;
}

.quiz-start .quiz-start-card :is(h1, p, label) {
  color: var(--quiz-detail-text);
}

.quiz-start .quiz-start-card h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.25;
}

.quiz-start .quiz-start-card > p {
  margin: -4px 0 0;
  color: var(--quiz-detail-muted);
  font-size: 14px;
  line-height: 1.55;
}

.quiz-start .quiz-back-button,
.quiz-start .quiz-code {
  width: max-content;
  max-width: 100%;
  justify-self: start;
}

.quiz-start .quiz-code {
  border: 0;
  background: var(--quiz-detail-brand-soft);
  color: var(--quiz-detail-brand);
  font-size: 12px;
}

.quiz-start .quiz-start-image {
  width: min(100%, 560px);
  max-height: 260px;
  justify-self: center;
  border: 1px solid var(--quiz-detail-line);
  border-radius: 10px;
  background: var(--quiz-detail-subtle);
}

.quiz-start .quiz-start-meta {
  gap: 6px;
}

.quiz-start .quiz-start-meta span {
  min-height: 26px;
  border: 0;
  background: var(--quiz-detail-subtle);
  padding: 0 9px;
  color: var(--quiz-detail-muted);
  font-size: 12px;
  line-height: 26px;
}

.quiz-start .quiz-start-card label {
  display: grid;
  gap: 7px;
  font-size: 13px;
}

.quiz-start .quiz-name-input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border-color: var(--quiz-detail-line);
  color: var(--quiz-detail-text);
}

.quiz-start .quiz-start-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quiz-start .quiz-start-actions > button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border-radius: 10px;
  padding-inline: 10px;
  font-size: 13px;
  white-space: normal;
}

.quiz-start .quiz-start-card .primary {
  border-color: var(--quiz-detail-brand);
  background: var(--quiz-detail-brand);
  color: #fff;
}

.quiz-start .quiz-start-card .ghost {
  border-color: var(--quiz-detail-line);
  background: #fff;
  color: var(--quiz-detail-text);
}

/* Solo play */

.quiz-play {
  width: 100%;
  min-width: 0;
  gap: 12px;
  overflow: hidden;
  border: 1px solid #183d32;
  border-radius: 14px;
  background: #123c30;
  padding: 16px;
  box-shadow: none;
}

.quiz-play .quiz-play-top {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) auto minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
}

.quiz-play .quiz-play-top > :first-child { justify-self: start; }
.quiz-play .quiz-play-top > :last-child { justify-self: end; }

.quiz-play .quiz-play-top .ghost {
  min-width: 0;
  min-height: 40px;
  border-radius: 9px;
  padding: 0 12px;
  box-shadow: none;
}

.quiz-play .quiz-code {
  min-width: 0;
  max-width: 160px;
  overflow: hidden;
  border: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiz-play .quiz-question-stage {
  min-width: 0;
  gap: 11px;
  overflow: hidden;
  border-radius: 12px;
  padding: 18px;
}

.quiz-play :is(.quiz-progress, .quiz-timer) {
  width: min(100%, 760px);
  height: 6px;
  min-height: 6px;
}

.quiz-play .quiz-stage-meta {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.quiz-play .quiz-stage-meta .badge {
  min-height: 24px;
  border: 0;
  padding: 0 8px;
  font-size: 11px;
  line-height: 24px;
}

.quiz-play .quiz-question-stage h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.35;
  text-wrap: balance;
}

.quiz-play .quiz-question-image {
  width: min(100%, 520px);
  max-height: min(32vh, 280px);
  border-radius: 10px;
}

.quiz-play .quiz-answer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.quiz-play .quiz-answer {
  min-width: 0;
  min-height: 88px;
  gap: 10px;
  border-radius: 11px;
  padding: 14px 16px;
  box-shadow: none;
}

.quiz-play .quiz-answer > span {
  flex: 0 0 auto;
  font-size: 21px;
}

.quiz-play .quiz-answer > strong {
  min-width: 0;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
}

.quiz-play .quiz-answer:not(.correct):not(.wrong):hover,
.quiz-play .quiz-answer:not(.correct):not(.wrong):active {
  border-color: #aab5b0;
  background: #f7f9f8;
  color: #18211d;
  filter: none;
  transform: none;
}

.quiz-play .quiz-answer:not(.correct):not(.wrong):hover :is(span, strong),
.quiz-play .quiz-answer:not(.correct):not(.wrong):active :is(span, strong) {
  color: inherit;
}

/* A choice is neutral until the result is revealed. Green is reserved for
   the actual correct-answer state so selection never leaks the answer. */
.quiz-play .quiz-answer.selected:not(.correct):not(.wrong) {
  border-color: #66736d;
  outline: 2px solid #66736d;
  outline-offset: 1px;
  background: #f2f5f3;
  color: #18211d;
  filter: none;
}

.quiz-play .quiz-answer.selected:not(.correct):not(.wrong) :is(span, strong) {
  color: inherit;
}

.quiz-play .quiz-feedback-slot {
  min-width: 0;
  min-height: 54px;
}

.quiz-play .quiz-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  gap: 6px 12px;
  min-width: 0;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: none;
}

.quiz-play .quiz-feedback > :is(strong, span) {
  align-self: center;
}

.quiz-play .quiz-feedback > strong {
  color: var(--quiz-detail-text);
  font-size: 17px;
}

.quiz-play .quiz-feedback > span,
.quiz-play .quiz-feedback > p {
  color: var(--quiz-detail-muted);
  font-size: 13px;
}

.quiz-play .quiz-feedback > p {
  grid-column: 1 / -1;
  margin: 0;
  line-height: 1.5;
  text-align: left;
}

.quiz-play .quiz-feedback > .primary {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-width: 88px;
  min-height: 40px;
  align-self: center;
  border: 0;
  background: var(--quiz-detail-brand);
}

/* Results and wrong-answer retry */

.quiz-result {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: start;
  gap: 16px;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--quiz-detail-text);
  box-shadow: none;
}

.quiz-result .quiz-result-stack {
  min-width: 0;
  gap: 12px;
}

.quiz-result :is(.quiz-result-card, .quiz-review.panel, .quiz-leaderboard.panel) {
  min-width: 0;
  border: 1px solid var(--quiz-detail-line);
  border-radius: 12px;
  background: var(--quiz-detail-surface);
  color: var(--quiz-detail-text);
  box-shadow: none;
}

.quiz-result .quiz-result-card {
  min-height: 0;
  align-content: start;
  gap: 7px;
  padding: 24px;
  text-align: left;
}

.quiz-result .quiz-result-card .hero-kicker {
  color: var(--quiz-detail-brand);
  font-size: 12px;
}

.quiz-result .quiz-result-card h1 {
  margin: 0;
  color: var(--quiz-detail-text);
  font-size: clamp(36px, 7vw, 54px);
  line-height: 1.1;
}

.quiz-result .quiz-result-card > p {
  margin: 0;
  color: var(--quiz-detail-muted);
  font-size: 14px;
}

.quiz-result .quiz-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.quiz-result .quiz-result-actions > button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border-radius: 10px;
  padding-inline: 10px;
  font-size: 13px;
  white-space: normal;
}

.quiz-result .quiz-result-card .primary {
  border-color: var(--quiz-detail-brand);
  background: var(--quiz-detail-brand);
}

.quiz-result .quiz-result-card .ghost {
  border-color: var(--quiz-detail-line);
  background: #fff;
  color: var(--quiz-detail-text);
}

.quiz-result :is(.quiz-review.panel, .quiz-leaderboard.panel),
.quiz-start .quiz-leaderboard.panel {
  padding: 16px;
}

.quiz-result .quiz-review-list {
  max-height: 520px;
  gap: 0;
  overflow-x: hidden;
  padding: 0;
}

.quiz-result .quiz-review-item {
  gap: 6px;
  border: 0;
  border-bottom: 1px solid var(--quiz-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.quiz-result .quiz-review-item:last-child {
  border-bottom: 0;
}

.quiz-result .quiz-review-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.quiz-result .quiz-review-head strong {
  min-width: 0;
  color: var(--quiz-detail-text);
  font-size: 14px;
  line-height: 1.45;
}

.quiz-result .quiz-review-head .badge {
  min-height: 24px;
  align-self: start;
  border: 0;
  background: #fff0ed;
  padding: 0 8px;
  color: #b43b34;
  font-size: 11px;
  line-height: 24px;
}

.quiz-result .quiz-review-item.correct .badge {
  background: var(--quiz-detail-brand-soft);
  color: var(--quiz-detail-brand);
}

.quiz-result .quiz-review-answers {
  min-width: 0;
  justify-content: flex-start;
  gap: 3px 12px;
  color: var(--quiz-detail-muted);
  font-size: 12px;
}

.quiz-result .quiz-review-item > p {
  color: var(--quiz-detail-muted);
  font-size: 12px;
  line-height: 1.5;
}

.quiz-result .quiz-rank-row,
.quiz-start .quiz-rank-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quiz-result .quiz-rank-row > span,
.quiz-start .quiz-rank-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Live quiz utility/settings controls */

.quiz-live-show .quiz-live-show-actions {
  min-width: 0;
  flex-wrap: wrap;
}

.quiz-live-show .quiz-live-icon-button {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  padding: 0;
  line-height: 0;
}

.quiz-live-show .quiz-live-icon-button .icon {
  width: 19px;
  height: 19px;
  margin: 0;
}

.quiz-live-show .quiz-live-icon-button:focus-visible,
.quiz-workspace.section-browse .quiz-card-more > summary:focus-visible {
  outline: 2px solid var(--quiz-detail-brand);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .quiz-start,
  .quiz-result {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .quiz-start :is(.quiz-start-card, .quiz-leaderboard.panel),
  .quiz-result :is(.quiz-result-card, .quiz-review.panel, .quiz-leaderboard.panel) {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .quiz-start .quiz-start-card,
  .quiz-result .quiz-result-card {
    padding: 18px 16px;
  }

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

  .quiz-play {
    min-height: calc(100dvh - 124px);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 12px 14px;
  }

  .quiz-play .quiz-play-top {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .quiz-play .quiz-play-top .ghost {
    display: grid;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    place-items: center;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }

  .quiz-play .quiz-play-top .ghost .icon {
    width: 18px;
    height: 18px;
    margin: 0;
  }

  .quiz-play .quiz-code {
    justify-self: center;
    max-width: 100%;
    font-size: 11px;
  }

  .quiz-play .quiz-question-stage {
    padding: 14px 10px;
  }

  .quiz-play .quiz-question-stage h1 {
    font-size: clamp(21px, 6.2vw, 28px);
  }

  .quiz-play .quiz-answer {
    min-height: 82px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 11px;
  }

  .quiz-play .quiz-answer > span { font-size: 17px; }
  .quiz-play .quiz-answer > strong { width: 100%; font-size: 14px; }

  .quiz-play .quiz-feedback {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 11px 12px;
  }

  .quiz-play .quiz-feedback > :is(strong, span) { grid-column: 1; }

  .quiz-play .quiz-feedback > .primary {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-width: 72px;
  }

  .quiz-result :is(.quiz-review.panel, .quiz-leaderboard.panel),
  .quiz-start .quiz-leaderboard.panel {
    padding: 14px 16px;
  }
}

@media (max-width: 430px) {
  .quiz-workspace.section-join .quiz-code-entry.panel { padding: 14px; }
  .quiz-workspace.section-join .quiz-code-form { grid-template-columns: minmax(0, 1fr); }
  .quiz-workspace.section-join .quiz-start-button { width: 100%; }
  .quiz-result .quiz-result-actions { grid-template-columns: minmax(0, 1fr); }
  .quiz-live-show .quiz-live-show-actions { gap: 6px; }

  .quiz-live-show .quiz-live-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
  }
}

@media (max-width: 370px) {
  .quiz-play .quiz-answer-grid { grid-template-columns: minmax(0, 1fr); }

  .quiz-play .quiz-answer {
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }
}

@media (hover: none) {
  .quiz-workspace.section-browse .quiz-card-more > summary:hover {
    border-color: transparent;
    background: transparent;
    color: #77827d;
  }

  .quiz-workspace.section-browse .quiz-card-more[open] > summary {
    border-color: var(--quiz-detail-line);
    background: var(--quiz-detail-subtle);
    color: var(--quiz-detail-brand);
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-play .quiz-answer,
  .quiz-play .quiz-feedback,
  .quiz-result .quiz-confetti,
  .quiz-play .quiz-effect-pop {
    animation: none;
    transition: none;
  }
}


/* Source: /profile-reference-release-03858b95b771.css?v=1 */
/*
 * Wooshin Tutor profile reference layer.
 * Load after tutor-redesign.css, campus-design.css, and ui-polish.css.
 * This file intentionally changes presentation only; routes and controls stay intact.
 */

.profile-page,
.profile-page *,
.activity-page,
.activity-page * {
  box-sizing: border-box;
}

.profile-page {
  --profile-ref-brand: var(--brand, #087454);
  --profile-ref-brand-strong: #066247;
  --profile-ref-brand-soft: #edf7f3;
  --profile-ref-ink: var(--text, #18211d);
  --profile-ref-muted: var(--text-2, #66736d);
  --profile-ref-line: var(--border, #dfe7e3);
  --profile-ref-surface: var(--surface, #fff);
  --profile-ref-subtle: var(--surface-subtle, #f5f7f6);
  width: min(100%, 900px);
  min-width: 0;
  margin-inline: auto;
  gap: 14px;
}

/* Keep everyday profile views readable on wide screens. The administrator
   workspace intentionally keeps its own wider data layout. */
.profile-page.workspace-page:not(.profile-tab-admin) {
  width: min(100%, 900px);
  max-width: 900px;
  margin-inline: auto;
}

.profile-page > *,
.profile-page :where(.profile-cover-main, .profile-identity, .profile-navigation-shell, .profile-primary-tabs, .profile-overview-layout, .profile-overview-side, .profile-section-card) {
  min-width: 0;
  max-width: 100%;
}

/* Identity: one quiet header instead of a card nested inside another card. */
.profile-page > .profile-cover {
  display: block;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.profile-page > .profile-cover::before,
.profile-page > .profile-cover::after,
.profile-page .profile-cover-main::before,
.profile-page .profile-cover-main::after {
  display: none !important;
}

.profile-page .profile-cover-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  overflow: visible;
  border: 0;
  background: transparent;
  padding: 18px 4px 16px;
}

.profile-page .profile-identity {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.profile-page .profile-identity .avatar,
.profile-page .profile-cover .avatar,
.profile-page .profile-avatar-xl {
  width: 62px;
  height: 62px;
  min-width: 62px;
  flex: 0 0 62px;
  border: 1px solid #d9e5df;
  border-radius: 50%;
  background: var(--profile-ref-brand-soft);
  box-shadow: none;
  object-fit: cover;
}

.profile-page .profile-identity .badges {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 4px;
}

.profile-page .profile-identity .badge {
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: var(--profile-ref-brand-soft);
  padding: 2px 7px;
  color: var(--profile-ref-brand-strong);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.35;
}

.profile-page .profile-identity h1 {
  margin: 0;
  color: var(--profile-ref-ink);
  font-size: 23px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.profile-page .profile-identity p {
  margin: 4px 0 0;
  color: var(--profile-ref-muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-page .profile-identity .meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
  color: var(--profile-ref-muted);
  font-size: 12px;
  line-height: 1.4;
}

.profile-page .profile-edit-button {
  align-self: start;
  justify-self: end;
  min-height: 34px;
  border: 1px solid #cfe1d8;
  border-radius: 8px;
  background: var(--profile-ref-surface);
  padding: 6px 10px;
  color: var(--profile-ref-brand-strong);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
  white-space: nowrap;
}

.profile-page .profile-edit-button:hover,
.profile-page .profile-edit-button:focus-visible {
  border-color: var(--profile-ref-brand);
  background: var(--profile-ref-brand-soft);
}

.profile-page .profile-banner-design {
  min-height: 88px;
  max-height: 120px;
  overflow: hidden;
  border: 1px solid var(--profile-ref-line);
  border-radius: 12px;
  box-shadow: none;
}

.profile-page > .profile-cover.has-profile-banner {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--profile-ref-line);
  padding: 0;
}

.profile-page > .profile-cover.has-profile-banner .profile-cover-main {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 4px;
}

/* Three current values and a future fourth value share the width automatically. */
.profile-page .profile-stat-grid {
  display: grid;
  width: 100%;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-columns: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
}

.profile-page .profile-stat-grid > div {
  display: grid;
  min-width: 0;
  min-height: 66px;
  place-content: center;
  justify-items: center;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 9px 6px;
  text-align: center;
}

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

.profile-page .profile-stat-grid strong {
  max-width: 100%;
  color: var(--profile-ref-ink);
  font-size: 18px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.profile-page .profile-stat-grid span {
  width: auto;
  color: var(--profile-ref-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

/* Navigation: compact account rows, while every existing destination remains available. */
.profile-page .profile-navigation-shell {
  position: relative;
  z-index: 6;
  display: block;
  overflow: visible;
  border: 1px solid var(--profile-ref-line);
  border-radius: 12px;
  background: var(--profile-ref-surface);
  padding: 0 14px;
  box-shadow: none;
}

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

.profile-page .profile-primary-tabs button,
.profile-page .profile-more-menu > summary {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  grid-template-columns: 22px minmax(0, 1fr) 14px;
  align-items: center;
  justify-content: stretch;
  gap: 11px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 8px 2px;
  color: var(--profile-ref-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  list-style: none;
  box-shadow: none;
}

.profile-page .profile-primary-tabs button::after,
.profile-page .profile-more-menu > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  justify-self: end;
  border-top: 1.5px solid #8b9891;
  border-right: 1.5px solid #8b9891;
  transform: rotate(45deg);
}

.profile-page .profile-primary-tabs button:last-child {
  border-bottom: 1px solid var(--profile-ref-line);
}

.profile-page .profile-more-menu > summary {
  cursor: pointer;
}

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

.profile-page .profile-primary-tabs button > .icon,
.profile-page .profile-more-menu > summary > .icon {
  width: 20px;
  height: 20px;
  color: #66736d;
  stroke-width: 1.8;
}

.profile-page .profile-primary-tabs button > span,
.profile-page .profile-more-menu > summary > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-page .profile-primary-tabs button:hover,
.profile-page .profile-more-menu > summary:hover {
  background: transparent;
  color: var(--profile-ref-brand);
}

.profile-page .profile-primary-tabs button.active,
.profile-page .profile-more-menu.active > summary,
.profile-page .profile-more-menu[open] > summary {
  background: transparent;
  color: var(--profile-ref-brand-strong);
  box-shadow: none;
}

.profile-page .profile-primary-tabs button.active > .icon,
.profile-page .profile-more-menu.active > summary > .icon,
.profile-page .profile-more-menu[open] > summary > .icon {
  color: var(--profile-ref-brand);
}

.profile-page .profile-more-menu {
  position: relative;
  display: block;
  min-width: 0;
}

.profile-page .profile-more-popover {
  position: absolute;
  z-index: 1301;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(360px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - 110px));
  overflow: auto;
  gap: 0;
  border: 1px solid var(--profile-ref-line);
  border-radius: 12px;
  background: var(--profile-ref-surface);
  padding: 10px 14px;
  box-shadow: 0 14px 34px rgb(24 33 29 / 14%);
  overscroll-behavior: contain;
}

/* A menu below the profile's five rows cannot be anchored downward on a
   landscape tablet. Keep the entire dialog in the viewport instead. */
@media (min-width: 701px) {
  .profile-page .profile-more-menu[open] > .profile-more-popover {
    position: fixed;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(420px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    max-height: min(620px, calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    margin: 0;
    transform: translate(-50%, -50%);
    overflow: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-page .profile-more-menu[open] > .profile-more-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgb(15 25 20 / 34%);
  }
}

.profile-page .profile-more-menu[open] > .profile-more-backdrop {
  z-index: 1290;
}

.profile-page .profile-more-sheet-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 10px;
}

.profile-page .profile-more-sheet-head > div {
  min-width: 0;
}

.profile-page .profile-more-sheet-head strong,
.profile-page .profile-more-sheet-head span {
  display: block;
  overflow-wrap: anywhere;
}

.profile-page .profile-more-sheet-head strong {
  color: var(--profile-ref-ink);
  font-size: 16px;
}

.profile-page .profile-more-sheet-head span {
  margin-top: 2px;
  color: var(--profile-ref-muted);
  font-size: 11px;
}

.profile-page .profile-more-group {
  display: grid;
  gap: 0;
  padding: 5px 0;
}

.profile-page .profile-more-group + .profile-more-group {
  border-top: 1px solid var(--profile-ref-line);
}

.profile-page .profile-more-group > strong {
  padding: 7px 2px 5px;
  color: var(--profile-ref-muted);
  font-size: 11px;
  font-weight: 600;
}

.profile-page .profile-more-group > div {
  display: grid;
  gap: 0;
}

.profile-page .profile-more-group button {
  display: grid;
  min-width: 0;
  min-height: 46px;
  grid-template-columns: 20px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 7px 4px;
  color: var(--profile-ref-ink);
  font-size: 13px;
  text-align: left;
}

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

/* Overview content stays useful but no longer competes with the identity and menu. */
.profile-page .profile-overview-stack,
.profile-page .profile-overview-layout,
.profile-page .profile-overview-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.profile-page .profile-section-card {
  overflow: hidden;
  border: 1px solid var(--profile-ref-line);
  border-radius: 12px;
  background: var(--profile-ref-surface);
  padding: 16px;
  box-shadow: none;
}

.profile-page .profile-section-card .workspace-section-head {
  min-width: 0;
  margin-bottom: 10px;
}

.profile-page .profile-section-card .workspace-section-head h2 {
  margin: 0;
  color: var(--profile-ref-ink);
  font-size: 17px;
  line-height: 1.35;
}

.profile-page .profile-section-card .workspace-section-head p {
  margin: 3px 0 0;
  color: var(--profile-ref-muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-page .profile-activity-list {
  display: grid;
  gap: 0;
}

.profile-page .profile-activity-row {
  display: grid;
  min-width: 0;
  min-height: 55px;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 9px 0;
  color: var(--profile-ref-ink);
  text-align: left;
  box-shadow: none;
}

.profile-page .profile-activity-row:first-child {
  border-top: 0;
}

.profile-page .profile-activity-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--profile-ref-brand-soft);
  color: var(--profile-ref-brand);
}

.profile-page .profile-activity-copy,
.profile-page .profile-activity-meta {
  min-width: 0;
}

.profile-page .profile-activity-copy strong,
.profile-page .profile-activity-copy small,
.profile-page .profile-activity-meta b,
.profile-page .profile-activity-meta small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-page .profile-activity-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.profile-page .profile-activity-copy small,
.profile-page .profile-activity-meta {
  color: var(--profile-ref-muted);
  font-size: 11px;
}

.profile-page .profile-activity-meta {
  justify-items: end;
  text-align: right;
}

.profile-page .profile-achievement-art {
  width: 66px;
  min-width: 66px;
  height: 66px;
  object-fit: contain;
}

.profile-page .profile-shop-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--profile-ref-line);
  border-radius: 10px;
}

.profile-page .profile-shop-summary > div {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 10px 6px;
  text-align: center;
}

.profile-page .profile-shop-summary > div:last-child {
  border-right: 0;
}

.profile-page .profile-shop-summary strong {
  font-size: 16px;
}

.profile-page .profile-shop-summary span {
  font-size: 10px;
}

/* Account rows, including logout, follow the same compact profile language. */
.profile-page .account-setting-links {
  overflow: hidden;
  border: 1px solid var(--profile-ref-line);
  border-radius: 12px;
  background: var(--profile-ref-surface);
}

.profile-page .account-setting-link {
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--profile-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 9px 12px;
  box-shadow: none;
}

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

.profile-page .account-logout-row {
  margin-top: 14px;
  border: 1px solid #f0d2cf;
  border-radius: 10px;
  background: #fff;
  color: #c23b34;
}

/* Activity summary: dense 2-up data on mobile, calm progress surface. */
.activity-page {
  width: min(100%, 760px);
  min-width: 0;
  margin-inline: auto;
  gap: 16px;
}

.activity-page > *,
.activity-page :where(.activity-overview-card, .activity-progress-panel, .activity-latest-achievement, .activity-stat-section, .activity-stat-grid, .activity-stat-card) {
  min-width: 0;
  max-width: 100%;
}

.activity-page > .workspace-section-head:first-child {
  margin-bottom: 0;
}

.activity-page > .workspace-section-head:first-child .eyebrow {
  color: var(--profile-ref-brand, #087454);
}

.activity-page .activity-overview-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) minmax(170px, .55fr);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 12px;
  background: var(--surface, #fff);
  padding: 0;
  box-shadow: none;
}

.activity-page .activity-level-mark {
  display: grid;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 118px;
  place-content: center;
  justify-items: center;
  gap: 1px;
  border: 0;
  border-right: 1px solid var(--border, #dfe7e3);
  border-radius: 0;
  background: var(--brand-soft, #edf7f3);
  color: var(--brand, #087454);
  box-shadow: none;
}

.activity-page .activity-level-mark > span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
}

.activity-page .activity-level-mark > strong {
  font-size: 29px;
  font-weight: 800;
  line-height: 1;
}

.activity-page .activity-level-mark > em {
  color: var(--text-2, #66736d);
  font-size: 11px;
  font-style: normal;
}

.activity-page .activity-progress-panel {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
}

.activity-page .activity-score-heading,
.activity-page .activity-progress-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-page .activity-score-heading strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.activity-page .activity-live-state {
  min-height: 24px;
  border-radius: 999px;
  background: var(--brand-soft, #edf7f3);
  padding: 3px 8px;
  color: var(--brand, #087454);
  font-size: 10px;
}

.activity-page .level-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeeb;
}

.activity-page .level-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand, #087454);
}

.activity-page .activity-progress-meta {
  color: var(--text-2, #66736d);
  font-size: 11px;
}

.activity-page .activity-latest-achievement {
  display: grid;
  align-content: center;
  gap: 8px;
  border-left: 1px solid var(--border, #dfe7e3);
  padding: 16px;
}

.activity-page .activity-latest-achievement > span {
  color: var(--text-2, #66736d);
  font-size: 10px;
  font-weight: 600;
}

.activity-page .activity-latest-trophy {
  display: grid;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.activity-page .activity-latest-trophy .activity-trophy-art {
  width: 44px;
  height: 44px;
}

.activity-page .activity-latest-trophy strong,
.activity-page .activity-latest-trophy small,
.activity-page .activity-no-trophy strong,
.activity-page .activity-no-trophy span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-page .activity-latest-trophy strong,
.activity-page .activity-no-trophy strong {
  color: var(--text, #18211d);
  font-size: 12px;
}

.activity-page .activity-latest-trophy small,
.activity-page .activity-no-trophy span {
  margin-top: 2px;
  color: var(--text-2, #66736d);
  font-size: 10px;
}

.activity-page .activity-stat-section {
  overflow: hidden;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 12px;
  background: var(--surface, #fff);
  padding: 16px;
  box-shadow: none;
}

.activity-page .activity-stat-head {
  margin-bottom: 10px;
}

.activity-page .activity-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border, #dfe7e3);
  border-radius: 10px;
}

.activity-page .activity-stat-card,
.activity-page .activity-stat-card:nth-child(4n),
.activity-page .activity-stat-card:nth-last-child(-n + 4) {
  display: grid;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--border, #dfe7e3);
  border-bottom: 1px solid var(--border, #dfe7e3);
  border-radius: 0;
  background: transparent;
  padding: 11px;
  box-shadow: none;
}

.activity-page .activity-stat-card:nth-child(4n) {
  border-right: 0;
}

.activity-page .activity-stat-card:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.activity-page .activity-stat-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft, #edf7f3);
  color: var(--brand, #087454);
}

.activity-page .activity-stat-icon .icon {
  width: 16px;
  height: 16px;
}

.activity-page .activity-stat-card > div {
  min-width: 0;
}

.activity-page .activity-stat-card > div strong,
.activity-page .activity-stat-card > div span {
  display: block;
  max-width: 100%;
}

.activity-page .activity-stat-card > div strong {
  color: var(--text, #18211d);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.activity-page .activity-stat-card > div span {
  margin-top: 2px;
  color: var(--text-2, #66736d);
  font-size: 10px;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .profile-page {
    gap: 12px;
  }

  .profile-page .profile-cover-main {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding: 12px 2px 14px;
  }

  .profile-page .profile-identity {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 11px;
  }

  .profile-page .profile-identity .avatar,
  .profile-page .profile-cover .avatar,
  .profile-page .profile-avatar-xl {
    width: 54px;
    height: 54px;
    min-width: 54px;
    flex-basis: 54px;
  }

  .profile-page .profile-identity h1 {
    font-size: 20px;
  }

  .profile-page .profile-edit-button {
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .profile-page .profile-stat-grid > div {
    min-height: 60px;
    padding: 8px 4px;
  }

  .profile-page .profile-stat-grid strong {
    font-size: 17px;
  }

  .profile-page .profile-navigation-shell {
    grid-template-columns: none;
    padding: 0 12px;
  }

  .profile-page .profile-primary-tabs button,
  .profile-page .profile-more-menu > summary {
    min-height: 50px;
    flex-direction: initial;
    padding: 7px 2px;
    font-size: 13px;
  }

  .profile-page .profile-more-popover {
    position: fixed;
    z-index: 1301;
    top: auto;
    right: 10px;
    bottom: calc(var(--polish-mobile-tab-h, 60px) + env(safe-area-inset-bottom) + 8px);
    left: 10px;
    width: auto;
    max-height: min(72dvh, 560px);
    border-radius: 14px;
    padding: 12px 14px;
  }

  .profile-page .profile-more-menu[open] > .profile-more-backdrop {
    position: fixed;
    z-index: 1290;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgb(15 25 20 / 34%);
  }

  .profile-page .profile-section-card {
    padding: 14px;
  }

  .profile-page .profile-activity-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .profile-page .profile-activity-meta {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }

  .activity-page .activity-overview-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .activity-page .activity-level-mark {
    min-height: 108px;
  }

  .activity-page .activity-progress-panel {
    padding: 14px;
  }

  .activity-page .activity-latest-achievement {
    grid-column: 1 / -1;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    border-top: 1px solid var(--border, #dfe7e3);
    border-left: 0;
    padding: 12px 14px;
  }

  .activity-page .activity-stat-section {
    padding: 14px;
  }

  .activity-page .activity-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-page .activity-stat-card,
  .activity-page .activity-stat-card:nth-child(4n),
  .activity-page .activity-stat-card:nth-last-child(-n + 4) {
    min-height: 72px;
    border-right: 1px solid var(--border, #dfe7e3);
    border-bottom: 1px solid var(--border, #dfe7e3);
    padding: 10px;
  }

  .activity-page .activity-stat-card:nth-child(2n) {
    border-right: 0;
  }

  .activity-page .activity-stat-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

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

  .profile-page .profile-edit-button {
    position: absolute;
    top: 12px;
    right: 2px;
  }

  .profile-page .profile-identity > div:last-child {
    padding-right: 74px;
  }

  .profile-page .profile-identity .badges {
    padding-right: 0;
  }

  .profile-page .profile-stat-grid strong {
    font-size: 15px;
  }

  .profile-page .profile-stat-grid span {
    font-size: 9px;
  }

  .activity-page .activity-score-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-page .activity-live-state {
    align-self: flex-start;
  }

  .activity-page .activity-stat-card {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 7px;
    padding: 9px 7px;
  }

.activity-page .activity-stat-icon {
    width: 24px;
    height: 24px;
  }
}

/* Equipped banners use a clear foreground and the same art as a soft backdrop. */
.profile-page > .profile-cover.has-profile-banner {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-flow: row;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--profile-ref-line);
  border-radius: 12px;
  background: #eef3f0;
  padding: 0;
}

.profile-page > .profile-cover.has-profile-banner > :where(
  .profile-equipped-banner-showcase,
  .profile-cover-main,
  .profile-stat-grid
) {
  grid-column: 1;
  width: auto;
}

.profile-page > .profile-cover.has-profile-banner > .profile-equipped-banner-backdrop {
  position: absolute;
  inset: -36px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.profile-page .profile-equipped-banner-backdrop .profile-banner-design {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border: 0;
  border-radius: 0;
  filter: blur(30px) saturate(0.82);
  opacity: 0.62;
  transform: scale(1.18);
}

.profile-page .profile-equipped-banner-backdrop .profile-banner-design strong {
  display: none;
}

.profile-page > .profile-cover.has-profile-banner > .profile-equipped-banner-showcase {
  position: relative;
  z-index: 2;
  min-width: 0;
  height: auto;
  margin: 12px 12px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(24, 54, 43, 0.16);
}

.profile-page .profile-equipped-banner-showcase .profile-banner-design {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: 3 / 1;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* The green campus and user-created canvases are authored at 16:5. Keeping
   their native ratio prevents the equipped artwork from being vertically
   cropped while the remaining stock banners retain their 3:1 canvas. */
.profile-page .profile-equipped-banner-showcase :is(.banner-green, .banner-custom) {
  aspect-ratio: 16 / 5;
}

.profile-page .profile-equipped-banner-showcase .custom-banner-image {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.profile-page > .profile-cover.has-profile-banner .profile-cover-main {
  position: relative;
  z-index: 2;
  margin: 10px 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.86);
  padding: 13px;
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

.profile-page > .profile-cover.has-profile-banner .profile-stat-grid {
  position: relative;
  z-index: 2;
  width: auto;
  margin: 0 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-top-color: var(--profile-ref-line);
  border-radius: 0 0 10px 10px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}

@media (max-width: 700px) {
  .profile-page > .profile-cover.has-profile-banner > .profile-equipped-banner-showcase {
    margin: 8px 8px 0;
  }

  .profile-page > .profile-cover.has-profile-banner .profile-cover-main {
    margin: 8px 8px 0;
    padding: 11px;
  }

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

@media (min-width: 900px) {
  .profile-page .profile-overview-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    align-items: start;
  }

  .profile-page .profile-more-popover {
    right: -1px;
  }
}

@media (hover: none) {
  .profile-page .profile-primary-tabs button:hover,
  .profile-page .profile-more-menu > summary:hover,
  .profile-page .profile-more-group button:hover {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-page *,
  .activity-page * {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Profile identity geometry must not change when a banner is equipped. Later
   generic identity layers use larger breakpoint-specific avatar sizes and an
   absolute settings action, so this high-specificity block owns the final
   cover geometry for both banner and plain profiles. */
.profile-page > .profile-cover {
  --profile-cover-avatar-size: 62px;
}

.profile-page > .profile-cover .profile-cover-main,
.profile-page > .profile-cover .profile-identity,
.profile-page > .profile-cover .profile-identity > div:last-child {
  min-width: 0;
  max-width: 100%;
}

.profile-page > .profile-cover .profile-cover-main {
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
}

.profile-page > .profile-cover .profile-identity {
  width: 100%;
  grid-template-columns: var(--profile-cover-avatar-size) minmax(0, 1fr);
}

.profile-page > .profile-cover .profile-avatar-motion {
  display: grid;
  width: var(--profile-cover-avatar-size);
  min-width: var(--profile-cover-avatar-size);
  max-width: var(--profile-cover-avatar-size);
  height: var(--profile-cover-avatar-size);
  aspect-ratio: 1;
  place-items: center;
  align-self: center;
  flex: 0 0 var(--profile-cover-avatar-size);
}

.profile-page > .profile-cover .profile-avatar-motion > .profile-avatar-xl {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  aspect-ratio: 1;
  place-items: center;
}

.profile-page > .profile-cover .profile-avatar-motion > .profile-avatar-xl > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-page > .profile-cover .profile-identity h1 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-page > .profile-cover .profile-edit-button {
  max-width: 100%;
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .profile-page > .profile-cover {
    --profile-cover-avatar-size: 54px;
  }

  .profile-page > .profile-cover .profile-cover-main {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .profile-page > .profile-cover .profile-edit-button {
    position: static;
    top: auto;
    right: auto;
    width: fit-content;
    justify-self: start;
    margin-top: 2px;
  }

  .profile-page > .profile-cover .profile-identity > div:last-child {
    padding-right: 0;
  }
}


/* Source: /community-reference.css?v=14 */
/*
 * Community / study-room reference pass
 *
 * This file is intentionally scoped to .community-modern so it can be loaded
 * after the legacy styles without changing markup, state, or access rules.
 */

.community-modern {
  --community-ref-brand: #087454;
  --community-ref-brand-strong: #056247;
  --community-ref-brand-soft: #edf7f3;
  --community-ref-ink: #18211d;
  --community-ref-muted: #6b756f;
  --community-ref-line: #e2e8e4;
  --community-ref-line-strong: #cfdad4;
  --community-ref-surface: #ffffff;
  --community-ref-subtle: #f7f9f8;
  width: min(1120px, 100%);
  gap: 18px;
  color: var(--community-ref-ink);
}

/* Community threads and server-expiring photos */
.community-modern .community-post-type-picker,
.community-post-detail .community-post-type-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.community-post-type-picker > legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.community-post-type-picker > label {
  display: block;
  min-width: 0;
  cursor: pointer;
}

.community-post-type-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.community-post-type-picker label > span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  min-height: 70px;
  padding: 12px 14px;
  border: 1px solid #d9e1ec;
  border-radius: 16px;
  color: #526073;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.community-post-type-picker label > span > .icon {
  grid-row: 1 / 3;
  width: 22px;
  height: 22px;
  color: #748196;
}

.community-post-type-picker strong,
.community-post-type-picker small {
  min-width: 0;
}

.community-post-type-picker strong {
  color: #182337;
  font-size: 14px;
  line-height: 1.35;
}

.community-post-type-picker small {
  margin-top: 2px;
  color: #6f7b8e;
  font-size: 11px;
  line-height: 1.45;
}

.community-post-type-picker label.is-selected > span,
.community-post-type-picker input:focus-visible + span {
  border-color: #1769ff;
  background: #f5f8ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 255, .1);
}

.community-post-type-picker label:last-child.is-selected > span {
  border-color: #6657d9;
  background: #f8f7ff;
  box-shadow: 0 0 0 3px rgba(102, 87, 217, .1);
}

.community-post-type-picker label:last-child.is-selected .icon {
  color: #6657d9;
}

.community-standard-post-options {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.community-standard-post-options[hidden] {
  display: none !important;
}

.community-photo-retention-note {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  color: #667085;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
}

.community-thread-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  border-color: #ddd8ff !important;
  color: #5849bd !important;
  background: #f8f7ff !important;
}

.community-thread-badge .icon {
  width: 13px;
  height: 13px;
}

.community-post-card.is-thread {
  position: relative;
  overflow: hidden;
  border-color: #dddaf4;
}

.community-post-card.is-thread::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #6657d9, #8b7ff0);
  content: "";
}

.community-thread-photo-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 16px;
  background: #eef1f6;
}

.community-thread-photo-grid:has(img:only-of-type) {
  grid-template-columns: minmax(0, 1fr);
}

.community-thread-photo-grid img {
  display: block;
  width: 100%;
  height: min(42vw, 340px);
  min-height: 170px;
  object-fit: cover;
}

.community-thread-photo-grid.is-card img {
  height: 180px;
  min-height: 130px;
}

.community-thread-detail {
  --thread-line: #d8d4ee;
}

.community-thread-root,
.community-thread-message {
  position: relative;
}

.community-thread-root {
  border-color: #dedaf4 !important;
}

.community-thread-reply-section {
  position: relative;
  margin-top: -2px;
}

.community-thread-replies {
  position: relative;
  gap: 12px !important;
  padding-left: 30px;
}

.community-thread-replies::before {
  position: absolute;
  top: -18px;
  bottom: 22px;
  left: 13px;
  width: 2px;
  border-radius: 2px;
  background: var(--thread-line);
  content: "";
}

.community-thread-message {
  border-color: #e2e0ef !important;
  box-shadow: 0 8px 24px rgba(59, 51, 112, .055) !important;
}

.community-thread-message::before {
  position: absolute;
  top: 24px;
  left: -22px;
  width: 10px;
  height: 10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #7668dc;
  box-shadow: 0 0 0 2px var(--thread-line);
  content: "";
}

.community-thread-reply-form {
  border-color: #dedaf4 !important;
  background: linear-gradient(180deg, #fff, #fbfaff) !important;
}

@media (max-width: 680px) {
  .community-modern .community-post-type-picker,
  .community-post-detail .community-post-type-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-post-type-picker label > span {
    min-height: 62px;
    padding: 10px 12px;
    border-radius: 14px;
  }

  .community-thread-photo-grid img {
    height: min(64vw, 300px);
    min-height: 140px;
  }

  .community-thread-photo-grid.is-card img {
    height: 150px;
    min-height: 116px;
  }

  .community-thread-replies {
    padding-left: 21px;
  }

  .community-thread-replies::before {
    left: 8px;
  }

  .community-thread-message::before {
    left: -18px;
  }

}

.community-modern > .workspace-head {
  min-height: 0;
  align-items: end;
  border: 0;
  background: transparent;
  padding: 2px 0 4px;
  box-shadow: none;
}

.community-modern > .workspace-head::before,
.community-modern > .workspace-head::after {
  content: none;
}

.community-modern .workspace-title-block {
  gap: 3px;
}

.community-modern .workspace-title-block .workspace-kicker {
  display: none;
}

.community-modern .workspace-title-block h2 {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.25;
}

.community-modern .workspace-title-block > p {
  margin: 0;
  color: var(--community-ref-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.community-modern .community-shell {
  display: grid;
  grid-template-columns: minmax(300px, 342px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.community-modern .community-left-rail {
  position: sticky;
  top: 84px;
  min-width: 0;
  overflow: visible;
}

.community-modern .community-control-panel {
  display: grid;
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-control-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-modern .community-control-head > div {
  display: grid;
  gap: 1px;
}

.community-modern .community-control-head .workspace-kicker,
.community-modern .community-control-head p {
  display: none;
}

.community-modern .community-control-head h3 {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 17px;
  font-weight: 730;
  line-height: 1.35;
}

.community-modern .community-create-trigger {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--community-ref-brand);
  padding: 0;
  color: #fff;
  box-shadow: none;
}

.community-modern .community-create-trigger:hover {
  background: var(--community-ref-brand-strong);
  transform: none;
}

.community-modern .community-create-trigger > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.community-modern .community-create-trigger .icon {
  width: 19px;
  height: 19px;
}

.community-modern .community-mobile-picker {
  display: none !important;
}

.community-modern .community-board-browser,
.community-modern .community-board-browser.is-open,
.community-modern .community-board-browser:not(.is-open) {
  display: grid !important;
  gap: 10px;
  min-width: 0;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "search access"
    "categories categories"
    "tabs tabs"
    "count count";
  gap: 8px;
  align-items: center;
}

.community-modern .community-search-row > .searchbox {
  grid-area: search;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 0 12px;
  box-shadow: none;
}

.community-modern .community-search-row > .searchbox:focus-within {
  border-color: var(--community-ref-brand);
  box-shadow: 0 0 0 3px rgba(8, 116, 84, 0.1);
}

.community-modern .community-search-row > .searchbox .icon {
  width: 18px;
  height: 18px;
  color: var(--community-ref-muted);
}

.community-modern .community-search-row > .searchbox input {
  min-width: 0;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 500;
}

.community-modern .community-search-row > .searchbox input::placeholder {
  color: #98a19c;
  opacity: 1;
}

.community-modern .community-search-row > .compact-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  overflow: visible;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0;
}

.community-modern .community-search-row > .compact-tabs .chip {
  min-width: 0;
  min-height: 39px;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0 6px;
  color: var(--community-ref-muted);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.community-modern .community-search-row > .compact-tabs .chip:hover {
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
  transform: none;
}

.community-modern .community-search-row > .compact-tabs .chip.active {
  border-bottom-color: var(--community-ref-brand);
  background: transparent;
  color: var(--community-ref-brand);
}

.community-modern .community-search-row > .compact-tabs .icon {
  width: 15px;
  height: 15px;
}

.community-modern .community-access-filter {
  grid-area: access;
  position: relative;
  min-width: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.community-modern .community-access-filter > summary {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 0 11px;
  color: var(--community-ref-ink);
  font-size: 12px;
  font-weight: 650;
  list-style: none;
}

.community-modern .community-access-filter > summary::-webkit-details-marker {
  display: none;
}

.community-modern .community-access-filter > summary .icon {
  width: 18px;
  height: 18px;
  color: var(--community-ref-muted);
}

.community-modern .community-access-filter[open] > summary {
  border-color: var(--community-ref-brand);
  color: var(--community-ref-brand);
  box-shadow: 0 0 0 3px rgba(8, 116, 84, 0.1);
}

.community-modern .community-access-filter > div {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 154px;
  grid-template-columns: 1fr;
  gap: 4px;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 6px;
  box-shadow: 0 12px 30px rgba(24, 33, 29, 0.12);
}

.community-modern .community-access-filter .chip {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  justify-content: flex-start;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 0 9px;
  color: var(--community-ref-ink);
  font-size: 12px;
  box-shadow: none;
}

.community-modern .community-access-filter .chip.active {
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-brand);
}

.community-modern #communityBoardCount {
  grid-area: count;
  justify-self: end;
  margin: -2px 2px 0;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 500;
}

.community-modern .enhanced-board-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-height: calc(100dvh - 310px);
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #c8d2cc transparent;
}

.community-modern .enhanced-board-list .community-board {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: var(--community-ref-surface);
  padding: 10px 7px;
  color: var(--community-ref-ink);
  text-align: left;
  box-shadow: none;
  transform: none;
}

.community-modern .enhanced-board-list .community-board:last-child {
  border-bottom: 0;
}

.community-modern .enhanced-board-list .community-board:hover {
  border-color: var(--community-ref-line);
  border-bottom-color: var(--community-ref-line);
  background: var(--community-ref-subtle);
  box-shadow: none;
  transform: none;
}

.community-modern .enhanced-board-list .community-board.active {
  border-color: var(--community-ref-line);
  border-bottom-color: var(--community-ref-line);
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .enhanced-board-list .community-board.active :is(strong, .board-name) {
  color: var(--community-ref-brand-strong);
}

.community-modern .enhanced-board-list .board-type-icon {
  display: grid;
  width: 50px;
  min-width: 50px;
  height: 50px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--board-color, var(--community-ref-brand)) 18%, #dfe7e3);
  border-radius: 10px;
  background: color-mix(in srgb, var(--board-color, var(--community-ref-brand)) 12%, #fff);
  color: var(--board-color, var(--community-ref-brand));
  box-shadow: none;
}

.community-modern .enhanced-board-list .board-type-icon .icon {
  width: 23px;
  height: 23px;
}

.community-modern .enhanced-board-list .board-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.community-modern .enhanced-board-list .board-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .enhanced-board-list .board-main small {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-modern .enhanced-board-list .board-stat {
  display: grid;
  min-width: 43px;
  justify-items: end;
  gap: 1px;
  padding: 0;
}

.community-modern .enhanced-board-list .board-stat b {
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
}

.community-modern .enhanced-board-list .board-stat small {
  max-width: 52px;
  overflow: hidden;
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .enhanced-board-list .board-pending {
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  border-width: 2px;
  font-size: 9px;
}

/* Selected room: hierarchy comes from type and spacing rather than nested cards. */
.community-modern .community-main-panel {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.community-modern .community-hero {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  min-height: 0;
  align-items: center;
  gap: 14px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 16px;
  box-shadow: none;
}

.community-modern .community-hero.no-banner {
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.community-modern .community-hero.no-banner::before {
  content: "";
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid color-mix(in srgb, var(--community-color, var(--community-ref-brand)) 18%, #dfe7e3);
  border-radius: 11px;
  background-color: color-mix(in srgb, var(--community-color, var(--community-ref-brand)) 10%, #fff);
  background-image: url("/wooshin-high-icon.svg?v=2");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 36px 36px;
}

.community-modern .community-banner {
  width: 76px;
  min-width: 76px;
  height: 76px;
  max-height: none;
  aspect-ratio: 1;
  border: 1px solid var(--community-ref-line);
  border-radius: 11px;
  object-fit: cover;
  box-shadow: none;
}

.community-modern .community-hero-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.community-modern .community-hero-context {
  gap: 7px;
  color: var(--community-ref-brand);
  font-size: 10.5px;
  font-weight: 650;
}

.community-modern .community-hero-context span + span::before {
  color: #b3bcb7;
}

.community-modern .community-hero-text h2 {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 22px;
  font-weight: 760;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-hero-text > p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--community-ref-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-modern .community-hero .meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 550;
}

.community-modern .community-hero-actions {
  position: static;
  display: flex;
  max-width: 210px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.community-modern .community-hero-actions > :is(button, a) {
  min-height: 38px;
  border-radius: 9px;
  padding-inline: 12px;
  box-shadow: none;
}

.community-modern .community-section-tabs {
  display: flex;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  scrollbar-width: none;
}

.community-modern .community-section-tabs::-webkit-scrollbar {
  display: none;
}

.community-modern .community-section-tabs > button {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 42px;
  gap: 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--community-ref-muted);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.community-modern .community-section-tabs > button.active {
  border-bottom-color: var(--community-ref-brand);
  background: transparent;
  color: var(--community-ref-brand);
}

.community-modern .community-section-tabs > button b:not(:empty) {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--community-ref-subtle);
  padding: 0 5px;
  color: var(--community-ref-muted);
  font-size: 9px;
}

.community-modern .community-section-tabs > button.active b:not(:empty) {
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-brand);
}

.community-modern .feed-tab-panel {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .feed-tab-panel .feed-tab-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}

.community-modern .feed-tab-panel .chip {
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  padding: 0 9px;
  color: var(--community-ref-muted);
  font-size: 11px;
  box-shadow: none;
}

.community-modern .feed-tab-panel .chip.active {
  border-color: var(--community-ref-line-strong);
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
}

.community-modern .community-feed {
  gap: 0;
  border-top: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
}

.community-modern .community-feed > .community-post-card {
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: var(--community-ref-surface);
  padding: 15px 2px;
  box-shadow: none;
}

.community-modern .community-main-panel > .community-study-room,
.community-modern .community-main-panel > .community-write,
.community-modern .community-main-panel > .community-customize {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern :is(.community-board, .community-section-tabs button, .community-create-trigger, .community-access-filter > summary):focus-visible {
  outline: 3px solid rgba(8, 116, 84, 0.22);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .community-modern .community-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .community-modern .community-left-rail {
    position: static;
    top: auto;
  }

  .community-modern .enhanced-board-list {
    max-height: 330px;
  }
}

@media (max-width: 700px) {
  .community-modern {
    width: 100%;
    gap: 12px;
  }

  .community-modern > .workspace-head {
    display: block;
    padding: 0 0 2px;
  }

  .community-modern .workspace-title-block h2 {
    font-size: 22px;
  }

  .community-modern .workspace-title-block > p,
  .community-modern > .workspace-head .workspace-head-actions {
    display: none;
  }

  .community-modern .community-control-panel {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .community-modern .community-control-head {
    display: contents !important;
  }

  .community-modern .community-control-head > div,
  .community-modern .community-control-head > .badge,
  .community-modern .community-mobile-picker {
    display: none !important;
  }

  .community-modern .community-create-trigger {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .community-modern .community-board-browser,
  .community-modern .community-board-browser.is-open,
  .community-modern .community-board-browser:not(.is-open),
  .community-modern .community-control-head > .badge + .community-mobile-picker + .community-board-browser {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    gap: 9px;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .community-modern .community-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "search create-space"
      "categories categories"
      "tabs tabs"
      "count access";
    gap: 7px;
  }

  .community-modern .community-search-row > .searchbox {
    min-height: 42px;
  }

  .community-modern .community-search-row > .compact-tabs {
    min-width: 0;
  }

  .community-modern .community-search-row > .compact-tabs .chip {
    min-height: 38px;
    gap: 4px;
    padding-inline: 3px;
    font-size: 11px;
  }

  .community-modern .community-search-row > .compact-tabs .icon {
    width: 14px;
    height: 14px;
  }

  .community-modern .community-access-filter {
    grid-area: access;
    justify-self: end;
  }

  .community-modern .community-access-filter > summary {
    width: auto;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    display: inline-flex;
    gap: 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 0 2px 0 8px;
    color: var(--community-ref-muted);
    font-size: 10.5px;
    font-weight: 600;
  }

  .community-modern .community-access-filter > summary .icon {
    width: 14px;
    height: 14px;
  }

  .community-modern .community-access-filter > div {
    top: calc(100% + 2px);
  }

  .community-modern #communityBoardCount {
    grid-area: count;
    align-self: center;
    justify-self: start;
    margin: 0 2px;
  }

  .community-modern .enhanced-board-list {
    max-height: 310px;
    border-top-color: var(--community-ref-line);
  }

  .community-modern .enhanced-board-list .community-board {
    min-height: 72px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 9px 4px;
  }

  .community-modern .enhanced-board-list .board-type-icon {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 9px;
  }

  .community-modern .enhanced-board-list .board-type-icon .icon {
    width: 21px;
    height: 21px;
  }

  .community-modern .enhanced-board-list .board-main strong {
    font-size: 13.5px;
  }

  .community-modern .enhanced-board-list .board-main small {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  .community-modern .community-main-panel {
    gap: 12px;
  }

  .community-modern .community-hero,
  .community-modern .community-hero.no-banner {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    padding: 4px 0 13px;
  }

  .community-modern .community-hero.no-banner::before {
    width: 56px;
    height: 56px;
    border-radius: 9px;
    background-size: 32px 32px;
  }

  .community-modern .community-banner {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-radius: 9px;
  }

  .community-modern .community-hero-text h2 {
    font-size: 19px;
  }

  .community-modern .community-hero-context {
    overflow: hidden;
    font-size: 9.5px;
    white-space: nowrap;
  }

  .community-modern .community-hero-text > p {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .community-modern .community-hero .meta {
    gap: 6px;
    overflow-x: auto;
    font-size: 10px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .community-modern .community-hero-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    justify-content: stretch;
  }

  .community-modern .community-hero-actions > :is(button, a) {
    width: 100%;
  }

  .community-modern .community-section-tabs > button {
    min-width: 82px;
    min-height: 40px;
    padding-inline: 9px;
  }

  .community-modern .feed-tab-panel {
    align-items: center;
  }

  .community-modern .feed-tab-panel > .muted {
    display: none;
  }

  .community-modern .feed-tab-panel .feed-tab-row {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }

  .community-modern .feed-tab-panel .chip {
    width: 100%;
    justify-content: center;
    padding-inline: 3px;
  }

  .community-modern .community-feed > .community-post-card {
    padding: 13px 0;
  }
}

.community-anonymous-compose {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(15, 101, 75, 0.18);
  border-radius: 14px;
  background: rgba(15, 101, 75, 0.045);
  padding: 12px 14px;
}

.community-anonymous-toggle {
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.community-anonymous-toggle > input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand);
}

.community-anonymous-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: rgba(15, 101, 75, 0.1);
  color: var(--brand);
}

.community-anonymous-icon .icon {
  width: 18px;
  height: 18px;
}

.community-anonymous-toggle > span:last-child {
  display: grid;
  gap: 2px;
}

.community-anonymous-toggle small,
.community-anonymous-compose > p,
.community-anonymous-disclosure {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.community-anonymous-compose > p {
  margin: 0 0 0 68px;
}

.community-anonymous-author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  font-weight: 750;
}

.community-anonymous-author .icon,
.community-anonymous-badge .icon {
  width: 14px;
  height: 14px;
}

.community-anonymous-badge {
  gap: 4px;
  border-color: rgba(15, 101, 75, 0.2);
  background: rgba(15, 101, 75, 0.08);
  color: var(--brand);
}

.community-anonymous-disclosure {
  max-width: 62ch;
  margin: 8px 0 0;
  border-left: 3px solid rgba(15, 101, 75, 0.35);
  padding-left: 9px;
}

@media (max-width: 520px) {
  .community-anonymous-compose {
    padding: 11px 12px;
  }

  .community-anonymous-compose > p {
    margin-left: 0;
  }
}

@media (max-width: 350px) {
  .community-modern .community-search-row > .compact-tabs .chip .icon,
  .community-modern .community-section-tabs > button .icon {
    display: none;
  }

  .community-modern .enhanced-board-list .community-board {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .community-modern .enhanced-board-list .board-type-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }
}

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

/* Focus room: timer, current totals, goal, and participants form one calm tool. */
.community-modern .community-study-room .study-room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 2px 0 13px;
}

.community-modern .community-study-room .study-room-head > div:first-child {
  display: grid;
  gap: 3px;
}

.community-modern .community-study-room .study-room-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--community-ref-brand);
  font-size: 10.5px;
  font-weight: 680;
}

.community-modern .community-study-room .study-room-head h3 {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 19px;
  font-weight: 740;
  line-height: 1.35;
}

.community-modern .community-study-room .study-room-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.community-modern .community-study-room .study-summary-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--community-ref-line);
  border-radius: 9px;
  background: var(--community-ref-surface);
}

.community-modern .community-study-room .study-summary-pills > span {
  display: grid;
  min-width: 72px;
  gap: 1px;
  border: 0;
  border-right: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 7px 9px;
  text-align: left;
}

.community-modern .community-study-room .study-summary-pills > span:last-child {
  border-right: 0;
}

.community-modern .community-study-room .study-summary-pills b {
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 730;
}

.community-modern .community-study-room .study-summary-pills small {
  color: var(--community-ref-muted);
  font-size: 9.5px;
  font-weight: 520;
}

.community-modern .community-study-room .invite-button {
  min-height: 38px;
  border: 1px solid var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
  color: var(--community-ref-brand);
  box-shadow: none;
}

.community-modern .community-study-room .study-room-grid.visual-study-grid {
  grid-template-columns: minmax(260px, 0.88fr) minmax(320px, 1.12fr);
  gap: 18px;
  align-items: start;
}

.community-modern .community-study-room .study-side-stack {
  gap: 14px;
}

.community-modern .community-study-room .study-timer-card,
.community-modern .community-study-room .study-leaderboard {
  position: static;
  overflow: visible;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 13px;
  box-shadow: none;
}

.community-modern .community-study-room .study-timer-card::after {
  content: none;
}

.community-modern .community-study-room .study-stopwatch-face {
  min-height: 112px;
  align-content: center;
  gap: 4px;
  border: 1px solid #a9cdbd;
  border-radius: 9px;
  background: #f1f8f5;
  padding: 15px;
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .community-study-room .study-stopwatch-face span,
.community-modern .community-study-room .study-stopwatch-face small {
  color: var(--community-ref-muted);
  font-size: 10.5px;
  font-weight: 560;
}

.community-modern .community-study-room .study-stopwatch-face strong {
  color: var(--community-ref-ink);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: none;
}

.community-modern .community-study-room .study-start-form {
  gap: 10px;
}

.community-modern .community-study-room .study-start-copy {
  display: grid;
  gap: 2px;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 3px 0 10px;
}

.community-modern .community-study-room .study-start-copy strong {
  color: var(--community-ref-ink);
  font-size: 15px;
  font-weight: 720;
}

.community-modern .community-study-room .study-start-copy span {
  color: var(--community-ref-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
}

.community-modern .community-study-room .study-goal-select {
  display: grid;
  gap: 6px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 600;
}

.community-modern .community-study-room .study-goal-select .select {
  min-height: 42px;
  border-color: var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
}

.community-modern .community-study-room .study-start-warning,
.community-modern .community-study-room .study-confirm-alert {
  gap: 4px;
  border: 1px solid #eadca6;
  border-radius: 9px;
  background: #fffdf3;
  padding: 10px;
  box-shadow: none;
}

.community-modern .community-study-room .study-start-warning strong,
.community-modern .community-study-room .study-confirm-alert strong {
  font-size: 11.5px;
}

.community-modern .community-study-room .study-start-warning p,
.community-modern .community-study-room .study-confirm-alert p {
  font-size: 10.5px;
  line-height: 1.45;
}

.community-modern .community-study-room .study-start-verify {
  align-items: flex-start;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
}

.community-modern .community-study-room .study-start-main-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  background: var(--community-ref-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.community-modern .community-study-room .study-start-main-button:hover {
  background: var(--community-ref-brand-strong);
  transform: none;
}

.community-modern .community-study-room .study-tools-toggle {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 7px 2px 0;
  color: var(--community-ref-muted);
  font-size: 11px;
  box-shadow: none;
}

.community-modern .community-study-room .study-leaderboard {
  gap: 0;
  padding: 0;
}

.community-modern .community-study-room .study-leaderboard .mini-title {
  min-height: 42px;
  align-items: center;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 12px;
}

.community-modern .community-study-room .study-leaderboard .mini-title strong {
  font-size: 13px;
  font-weight: 720;
}

.community-modern .community-study-room .study-rank {
  min-height: 48px;
  grid-template-columns: 24px 30px minmax(0, 1fr) auto auto;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 7px 11px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-rank:last-child {
  border-bottom: 0;
}

.community-modern .community-study-room .study-rank:hover,
.community-modern .community-study-room .study-rank.me {
  border-color: var(--community-ref-line);
  background: var(--community-ref-brand-soft);
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .rank-no {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--community-ref-subtle);
  color: var(--community-ref-muted);
  font-size: 10px;
  box-shadow: none;
}

.community-modern .community-study-room .study-rank strong,
.community-modern .community-study-room .study-rank b {
  font-size: 11.5px;
}

/* Keep the classroom feature, but remove the old 3D furniture treatment. */
.community-modern .community-study-room .study-classroom {
  min-height: 0;
  gap: 10px;
  overflow: visible;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 12px;
  perspective: none;
  box-shadow: none;
}

.community-modern .community-study-room .study-classroom::before {
  content: none;
}

.community-modern .community-study-room .classroom-board {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #164c3c;
  color: #fff;
  padding: 10px;
  font-size: 15px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .classroom-floor {
  max-height: 460px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 0 0;
  box-shadow: none;
}

.community-modern .community-study-room .seat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.community-modern .community-study-room .study-seat {
  min-height: 62px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 3px 7px;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
  padding: 7px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-seat::after {
  content: none;
}

.community-modern .community-study-room .study-seat small {
  color: var(--community-ref-muted);
}

.community-modern .community-study-room .desk-avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--community-ref-line);
  background: #fff;
  color: var(--community-ref-brand);
  box-shadow: none;
}

/* Management: a straightforward settings form, not another card stack. */
.community-modern .community-customize {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.community-modern .community-customize > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  background: transparent;
  padding: 0 2px;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 720;
}

.community-modern .community-customize > summary::after {
  margin-left: auto;
  color: var(--community-ref-muted);
}

.community-modern .community-customize[open] > summary {
  margin-bottom: 0;
  color: var(--community-ref-brand);
}

.community-modern .community-customize > form {
  gap: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.community-modern .community-customize > form > :is(input, textarea, select, label, .blog-toolbar, .community-setting-preview, .form-actions, .join-request-box) {
  margin: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  padding-top: 12px;
  padding-bottom: 12px;
}

.community-modern .community-customize :is(.input, .select, .textarea) {
  border-color: var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}

.community-modern .community-customize input[type="color"] {
  width: 48px;
  min-width: 48px;
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  padding: 3px;
}

.community-modern .community-setting-preview {
  min-height: 0;
}

.community-modern .community-setting-preview:empty {
  display: none;
}

.community-modern .community-setting-preview img {
  display: block;
  width: 100%;
  max-height: 160px;
  border: 1px solid var(--community-ref-line);
  border-radius: 9px;
  object-fit: cover;
  box-shadow: none;
}

.community-modern .community-customize .split-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-bottom: 0;
}

.community-modern .community-customize .split-actions > button {
  min-height: 42px;
  border-radius: 9px;
  box-shadow: none;
}

@media (max-width: 700px) {
  .community-modern .community-study-room .study-room-head {
    display: grid;
    gap: 10px;
  }

  .community-modern .community-study-room .study-room-head-actions {
    display: grid;
    justify-items: stretch;
  }

  .community-modern .community-study-room .study-summary-pills {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .community-modern .community-study-room .study-summary-pills > span {
    min-width: 0;
    padding: 7px 6px;
  }

  .community-modern .community-study-room .invite-button {
    width: 100%;
  }

  .community-modern .community-study-room .study-room-grid.visual-study-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .community-modern .community-study-room .study-timer-card,
  .community-modern .community-study-room .study-leaderboard,
  .community-modern .community-study-room .study-classroom {
    border-radius: 9px;
  }

  .community-modern .community-study-room .study-stopwatch-face {
    min-height: 104px;
  }

  .community-modern .community-study-room .study-stopwatch-face strong {
    font-size: 36px;
  }

  .community-modern .community-study-room .seat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-study-room .study-rank {
    grid-template-columns: 22px 28px minmax(0, 1fr) auto;
  }

  .community-modern .community-study-room .study-rank em {
    display: none;
  }

  .community-modern .community-customize .split-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-customize .split-actions > button {
    width: 100%;
  }
}

/* Routed community directory and detail screens. */
.community-modern.community-directory-page {
  width: min(760px, 100%);
}

.community-modern .community-directory-shell {
  min-width: 0;
}

.community-directory-page .community-control-panel {
  width: 100%;
}

.community-directory-page .enhanced-board-list {
  max-height: none;
  overflow: visible;
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 0;
}

.community-directory-page .enhanced-board-list .community-board {
  min-height: 98px;
  grid-template-columns: 62px minmax(0, 1fr) 42px;
  gap: 14px;
  padding: 13px 4px;
}

.community-directory-page .enhanced-board-list .board-type-icon {
  width: 62px;
  min-width: 62px;
  height: 62px;
  border-radius: 11px;
}

.community-modern .enhanced-board-list .board-type-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-modern .enhanced-board-list .board-type-icon img.official-community-icon {
  object-fit: contain;
  padding: 8px;
  background: #f4faf7;
}

.community-directory-page .enhanced-board-list .board-main {
  gap: 4px;
}

.community-directory-page .enhanced-board-list .board-main strong {
  font-size: 15px;
}

.community-modern .enhanced-board-list .board-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 9px;
  color: var(--community-ref-muted);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.35;
}

.community-modern .enhanced-board-list .board-meta i {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-directory-page .enhanced-board-list .board-stat {
  min-width: 42px;
  align-self: stretch;
  align-content: center;
  justify-items: center;
  color: var(--community-ref-muted);
}

.community-directory-page .enhanced-board-list .board-stat .icon {
  width: 18px;
  height: 18px;
}

.community-modern.community-detail-page {
  width: min(880px, 100%);
  gap: 0;
  overflow: visible;
}

.community-modern .community-detail-toolbar {
  display: grid;
  min-width: 0;
  min-height: 54px;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--community-ref-line);
  background: var(--community-ref-surface);
  padding: 0 2px;
}

.community-modern .community-detail-toolbar > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 15px;
  font-weight: 720;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-back-button {
  width: fit-content;
  min-width: 0;
  min-height: 40px;
  justify-content: flex-start;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0 8px 0 0;
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .community-back-button:hover {
  background: transparent;
  color: var(--community-ref-brand);
  transform: none;
}

.community-modern .community-back-button .icon {
  width: 19px;
  height: 19px;
}

.community-modern .community-detail-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.community-modern .community-detail-actions > button {
  min-height: 38px;
  gap: 5px;
  border-radius: 9px;
  padding: 0 11px;
  box-shadow: none;
}

.community-modern .community-detail-actions > .ghost {
  border-color: var(--community-ref-line);
  background: #fff;
  color: var(--community-ref-ink);
}

.community-detail-page .community-main-panel {
  width: 100%;
  padding-top: 15px;
}

.community-detail-page .community-hero {
  margin: 0;
}

.community-detail-page .community-section-tabs {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  overflow: visible;
}

.community-detail-page .community-section-tabs > button {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}

.community-detail-page :is(
  .community-posts-view,
  .community-info-view,
  .community-files-view,
  .community-members-view,
  .community-compose-view,
  .community-customize
) {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
  padding: 4px 0 0;
}

.community-modern .community-subview-head {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 2px 10px;
}

.community-modern .community-subview-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern .community-subview-head strong {
  color: var(--community-ref-ink);
  font-size: 16px;
  font-weight: 730;
  line-height: 1.35;
}

.community-modern .community-subview-head span {
  color: var(--community-ref-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.community-modern .community-subview-head > b {
  flex: 0 0 auto;
  color: var(--community-ref-brand);
  font-size: 12px;
  font-weight: 700;
}

.community-modern .community-description {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.community-modern .community-fact-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--community-ref-line);
}

.community-modern .community-fact-list > div {
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 2px;
}

.community-modern .community-fact-list :is(dt, dd) {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.community-modern .community-fact-list dt {
  color: var(--community-ref-muted);
  font-weight: 560;
}

.community-modern .community-fact-list dd {
  color: var(--community-ref-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.community-modern .community-focus-link {
  width: fit-content;
  min-height: 40px;
  border-color: var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
  color: var(--community-ref-brand);
  box-shadow: none;
}

.community-modern .community-member-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 1px solid var(--community-ref-line);
}

.community-modern .community-member-summary > div {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-right: 1px solid var(--community-ref-line);
  padding: 13px 10px;
  text-align: center;
}

.community-modern .community-member-summary > div:last-child {
  border-right: 0;
}

.community-modern .community-member-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 17px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-member-summary span {
  color: var(--community-ref-muted);
  font-size: 10.5px;
}

.community-modern .community-manager-list {
  display: grid;
  gap: 0;
}

.community-modern .community-manager-list h3 {
  margin: 0;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 2px 9px;
  font-size: 13px;
  font-weight: 700;
}

.community-modern .community-manager-row {
  display: grid;
  min-width: 0;
  min-height: 54px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 8px 2px;
}

.community-modern .community-manager-row > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.community-modern .community-manager-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-manager-row span {
  color: var(--community-ref-muted);
  font-size: 10.5px;
}

.community-modern .community-resource-feed {
  border-top: 0;
}

.community-modern .community-compose-view > .community-write {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-route-empty {
  min-height: 260px;
}

.community-detail-page :is(img, video, canvas, iframe, table, pre, .content-box, .image-preview, .document-preview-list) {
  max-width: 100%;
}

.community-detail-page :is(.katex-display, pre, table, .document-preview-list) {
  overflow-x: auto;
}

.community-detail-page :is(input, textarea, select, button) {
  max-width: 100%;
}

@media (max-width: 700px) {
  .community-modern.community-directory-page,
  .community-modern.community-detail-page {
    width: 100%;
  }

  .community-directory-page .enhanced-board-list .community-board {
    min-height: 88px;
    grid-template-columns: 54px minmax(0, 1fr) 32px;
    gap: 10px;
    padding: 11px 1px;
  }

  .community-directory-page .enhanced-board-list .board-type-icon {
    width: 54px;
    min-width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .community-directory-page .enhanced-board-list .board-main small {
    -webkit-line-clamp: 1;
  }

  .community-directory-page .enhanced-board-list .board-stat small {
    display: none;
  }

  .community-modern .community-detail-toolbar {
    min-height: 50px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 0;
  }

  .community-modern .community-back-button {
    min-height: 38px;
    padding-right: 4px;
  }

  .community-modern .community-back-button span {
    display: none;
  }

  .community-modern .community-detail-toolbar > strong {
    font-size: 14px;
    text-align: left;
  }

  .community-modern .community-detail-actions {
    gap: 4px;
  }

  .community-modern .community-detail-actions > button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
  }

  .community-modern .community-detail-actions > button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .community-detail-page .community-main-panel {
    gap: 11px;
    padding-top: 11px;
  }

  .community-detail-page .community-section-tabs {
    grid-auto-columns: minmax(0, 1fr);
  }

  .community-detail-page .community-section-tabs > button {
    min-height: 42px;
    gap: 3px;
    padding-inline: 2px;
    font-size: 10.5px;
  }

  .community-detail-page .community-section-tabs > button .icon {
    width: 14px;
    height: 14px;
  }

  .community-detail-page .community-section-tabs > button b:not(:empty) {
    display: none;
  }

  .community-detail-page :is(
    .community-posts-view,
    .community-info-view,
    .community-files-view,
    .community-members-view,
    .community-compose-view,
    .community-customize
  ) {
    gap: 11px;
    padding-top: 2px;
  }

  .community-modern .community-subview-head {
    min-height: 46px;
    gap: 8px;
    padding-bottom: 9px;
  }

  .community-modern .community-subview-head strong {
    font-size: 15px;
  }

  .community-modern .community-subview-head span {
    font-size: 10.5px;
  }

  .community-modern .community-fact-list > div {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .community-modern .community-member-summary > div {
    padding: 11px 5px;
  }

  .community-modern .community-member-summary strong {
    font-size: 14px;
  }

  .community-modern .community-focus-link {
    width: 100%;
  }
}

@media (max-width: 370px) {
  .community-detail-page .community-section-tabs > button .icon {
    display: none;
  }

  .community-detail-page .community-section-tabs > button {
    font-size: 10px;
  }
}

/* Study-room creation: one decision flow with a faithful list preview. */
body.has-community-create {
  overflow: hidden;
}

/*
 * The creation dialog is mounted beside .app-shell, not inside the directory
 * content. This dedicated layer prevents container overflow, sticky headers,
 * and the mobile tab bar from clipping or covering the dialog.
 */
#app > .community-create-overlay-root {
  position: fixed;
  z-index: 6000;
  inset: 0;
  width: 100%;
  height: 100dvh;
  pointer-events: none;
  isolation: isolate;
}

#app > .community-create-overlay-root .community-create-modal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: auto;
}

#app > .community-create-overlay-root :is(.community-create-backdrop, .community-create-dialog) {
  pointer-events: auto;
}

body.has-community-create .toast {
  z-index: 6100 !important;
}

.community-modern .community-create-modal {
  padding: 24px;
}

.community-modern .community-create-backdrop {
  background: rgb(13 27 21 / 46%);
  backdrop-filter: blur(2px);
}

.community-modern .community-create-dialog {
  display: block;
  width: min(780px, calc(100vw - 48px));
  max-width: 780px;
  max-height: min(820px, calc(100dvh - 48px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--community-ref-line-strong);
  border-top: 1px solid var(--community-ref-line-strong);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 0;
  color: var(--community-ref-ink);
  box-shadow: 0 24px 72px rgb(10 26 19 / 24%);
  overscroll-behavior: contain;
}

.community-modern .community-create-form-head {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--community-ref-line);
  background: rgb(255 255 255 / 97%);
  padding: 18px 20px 15px;
  backdrop-filter: blur(10px);
}

.community-modern .community-create-form-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern .community-create-form-head .workspace-kicker {
  color: var(--community-ref-brand);
  font-size: 11px;
  font-weight: 750;
}

.community-modern .community-create-form-head strong {
  color: var(--community-ref-ink);
  font-size: 21px;
  font-weight: 760;
  line-height: 1.3;
}

.community-modern .community-create-form-head p {
  margin: 2px 0 0;
  color: var(--community-ref-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.community-modern .community-create-form-head > .icon-only {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--community-ref-muted);
  padding: 0;
}

.community-modern .community-create-form-head > .icon-only:hover {
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
}

.community-modern .community-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  align-items: stretch;
}

.community-modern .community-create-fields {
  display: grid;
  min-width: 0;
  gap: 20px;
  padding: 20px;
}

.community-modern .community-create-group {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.community-modern .community-create-group > legend,
.community-modern .community-create-label b {
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.4;
}

.community-modern .community-create-group > p {
  margin: -5px 0 1px;
  color: var(--community-ref-muted);
  font-size: 11px;
  line-height: 1.45;
}

.community-modern .community-purpose-options,
.community-modern .community-access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.community-modern :is(.community-purpose-option, .community-access-option) {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 68px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 10px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.community-modern :is(.community-purpose-option, .community-access-option):hover {
  border-color: var(--community-ref-line-strong);
  background: var(--community-ref-subtle);
}

.community-modern :is(.community-purpose-option, .community-access-option):has(input:checked) {
  border-color: var(--community-ref-brand);
  background: var(--community-ref-brand-soft);
}

.community-modern :is(.community-purpose-option, .community-access-option):has(input:focus-visible) {
  outline: 3px solid rgb(8 116 84 / 14%);
  outline-offset: 1px;
}

.community-modern :is(.community-purpose-option, .community-access-option) > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.community-modern :is(.community-purpose-icon, .community-access-icon) {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--community-ref-subtle);
  color: var(--community-ref-muted);
}

.community-modern :is(.community-purpose-option, .community-access-option):has(input:checked) :is(.community-purpose-icon, .community-access-icon) {
  background: var(--community-ref-surface);
  color: var(--community-ref-brand);
}

.community-modern :is(.community-purpose-icon, .community-access-icon) .icon {
  width: 17px;
  height: 17px;
}

.community-modern :is(.community-purpose-option, .community-access-option) > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern :is(.community-purpose-option, .community-access-option) strong {
  color: var(--community-ref-ink);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.community-modern :is(.community-purpose-option, .community-access-option) small {
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.community-modern .community-create-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--community-ref-ink);
}

.community-modern .community-create-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.community-modern .community-create-label small {
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 550;
}

.community-modern .community-create-field :is(.input, .textarea) {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .community-create-field .input {
  min-height: 46px;
  padding-inline: 13px;
}

.community-modern .community-create-field .compact-textarea {
  min-height: 84px;
  padding: 11px 13px;
  resize: vertical;
}

.community-modern .community-create-field :is(.input, .textarea):focus {
  border-color: var(--community-ref-brand);
  outline: 3px solid rgb(8 116 84 / 10%);
  outline-offset: 0;
}

.community-modern .community-color-options {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.community-modern .community-create-swatch {
  position: relative;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border: 2px solid var(--community-ref-surface);
  border-radius: 50%;
  background: var(--swatch);
  padding: 0;
  box-shadow: 0 0 0 1px var(--community-ref-line);
}

.community-modern .community-create-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--community-ref-ink);
}

.community-modern .community-create-swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}

.community-modern .community-custom-color {
  position: relative;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  cursor: pointer;
}

.community-modern .community-custom-color input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.community-modern .community-custom-color span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 0 10px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 650;
}

.community-modern .community-custom-color:has(input:focus-visible) span {
  outline: 3px solid rgb(8 116 84 / 14%);
  outline-offset: 1px;
}

.community-modern .community-custom-color .icon {
  width: 14px;
  height: 14px;
}

.community-modern .community-create-preview {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
  border-left: 1px solid var(--community-ref-line);
  background: var(--community-ref-subtle);
  padding: 20px;
}

.community-modern .community-preview-kicker {
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 720;
}

.community-modern .community-create-preview-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 13px;
}

.community-modern .community-create-preview-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--create-color) 12%, #fff);
  color: var(--create-color);
}

.community-modern .community-create-preview-icon .icon {
  width: 21px;
  height: 21px;
}

.community-modern .community-create-preview-card > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
}

.community-modern .community-create-preview-type {
  color: var(--create-color);
  font-size: 10px;
  font-weight: 720;
}

.community-modern .community-create-preview-card strong {
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-create-preview-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--community-ref-muted);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-modern .community-create-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--community-ref-muted);
  font-size: 9.5px;
  font-weight: 580;
}

.community-modern .community-create-preview-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--community-ref-muted);
  font-size: 10px;
  line-height: 1.5;
}

.community-modern .community-create-preview-note .icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--community-ref-brand);
}

.community-modern .community-create-footer {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--community-ref-line);
  background: rgb(255 255 255 / 97%);
  padding: 10px 20px;
  backdrop-filter: blur(10px);
}

.community-modern .community-create-footer > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--community-ref-muted);
  font-size: 10px;
  line-height: 1.4;
}

.community-modern .community-create-footer > span .icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  color: var(--community-ref-brand);
}

.community-modern .community-create-submit {
  width: auto;
  min-width: 156px;
  min-height: 44px;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--community-ref-brand);
  color: #fff;
  padding: 0 16px;
  box-shadow: none;
}

.community-modern .community-create-submit:hover {
  background: var(--community-ref-brand-strong);
}

.community-modern .community-create-dialog.is-submitting {
  pointer-events: none;
}

@media (max-width: 760px) {
  .community-modern .community-create-modal {
    place-items: end stretch;
    padding: 0;
  }

  .community-modern .community-create-dialog {
    width: 100%;
    max-width: none;
    max-height: min(90dvh, 780px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -18px 54px rgb(10 26 19 / 22%);
  }

  .community-modern .community-create-form-head {
    min-height: 74px;
    padding: 14px 16px 12px;
  }

  .community-modern .community-create-form-head strong {
    font-size: 19px;
  }

  .community-modern .community-create-form-head p {
    font-size: 10.5px;
  }

  .community-modern .community-create-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-create-fields {
    gap: 18px;
    padding: 18px 16px;
  }

  .community-modern .community-create-preview {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    border-top: 1px solid var(--community-ref-line);
    border-left: 0;
    padding: 15px 16px;
  }

  .community-modern .community-create-preview-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 11px;
  }

  .community-modern .community-create-preview-icon {
    width: 42px;
    height: 42px;
  }

  .community-modern .community-create-footer {
    min-height: 66px;
    padding: 9px 16px max(9px, env(safe-area-inset-bottom));
  }

  .community-modern .community-create-footer > span {
    display: none;
  }

  .community-modern .community-create-submit {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .community-modern .community-purpose-options,
  .community-modern .community-access-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-purpose-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-modern .community-purpose-option {
    min-height: 62px;
    grid-template-columns: 29px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .community-modern .community-purpose-icon {
    width: 29px;
    height: 29px;
  }

  .community-modern .community-purpose-option small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-modern :is(.community-purpose-option, .community-access-option) {
    transition: none;
  }
}

/* School-board categories and lightweight meetup posts */
.community-modern [hidden] {
  display: none !important;
}

.community-modern .community-category-filter {
  grid-area: categories;
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 0 4px;
  scrollbar-width: none;
}

.community-modern .community-category-filter::-webkit-scrollbar {
  display: none;
}

.community-modern .community-category-filter .chip {
  min-height: 34px;
  flex: 0 0 auto;
  gap: 5px;
  border-radius: 999px;
  padding: 0 11px;
  white-space: nowrap;
}

.community-modern .community-category-filter .chip .icon {
  width: 15px;
  height: 15px;
}

@media (max-width: 700px) {
  .community-modern .community-category-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }

  .community-modern .community-category-filter .chip {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: 7px;
  }
}

@media (max-width: 370px) {
  .community-modern .community-category-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.community-modern .community-category-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.community-modern .community-category-options .community-purpose-option:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.community-modern .community-meeting-compose {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 1px solid var(--community-ref-line);
  padding: 12px 0;
}

.community-modern .community-meeting-toggle {
  display: grid;
  min-width: 0;
  grid-template-columns: 20px 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.community-modern .community-meeting-toggle > input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--community-ref-brand);
}

.community-modern .community-meeting-toggle-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-brand);
}

.community-modern .community-meeting-toggle-icon .icon {
  width: 18px;
  height: 18px;
}

.community-modern .community-meeting-toggle > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern .community-meeting-toggle strong {
  font-size: 14px;
  line-height: 1.35;
}

.community-modern .community-meeting-toggle small {
  color: var(--community-ref-muted);
  font-size: 11px;
  line-height: 1.4;
}

.community-modern .community-meeting-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(160px, 1fr) minmax(130px, .7fr);
  gap: 8px;
  padding-left: 65px;
}

.community-modern .community-meeting-fields label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 650;
}

.community-modern .community-meeting-fields label > span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.community-modern .community-meeting-fields label small {
  font-weight: 500;
}

.community-modern .community-meeting-fields .input {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  font-size: 13px;
}

.community-modern .community-meeting-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  border: 0;
  border-radius: 8px;
  background: var(--community-ref-brand-soft);
  padding: 12px;
  color: var(--community-ref-ink);
}

.community-modern .community-meeting-main {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.community-modern .community-meeting-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--community-ref-surface);
  color: var(--community-ref-brand);
}

.community-modern .community-meeting-symbol .icon {
  width: 18px;
  height: 18px;
}

.community-modern .community-meeting-main > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern .community-meeting-status {
  color: var(--community-ref-brand);
  font-size: 10px;
  font-weight: 720;
}

.community-modern .community-meeting-main strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-meeting-main small,
.community-modern .community-meeting-side > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  color: var(--community-ref-muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.community-modern .community-meeting-main small .icon,
.community-modern .community-meeting-side > span .icon {
  width: 13px;
  min-width: 13px;
  height: 13px;
}

.community-modern .community-meeting-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.community-modern .community-meeting-rsvp,
.community-modern .community-meeting-role {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.community-modern .community-meeting-role {
  min-height: 28px;
  background: rgb(255 255 255 / 72%);
  color: var(--community-ref-muted);
}

.community-modern .community-meeting-people {
  display: flex;
  min-width: 0;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgb(8 116 84 / 12%);
  padding-top: 10px;
  color: var(--community-ref-muted);
  font-size: 10.5px;
}

.community-modern .community-meeting-people > div {
  display: flex;
}

.community-modern .community-meeting-people .mini-avatar {
  width: 25px;
  height: 25px;
  margin-left: -5px;
  border: 2px solid var(--community-ref-brand-soft);
}

.community-modern .community-meeting-people .mini-avatar:first-child {
  margin-left: 0;
}

.community-modern .community-meeting-people small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .community-modern .community-meeting-fields {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 0;
  }

  .community-modern .community-meeting-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-meeting-side {
    justify-content: space-between;
    padding-left: 45px;
  }
}

@media (max-width: 430px) {
  .community-modern .community-category-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-category-options .community-purpose-option:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .community-modern .community-meeting-toggle {
    grid-template-columns: 20px 32px minmax(0, 1fr);
    gap: 7px;
  }

  .community-modern .community-meeting-toggle-icon,
  .community-modern .community-meeting-symbol {
    width: 32px;
    height: 32px;
  }

  .community-modern .community-meeting-main {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .community-modern .community-meeting-side {
    padding-left: 39px;
  }
}

/* Thread feed, timeline, reactions, and reply composer.
 *
 * Keep these rules at the end of the reference layer. The general community
 * feed deliberately owns a flat list style above; thread cards need a compact
 * conversation treatment without changing ordinary posts.
 */
.community-modern .community-feed > .community-post-card.is-thread {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 11px;
  overflow: hidden;
  margin: 9px 0;
  border: 1px solid #dce7e1;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 20px rgb(23 49 38 / 6%);
}

.community-modern .community-feed > .community-post-card.is-thread:hover {
  border-color: #b8d3c8;
  background: #fbfdfc;
  box-shadow: 0 9px 24px rgb(23 49 38 / 9%);
}

.community-modern .community-feed > .community-post-card.is-thread::before {
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #17815f;
}

.community-thread-card-head,
.community-thread-card-footer,
.community-thread-message-head,
.community-thread-message-actions,
.community-reaction-bar,
.community-reaction-sheet-head {
  display: flex;
  min-width: 0;
  align-items: center;
}

.community-thread-card-head {
  min-height: 32px;
  justify-content: space-between;
  gap: 10px;
  color: #66736d;
  font-size: 11px;
}

.community-thread-card-head :is(.author-link, .post-author-avatar) {
  min-width: 0;
  min-height: 32px;
  flex-direction: row;
  justify-content: flex-start;
  gap: 7px;
  padding: 0;
  color: #24332d;
  font-size: 12px;
}

.community-thread-card-head :is(.author-link, .post-author-avatar) .mini-avatar {
  display: grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
}

.community-thread-card-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: stretch;
  gap: 13px;
}

.community-thread-card-layout:not(:has(.community-thread-card-thumbnail)) {
  grid-template-columns: minmax(0, 1fr);
}

.community-thread-card-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 6px;
}

.community-thread-card-author :is(.post-author-avatar, .author-link) {
  min-height: 30px;
  justify-content: flex-start;
  gap: 7px;
  padding: 0;
  color: #34463e;
  font-size: 11.5px;
}

.community-thread-card-copy :is(h3, p) {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.community-modern .community-post-card.is-thread .community-thread-card-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  color: #17241f;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-thread-card-copy p {
  display: -webkit-box;
  overflow: hidden;
  color: #59675f;
  font-size: 12.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.community-thread-card-thumbnail {
  position: relative;
  display: block;
  width: 112px;
  min-width: 0;
  height: 92px;
  overflow: hidden;
  align-self: start;
  border: 1px solid #e0e8e4;
  border-radius: 12px;
  background: #edf3f0;
}

.community-thread-card-thumbnail > img,
img.community-thread-card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-thread-card-more {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 46%);
  border-radius: 999px;
  background: rgb(20 35 29 / 76%);
  padding: 0 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  backdrop-filter: blur(6px);
}

.community-thread-card-footer {
  min-height: 44px;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px 10px;
  border-top: 1px solid #edf1ef;
  padding-top: 7px;
  color: #68756f;
  font-size: 11px;
}

.community-reaction-bar {
  flex: 1 1 auto;
  min-height: 44px;
  flex-wrap: wrap;
  gap: 6px;
}

.community-reaction-chip,
.community-reaction-add {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #dce6e1;
  border-radius: 12px;
  background: #f7faf8;
  padding: 0 10px;
  color: #52615a;
  box-shadow: none;
  font-size: 11px;
  font-weight: 680;
  line-height: 1;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.community-reaction-bar.is-compact .community-reaction-chip-label {
  display: none;
}

.community-reaction-chip:hover,
.community-reaction-add:hover {
  border-color: #aecdbf;
  background: #edf7f3;
  color: #086548;
}

.community-reaction-chip[aria-pressed="true"] {
  border-color: #7fb9a3;
  background: #e4f4ed;
  color: #075f45;
  box-shadow: inset 0 0 0 1px rgb(8 116 84 / 10%);
}

.community-reaction-chip:focus-visible,
.community-reaction-add:focus-visible,
.community-reaction-option:focus-visible {
  outline: 3px solid rgb(8 116 84 / 22%);
  outline-offset: 2px;
}

.community-reaction-chip .icon,
.community-reaction-add .icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
}

.community-reaction-add {
  border-style: dashed;
  background: #fff;
}

.community-reaction-backdrop {
  --community-reaction-brand: #087454;
  --community-reaction-ink: #17231e;
  --community-reaction-muted: #66736d;
  --community-reaction-line: #dfe7e3;
  position: fixed;
  z-index: 6000;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background: rgb(13 27 21 / 44%);
  backdrop-filter: blur(2px);
}

.community-reaction-sheet {
  display: grid;
  width: min(420px, 100%);
  max-height: min(620px, calc(100dvh - 36px));
  overflow-x: hidden;
  overflow-y: auto;
  gap: 12px;
  border: 1px solid var(--community-reaction-line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  color: var(--community-reaction-ink);
  box-shadow: 0 24px 70px rgb(9 27 19 / 24%);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.community-reaction-sheet-head {
  min-height: 44px;
  justify-content: space-between;
  gap: 12px;
}

.community-reaction-sheet-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-reaction-sheet-head :is(h2, strong, p) {
  margin: 0;
}

.community-reaction-sheet-head :is(h2, strong) {
  color: var(--community-reaction-ink);
  font-size: 17px;
  line-height: 1.35;
}

.community-reaction-sheet-head p {
  color: var(--community-reaction-muted);
  font-size: 11px;
  line-height: 1.45;
}

.community-reaction-sheet-head > button {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: #f2f6f4;
  color: #53615a;
  padding: 0;
}

.community-reaction-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.community-reaction-option {
  display: grid;
  min-width: 0;
  min-height: 88px;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid #e0e8e4;
  border-radius: 14px;
  background: #f8faf9;
  padding: 9px 5px;
  color: #3f5048;
  box-shadow: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.community-reaction-option:hover,
.community-reaction-option[aria-pressed="true"] {
  border-color: #99c7b5;
  background: #eaf6f1;
  color: #075f45;
}

.community-reaction-option-glyph {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  color: var(--community-reaction-brand);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgb(8 116 84 / 9%);
}

.community-reaction-option-glyph .icon {
  width: 24px;
  height: 24px;
}

.community-thread-detail {
  --community-thread-brand: #087454;
  --community-thread-line: #dce6e1;
  width: min(820px, 100%);
  margin-inline: auto;
}

.community-thread-detail .community-thread-root {
  overflow: hidden;
  border: 1px solid #d8e5df !important;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 24px rgb(23 49 38 / 6%) !important;
}

.community-thread-detail .community-thread-replies {
  gap: 0 !important;
  padding-left: 0;
}

.community-thread-detail .community-thread-replies::before,
.community-thread-detail .community-thread-message::before {
  content: none;
}

.community-thread-timeline {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 4px 0 8px;
}

.community-thread-timeline::before {
  position: absolute;
  z-index: 0;
  top: 26px;
  bottom: 28px;
  left: 21px;
  width: 1px;
  background: var(--community-thread-line);
  content: "";
}

.community-thread-date-separator {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 10px;
  color: #7a8680;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}

.community-thread-date-separator::before,
.community-thread-date-separator::after {
  height: 1px;
  flex: 1 1 auto;
  background: #e5ebe8;
  content: "";
}

.community-thread-date-separator :is(time, span) {
  flex: 0 0 auto;
  border: 1px solid #e1e9e5;
  border-radius: 999px;
  background: #fff;
  padding: 5px 9px;
}

.community-thread-message {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.community-thread-message-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  overflow: hidden;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 14px;
  background: #dff1ea;
  color: #076548;
  font-size: 14px;
  font-weight: 750;
  box-shadow: 0 0 0 1px #dce6e1;
}

.community-thread-message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-thread-message-profile {
  position: relative;
  z-index: 2;
  display: block;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 0;
}

.community-thread-message-main {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid #e0e8e4;
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
  box-shadow: 0 4px 15px rgb(23 49 38 / 4%);
}

.community-thread-message-head {
  min-height: 24px;
  justify-content: space-between;
  gap: 10px;
}

.community-thread-message-head :is(strong, .author-link, .answer-author-link) {
  min-width: 0;
  color: #203029;
  font-size: 12px;
  font-weight: 730;
}

.community-thread-message-head > button {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: #203029;
  font-size: 12px;
  font-weight: 730;
  text-align: left;
}

.community-thread-message-head :is(time, small, .badge) {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 0;
  color: #7c8882;
  font-size: 9.5px;
  font-weight: 550;
}

.community-thread-message-body {
  min-width: 0;
  color: #2e3d36;
  font-size: 13px;
  line-height: 1.62;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.community-thread-message-actions {
  min-height: 44px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  border-top: 1px solid #edf1ef;
  padding-top: 6px;
}

.community-thread-message-actions > button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  padding-inline: 10px;
  font-size: 10.5px;
}

.community-thread-reply-form {
  position: sticky;
  z-index: 36;
  bottom: 12px;
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid #cfdfd8 !important;
  border-radius: 16px;
  background: rgb(255 255 255 / 97%) !important;
  padding: 10px !important;
  box-shadow: 0 12px 34px rgb(15 39 29 / 13%) !important;
  backdrop-filter: blur(14px);
}

.community-thread-composer-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 7px;
}

.community-thread-composer-row :is(textarea, .textarea) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #d9e4df;
  border-radius: 12px;
  background: #f8faf9;
  padding: 10px 11px;
  color: #22322b;
  line-height: 1.5;
}

.community-thread-composer-row :is(textarea, .textarea):focus {
  border-color: #7fb9a3;
  outline: 3px solid rgb(8 116 84 / 10%);
  background: #fff;
}

.community-thread-composer-media,
.community-thread-composer-send {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 12px;
  padding: 0;
}

.community-thread-composer-media {
  cursor: pointer;
}

.community-thread-composer-preview {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.community-thread-composer-preview > .image-preview:empty,
.community-thread-composer-preview:empty {
  display: none;
}

.community-thread-composer-preview > .image-preview {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  padding: 0;
}

.community-thread-composer-preview > .image-preview .question-image,
.community-thread-composer-preview > .image-preview img {
  width: 62px;
  min-width: 62px;
  height: 54px;
  border-radius: 9px;
  object-fit: cover;
}

.community-thread-composer-media {
  border: 1px solid #cfe0d9;
  background: #f2f8f5;
  color: #087454;
}

.community-thread-composer-send {
  border: 1px solid #087454;
  background: #087454;
  color: #fff;
}

.community-thread-composer-media .icon,
.community-thread-composer-send .icon {
  width: 19px;
  height: 19px;
}

@media (max-width: 768px) {
  .community-modern .community-feed > .community-post-card.is-thread {
    margin: 8px 0;
    padding: 13px;
    border-radius: 15px;
  }

  .community-thread-card-layout {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 10px;
  }

  .community-thread-card-thumbnail {
    width: 96px;
    height: 86px;
    border-radius: 11px;
  }

  .community-thread-card-footer {
    align-items: flex-start;
  }

  .community-reaction-backdrop {
    inset: var(--wt-viewport-offset-top, 0px) 0 auto;
    width: 100%;
    height: var(--wt-visual-viewport-height, 100dvh);
    align-items: end;
    padding: 0;
  }

  .community-reaction-sheet {
    width: 100%;
    max-width: none;
    max-height: min(74%, 620px);
    gap: 10px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    padding:
      13px
      max(14px, env(safe-area-inset-right))
      max(14px, env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    box-shadow: 0 -18px 54px rgb(9 27 19 / 22%);
  }

  .community-thread-detail {
    padding-bottom: calc(var(--community-thread-composer-height, 120px) + var(--polish-mobile-tab-h, 60px) + env(safe-area-inset-bottom) + 16px);
  }

  .community-thread-reply-form {
    position: fixed;
    z-index: 55;
    top: auto;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(var(--polish-mobile-tab-h, 60px) + env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: min(42dvh, 360px);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    border-radius: 16px 16px 0 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.wt-keyboard-open .community-thread-reply-form {
    top: calc(var(--wt-viewport-offset-top, 0px) + var(--wt-visual-viewport-height, 100dvh));
    bottom: auto;
    max-height: min(48dvh, calc(var(--wt-visual-viewport-height, 100dvh) - 10px));
    transform: translateY(-100%);
  }

  .community-thread-reply-form > .workspace-section-head,
  .community-thread-reply-form > .community-photo-retention-note {
    display: none;
  }

  .community-thread-message-main {
    padding: 10px 11px;
  }
}

body.has-community-reaction {
  overflow: hidden;
  overscroll-behavior: none;
}

.community-post-title-link {
  display: inline;
  width: auto;
  max-width: 100%;
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.community-post-title-link:focus-visible {
  outline: 3px solid rgb(8 116 84 / 22%);
  outline-offset: 3px;
}

@media (max-width: 420px) {
  .community-thread-card-layout {
    grid-template-columns: minmax(0, 1fr) 84px;
  }

  .community-thread-card-thumbnail {
    width: 84px;
    height: 78px;
  }

  .community-modern .community-post-card.is-thread .community-thread-card-copy h3 {
    font-size: 15px;
  }

  .community-thread-card-copy p {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .community-thread-card-footer > .community-reaction-bar {
    flex-basis: 100%;
  }

  .community-reaction-chip,
  .community-reaction-add {
    padding-inline: 8px;
  }

  .community-reaction-grid {
    gap: 7px;
  }

  .community-reaction-option {
    min-height: 82px;
    border-radius: 12px;
    padding-inline: 3px;
    font-size: 10.5px;
  }

  .community-thread-timeline::before {
    left: 18px;
  }

  .community-thread-message {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
  }

  .community-thread-message-avatar {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 12px;
  }

  .community-thread-message-profile {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .community-thread-message-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 340px) {
  .community-modern .community-feed > .community-post-card.is-thread {
    padding-inline: 11px;
  }

  .community-thread-card-layout {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
  }

  .community-thread-card-thumbnail {
    width: 76px;
    height: 72px;
  }

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

  .community-thread-composer-row {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 5px;
  }

  .community-thread-composer-media,
  .community-thread-composer-send {
    width: 42px;
    min-width: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-reaction-chip,
  .community-reaction-add,
  .community-reaction-option {
    transition: none;
  }
}

/* One school-wide feed; legacy spaces remain available in the disclosure below. */
.community-modern.community-unified-page {
  display: grid;
  width: min(760px, 100%);
  min-width: 0;
  gap: 16px;
  margin-inline: auto;
}

.community-unified-heading {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.community-unified-heading > div { min-width: 0; }
.community-unified-heading h1 {
  margin: 4px 0;
  color: #153c2d;
  font-size: clamp(25px, 4.5vw, 33px);
  letter-spacing: -.035em;
  line-height: 1.2;
}
.community-unified-heading p { margin: 0; color: #687b71; font-size: 13px; }
.community-unified-compose-trigger {
  min-width: 106px;
  min-height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
}

.community-unified-compose,
.community-unified-controls,
.community-unified-spaces {
  min-width: 0;
  border: 1px solid #dbe9df;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 18px rgb(14 66 45 / 4%);
}
.community-unified-compose { display: grid; gap: 10px; padding: 16px; }
.community-unified-compose-head { display: grid; gap: 2px; }
.community-unified-compose-head strong { color: #153c2d; font-size: 17px; }
.community-unified-compose-head span { color: #708078; font-size: 12px; }
.community-modern .community-unified-compose > .community-write {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.community-compose-hashtags { display: grid; min-width: 0; gap: 6px; }
.community-compose-hashtags > span { color: #325744; font-size: 13px; font-weight: 700; }
.community-compose-hashtags > span small { color: #809187; font-weight: 500; }
.community-compose-hashtags > .input { width: 100%; min-width: 0; }
.community-compose-hashtags > small { color: #718278; font-size: 11px; }

.community-unified-controls { display: grid; gap: 12px; padding: 14px; }
.community-unified-search {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  border: 1px solid #e1ebe4;
  border-radius: 12px;
  background: #f6faf7;
  padding: 0 13px;
  color: #5d7465;
}
.community-unified-search > .icon { width: 18px; height: 18px; flex: 0 0 auto; }
.community-unified-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #193a2b;
  font: inherit;
}
.community-unified-mode-row,
.community-unified-tags { display: flex; min-width: 0; flex-wrap: wrap; gap: 7px; }
.community-unified-mode-row > .chip { min-height: 36px; border-radius: 999px; }
.community-unified-mode-row > .chip.active,
.community-unified-mode-row > .chip[aria-pressed="true"] {
  border-color: #0c7957;
  background: #e6f5eb;
  color: #075d42;
}
.community-unified-scope-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.community-unified-scope-row > label { display: grid; min-width: 0; gap: 5px; color: #617367; font-size: 11px; font-weight: 700; }
.community-unified-scope-row .select { width: 100%; min-width: 0; min-height: 40px; }
.community-unified-tags { padding-top: 3px; }
.community-hashtag {
  display: inline-flex;
  max-width: 100%;
  min-height: 29px;
  align-items: center;
  gap: 4px;
  overflow-wrap: anywhere;
  border: 1px solid #d8e9de;
  border-radius: 999px;
  background: #f2f9f4;
  padding: 4px 10px;
  color: #126247;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
}
.community-hashtag:hover,
.community-hashtag.active { border-color: #0d7955; background: #e0f2e6; color: #085a3e; }
.community-hashtag small { color: #638b72; font-size: 10px; }
.community-post-hashtags { display: flex; min-width: 0; flex-wrap: wrap; gap: 5px; }
.community-post-hashtags .community-hashtag { min-height: 25px; padding: 2px 8px; font-size: 11px; }
.community-post-hashtags.is-detail { margin-block: 8px 12px; }
.community-post-board-link { cursor: pointer; font: inherit; }
.community-post-board-link:hover { border-color: #a2c4ad; color: #0c5f42; }
.community-unified-result-head { display: flex; justify-content: space-between; gap: 12px; color: #234637; }
.community-unified-result-head strong { font-size: 16px; }
.community-unified-result-head span { color: #76877d; font-size: 12px; }
.community-modern.community-unified-page .community-unified-feed { width: 100%; min-width: 0; }
.community-modern.community-unified-page .community-unified-feed > .community-post-card {
  padding: 16px 12px;
  border-bottom: 1px solid #e4ece6;
}
.community-modern.community-unified-page .community-unified-feed > .community-post-card:last-child { border-bottom: 0; }
.community-unified-spaces { overflow: hidden; }
.community-unified-spaces > summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  color: #345b46;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.community-unified-spaces > summary::-webkit-details-marker { display: none; }
.community-unified-spaces > summary span { margin-left: auto; color: #7b8d82; font-weight: 500; }
.community-unified-spaces > summary .icon:last-child { width: 16px; height: 16px; transform: rotate(90deg); }
.community-unified-spaces[open] > summary .icon:last-child { transform: rotate(-90deg); }
.community-unified-spaces > .community-directory-shell { border-top: 1px solid #e7eee8; padding: 12px 16px 18px; }

@media (max-width: 700px) {
  .community-modern.community-unified-page { gap: 13px; }
  .community-unified-heading { align-items: center; }
  .community-unified-heading p { font-size: 12px; }
  .community-unified-compose-trigger { min-width: 44px; min-height: 42px; padding-inline: 12px; }
  .community-unified-controls { padding: 12px; }
  .community-unified-scope-row { grid-template-columns: minmax(0, 1fr); }
  .community-modern.community-unified-page .community-unified-feed > .community-post-card { padding-inline: 10px; }
  .community-unified-spaces > .community-directory-shell { padding-inline: 10px; }
}

@media (max-width: 360px) {
  .community-unified-heading { align-items: flex-start; }
  .community-unified-heading h1 { font-size: 24px; }
  .community-unified-compose-trigger { font-size: 12px; }
}


/* Source: /note-reference-goodnotes-1becee2b1e1a.css?v=1 */
/*
 * Wooshin Tutor notes reference layer
 * Loaded after the legacy stylesheets. This file intentionally changes only
 * the note library, note market, and handwriting editor surfaces.
 */

:root {
  --note-green: #0f654b;
  --note-green-strong: #0a513d;
  --note-green-soft: #edf7f2;
  --note-green-tint: #f6fbf8;
  --note-ink: #17211d;
  --note-muted: #68736e;
  --note-line: #dfe6e2;
  --note-line-strong: #cbd7d1;
  --note-canvas-bg: #edf1ef;
  --note-danger: #c73b33;
  --note-control-radius: 8px;
  --note-card-radius: 10px;
}

/* --------------------------------------------------------------------------
 * Note library frame
 * ----------------------------------------------------------------------- */

.notes-workspace {
  width: 100%;
  min-width: 0;
  color: var(--note-ink);
}

/* Profile tab integration may arrive after this isolated stylesheet. */
.profile-tab-notes {
  min-width: 0;
  overflow: visible;
  gap: 0;
}

.profile-tab-notes > .profile-cover,
.profile-tab-notes > .profile-navigation-shell {
  display: none;
}

.profile-tab-notes .notes-workspace {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.notes-workspace,
.notes-workspace * {
  box-sizing: border-box;
}

.notes-workspace > .workspace-head {
  min-height: 0;
  margin: 0 0 22px;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--note-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.notes-workspace > .workspace-head::before,
.notes-workspace > .workspace-head::after {
  display: none;
}

.notes-workspace > .workspace-head .workspace-kicker,
.notes-workspace > .workspace-head .eyebrow {
  color: var(--note-green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.notes-workspace > .workspace-head h1,
.notes-workspace > .workspace-head h2 {
  margin: 4px 0 5px;
  color: var(--note-ink);
  font-size: clamp(25px, 3vw, 32px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0;
}

.notes-workspace > .workspace-head p {
  max-width: 660px;
  margin: 0;
  color: var(--note-muted);
  font-size: 14px;
  line-height: 1.55;
}

.notes-workspace .workspace-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.notes-workspace .workspace-head-actions > button {
  min-width: 0;
  min-height: 42px;
  padding: 0 15px;
  border-radius: var(--note-control-radius);
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.notes-workspace .workspace-head-actions > .primary {
  border-color: var(--note-green);
  background: var(--note-green);
  color: #fff;
}

.notes-workspace .workspace-head-actions > .primary:hover {
  border-color: var(--note-green-strong);
  background: var(--note-green-strong);
}

.notes-workspace .workspace-head-actions > .ghost {
  border-color: var(--note-line-strong);
  background: #fff;
  color: var(--note-ink);
}

/* Recovery is important, but should not dominate the whole page. */
.notes-workspace .note-recovery-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1px solid #d9e4dd;
  border-radius: var(--note-card-radius);
  background: var(--note-green-tint);
  color: var(--note-ink);
  box-shadow: none;
}

.notes-workspace .note-recovery-banner > div:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notes-workspace .note-recovery-banner strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-recovery-banner span {
  overflow: hidden;
  color: var(--note-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-recovery-banner .chips {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.notes-workspace .note-recovery-banner button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 13px;
  box-shadow: none;
}

/* Search and sort are one quiet utility row. */
.notes-workspace .note-toolbar.workspace-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.notes-workspace .note-toolbar .search-field {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--note-line-strong);
  border-radius: var(--note-control-radius);
  background: #fff;
  box-shadow: none;
}

.notes-workspace .note-toolbar .search-field:focus-within {
  border-color: var(--note-green);
  box-shadow: 0 0 0 3px rgba(15, 101, 75, 0.1);
}

.notes-workspace .note-toolbar .search-field .icon {
  width: 18px;
  height: 18px;
  color: #75817b;
}

.notes-workspace .note-toolbar .search-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--note-ink);
  font-size: 14px;
  box-shadow: none;
}

.notes-workspace .note-toolbar .compact-select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--note-line-strong);
  border-radius: var(--note-control-radius);
  background-color: #fff;
  color: #38453f;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

/* Categories behave like document tabs, not a row of floating pills. */
.notes-workspace .note-tabs.workspace-tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--note-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.notes-workspace .note-tabs.workspace-tabs::-webkit-scrollbar {
  display: none;
}

.notes-workspace .note-tabs.workspace-tabs > button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 43px;
  margin: 0;
  padding: 0 14px;
  scroll-snap-align: start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #65716b;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}

.notes-workspace .note-tabs.workspace-tabs > button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
}

.notes-workspace .note-tabs.workspace-tabs > button:hover {
  background: transparent;
  color: var(--note-green);
}

.notes-workspace .note-tabs.workspace-tabs > button.active {
  border: 0;
  background: transparent;
  color: var(--note-green);
  box-shadow: none;
}

.notes-workspace .note-tabs.workspace-tabs > button.active::after {
  background: var(--note-green);
}

.notes-workspace .note-tabs .icon {
  width: 16px;
  height: 16px;
}

.notes-workspace .note-tabs .chip-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  background: #eef2f0;
  color: #5f6a65;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.notes-workspace .note-tabs > button.active .chip-count {
  background: var(--note-green-soft);
  color: var(--note-green);
}

/* Optional metrics retain one shared surface instead of four nested cards. */
.notes-workspace .note-workspace-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--note-line);
  border-radius: var(--note-card-radius);
  background: #fff;
  box-shadow: none;
}

.notes-workspace .note-stat {
  display: grid;
  min-width: 0;
  min-height: 62px;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 0;
  border-right: 1px solid var(--note-line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.notes-workspace .note-stat:last-child {
  border-right: 0;
}

.notes-workspace .note-stat strong {
  color: var(--note-ink);
  font-size: 20px;
  font-weight: 750;
  line-height: 1;
}

.notes-workspace .note-stat span {
  color: var(--note-muted);
  font-size: 11px;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
 * Library list and selected document
 * ----------------------------------------------------------------------- */

.notes-workspace .note-layout.grid.two {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.notes-workspace .note-layout.grid.two.is-empty {
  grid-template-columns: minmax(0, 1fr);
}

.notes-workspace .note-inspector[hidden] {
  display: none;
}

.notes-workspace .note-card[hidden] {
  display: none;
}

.notes-workspace .note-list.notice-list {
  display: grid;
  min-width: 0;
  max-height: min(690px, calc(100dvh - 250px));
  gap: 0;
  padding: 0;
  overflow: hidden auto;
  border: 1px solid var(--note-line);
  border-radius: var(--note-card-radius);
  background: #fff;
  box-shadow: none;
  scrollbar-color: #c8d3cd transparent;
  scrollbar-width: thin;
}

.notes-workspace .note-card.notice-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  grid-template-rows: auto minmax(30px, auto) auto;
  column-gap: 12px;
  row-gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--note-line);
  border-radius: 0;
  background: #fff;
  color: var(--note-ink);
  outline: 0;
  box-shadow: none;
  transform: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.notes-workspace .note-card.notice-card:last-child {
  border-bottom: 0;
}

.notes-workspace .note-card.notice-card:hover {
  border-color: var(--note-line);
  background: #f8faf9;
  box-shadow: none;
  transform: none;
}

.notes-workspace .note-card.notice-card:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--note-green);
  outline-offset: -2px;
  background: #f8faf9;
}

.notes-workspace .note-card.notice-card.active-note {
  border-color: var(--note-line);
  background: var(--note-green-soft);
  color: var(--note-ink);
  box-shadow: none;
  transform: none;
}

.notes-workspace .note-card .card-head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.notes-workspace .note-card .card-head strong {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-card .badge {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #d7e4dd;
  border-radius: 6px;
  background: #f5faf7;
  color: var(--note-green);
  font-size: 10px;
  font-weight: 700;
}

.notes-workspace .note-card .note-thumb {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: stretch;
  width: 72px;
  height: 88px;
  max-width: 100%;
  max-height: 88px;
  margin: 0;
  border: 1px solid var(--note-line);
  border-radius: 7px;
  background: #f7f9f8;
  object-fit: cover;
  box-shadow: none;
}

.notes-workspace .note-card > p {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--note-muted);
  font-size: 13px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-card:has(.note-thumb) > p {
  grid-column: 1;
}

.notes-workspace .note-card .meta {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #7b857f;
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
}

.notes-workspace .note-card .meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-card .meta span + span::before {
  content: "\00b7";
  margin-right: 7px;
  color: #a1aaa5;
}

.notes-workspace .note-list[data-empty="true"]::after {
  content: "Search results are empty.";
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--note-muted);
  font-size: 13px;
  font-weight: 600;
}

.notes-workspace .note-empty.empty {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px 20px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--note-muted);
  text-align: center;
}

.notes-workspace .note-empty strong {
  color: var(--note-ink);
  font-size: 16px;
  font-weight: 720;
}

.notes-workspace .note-empty span {
  max-width: 310px;
  font-size: 13px;
  line-height: 1.55;
}

.notes-workspace .note-empty button {
  min-height: 39px;
  margin-top: 7px;
  padding: 0 13px;
  border-radius: var(--note-control-radius);
  font-size: 13px;
  box-shadow: none;
}

.notes-workspace .note-inspector.panel {
  position: sticky;
  top: 80px;
  min-width: 0;
  min-height: 330px;
  margin: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--note-line);
  border-radius: var(--note-card-radius);
  background: #fff;
  box-shadow: none;
}

.notes-workspace .note-inspector > .form,
.notes-workspace .note-inspector > form {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.notes-workspace .note-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.notes-workspace .note-inspector-head .badge {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #d6e4dc;
  border-radius: 6px;
  background: var(--note-green-soft);
  color: var(--note-green);
  font-size: 11px;
}

.notes-workspace .note-inspector-head .muted {
  min-width: 0;
  overflow: hidden;
  color: var(--note-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-title-edit {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 3px;
  padding: 0 0 11px;
  border: 0;
  border-bottom: 1px solid var(--note-line);
  border-radius: 0;
  background: transparent;
  color: var(--note-ink);
  text-align: left;
  box-shadow: none;
}

.notes-workspace .note-title-edit:hover span {
  color: var(--note-green);
}

.notes-workspace .note-title-edit span {
  width: 100%;
  overflow: hidden;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .note-title-edit small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--note-muted);
  font-size: 11px;
  font-weight: 600;
}

.notes-workspace .note-title-edit small .icon {
  width: 13px;
  height: 13px;
}

.notes-workspace .hand-note-summary {
  display: grid;
  width: 100%;
  min-width: 0;
  max-height: 440px;
  place-items: center;
  overflow: auto;
  border: 1px solid var(--note-line);
  border-radius: 8px;
  background: #f5f7f6;
}

.notes-workspace .hand-note-summary img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 420px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  object-fit: contain;
  box-shadow: none;
}

.notes-workspace .note-inspector :is(.input, .select, .textarea) {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--note-line-strong);
  border-radius: var(--note-control-radius);
  background-color: #fff;
  color: var(--note-ink);
  box-shadow: none;
}

.notes-workspace .note-inspector :is(.input, .select) {
  min-height: 43px;
  padding-inline: 12px;
}

.notes-workspace .note-inspector :is(.input, .select, .textarea):focus {
  border-color: var(--note-green);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(15, 101, 75, 0.1);
}

.notes-workspace .note-textarea {
  min-height: 350px;
  padding: 13px 14px;
  resize: vertical;
  background-color: #fff;
  background-image: linear-gradient(to bottom, transparent 30px, #edf1ef 31px);
  background-size: 100% 31px;
  font-size: 14px;
  line-height: 31px;
  overflow-wrap: anywhere;
}

.notes-workspace .note-text-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.notes-workspace .note-text-tools > button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--note-line-strong);
  border-radius: 9px;
  background: #f8faf9;
  color: var(--note-ink);
  font-size: 12px;
  font-weight: 680;
}

.notes-workspace .note-text-tools > button:focus-visible {
  outline: 2px solid var(--note-green);
  outline-offset: 2px;
}

.notes-workspace .note-draft-hint {
  margin: 0;
  color: var(--note-muted);
  font-size: 12px;
  line-height: 1.55;
}

.notes-workspace .note-draft-hint kbd {
  padding: 1px 3px;
  border: 1px solid var(--note-line);
  border-radius: 4px;
  background: #f8faf9;
  font: inherit;
}

.notes-workspace .note-inspector .chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.notes-workspace .note-inspector .chips > button {
  min-height: 40px;
  padding: 0 13px;
  border-radius: var(--note-control-radius);
  font-size: 13px;
  font-weight: 680;
  box-shadow: none;
}

.notes-workspace .note-inspector .chips > .primary {
  border-color: var(--note-green);
  background: var(--note-green);
  color: #fff;
}

.notes-workspace .note-inspector .chips > .ghost {
  border-color: var(--note-line-strong);
  background: #fff;
  color: var(--note-ink);
}

.notes-workspace .note-inspector .chips > .danger {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--note-danger);
}

.notes-workspace .note-inspector :is(.katex-display, pre, table) {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.notes-workspace .note-inspector :is(p, span, strong, textarea) {
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
 * Note market
 * ----------------------------------------------------------------------- */

.notes-workspace > .panel:not(.note-toolbar):not(.note-inspector),
.notes-workspace .note-tabs + .panel {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--note-line);
  border-radius: var(--note-card-radius);
  background: #fff;
  box-shadow: none;
}

.notes-workspace .compact-title.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.notes-workspace .compact-title h2 {
  margin: 0;
  color: var(--note-ink);
  font-size: 19px;
  font-weight: 750;
}

.notes-workspace .compact-title .compact-select {
  width: auto;
  min-width: 120px;
  min-height: 40px;
  border: 1px solid var(--note-line-strong);
  border-radius: var(--note-control-radius);
  background-color: #fff;
  box-shadow: none;
}

.notes-workspace .market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.notes-workspace .market-card.notice-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  margin: 0;
  padding: 13px;
  overflow: hidden;
  border: 1px solid var(--note-line);
  border-radius: var(--note-card-radius);
  background: #fff;
  box-shadow: none;
}

.notes-workspace .market-card:hover {
  border-color: var(--note-line-strong);
  transform: none;
}

.notes-workspace .note-full-preview {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--note-line);
  border-radius: 7px;
  background: #f5f7f6;
  box-shadow: none;
}

.notes-workspace .market-card .note-thumb {
  display: block;
  width: 100%;
  height: auto;
  max-height: 250px;
  aspect-ratio: 3 / 4;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.notes-workspace .market-card .card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.notes-workspace .market-card .card-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--note-ink);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-workspace .market-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--note-muted);
  font-size: 11px;
}

.notes-workspace .market-card .chips {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.notes-workspace .market-card .chips button {
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
 * Handwriting workspace
 * ----------------------------------------------------------------------- */

.app-shell.has-note-editor {
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
  background: var(--note-canvas-bg);
}

.has-note-editor .note-editor-backdrop {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: block;
  min-width: 0;
  min-height: 100dvh;
  padding: 0;
  background: var(--note-canvas-bg);
}

.has-note-editor .note-editor {
  display: grid;
  grid-template-rows: 62px minmax(0, 1fr);
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--note-canvas-bg);
  box-shadow: none;
}

.has-note-editor .note-editor-top {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--note-line);
  background: #fff;
  box-shadow: none;
}

.has-note-editor .note-editor-leading,
.has-note-editor .note-editor-actions,
.has-note-editor .note-header-history {
  display: flex;
  align-items: center;
  min-width: 0;
}

.has-note-editor .note-editor-leading {
  gap: 9px;
}

.has-note-editor .note-document-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.has-note-editor .note-document-copy > span {
  color: var(--note-green);
  font-size: 10px;
  font-weight: 700;
}

.has-note-editor .note-title-input {
  width: min(38vw, 430px);
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--note-ink);
  font: inherit;
  font-size: 15px;
  font-weight: 740;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
}

.has-note-editor .note-editor-back-button,
.has-note-editor .note-header-history .icon-ghost {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--note-control-radius);
  background: transparent;
  color: #4c5953;
  box-shadow: none;
}

.has-note-editor .note-editor-back-button:hover,
.has-note-editor .note-header-history .icon-ghost:hover {
  border-color: var(--note-line);
  background: #f5f8f6;
  color: var(--note-green);
}

.has-note-editor .note-save-status {
  justify-self: center;
  min-width: 72px;
  color: var(--note-muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}

.has-note-editor .note-save-status[data-status="saving"],
.has-note-editor .note-save-status[data-status="dirty"],
.has-note-editor .note-save-status[data-status="local"] {
  color: #9a6a15;
}

.has-note-editor .note-save-status[data-status="saved"] {
  color: var(--note-green);
}

.has-note-editor .note-save-status[data-status="error"],
.has-note-editor .note-save-status[data-status="backup-error"] {
  color: var(--note-danger);
}

.has-note-editor .note-editor-actions {
  justify-self: end;
  gap: 6px;
}

.has-note-editor .note-header-history {
  gap: 2px;
  padding-right: 7px;
  border-right: 1px solid var(--note-line);
}

.has-note-editor .note-save-button,
.has-note-editor .note-share-button,
.has-note-editor .note-copy-button {
  min-width: 0;
  min-height: 40px;
  padding: 0 13px;
  border-radius: var(--note-control-radius);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.has-note-editor .note-save-button {
  border-color: var(--note-line-strong);
  background: #fff;
  color: var(--note-ink);
}

.has-note-editor .note-share-button,
.has-note-editor .note-copy-button {
  border-color: var(--note-green);
  background: var(--note-green);
  color: #fff;
}

.has-note-editor .note-editor-body {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  /* Override the legacy <=980px two-row layout on portrait tablets. */
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.has-note-editor .note-toolrail {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 8px 7px;
  overflow: hidden auto;
  border: 0;
  border-right: 1px solid var(--note-line);
  background: #fff;
  box-shadow: none;
  scrollbar-width: thin;
}

.has-note-editor .note-tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.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: 8px;
  border-top: 1px solid #edf1ef;
}

.has-note-editor .note-toolrail button {
  position: relative;
  display: grid;
  width: 52px;
  min-width: 52px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #52605a;
  box-shadow: none;
}

.has-note-editor .note-toolrail button:hover {
  background: #f1f5f3;
  color: var(--note-green);
}

.has-note-editor .note-toolrail button.active,
.has-note-editor .note-toolrail button[aria-pressed="true"] {
  background: var(--note-green-soft);
  color: var(--note-green);
  box-shadow: none;
}

.has-note-editor .note-toolrail button .icon,
.has-note-editor .note-toolrail button svg {
  width: 20px;
  height: 20px;
}

.has-note-editor .note-toolrail button > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.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: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 56px;
  padding: 7px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-bottom: 1px solid var(--note-line);
  background: #fff;
  box-shadow: none;
  scrollbar-color: #c8d3cd transparent;
  scrollbar-width: thin;
}

.has-note-editor .note-active-tool-state {
  display: grid;
  flex: 0 0 auto;
  min-width: 66px;
  gap: 0;
}

.has-note-editor .note-active-tool-state span,
.has-note-editor .note-size-wrap > span {
  color: var(--note-muted);
  font-size: 10px;
  font-weight: 650;
}

.has-note-editor .note-active-tool-state strong {
  color: var(--note-ink);
  font-size: 13px;
  font-weight: 720;
}

.has-note-editor .note-colors {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
  padding: 0 11px;
  border-inline: 1px solid var(--note-line);
}

.has-note-editor .note-colors button {
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px #bfcac4;
}

.has-note-editor .note-colors button.active {
  box-shadow: 0 0 0 2px var(--note-green);
}

.has-note-editor .note-size-wrap {
  display: grid;
  grid-template-columns: auto minmax(84px, 136px) 34px;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.has-note-editor .note-size-wrap input[type="range"] {
  min-width: 84px;
  accent-color: var(--note-green);
}

.has-note-editor .note-size-wrap output {
  color: #5f6b65;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.has-note-editor .shape-detail-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
}

.has-note-editor .shape-detail-tools > button,
.has-note-editor .pen-only-button,
.has-note-editor .vector-eraser-button {
  width: auto;
  min-width: 40px;
  height: 36px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--note-line-strong);
  border-radius: 7px;
  background: #fff;
  color: #52605a;
  box-shadow: none;
}

.has-note-editor .shape-detail-tools > button.active,
.has-note-editor .pen-only-button.active,
.has-note-editor .vector-eraser-button.active {
  border-color: #a9cbbd;
  background: var(--note-green-soft);
  color: var(--note-green);
  box-shadow: none;
}

.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 .vector-eraser-button {
  display: none;
  white-space: nowrap;
}

.has-note-editor .note-editor[data-active-tool="eraser"] .vector-eraser-button {
  display: inline-flex;
}

.has-note-editor .hand-canvas-stage {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(14px, 2.5vw, 34px);
  background-color: var(--note-canvas-bg);
  background-image: radial-gradient(#ccd5d0 0.65px, transparent 0.65px);
  background-size: 18px 18px;
}

.has-note-editor .hand-paper {
  position: relative;
  display: block;
  max-width: none;
  margin: auto;
  border: 1px solid #ccd5d0;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 33, 29, 0.11);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.has-note-editor .hand-paper canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.has-note-editor #handCanvas,
.has-note-editor #handInkCanvas {
  pointer-events: none;
}

.has-note-editor #handPreviewCanvas {
  touch-action: none;
  cursor: crosshair;
}

.has-note-editor .note-editor-readonly #handPreviewCanvas {
  cursor: default;
}

.has-note-editor .mobile-tabbar,
.has-note-editor .bottom-ask {
  display: none !important;
}

/* --------------------------------------------------------------------------
 * Responsive behavior
 * ----------------------------------------------------------------------- */

@media (max-width: 960px) {
  .notes-workspace .note-layout.grid.two {
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
    gap: 12px;
  }

  .notes-workspace .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell:has(.notes-workspace) .container {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .notes-workspace {
    padding-bottom: 10px;
  }

  .notes-workspace > .workspace-head {
    margin-bottom: 16px;
    padding-bottom: 15px;
  }

  .notes-workspace > .workspace-head h1,
  .notes-workspace > .workspace-head h2 {
    font-size: 24px;
  }

  .notes-workspace > .workspace-head p {
    max-width: 100%;
    font-size: 13px;
  }

  .notes-workspace .workspace-head-actions {
    width: 100%;
  }

  .notes-workspace .workspace-head-actions > button {
    flex: 1 1 0;
    min-height: 42px;
  }

  .notes-workspace .note-recovery-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .notes-workspace .note-recovery-banner .chips {
    width: 100%;
  }

  .notes-workspace .note-recovery-banner .chips > button {
    flex: 1 1 0;
  }

  .notes-workspace .note-toolbar.workspace-section {
    grid-template-columns: minmax(0, 1fr) 126px;
  }

  .notes-workspace .note-tabs.workspace-tabs > button {
    min-height: 42px;
    padding-inline: 12px;
  }

  .notes-workspace .note-layout.grid.two {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .notes-workspace .note-list.notice-list {
    max-height: min(44dvh, 430px);
  }

  .notes-workspace .note-inspector.panel {
    position: static;
    min-height: 0;
    padding: 15px;
  }

  .notes-workspace .note-textarea {
    min-height: 300px;
  }

  .notes-workspace .market-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .notes-workspace .market-card.notice-card {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: start;
  }

  .notes-workspace .market-card .note-full-preview {
    grid-column: 1;
    grid-row: 1 / 4;
  }

  .notes-workspace .market-card .note-thumb {
    max-height: none;
    aspect-ratio: 3 / 4;
  }

  .notes-workspace .market-card .card-head,
  .notes-workspace .market-card > p,
  .notes-workspace .market-card .meta,
  .notes-workspace .market-card .chips {
    grid-column: 2;
    min-width: 0;
  }

  .notes-workspace .market-card .chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .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: 6px;
    min-height: calc(58px + env(safe-area-inset-top));
    padding: max(7px, env(safe-area-inset-top)) max(9px, env(safe-area-inset-right)) 7px max(9px, env(safe-area-inset-left));
  }

  .has-note-editor .note-editor-leading {
    gap: 5px;
  }

  .has-note-editor .note-editor-back-button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .has-note-editor .note-document-copy > span {
    display: none;
  }

  .has-note-editor .note-title-input {
    width: min(43vw, 190px);
    height: 22px !important;
    min-height: 22px !important;
    font-size: 14px;
    line-height: 22px;
  }

  .has-note-editor .note-save-status {
    position: absolute;
    left: calc(max(9px, env(safe-area-inset-left)) + 43px);
    bottom: 4px;
    height: 14px;
    min-width: 0;
    min-height: 14px;
    font-size: 9px;
    line-height: 14px;
  }

  .has-note-editor .note-header-history {
    display: none;
  }

  .has-note-editor .note-editor-actions {
    gap: 4px;
  }

  .has-note-editor .note-save-button,
  .has-note-editor .note-share-button,
  .has-note-editor .note-copy-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    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) calc(56px + env(safe-area-inset-bottom));
  }

  .has-note-editor .note-workbench {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: 52px minmax(0, 1fr);
  }

  .has-note-editor .note-toolrail {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    overflow: auto hidden;
    border: 0;
    border-top: 1px solid var(--note-line);
    background: #fff;
    scrollbar-width: none;
  }

  .has-note-editor .note-toolrail::-webkit-scrollbar {
    display: none;
  }

  .has-note-editor .note-toolrail .note-tool-group {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
  }

  .has-note-editor .note-toolrail .note-tool-group + .note-tool-group {
    padding: 0 0 0 6px;
    border-top: 0;
    border-left: 1px solid var(--note-line);
  }

  .has-note-editor .note-toolrail button {
    width: 44px;
    min-width: 44px;
    height: 42px;
    min-height: 42px;
  }

  .has-note-editor .note-rail-actions {
    margin-top: 0;
  }

  .has-note-editor .note-tool-inspector {
    min-height: 52px;
    gap: 8px;
    padding: 6px 8px;
  }

  .has-note-editor .note-active-tool-state {
    min-width: 55px;
  }

  .has-note-editor .note-colors {
    gap: 4px;
    padding-inline: 8px;
  }

  .has-note-editor .note-colors button {
    width: 23px;
    min-width: 23px;
    height: 23px;
    min-height: 23px;
  }

  .has-note-editor .note-size-wrap {
    grid-template-columns: auto 78px 31px;
  }

  .has-note-editor .note-size-wrap input[type="range"] {
    min-width: 78px;
  }

  .has-note-editor .shape-detail-tools > button,
  .has-note-editor .pen-only-button,
  .has-note-editor .vector-eraser-button {
    height: 34px;
    min-height: 34px;
  }

  .has-note-editor .hand-canvas-stage {
    padding: 10px;
  }
}

@media (max-width: 430px) {
  .notes-workspace .note-toolbar.workspace-section {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 6px;
  }

  .notes-workspace .note-toolbar .search-field {
    padding-inline: 10px;
  }

  .notes-workspace .note-tabs.workspace-tabs > button {
    gap: 5px;
    padding-inline: 11px;
    font-size: 12px;
  }

  .notes-workspace .note-tabs .chip-count {
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
  }

  .notes-workspace .note-card.notice-card {
    grid-template-columns: minmax(0, 1fr) 64px;
    column-gap: 10px;
    padding: 12px;
  }

  .notes-workspace .note-card .note-thumb {
    width: 64px;
    height: 78px;
    max-height: 78px;
  }

  .notes-workspace .note-card .card-head strong {
    font-size: 14px;
  }

  .notes-workspace .note-inspector.panel {
    padding: 13px;
  }

  .notes-workspace .note-inspector .chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-workspace .note-inspector .chips > button {
    width: 100%;
    min-width: 0;
  }

  .notes-workspace .note-inspector .chips > .danger {
    margin-left: 0;
  }

  .notes-workspace .market-card.notice-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .has-note-editor .note-title-input {
    width: min(36vw, 142px);
  }

  .has-note-editor .note-active-tool-state {
    display: none;
  }

  .has-note-editor .shape-detail-tools > button span,
  .has-note-editor .pen-only-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-workspace .note-card,
  .notes-workspace button,
  .has-note-editor button {
    scroll-behavior: auto;
    transition: none !important;
  }
}

/* James study materials: the original stays server-side; students write on a page layer. */
.has-note-editor .note-editor-material {
  grid-template-rows: 62px auto minmax(0, 1fr);
}

/* The fixed backdrop fills the iPad screen even if Safari briefly reports a
   stale 100dvh after rotation or dismissing the page-jump keyboard. */
.app-shell.has-note-editor .note-editor-backdrop.is-material-editor {
  inset: 0;
  height: auto;
  min-height: 0;
}

.app-shell.has-note-editor .note-editor-material {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.has-note-editor .note-pagebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--note-line);
  background: #fff;
  color: var(--note-ink);
}

.has-note-editor .note-pagebar > button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 37px;
  padding: 0 12px;
  border: 1px solid var(--note-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--note-green);
  font-weight: 750;
}

.has-note-editor .note-pagebar > button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.has-note-editor .note-pagebar label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--note-muted);
  font-size: 12px;
}

.has-note-editor .note-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.has-note-editor .note-page-jump input {
  width: 58px;
  min-height: 37px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  appearance: textfield;
}

.has-note-editor .note-page-jump input::-webkit-inner-spin-button,
.has-note-editor .note-page-jump input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.has-note-editor .note-page-jump .note-page-total {
  color: var(--note-muted);
  font-size: 12px;
  white-space: nowrap;
}

.has-note-editor .note-page-jump button {
  min-height: 37px;
  padding: 0 10px;
  border: 1px solid var(--note-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--note-green);
  font-weight: 750;
}

.has-note-editor .note-pagebar .note-page-progress {
  min-width: 62px;
  color: var(--note-muted);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.has-note-editor .study-touch-mode {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--note-line-strong);
  border-radius: 12px;
  background: #f3f8f5;
}

.has-note-editor .study-touch-mode button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--note-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.has-note-editor .study-touch-mode button.active {
  background: var(--note-green);
  color: #fff;
  box-shadow: 0 2px 5px rgba(22, 89, 65, .16);
}

.has-note-editor .study-touch-mode button:focus-visible {
  outline: 2px solid var(--note-green);
  outline-offset: 2px;
}

.has-note-editor .study-reader-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--note-line-strong);
  border-radius: 12px;
  background: #f3f8f5;
}

.has-note-editor .study-reader-view-controls button {
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--note-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.has-note-editor .study-reader-view-controls button.active {
  background: var(--note-green);
  color: #fff;
  box-shadow: 0 2px 5px rgba(22, 89, 65, .16);
}

.has-note-editor .study-reader-view-controls button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.has-note-editor .note-pagebar > small {
  width: 100%;
  margin: 0;
  color: var(--note-muted);
  font-size: 11px;
  text-align: center;
}

.has-note-editor .study-solution-conflict {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid #e9c175;
  border-radius: 10px;
  background: #fff8e7;
  color: #6b4a13;
  font-size: 12px;
}

.has-note-editor .study-solution-conflict > span {
  flex: 1 1 auto;
}

.has-note-editor .study-solution-conflict > button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #dfbd82;
  border-radius: 8px;
  background: #fff;
  color: #5b441a;
  font-weight: 700;
}

.has-note-editor .hand-canvas-stage.is-material-page:not(.is-ready) .hand-paper {
  visibility: hidden;
}

/* The page and its ink enter as one sheet after the next image is ready. */
.has-note-editor .hand-canvas-stage.is-material-page.is-ready[data-page-turn="next"] .hand-paper {
  animation: study-page-slide-next 260ms cubic-bezier(.2, .72, .24, 1) both;
}

.has-note-editor .hand-canvas-stage.is-material-page.is-ready[data-page-turn="prev"] .hand-paper {
  animation: study-page-slide-prev 260ms cubic-bezier(.2, .72, .24, 1) both;
}

@keyframes study-page-slide-next {
  from { opacity: .7; transform: translate3d(46px, 0, 0) rotateY(-4deg); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotateY(0); }
}

@keyframes study-page-slide-prev {
  from { opacity: .7; transform: translate3d(-46px, 0, 0) rotateY(4deg); }
  to { opacity: 1; transform: translate3d(0, 0, 0) rotateY(0); }
}

.has-note-editor .study-page-image-status {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90%, 360px);
  margin: 0;
  padding: 18px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--note-line);
  border-radius: 14px;
  background: #fff;
  color: var(--note-muted);
  font-size: 13px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(20, 50, 40, .08);
}

.has-note-editor .study-page-image-status[hidden] {
  display: none;
}

.has-note-editor .study-page-image-status button {
  margin-left: 4px;
  border: 0;
  background: transparent;
  color: var(--note-green);
  font-weight: 750;
}

.has-note-editor .hand-canvas-stage.is-material-page {
  position: relative;
  /* Include the empty margins around a narrow portrait page in the gesture surface. */
  touch-action: none;
}

.has-note-editor .study-page-spread {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: none;
  margin: auto;
  transition: translate 160ms ease-out;
}

.has-note-editor .study-page-spread .hand-paper {
  flex: 0 0 auto;
  margin: 0;
}

.has-note-editor .study-spread-companion {
  position: relative;
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ccd5d0;
  border-radius: 2px;
  background: #fff;
  color: #fff;
  box-shadow: 0 8px 24px rgba(23, 33, 29, .11);
  cursor: pointer;
}

.has-note-editor .study-spread-companion img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.has-note-editor .study-spread-companion span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .72);
  font-size: 10px;
  font-weight: 750;
  opacity: .78;
  backdrop-filter: blur(8px);
}

.has-note-editor .study-spread-companion:hover span,
.has-note-editor .study-spread-companion:focus-visible span {
  opacity: 1;
}

.has-note-editor .study-reference-viewer {
  position: fixed;
  z-index: 430;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(var(--study-reference-width, 300px), calc(100vw - 16px));
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  border: 1px solid rgba(17, 70, 51, .28);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(19, 47, 38, .28);
  transition: box-shadow 140ms ease, width 140ms ease;
}

.has-note-editor .study-reference-viewer.is-dragging {
  box-shadow: 0 24px 72px rgba(19, 47, 38, .38);
  transition: none;
}

.has-note-editor .study-reference-viewer > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--note-line);
  background: #f6faf7;
  color: var(--note-ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.has-note-editor .study-reference-viewer.is-dragging > header {
  cursor: grabbing;
}

.has-note-editor .study-reference-viewer > header strong {
  font-size: 12px;
}

.has-note-editor .study-reference-viewer > header span {
  color: var(--note-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.has-note-editor .study-reference-viewer button {
  display: inline-grid;
  min-width: 32px;
  min-height: 32px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--note-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--note-green);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.has-note-editor .study-reference-viewer button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.has-note-editor .study-reference-viewer > header button {
  border: 0;
  background: transparent;
  color: #53625b;
  font-size: 21px;
}

.has-note-editor .study-reference-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-bottom: 1px solid var(--note-line);
}

.has-note-editor .study-reference-nav form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.has-note-editor .study-reference-nav input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--note-line-strong);
  border-radius: 8px;
  color: var(--note-ink);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.has-note-editor .study-reference-sheet {
  position: relative;
  display: grid;
  min-height: 120px;
  overflow: auto;
  place-items: center;
  background: #e8eeeb;
}

.has-note-editor .study-reference-sheet.is-loading::before {
  content: "페이지 불러오는 중…";
  position: absolute;
  z-index: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--note-muted);
  font-size: 10px;
}

.has-note-editor .study-reference-sheet img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(62dvh, 720px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.has-note-editor .study-reference-size {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 10px;
  border-top: 1px solid var(--note-line);
  background: #fff;
  color: var(--note-muted);
  font-size: 10px;
}

.has-note-editor .study-reference-size input {
  width: 100%;
  accent-color: var(--note-green);
}

.study-invite-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--note-line-strong);
  border-radius: 18px;
  background: #fff;
}

.study-material-heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
}

.study-material-heading-actions > button {
  min-height: 40px;
  border-radius: 11px;
}

.study-book-upload-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--note-line-strong);
  border-radius: 18px;
  background: #fff;
}

.study-book-upload-panel > form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.study-book-upload-panel > form > label {
  display: grid;
  gap: 5px;
  color: var(--note-muted);
  font-size: 12px;
}

.study-book-upload-panel > form > label > input,
.study-book-upload-panel > form > label > select {
  width: 100%;
  min-width: 0;
}

.study-book-upload-panel > form > button {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 40px;
}

.study-category-create-panel > form > .study-book-published {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  color: var(--note-text);
  font-size: 13px;
}

.study-category-create-panel > form > .study-book-published input {
  width: auto;
  min-width: auto;
  margin: 0;
  accent-color: var(--note-green);
}

.study-upload-status {
  display: grid;
  gap: 6px;
  color: var(--note-muted);
  font-size: 12px;
}

.study-upload-status progress {
  width: 100%;
  height: 9px;
  accent-color: var(--note-green);
}

.study-upload-ready {
  margin: 0;
  color: var(--note-green);
  font-weight: 750;
}

.study-upload-error {
  margin: 0;
  color: var(--note-danger);
  font-size: 12px;
}

.study-book-metadata-form {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--note-line);
  border-radius: 13px;
  background: #fff;
}

.study-book-metadata-form > label {
  display: grid;
  gap: 4px;
  color: var(--note-muted);
  font-size: 12px;
  text-align: left;
}

.study-book-metadata-form :is(input, select) {
  min-width: 0;
  width: 100%;
}

.study-book-metadata-form .study-book-published {
  display: flex;
  align-items: center;
  gap: 7px;
}

.study-book-metadata-form .study-book-published input {
  width: auto;
}

.study-material-card.is-loading .study-material-actions button {
  cursor: progress;
}

.study-book-opening-overlay {
  position: fixed;
  z-index: 2147482800;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(232, 248, 240, .94);
  backdrop-filter: blur(10px);
  animation: study-book-loading-appear 360ms ease 320ms both;
}

.study-book-opening-panel {
  display: grid;
  justify-items: center;
  gap: 11px;
  width: min(100%, 390px);
  padding: 27px 22px;
  border: 1px solid #cfe5d8;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(17, 70, 43, .13);
  color: #183d2c;
  text-align: center;
}

.study-book-opening-panel strong { font-size: 19px; }
.study-book-opening-title { font-size: 14px; font-weight: 750; }
.study-book-opening-panel small { color: #677f70; line-height: 1.55; }
.study-book-opening-panel button { margin-top: 3px; }

.study-book-opening-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid #d6ece0;
  border-top-color: #087b62;
  border-radius: 50%;
  animation: study-book-loading-spin .8s linear infinite;
}

@keyframes study-book-loading-spin { to { transform: rotate(360deg); } }
@keyframes study-book-loading-appear { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .study-book-opening-overlay,
  .study-book-opening-spinner { animation: none; }
}

.study-category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 20px;
  color: var(--note-muted);
  font-size: 12px;
}

.study-category-summary > span {
  display: inline-flex;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--note-line);
  border-radius: 999px;
  background: #fff;
}

.study-category-summary strong {
  color: var(--note-green);
}

.study-privacy-note {
  margin: -8px 0 19px;
  color: #536b5c;
  font-size: 12px;
  line-height: 1.55;
}

.study-invite-head,
.study-invite-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.study-invite-head strong,
.study-invite-list-title {
  color: var(--note-ink);
  font-size: 15px;
}

.study-invite-head p {
  margin: 4px 0 0;
  color: var(--note-muted);
  font-size: 12px;
}

.study-invite-search {
  display: flex;
  gap: 8px;
}

.study-invite-search input {
  flex: 1 1 auto;
  min-width: 0;
}

.study-invite-list {
  display: grid;
  gap: 0;
}

.study-invite-list > div {
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid var(--note-line);
}

.study-invite-list > div > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.study-invite-list small,
.study-invite-loading,
.study-invite-empty {
  color: var(--note-muted);
  font-size: 12px;
}

.study-invite-list button {
  flex: 0 0 auto;
  min-height: 34px;
}

.study-analytics-backdrop {
  z-index: 700;
}

.study-analytics-modal {
  width: min(94vw, 680px);
  max-height: min(82dvh, 720px);
  overflow: auto;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(10, 35, 25, .2);
}

.study-analytics-modal > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.study-analytics-modal h2 {
  margin: 4px 0 0;
  color: var(--note-ink);
  font-size: clamp(19px, 3vw, 24px);
}

.study-analytics-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 20px 0;
}

.study-analytics-stats > div {
  display: grid;
  gap: 3px;
  padding: 14px 10px;
  border-radius: 12px;
  background: var(--note-green-soft);
  text-align: center;
}

.study-analytics-stats strong {
  color: var(--note-green);
  font-size: 21px;
}

.study-analytics-stats span,
.study-analytics-users small {
  color: var(--note-muted);
  font-size: 11px;
}

.study-analytics-users {
  display: grid;
}

.study-analytics-users > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px;
  border: 0;
  border-top: 1px solid var(--note-line);
  background: #fff;
  color: var(--note-ink);
  text-align: left;
}

.study-analytics-users > button > span {
  display: grid;
  gap: 3px;
}

@media (max-width: 760px) {
  .study-material-heading-actions {
    width: 100%;
  }

  .study-book-upload-panel > form {
    grid-template-columns: minmax(0, 1fr);
  }

  .has-note-editor .note-editor-material {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .has-note-editor .note-pagebar {
    gap: 5px;
    min-height: 48px;
    padding-inline: 8px;
  }

  .has-note-editor .note-pagebar > button {
    min-width: 37px;
    padding-inline: 7px;
  }

  .has-note-editor .note-pagebar > button > span,
  .has-note-editor .note-pagebar label > span {
    display: none;
  }

  .has-note-editor .note-pagebar > small {
    order: 5;
    width: 100%;
    margin: 0;
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
  }

  .has-note-editor .study-touch-mode {
    order: 4;
    width: 100%;
    max-width: 340px;
    margin-inline: auto;
  }

  .has-note-editor .study-reader-view-controls {
    order: 3;
    flex: 1 1 auto;
    justify-content: center;
  }

  .has-note-editor .study-reader-view-controls button {
    flex: 1;
    padding-inline: 7px;
  }

  .has-note-editor .hand-canvas-stage.is-spread-view {
    padding-inline: 8px;
  }

  .has-note-editor .study-spread-companion span {
    right: 4px;
    bottom: 4px;
    padding: 3px 5px;
    font-size: 8px;
  }

  .has-note-editor .study-reference-viewer {
    border-radius: 13px;
  }

  .has-note-editor .study-touch-mode button {
    flex: 1;
    min-width: 0;
    padding-inline: 5px;
  }

  .has-note-editor .note-pagebar .note-page-progress {
    min-width: 48px;
    font-size: 11px;
  }

  .has-note-editor .study-solution-conflict {
    flex-wrap: wrap;
  }

  .study-analytics-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .has-note-editor .hand-canvas-stage.is-material-page.is-ready[data-page-turn] .hand-paper {
    animation: none;
  }

  .has-note-editor .study-page-spread,
  .has-note-editor .study-reference-viewer {
    transition: none;
  }
}


/* Source: /note-detail-reference.css?v=2 */
/*
 * Wooshin Tutor note detail polish
 *
 * Final, narrowly scoped corrections for the note library and handwriting
 * workspace. Load after note-reference.css. This layer deliberately avoids
 * canvas sizing, pointer behavior, and application navigation.
 */

/* --------------------------------------------------------------------------
 * Shared containment
 * ----------------------------------------------------------------------- */

.notes-workspace :where(
  .workspace-head,
  .workspace-head-actions,
  .note-workspace-metrics,
  .note-toolbar,
  .note-tabs,
  .note-layout,
  .note-list,
  .note-card,
  .note-inspector,
  .note-inspector > .form,
  .note-inspector > form,
  .market-grid,
  .market-card
) {
  min-width: 0;
  max-width: 100%;
}

.notes-workspace :where(button, input, select, textarea) {
  max-width: 100%;
}

.notes-workspace :where(.icon, svg) {
  flex: 0 0 auto;
}

.notes-workspace :where(.card-head, .meta, .chips) > * {
  min-width: 0;
}

/* A text-only note must not reserve the thumbnail column. */
.notes-workspace .note-card.notice-card:not(:has(.note-thumb)) {
  grid-template-columns: minmax(0, 1fr);
}

.notes-workspace .note-card.notice-card:not(:has(.note-thumb)) :where(.card-head, .meta, p) {
  grid-column: 1;
}

.notes-workspace .note-card .card-head strong,
.notes-workspace .market-card .card-head strong,
.notes-workspace .note-title-edit span {
  overflow-wrap: anywhere;
}

/* Keep the selected state quiet: the row changes tone, not geometry. */
.notes-workspace .note-card.notice-card.active-note {
  outline: 0;
}

.notes-workspace .note-card.notice-card.active-note::before {
  display: none;
}

/* The DOM-filter fallback should remain Korean and use the same empty rhythm. */
.notes-workspace .note-list[data-empty="true"]::after {
  content: "검색 결과가 없습니다.";
  min-height: 180px;
  padding: 24px 16px;
  color: var(--note-muted, #68736e);
}

/* --------------------------------------------------------------------------
 * Flat library and inspector
 * ----------------------------------------------------------------------- */

.notes-workspace .note-layout.grid.two {
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
}

.notes-workspace .note-list.notice-list {
  overscroll-behavior: contain;
}

.notes-workspace .note-card.notice-card {
  min-height: 94px;
}

.notes-workspace .note-inspector.panel {
  scroll-margin-block: 76px calc(80px + env(safe-area-inset-bottom));
}

/* Text-note controls read as one settings sheet instead of nested cards. */
.notes-workspace .note-inspector > form.form {
  gap: 0;
}

.notes-workspace .note-inspector > form.form .note-inspector-head {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--note-line, #dfe6e2);
}

.notes-workspace .note-inspector > form.form :where(.input, .select) {
  min-height: 50px;
  margin: 0;
  padding-inline: 0;
  border: 0;
  border-bottom: 1px solid var(--note-line, #dfe6e2);
  border-radius: 0;
  background-color: transparent;
}

.notes-workspace .note-inspector > form.form :where(.input, .select):focus {
  border-color: var(--note-green, #0f654b);
  box-shadow: inset 0 -1px 0 var(--note-green, #0f654b);
}

.notes-workspace .note-inspector > form.form .note-textarea {
  min-height: 290px;
  margin-top: 12px;
  border-color: var(--note-line, #dfe6e2);
}

.notes-workspace .note-inspector > form.form > .chips {
  margin-top: 12px;
}

.notes-workspace .note-inspector .compact-empty {
  width: 100%;
  min-height: 168px;
  border: 0;
  background: transparent;
}

.notes-workspace .note-empty.empty {
  width: 100%;
  min-height: 220px;
  padding-inline: clamp(16px, 5vw, 36px);
}

.notes-workspace .note-empty.empty > :where(strong, span) {
  max-width: 340px;
}

.notes-workspace .note-empty.empty button {
  width: auto;
  max-width: 100%;
}

/* Prevent an oversized market preview from forcing the information column. */
.notes-workspace .market-card .note-full-preview,
.notes-workspace .market-card .note-thumb {
  min-width: 0;
}

/* --------------------------------------------------------------------------
 * Handwriting editor containment
 * ----------------------------------------------------------------------- */

.app-shell.has-note-editor,
.has-note-editor .note-editor-backdrop,
.has-note-editor .note-editor {
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overscroll-behavior: none;
}

.has-note-editor .note-editor :where(
  .note-editor-top,
  .note-editor-leading,
  .note-document-copy,
  .note-editor-actions,
  .note-editor-body,
  .note-toolrail,
  .note-workbench,
  .note-tool-inspector,
  .hand-canvas-stage
) {
  min-width: 0;
  max-width: 100%;
}

.has-note-editor .note-document-copy {
  flex: 1 1 auto;
  overflow: hidden;
}

.has-note-editor .note-title-input {
  display: block;
  max-width: 100%;
}

.has-note-editor .note-editor-actions button :where(.icon, svg),
.has-note-editor .note-editor-back-button :where(.icon, svg) {
  width: 18px;
  height: 18px;
}

.has-note-editor .note-tool-inspector,
.has-note-editor .note-toolrail {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 10px;
}

.has-note-editor .note-tool-inspector > *,
.has-note-editor .note-toolrail .note-tool-group {
  flex-shrink: 0;
}

.has-note-editor .note-tool-inspector :where(button, input, output),
.has-note-editor .note-toolrail button {
  touch-action: manipulation;
}

.has-note-editor .note-size-wrap output {
  min-width: 31px;
  text-align: right;
}

.has-note-editor .hand-canvas-stage {
  isolation: isolate;
  scrollbar-gutter: stable both-edges;
}

/* There is no rail or inspector in read-only mode. Remove both reserved slots. */
.has-note-editor .note-editor-readonly .note-editor-body {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.has-note-editor .note-editor-readonly .note-workbench {
  grid-column: 1;
  grid-row: 1;
  grid-template-rows: minmax(0, 1fr);
}

.has-note-editor .note-editor-readonly .hand-canvas-stage {
  grid-row: 1;
}

/* Undo/redo/fit already live in the desktop header; avoid duplicate controls. */
@media (min-width: 761px) {
  .has-note-editor .note-rail-actions {
    display: none;
  }
}

/* --------------------------------------------------------------------------
 * Tablet and mobile
 * ----------------------------------------------------------------------- */

@media (max-width: 960px) {
  .notes-workspace .note-layout.grid.two {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .profile-tab-notes,
  .profile-tab-notes .notes-workspace {
    min-width: 0;
    max-width: 100%;
  }

  .notes-workspace {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .notes-workspace .note-toolbar.workspace-section {
    align-items: stretch;
  }

  .notes-workspace .note-toolbar :where(.search-field, .compact-select) {
    height: 44px;
    min-height: 44px;
  }

  .notes-workspace .note-tabs.workspace-tabs {
    scroll-padding-inline: 12px;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Let the page own vertical scrolling. Nested list scrolling was easy to miss. */
  .notes-workspace .note-list.notice-list {
    max-height: none;
    overflow: visible;
    border-inline: 0;
    border-radius: 0;
  }

  .notes-workspace .note-card.notice-card {
    min-height: 92px;
    padding-inline: 2px;
  }

  .notes-workspace .note-card.notice-card:focus-visible {
    outline-offset: 0;
  }

  .notes-workspace .note-layout.grid.two {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  /* The document editor is a page section on mobile, not a card inside a card. */
  .notes-workspace .note-inspector.panel {
    padding: 16px 2px 0;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--note-line, #dfe6e2);
    border-radius: 0;
    background: transparent;
  }

  .notes-workspace .note-inspector .hand-note-summary {
    background: #f5f7f6;
  }

  .notes-workspace .note-empty.empty {
    min-height: 210px;
    padding-block: 30px;
    border-block: 1px solid var(--note-line, #dfe6e2);
  }

  .has-note-editor .note-editor-backdrop,
  .has-note-editor .note-editor {
    height: 100dvh;
    min-height: 100dvh;
  }

  .has-note-editor .note-editor-top {
    padding-top: max(7px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .has-note-editor .note-editor-leading {
    overflow: hidden;
  }

  .has-note-editor .note-title-input {
    width: 100%;
    max-width: min(48vw, 190px);
  }

  .has-note-editor .note-save-status {
    max-width: min(46vw, 190px);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .has-note-editor .note-editor-body {
    height: 100%;
  }

  .has-note-editor .note-toolrail {
    scroll-padding-right: max(12px, env(safe-area-inset-right));
    scroll-padding-left: max(12px, env(safe-area-inset-left));
  }

  .has-note-editor .note-tool-inspector {
    scrollbar-width: none;
  }

  .has-note-editor .note-tool-inspector::-webkit-scrollbar {
    display: none;
  }

  .has-note-editor .hand-canvas-stage {
    scrollbar-gutter: auto;
  }

  .has-note-editor .note-editor-readonly .note-editor-body {
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  .notes-workspace .note-workspace-metrics {
    border-inline: 0;
    border-radius: 0;
  }

  .notes-workspace .note-stat {
    padding-inline: 5px;
  }

  .notes-workspace .note-toolbar.workspace-section {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 30%);
  }

  .notes-workspace .note-card.notice-card {
    padding-block: 12px;
  }

  .notes-workspace .note-inspector .chips {
    gap: 6px;
  }

  .notes-workspace .note-inspector .chips > button {
    min-height: 42px;
  }

  .notes-workspace .note-inspector .chips > .danger:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .has-note-editor .note-editor-top {
    gap: 4px;
  }

  .has-note-editor .note-title-input {
    max-width: min(45vw, 168px);
  }

  .has-note-editor .note-tool-inspector {
    gap: 7px;
  }

  .has-note-editor .note-colors {
    padding-inline: 6px;
  }
}

@media (max-width: 760px) and (max-height: 600px) {
  .has-note-editor .note-editor-top {
    min-height: calc(52px + env(safe-area-inset-top));
  }

  .has-note-editor .note-workbench {
    grid-template-rows: 46px minmax(0, 1fr);
  }

  .has-note-editor .note-tool-inspector {
    min-height: 46px;
    padding-block: 4px;
  }

  .has-note-editor .note-editor-body:not(:has(.note-toolrail)) {
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-workspace .note-inspector,
  .has-note-editor :where(.note-toolrail, .note-tool-inspector, .hand-canvas-stage) {
    scroll-behavior: auto;
  }
}


/* Source: /achievement-reference.css?v=1 */
/* Achievement art: generated assets for defaults, compact SVG fallback for custom awards. */
.trophy-art.trophy-image-art {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(8, 116, 84, 0.12);
  border-radius: 14px;
  background: #eef4f1;
  box-shadow: none;
  isolation: isolate;
}

.trophy-art.trophy-image-art::before,
.trophy-art.trophy-image-art::after {
  display: none !important;
  content: none !important;
}

.trophy-image-art .trophy-image {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.trophy-image-art .trophy-image[hidden],
.trophy-image-art .trophy-image.image-load-failed {
  display: none !important;
}

.trophy-image-art .trophy-svg-fallback {
  width: 100%;
  height: 100%;
}

.trophy-image-art .trophy-svg-fallback[hidden] {
  display: none !important;
}

.trophy-image-art .trophy-svg-fallback:not([hidden]) {
  display: grid !important;
  place-items: center;
  color: var(--trophy-color);
}

.trophy-image-art .trophy-svg-fallback .trophy-svg {
  width: 80%;
  height: 80%;
}

.trophy-card:not(.earned) .trophy-image {
  filter: saturate(0.74) contrast(0.94);
  opacity: 0.82;
}

.trophy-card.earned .trophy-image {
  filter: saturate(1.02) contrast(1.01);
}

@media (max-width: 480px) {
  .trophy-card,
  .profile-page .trophy-card,
  .profile-achievement-card .trophy-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .trophy-card .trophy-art,
  .profile-page .trophy-card .trophy-art,
  .profile-achievement-card .trophy-card .trophy-art {
    width: 54px;
    min-width: 54px;
    height: 54px;
  }
}


/* Source: /identity-detail-reference.css?v=4 */
/*
 * Identity detail pass
 * Loaded after profile-reference.css and achievement-reference.css.
 * Keeps authentication, profile, and achievement layouts on one quiet grid.
 */

:where(.auth-wrap, .profile-page, .activity-page) {
  --identity-brand: var(--brand, #087454);
  --identity-brand-strong: var(--brand-hover, #066247);
  --identity-brand-soft: var(--brand-soft, #edf7f3);
  --identity-ink: var(--text, #18211d);
  --identity-muted: var(--text-2, #66736d);
  --identity-line: var(--border, #dfe7e3);
  --identity-surface: var(--surface, #fff);
  --identity-subtle: var(--surface-subtle, #f5f7f6);
  --identity-control-radius: 10px;
  --identity-panel-radius: 12px;
}

/* Authentication --------------------------------------------------------- */

.auth-wrap {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
  max-height: none;
  justify-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding:
    max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: #f6f8f7;
  -webkit-overflow-scrolling: touch;
}

.auth-wrap.auth-mode-login,
.auth-wrap.auth-login-only {
  align-items: center;
}

.auth-wrap.auth-mode-signup {
  align-items: start;
  scroll-padding-block: max(20px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-bottom));
}

.auth-card,
.auth-card.auth-card-login-only {
  width: min(430px, 100%);
  min-width: 0;
  max-width: 100%;
  max-height: none;
  margin: 0;
  overflow: visible;
  border: 1px solid var(--identity-line);
  border-top: 1px solid var(--identity-line);
  border-radius: var(--identity-panel-radius);
  background: var(--identity-surface);
  padding: 26px;
  box-shadow: 0 14px 36px rgb(24 33 29 / 8%);
}

.auth-wrap.auth-mode-signup .auth-card {
  margin-block: 0 12px;
}

.auth-card .brand.auth-brand {
  position: relative;
  display: grid;
  width: max-content;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  grid-template-columns: 46px max-content;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 0 auto 18px;
  padding: 0;
  overflow: visible;
  color: var(--identity-brand-strong);
}

.auth-card .brand.auth-brand::before,
.auth-card .brand.auth-brand::after {
  display: none;
  content: none;
}

.auth-card .auth-brand .brand-icons.school-brand-icons {
  position: relative;
  display: grid;
  width: 46px;
  min-width: 46px;
  height: 46px;
  place-items: center;
  overflow: visible;
}

.auth-card .auth-brand .brand-logo.school-logo-only {
  position: static;
  inset: auto;
  display: block;
  width: 44px !important;
  min-width: 44px;
  height: 44px !important;
  margin: 0;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transform: none;
}

.auth-card .auth-brand .brand-title.school-brand-title {
  position: static;
  display: flex !important;
  width: auto !important;
  min-width: 0;
  max-width: none;
  height: 46px;
  align-items: center;
  overflow: visible;
  padding: 1px 0 0;
  color: var(--identity-brand-strong);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  transform: none;
}

.auth-card .auth-brand .brand-title-school.school-title-only {
  position: static !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0;
  overflow: visible;
  color: inherit;
  font: inherit;
  line-height: 1;
  white-space: nowrap;
  opacity: 1;
  transform: none !important;
}

.auth-card .auth-heading,
.auth-card-login-only .auth-heading {
  display: grid;
  gap: 4px;
  margin: 0 0 17px;
  text-align: left;
}

.auth-card .auth-heading h1,
.auth-card-login-only .auth-heading h1 {
  margin: 0;
  color: var(--identity-ink);
  font-size: 24px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.3;
}

.auth-card .auth-heading p {
  margin: 0;
  color: var(--identity-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.auth-card .tabs {
  position: static;
  isolation: isolate;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--identity-line);
  border-radius: var(--identity-control-radius);
  background: var(--identity-subtle);
  padding: 3px;
}

.auth-card .tabs button,
.auth-card .tabs button.active {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
}

.auth-card .tabs button {
  background: transparent;
  color: var(--identity-muted);
}

.auth-card .tabs button.active {
  background: var(--identity-surface);
  color: var(--identity-brand-strong);
  box-shadow: 0 1px 3px rgb(24 33 29 / 8%);
}

.auth-card form[hidden],
.auth-card #loginForm[hidden],
.auth-card #signupForm[hidden] {
  display: none !important;
}

.auth-card .form {
  width: 100%;
  min-width: 0;
  gap: 13px;
}

.auth-card .form > *,
.auth-card .form label,
.auth-card .form .input,
.auth-card .form .select,
.auth-card .form .textarea {
  min-width: 0;
  max-width: 100%;
}

.auth-card .input,
.auth-card .select,
.auth-card .textarea {
  border-radius: var(--identity-control-radius);
}

.auth-card .signup-identity-fields {
  min-width: 0;
}

.auth-card .signup-student-number-preview,
.auth-card .signup-identity-warning,
.auth-card .signup-student-confirm,
.auth-card .legal-box,
.auth-card .signup-quiz-box {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--identity-control-radius);
}

.auth-card .legal-box :where(p, span, strong, small),
.auth-card .signup-identity-warning :where(p, span, strong),
.auth-card .signup-student-confirm :where(span, strong, small) {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Profile --------------------------------------------------------------- */

.profile-page,
.profile-page * {
  min-width: 0;
}

.profile-page {
  width: min(100%, 900px);
  max-width: 900px;
  margin-inline: auto;
  overflow-x: clip;
}

.profile-page > .profile-cover {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--identity-line);
  border-radius: var(--identity-panel-radius);
  background: var(--identity-surface);
  box-shadow: none;
}

.profile-page .profile-cover-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  padding: 20px 20px 18px;
}

.profile-page .profile-identity {
  display: grid;
  min-width: 0;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
}

.profile-page .profile-identity .avatar,
.profile-page .profile-cover .avatar,
.profile-page .profile-avatar-xl {
  display: grid;
  place-items: center;
  width: 72px;
  min-width: 72px;
  height: 72px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--identity-line);
  border-radius: 50%;
  background: var(--identity-brand-soft);
  object-fit: cover;
  box-shadow: none;
  padding: 0;
  color: var(--identity-brand);
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
}

.profile-page .profile-avatar-xl > img,
.profile-page .profile-identity .avatar > img,
.profile-page .profile-cover .avatar > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-page .profile-identity > div:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.profile-page .profile-identity .badges {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 1px;
}

.profile-page .profile-identity h1 {
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--identity-ink);
  font-size: 24px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.25;
}

.profile-page .profile-identity p {
  display: -webkit-box;
  max-width: 56ch;
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--identity-muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.profile-page .profile-identity .meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 1px;
  color: var(--identity-muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-page .profile-edit-button {
  align-self: start;
  min-height: 36px;
  border-radius: var(--identity-control-radius);
  padding: 7px 10px;
  white-space: nowrap;
}

.profile-page .profile-stat-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border-top: 1px solid var(--identity-line);
  background: var(--identity-surface);
}

.profile-page .profile-stat-grid:has(> :nth-child(4)) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-page .profile-stat-grid > div {
  display: grid;
  min-width: 0;
  min-height: 68px;
  place-content: center;
  gap: 3px;
  border-right: 1px solid var(--identity-line);
  padding: 9px 6px;
  text-align: center;
}

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

.profile-page .profile-stat-grid strong,
.profile-page .profile-stat-grid span {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-page .profile-stat-grid strong {
  color: var(--identity-ink);
  font-size: 18px;
  font-weight: 720;
  line-height: 1.15;
}

.profile-page .profile-stat-grid span {
  color: var(--identity-muted);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.25;
  white-space: nowrap;
}

.profile-page .profile-navigation-shell {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  border-radius: var(--identity-panel-radius);
}

.profile-page .profile-primary-tabs button,
.profile-page .profile-more-menu > summary {
  min-width: 0;
  min-height: 52px;
  grid-template-columns: 22px minmax(0, 1fr) 12px;
  gap: 11px;
  padding: 8px 2px;
}

.profile-page .profile-primary-tabs button > span,
.profile-page .profile-more-menu > summary > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Achievement cards ----------------------------------------------------- */

.trophy-grid,
.trophy-mini-row,
.trophy-strip,
.trophy-card,
.activity-latest-trophy {
  min-width: 0;
  max-width: 100%;
}

.trophy-grid,
.trophy-mini-row {
  align-items: stretch;
}

.trophy-card {
  display: grid;
  width: 100%;
  min-height: 82px;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 1px solid var(--identity-line, #dfe7e3);
  border-radius: var(--identity-control-radius);
  background: var(--identity-surface, #fff);
  padding: 11px;
  box-shadow: none;
  isolation: isolate;
}

.trophy-card:hover {
  border-color: #cbd8d2;
  box-shadow: none;
  transform: none;
}

.trophy-card > * {
  min-width: 0;
  max-width: 100%;
}

.trophy-card > div:last-child {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  align-content: center;
  gap: 2px;
  overflow: hidden;
}

.trophy-card .trophy-art,
.trophy-card .trophy-image-art,
.trophy-card .trophy-svg-art {
  position: relative;
  inset: auto;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  display: grid;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 58px;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgb(8 116 84 / 12%);
  border-radius: 10px;
  background: var(--identity-subtle, #f5f7f6);
  box-shadow: none;
}

.badge.professional-badge {
  border-color: #9bd2bd;
  background: #edf8f3;
  color: #087454;
}

.badge.professional-badge.strong-professional-badge {
  border-color: #087454;
  background: #087454;
  color: #fff;
  box-shadow: none;
}

.badge.professional-badge .icon {
  color: currentColor;
}

.trophy-image-art .trophy-image,
.trophy-card img.trophy-image {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 3px;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
}

.trophy-card .trophy-svg,
.trophy-image-art .trophy-svg-fallback .trophy-svg {
  width: 78%;
  max-width: 46px;
  height: 78%;
  max-height: 46px;
  object-fit: contain;
}

.trophy-card strong,
.trophy-card p,
.trophy-card span {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.trophy-card strong {
  color: var(--identity-ink, #18211d);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
  white-space: nowrap;
}

.trophy-card p {
  display: -webkit-box;
  margin: 1px 0;
  color: var(--identity-muted, #66736d);
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trophy-card span {
  color: var(--identity-muted, #66736d);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.profile-achievement-card .trophy-mini-row,
.profile-page .trophy-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 9px;
}

.activity-page .activity-latest-trophy {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.activity-page .activity-latest-trophy .activity-trophy-art {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 48px;
  padding: 2px;
}

.activity-page .activity-latest-trophy > div:last-child,
.activity-page .activity-latest-trophy strong,
.activity-page .activity-latest-trophy small {
  min-width: 0;
  max-width: 100%;
}

.activity-page .activity-latest-trophy strong,
.activity-page .activity-latest-trophy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Responsive tuning ----------------------------------------------------- */

@media (max-width: 700px) {
  .auth-wrap {
    align-items: start;
    padding:
      max(18px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .auth-wrap.auth-mode-login,
  .auth-wrap.auth-login-only {
    align-items: center;
  }

  .auth-card,
  .auth-card.auth-card-login-only {
    padding: 22px 20px;
  }

  .profile-page .profile-cover-main {
    gap: 10px;
    padding: 16px 14px 15px;
  }

  .profile-page .profile-identity {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
  }

  .profile-page .profile-identity .avatar,
  .profile-page .profile-cover .avatar,
  .profile-page .profile-avatar-xl {
    width: 64px;
    min-width: 64px;
    height: 64px;
  }

  .profile-page .profile-identity h1 {
    font-size: 21px;
  }

  .profile-page .profile-edit-button {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .profile-page .profile-stat-grid > div {
    min-height: 62px;
    padding: 8px 3px;
  }

  .profile-page .profile-navigation-shell {
    padding-inline: 13px;
  }

  .profile-page .profile-primary-tabs button,
  .profile-page .profile-more-menu > summary {
    min-height: 51px;
  }

  .profile-achievement-card .trophy-mini-row,
  .profile-page .trophy-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  .auth-card,
  .auth-card.auth-card-login-only {
    width: 100%;
    padding: 20px 17px;
  }

  .auth-card .brand.auth-brand {
    grid-template-columns: 43px max-content;
    gap: 9px;
    margin-bottom: 16px;
  }

  .auth-card .auth-brand .brand-icons.school-brand-icons {
    width: 43px;
    min-width: 43px;
    height: 43px;
  }

  .auth-card .auth-brand .brand-logo.school-logo-only {
    width: 41px !important;
    min-width: 41px;
    height: 41px !important;
  }

  .auth-card .auth-brand .brand-title.school-brand-title {
    height: 43px;
    font-size: 20px;
  }

  .auth-card .auth-heading h1 {
    font-size: 22px;
  }

  .profile-page .profile-cover-main {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .profile-page .profile-stat-grid strong {
    font-size: 17px;
  }

  .profile-page .profile-stat-grid span {
    font-size: 10px;
  }

  .trophy-card {
    min-height: 78px;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .trophy-card .trophy-art,
  .trophy-card .trophy-image-art,
  .trophy-card .trophy-svg-art {
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    height: 54px;
  }
}

@media (max-width: 390px) {
  .auth-wrap {
    padding-inline: max(10px, env(safe-area-inset-left));
  }

  .auth-card,
  .auth-card.auth-card-login-only {
    padding: 19px 15px;
  }

  .auth-card .signup-identity-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .profile-page .profile-cover-main {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 12px;
  }

  .profile-page .profile-identity {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 11px;
  }

  .profile-page .profile-identity .avatar,
  .profile-page .profile-cover .avatar,
  .profile-page .profile-avatar-xl {
    width: 60px;
    min-width: 60px;
    height: 60px;
  }

  .profile-page .profile-identity > div:last-child {
    padding-right: 68px;
  }

  .profile-page .profile-edit-button {
    position: absolute;
    top: 14px;
    right: 12px;
  }

  .profile-page .profile-stat-grid > div {
    min-height: 58px;
    padding-inline: 2px;
  }

  .profile-page .profile-stat-grid strong {
    font-size: 16px;
  }

  .profile-page .profile-stat-grid span {
    font-size: 9px;
  }
}

@media (min-width: 900px) {
  .auth-card,
  .auth-card.auth-card-login-only {
    padding: 28px;
  }

  .profile-page .profile-cover-main {
    padding: 22px 24px 20px;
  }

  .profile-page .profile-navigation-shell {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-wrap *,
  .profile-page *,
  .activity-page * {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* Source: /notification-reference.css?v=5 */
.topbar-notice-button {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  line-height: 0;
}

.topbar-notice-button > .icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  transform: none;
}

.topbar-notice-button > span:not(.icon) {
  top: 2px;
  right: 1px;
  margin: 0;
}

.notification-peek-layer {
  position: fixed;
  z-index: 1400;
  inset: 0 0 auto;
  height: 0;
  pointer-events: none;
}

.notification-peek-layer .notification-peek-backdrop {
  display: none !important;
}

.notification-peek {
  position: absolute;
  top: calc(var(--topbar-height, 64px) + 8px);
  right: max(16px, calc((100vw - 1180px) / 2));
  display: grid;
  width: min(620px, calc(100vw - 32px));
  min-height: 48px;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgb(255 255 255 / 97%);
  padding: 5px 7px;
  box-shadow: 0 10px 28px rgb(18 38 28 / 14%);
  pointer-events: auto;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.notification-peek-label {
  display: none;
}

.notification-peek-label .icon {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}

.notification-peek .notification-peek-row {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 3px 6px;
  text-align: left;
}

.notification-peek .notification-peek-row:hover,
.notification-peek .notification-peek-row:focus-visible {
  background: var(--surface-subtle);
}

.notification-peek .notification-type-icon {
  display: grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  line-height: 0;
}

.notification-peek .notification-type-icon .icon {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
}

/* The archive uses the same optical center as the compact preview. */
.notification-list {
  gap: 18px;
  overflow: visible;
  border-block: 0;
}

.device-notification-status {
  display: grid;
  min-height: 58px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-subtle);
  padding: 9px 12px;
}

.device-notification-status > .icon {
  width: 18px;
  height: 18px;
  margin: 0 auto;
  color: var(--text-2);
}

.device-notification-status > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.device-notification-status strong,
.device-notification-status small {
  line-height: 1.4;
}

.device-notification-status strong {
  font-size: 13px;
}

.device-notification-status small {
  color: var(--text-2);
  font-size: 11px;
}

.device-notification-status.is-enabled {
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
  background: color-mix(in srgb, var(--brand-soft) 68%, white);
}

.device-notification-status.is-enabled > .icon,
.device-notification-status.is-actionable > .icon {
  color: var(--brand);
}

.device-notification-status.is-blocked {
  border-color: color-mix(in srgb, #b42318 22%, var(--border));
  background: color-mix(in srgb, #fff0ed 72%, white);
}

.device-notification-status.is-blocked > .icon {
  color: #b42318;
}

.notification-group > h3 {
  margin: 0 0 7px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
}

.notification-group > div {
  overflow: hidden;
  border-block: 1px solid var(--border);
}

.notification-card {
  min-height: 56px;
  grid-template-columns: 32px minmax(0, 1fr) 8px 18px;
  gap: 9px;
  padding: 7px 6px 7px 4px;
}

.notification-card .notification-type-icon {
  display: grid;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  border-radius: 9px;
  line-height: 0;
}

.notification-card .notification-type-icon .icon,
.notification-card > .icon:last-child {
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
}

.notification-card > .icon:last-child {
  justify-self: center;
}

.notification-recent {
  display: grid;
  gap: 18px;
}

.notification-history {
  position: relative;
  isolation: isolate;
  margin-top: 2px;
}

.notification-history:not([open]) {
  padding-bottom: 8px;
}

.notification-history:not([open])::before,
.notification-history:not([open])::after {
  position: absolute;
  z-index: -1;
  right: 10px;
  bottom: 4px;
  left: 10px;
  height: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #fff);
  content: "";
}

.notification-history:not([open])::after {
  right: 18px;
  bottom: 0;
  left: 18px;
  opacity: 0.72;
}

.notification-history > summary {
  display: grid;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface, #fff);
  padding: 8px 12px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.notification-history > summary::-webkit-details-marker {
  display: none;
}

.notification-history > summary:hover {
  background: var(--surface-subtle);
}

.notification-history > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent);
  outline-offset: 2px;
}

.notification-history-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notification-history-copy strong,
.notification-history-copy small {
  margin: 0;
  line-height: 1.35;
}

.notification-history-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.notification-history-copy small {
  color: var(--text-2);
  font-size: 11px;
}

.notification-history-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 5px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.notification-history-action .icon {
  width: 16px;
  height: 16px;
  margin: 0;
  transition: transform 160ms ease;
}

.notification-history-close-label {
  display: none;
}

.notification-history[open] .notification-history-open-label {
  display: none;
}

.notification-history[open] .notification-history-close-label {
  display: inline;
}

.notification-history[open] .notification-history-action .icon {
  transform: rotate(90deg);
}

.notification-history-groups {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.notification-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  align-content: center;
}

.notification-copy strong,
.notification-copy small {
  margin: 0;
  line-height: 1.35;
}

.notification-peek .notification-peek-row > .icon:last-child {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
  justify-self: center;
}

.notification-peek .notification-peek-row > span:nth-child(2) {
  min-width: 0;
}

.notification-peek .notification-peek-row strong,
.notification-peek .notification-peek-row small {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-peek .notification-peek-row strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.notification-peek .notification-peek-row small {
  margin-left: 7px;
  color: var(--text-2);
  font-size: 11px;
}

.notification-peek-archive {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  padding: 0 10px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.notification-peek-close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--text-2);
}

.notification-peek-alert,
.notification-peek .notification-peek-empty,
.notification-peek .notification-peek-loading {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}

.notification-peek-alert span,
.notification-peek .notification-peek-empty span {
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .notification-peek {
    top: calc(56px + env(safe-area-inset-top) + 6px);
    right: 8px;
    left: 8px;
    width: auto;
    min-height: 44px;
    grid-template-columns: minmax(0, 1fr) auto 32px;
    gap: 5px;
    padding: 4px 5px 4px 7px;
  }

  .notification-peek .notification-peek-row {
    min-height: 34px;
    grid-template-columns: 22px minmax(0, 1fr) 14px;
    gap: 6px;
    padding-inline: 4px;
  }

  .notification-peek .notification-type-icon {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
  }

  .notification-peek .notification-peek-row strong {
    display: block;
    font-size: 12px;
  }

  .notification-peek .notification-peek-row small {
    display: none;
  }

  .notification-peek-archive {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 10px;
  }

  .notification-peek-close {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .notification-card {
    grid-template-columns: 30px minmax(0, 1fr) 7px 16px;
    gap: 8px;
    padding-inline: 2px;
  }

  .notification-card .notification-type-icon {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .device-notification-status {
    grid-template-columns: 30px minmax(0, 1fr);
    margin-block: 8px 14px;
    padding: 9px 10px;
  }

  .device-notification-status > button {
    grid-column: 2;
    width: max-content;
  }

  .notification-history > summary {
    min-height: 48px;
    gap: 8px;
    padding-inline: 10px;
  }

  .notification-history-copy small {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification-peek {
    animation: none !important;
  }

  .notification-history-action .icon {
    transition: none;
  }
}


/* Source: /question-list-reference.css?v=3 */
/* Question subject accordion
   Keeps the subject filter compact while exposing a touch-friendly choice grid. */

/* Both the filter panel and question cards inherit backdrop-filter from the
   shared surface layer, which makes each of them a separate stacking context.
   Keep the whole filter context above the later question-card contexts so the
   absolutely positioned subject and sort menus cannot be painted underneath
   the results list. The sticky header (40) and mobile navigation (90) remain
   above this local layer. */
.questions-workspace > .question-filter-panel {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.question-search-row {
  grid-template-columns: minmax(0, 1fr) minmax(158px, 190px) auto;
  overflow: visible;
}

.question-search-row > .question-search-field {
  grid-column: 1;
  grid-row: 1;
}

.question-search-row > .question-subject-menu {
  grid-column: 2;
  grid-row: 1;
}

.question-search-row > .question-sort-menu {
  grid-column: 3;
  grid-row: 1;
}

.question-subject-menu {
  position: relative;
  min-width: 0;
}

.question-subject-menu > summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--campus-line-strong, #cdd8d1);
  border-radius: 11px;
  background: #fff;
  color: var(--campus-text, #26332e);
  padding: 5px 10px;
  cursor: pointer;
  list-style: none;
}

.question-subject-menu > summary::-webkit-details-marker {
  display: none;
}

.question-subject-menu > summary > .icon {
  width: 18px;
  height: 18px;
  color: var(--campus-green, #14805e);
}

.question-subject-menu > summary:hover {
  border-color: var(--campus-green, #14805e);
  background: var(--campus-green-soft, #edf8f3);
}

.question-subject-menu > summary:focus-visible,
.question-subject-option:focus-visible,
.question-subject-popover-head button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--campus-green, #14805e) 28%, transparent);
  outline-offset: 2px;
}

.question-subject-menu[open] > summary {
  border-color: var(--campus-green, #14805e);
  background: var(--campus-green-soft, #edf8f3);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--campus-green, #14805e) 12%, transparent);
}

.question-subject-summary-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
  text-align: left;
}

.question-subject-summary-copy small {
  color: var(--campus-muted, #6b7772);
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
}

.question-subject-summary-copy strong {
  overflow: hidden;
  color: var(--campus-ink, #17221e);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-subject-summary-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--campus-muted, #6b7772);
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

.question-subject-summary-chevron .icon {
  width: 15px;
  height: 15px;
}

.question-subject-menu[open] .question-subject-summary-chevron {
  transform: rotate(-90deg);
}

.question-subject-popover {
  position: absolute;
  z-index: 24;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(430px, calc(100vw - 40px));
  max-height: min(500px, calc(100vh - 24px));
  max-height: var(--question-subject-available-height, min(500px, calc(100dvh - 24px)));
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid var(--campus-line-strong, #cdd8d1);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 18px 42px rgba(25, 45, 37, 0.16), 0 3px 10px rgba(25, 45, 37, 0.08);
}

.question-subject-menu.opens-up > .question-subject-popover {
  top: auto;
  bottom: calc(100% + 8px);
}

.question-subject-popover-head {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 11px;
}

.question-subject-popover-head > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.question-subject-popover-head strong {
  color: var(--campus-ink, #17221e);
  font-size: 14px;
  font-weight: 900;
}

.question-subject-popover-head small {
  color: var(--campus-muted, #6b7772);
  font-size: 11px;
  line-height: 1.45;
}

.question-subject-popover-head button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--campus-green-deep, #0f654b);
  padding: 3px 2px;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.question-subject-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  gap: 7px;
  max-height: min(420px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.question-subject-menu.viewport-tight > .question-subject-popover {
  padding: 8px;
}

.question-subject-menu.viewport-tight .question-subject-popover-head {
  padding-bottom: 7px;
}

.question-subject-menu.viewport-tight .question-subject-popover-head small {
  display: none;
}

.question-subject-menu.viewport-tight .question-subject-option {
  min-height: 48px;
}

.question-subject-option {
  --subject-choice-accent: #64748b;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  min-width: 0;
  min-height: 58px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--campus-line, #dfe7e2);
  border-radius: 10px;
  background: #fff;
  color: var(--campus-text, #26332e);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--subject-choice-accent);
}

.question-subject-option.subject-language { --subject-choice-accent: #b85c21; }
.question-subject-option.subject-math { --subject-choice-accent: #2563eb; }
.question-subject-option.subject-english { --subject-choice-accent: #7653a6; }
.question-subject-option.subject-science { --subject-choice-accent: #0f766e; }
.question-subject-option.subject-social { --subject-choice-accent: #9a6b12; }
.question-subject-option.subject-all { --subject-choice-accent: var(--campus-green, #14805e); }

.question-subject-option:hover {
  border-color: color-mix(in srgb, var(--subject-choice-accent) 52%, var(--campus-line, #dfe7e2));
  background: #f8fbf9;
}

.question-subject-option.active {
  border-color: var(--campus-green, #14805e);
  background: var(--campus-green-soft, #edf8f3);
  box-shadow: inset 3px 0 0 var(--campus-green, #14805e), 0 0 0 1px color-mix(in srgb, var(--campus-green, #14805e) 10%, transparent);
}

.question-subject-option-mark {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--subject-choice-accent) 35%, #dfe7e2);
  border-radius: 50%;
  background: color-mix(in srgb, var(--subject-choice-accent) 8%, #fff);
  color: var(--subject-choice-accent);
}

.question-subject-option.active .question-subject-option-mark {
  border-color: var(--campus-green, #14805e);
  background: var(--campus-green, #14805e);
  color: #fff;
}

.question-subject-option-mark .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.6;
}

.question-subject-option-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.question-subject-option-copy strong {
  overflow: hidden;
  color: var(--campus-ink, #17221e);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-subject-option-copy small {
  color: var(--campus-muted, #6b7772);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 700px) {
  .question-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .question-search-row > .question-search-field {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .question-search-row > .question-subject-menu {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .question-search-row > .question-sort-menu {
    grid-column: 2;
    grid-row: 2;
  }

  .question-subject-popover {
    right: auto;
    left: 0;
    width: min(430px, calc(100vw - 48px));
  }
}

@media (max-width: 390px) {
  .question-subject-options {
    grid-template-columns: minmax(0, 1fr);
    max-height: 52vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .question-subject-summary-chevron {
    transition: none;
  }
}


/* Source: /question-detail-reference.css?v=1 */
/* Question detail: calm document layout, scoped to the question route only. */

.question-detail-page {
  --question-rule: color-mix(in srgb, var(--border, #dfe7e3) 82%, transparent);
  display: grid;
  width: min(100%, 920px);
  min-width: 0;
  margin-inline: auto;
  gap: 24px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.question-detail-page,
.question-detail-page *,
.question-detail-page *::before,
.question-detail-page *::after {
  box-sizing: border-box;
}

.question-detail-page > *,
.question-detail-page :where(article, section, form, div, header) {
  min-width: 0;
}

/* App bar */
.question-detail-page > .detail-appbar {
  display: grid;
  min-height: 48px;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--question-rule);
  background: transparent;
  padding: 0 0 9px;
}

.question-detail-page > .detail-appbar > strong {
  overflow: hidden;
  color: var(--text, #18211d);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-detail-page > .detail-appbar .icon-only {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  color: var(--text, #18211d);
}

.question-detail-page > .detail-appbar .icon-only:hover {
  background: var(--surface-subtle, #f2f5f3);
}

.question-detail-page > .detail-appbar .icon {
  width: 21px;
  height: 21px;
}

/* Question document */
.question-detail-page .question-detail-card {
  display: grid;
  gap: 0;
  overflow: visible;
  border: 1px solid var(--question-rule);
  border-radius: 12px;
  background: var(--surface, #fff);
  padding: 24px;
  box-shadow: none;
}

.question-detail-page .question-detail-card::before,
.question-detail-page .question-detail-card::after,
.question-detail-page .question-detail-heading::before,
.question-detail-page .question-detail-heading::after {
  display: none !important;
  content: none !important;
}

.question-detail-page .question-detail-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: start;
  gap: 14px;
  border: 0;
  padding: 0 0 18px;
}

.question-detail-page .question-detail-title-copy {
  display: grid;
  gap: 10px;
}

.question-detail-page .question-detail-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  color: var(--text-2, #66736d);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
}

.question-detail-page .question-detail-context > span {
  display: inline-flex;
  width: auto;
  min-width: 0;
  min-height: 0;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
}

.question-detail-page .question-detail-context > span + span::before {
  display: inline;
  margin: 0 2px 0 0;
  color: #aab4af;
  content: "\00b7";
}

.question-detail-page .question-detail-context > .question-status-label {
  min-height: 24px;
  border-radius: 999px;
  background: var(--brand-soft, #edf7f3);
  padding: 3px 9px;
  color: var(--brand, #087454);
  font-weight: 700;
}

.question-detail-page .question-detail-context > .question-status-label::before {
  content: none;
}

.question-detail-page .question-status-label i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
}

.question-detail-page .question-detail-title-copy h1 {
  max-width: 32ch;
  margin: 0;
  color: var(--text, #18211d);
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.38;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.question-detail-page .question-detail-title-copy > .meta {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin: 0;
  color: var(--text-2, #66736d);
  font-size: 12px;
  line-height: 1.45;
}

.question-detail-page .question-detail-title-copy > .meta > span:not(:first-child)::before {
  margin-right: 8px;
  color: #b1bbb6;
  content: "\00b7";
}

.question-detail-page .question-detail-title-copy > .meta :where(a, button) {
  max-width: 100%;
}

.question-detail-page .question-object-menu {
  position: relative;
  z-index: 4;
  justify-self: end;
}

.question-detail-page .question-object-menu > summary {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  color: var(--text-2, #66736d);
  cursor: pointer;
  list-style: none;
}

.question-detail-page .question-object-menu > summary:hover,
.question-detail-page .question-object-menu[open] > summary {
  background: var(--surface-subtle, #f2f5f3);
  color: var(--text, #18211d);
}

.question-detail-page .question-object-menu > summary::-webkit-details-marker {
  display: none;
}

.question-detail-page .question-object-menu > summary .icon {
  width: 20px;
  height: 20px;
}

.question-detail-page .question-object-menu > div {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: min(190px, calc(100vw - 44px));
  gap: 4px;
  border: 1px solid var(--question-rule);
  border-radius: 12px;
  background: var(--surface, #fff);
  padding: 6px;
  box-shadow: 0 10px 28px rgb(14 33 25 / 12%);
}

.question-detail-page .question-object-menu > div > button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  justify-content: flex-start;
  border-radius: 8px;
  padding-inline: 10px;
  white-space: normal;
}

.question-detail-page .question-body {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--question-rule);
  border-radius: 0;
  background: transparent;
  padding: 20px 0 0;
  color: var(--text, #18211d);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: normal;
}

.question-detail-page .question-body > :first-child {
  margin-top: 0;
}

.question-detail-page .question-body > :last-child {
  margin-bottom: 0;
}

.question-detail-page .question-attempt-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-subtle, #f2f5f3);
  padding: 14px 15px;
}

.question-detail-page .question-attempt-box h3 {
  margin: 0;
  color: var(--text, #18211d);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.question-detail-page .question-attempt-box > .content-box {
  margin: 0;
  padding: 0;
  color: var(--text, #18211d);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

/* Problem images */
.question-detail-page .question-detail-card > .image-preview.hand-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 18px;
}

.question-detail-page .question-image-action {
  position: relative;
  display: grid;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--question-rule);
  border-radius: 10px;
  background: #f5f7f6;
  padding: 0;
  text-align: left;
}

.question-detail-page .question-image-action .question-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 620px;
  border: 0;
  border-radius: 0;
  background: #f5f7f6;
  object-fit: contain;
}

.question-detail-page .question-image-action > span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  background: rgb(24 33 29 / 88%);
  padding: 6px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  backdrop-filter: blur(8px);
}

.question-detail-page .question-image-action > span .icon {
  width: 15px;
  height: 15px;
}

/* Primary question actions */
.question-detail-page .question-detail-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  border-top: 1px solid var(--question-rule);
  padding-top: 16px;
}

.question-detail-page .question-detail-actions > :where(button, .question-reservation-state, .ai-answer-request-state) {
  max-width: 100%;
}

.question-detail-page .question-detail-actions > button {
  min-height: 40px;
  border-radius: 10px;
  padding-inline: 13px;
  font-size: 13px;
  line-height: 1.3;
}

.question-detail-page :where(.question-reservation-state, .ai-answer-request-state) {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  color: var(--text-2, #66736d);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.question-detail-page :where(.question-reservation-state, .ai-answer-request-state) .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* Answer section framing. AI card internals belong to ai-answer-reference.css. */
.question-detail-page > .workspace-content-section {
  display: grid;
  gap: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.question-detail-page > .workspace-content-section > .workspace-section-head {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  border: 0;
  padding: 0 2px;
}

.question-detail-page .workspace-section-head > div:first-child {
  display: grid;
  gap: 3px;
}

.question-detail-page .workspace-section-head :where(h2, h3) {
  margin: 0;
  color: var(--text, #18211d);
  font-size: 20px;
  font-weight: 720;
  line-height: 1.35;
}

.question-detail-page .workspace-section-head p {
  margin: 0;
  color: var(--text-2, #66736d);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.question-detail-page .workspace-count {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-subtle, #f2f5f3);
  padding: 3px 9px;
  color: var(--text-2, #66736d);
  font-size: 12px;
  font-weight: 650;
}

.question-detail-page .answer-list {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.question-detail-page .answer-list > * {
  min-width: 0;
  max-width: 100%;
}

.question-detail-page .answer-card:not(.ai-answer-card) {
  display: grid;
  min-width: 0;
  gap: 13px;
  overflow: hidden;
  border: 1px solid var(--question-rule);
  border-radius: 12px;
  background: var(--surface, #fff);
  padding: 18px;
  box-shadow: none;
}

.question-detail-page .answer-card:not(.ai-answer-card)::before,
.question-detail-page .answer-card:not(.ai-answer-card)::after {
  display: none !important;
  content: none !important;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .card-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .card-head > :first-child {
  min-width: 0;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .card-head h3 {
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .card-head .badge {
  flex: 0 0 auto;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .answer-content {
  min-width: 0;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text, #18211d);
  font-size: 15px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .meta {
  margin: 0;
  color: var(--text-2, #66736d);
  font-size: 12px;
  line-height: 1.4;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
  overflow: hidden;
  border-radius: 10px;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .image-preview:empty {
  display: none;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .image-preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 520px;
  border: 1px solid var(--question-rule);
  border-radius: 10px;
  background: #f5f7f6;
  object-fit: contain;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .chips {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px;
}

.question-detail-page .answer-card:not(.ai-answer-card) > .chips > button {
  min-height: 36px;
  max-width: 100%;
  border-radius: 9px;
  padding-inline: 11px;
  font-size: 12px;
  white-space: normal;
}

.question-detail-page .answer-empty {
  display: grid;
  min-height: 132px;
  place-content: center;
  gap: 5px;
  border: 1px dashed var(--question-rule);
  border-radius: 12px;
  background: transparent;
  padding: 20px;
  color: var(--text-2, #66736d);
  text-align: center;
}

.question-detail-page .answer-empty strong {
  color: var(--text, #18211d);
  font-size: 15px;
  font-weight: 700;
}

.question-detail-page .answer-empty span {
  font-size: 13px;
  line-height: 1.5;
}

/* Shared long-content overflow guards */
.question-detail-page :where(.question-body, .answer-content, .forum-rendered-document) :where(img, video, canvas, iframe, svg) {
  max-width: 100%;
  height: auto;
}

.question-detail-page :where(.question-body, .answer-content, .forum-rendered-document) :where(pre, table, .katex-display, .math-block) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.question-detail-page :where(.question-body, .answer-content, .forum-rendered-document) table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.question-detail-page :where(.question-body, .answer-content, .forum-rendered-document) :where(a, code) {
  overflow-wrap: anywhere;
}

.question-detail-page :where(.note-preview-card, .field-block, .forum-editor, .forum-editor-content, .forum-editor-surface) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.question-detail-page .note-preview-card {
  overflow: hidden;
}

.question-detail-page .note-preview-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
}

/* Regular answer form only; follow-up form is refined by AI answer CSS. */
.question-detail-page > form.panel.form:not(.question-followup-form) {
  display: grid;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--question-rule);
  border-radius: 12px;
  background: var(--surface, #fff);
  padding: 20px;
  box-shadow: none;
}

.question-detail-page > form.panel.form:not(.question-followup-form) > h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.35;
}

.question-detail-page > form.panel.form:not(.question-followup-form) > .muted {
  margin: -7px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

.question-detail-page > form.panel.form:not(.question-followup-form) > button[type="submit"] {
  justify-self: end;
  min-width: 112px;
  min-height: 42px;
  border-radius: 10px;
}

.question-detail-page :focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand, #087454) 55%, white);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .question-detail-page {
    width: 100%;
    gap: 20px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .question-detail-page > .detail-appbar {
    min-height: 44px;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding-bottom: 7px;
  }

  .question-detail-page .question-detail-card {
    border-radius: 11px;
    padding: 17px 15px;
  }

  .question-detail-page .question-detail-heading {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 8px;
    padding-bottom: 15px;
  }

  .question-detail-page .question-detail-title-copy {
    gap: 8px;
  }

  .question-detail-page .question-detail-title-copy h1 {
    max-width: none;
    font-size: 21px;
    line-height: 1.42;
  }

  .question-detail-page .question-detail-context {
    gap: 5px 7px;
    font-size: 11px;
  }

  .question-detail-page .question-detail-context > .question-status-label {
    min-height: 22px;
    padding: 2px 8px;
  }

  .question-detail-page .question-object-menu > summary {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .question-detail-page .question-detail-title-copy > .meta {
    gap: 4px 7px;
    font-size: 11px;
  }

  .question-detail-page .question-detail-title-copy > .meta > span:not(:first-child)::before {
    margin-right: 6px;
  }

  .question-detail-page .question-body {
    padding-top: 16px;
    font-size: 15px;
    line-height: 1.72;
  }

  .question-detail-page .question-attempt-box {
    margin-top: 15px;
    padding: 12px 13px;
  }

  .question-detail-page .question-detail-card > .image-preview.hand-image-list {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 15px;
  }

  .question-detail-page .question-image-action .question-image {
    max-height: min(66vh, 520px);
  }

  .question-detail-page .question-image-action > span {
    right: 8px;
    bottom: 8px;
    min-height: 31px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .question-detail-page .question-detail-actions {
    align-items: stretch;
    gap: 7px;
    margin-top: 16px;
    padding-top: 14px;
  }

  .question-detail-page .question-detail-actions > button {
    flex: 1 1 min(100%, 145px);
    min-width: 0;
    padding-inline: 10px;
  }

  .question-detail-page :where(.question-reservation-state, .ai-answer-request-state) {
    flex: 1 0 100%;
  }

  .question-detail-page > .workspace-content-section {
    gap: 11px;
  }

  .question-detail-page > .workspace-content-section > .workspace-section-head {
    align-items: flex-start;
    padding-inline: 1px;
  }

  .question-detail-page .workspace-section-head :where(h2, h3) {
    font-size: 18px;
  }

  .question-detail-page .workspace-section-head p {
    max-width: 32ch;
    font-size: 12px;
  }

  .question-detail-page .answer-list {
    gap: 10px;
  }

  .question-detail-page .answer-card:not(.ai-answer-card) {
    border-radius: 11px;
    padding: 15px;
  }

  .question-detail-page .answer-card:not(.ai-answer-card) > .answer-content {
    font-size: 15px;
    line-height: 1.7;
  }

  .question-detail-page .answer-card:not(.ai-answer-card) > .image-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-detail-page .answer-empty {
    min-height: 116px;
    padding: 16px;
  }

  .question-detail-page > form.panel.form:not(.question-followup-form) {
    border-radius: 11px;
    padding: 16px 15px;
  }

  .question-detail-page > form.panel.form:not(.question-followup-form) > button[type="submit"] {
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 390px) {
  .question-detail-page {
    gap: 18px;
  }

  .question-detail-page .question-detail-card {
    padding-inline: 14px;
  }

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

  .question-detail-page .question-detail-actions > button {
    flex-basis: 100%;
  }

  .question-detail-page .answer-card:not(.ai-answer-card) > .card-head {
    gap: 7px;
  }

  .question-detail-page .answer-card:not(.ai-answer-card) > .card-head .badge {
    font-size: 11px;
  }
}

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


/* Source: /ai-answer-reference.css?v=3 */
/*
 * Wooshin AI answer document
 * Scope every rule to question detail so ordinary student answers keep their
 * existing appearance. This stylesheet is intended to load after ui-polish.css.
 */

.question-detail-page {
  --ai-ink: #17231f;
  --ai-muted: #68766f;
  --ai-green: #087454;
  --ai-green-deep: #075d45;
  --ai-green-soft: #eef7f2;
  --ai-line: #dbe5e0;
  --ai-line-soft: #e9efec;
  --ai-paper: #ffffff;
  --ai-paper-soft: #f8faf9;
}

.question-detail-page .answer-list,
.question-detail-page .ai-answer-card,
.question-detail-page .ai-answer-card > *,
.question-detail-page .ai-answer-card .answer-content,
.question-detail-page .ai-solution-column,
.question-detail-page .ai-solution-section,
.question-detail-page .ai-solution-copy,
.question-detail-page .ai-followup-guide,
.question-detail-page .question-followup-form {
  min-width: 0;
  max-width: 100%;
}

/* One document surface: author, conclusion, reasoning, feedback. */
.question-detail-page .ai-answer-card {
  display: grid;
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid var(--ai-line) !important;
  border-left: 1px solid var(--ai-line) !important;
  border-radius: 12px !important;
  background: var(--ai-paper) !important;
  padding: 0 !important;
  box-shadow: 0 1px 2px rgba(20, 42, 33, 0.035) !important;
}

.question-detail-page .ai-answer-card::before,
.question-detail-page .ai-answer-card::after {
  display: none !important;
}

.question-detail-page .ai-answer-card > .card-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0 !important;
  border-bottom: 1px solid var(--ai-line-soft) !important;
  padding: 13px 18px !important;
  background: var(--ai-paper);
}

.question-detail-page .ai-answer-card > .card-head > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.question-detail-page .ai-answer-card > .card-head h3,
.question-detail-page .ai-answer-card > .card-head .badges {
  min-width: 0;
  margin: 0;
}

.question-detail-page .ai-answer-card .answer-author-link {
  min-width: 0;
  min-height: 36px;
  gap: 9px;
  border-radius: 8px;
  color: var(--ai-ink);
  padding: 2px 5px 2px 2px;
  font-size: 14px;
  font-weight: 720;
}

.question-detail-page .ai-answer-card .answer-author-link:hover {
  background: var(--ai-green-soft);
  color: var(--ai-green-deep);
}

.question-detail-page .ai-answer-card .answer-author-link > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Product mascot only; the school crest is never replaced or modified. */
.question-detail-page .ai-answer-card .answer-author-link .mini-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid #cfe1d8;
  border-radius: 10px;
  background-color: var(--ai-green-soft);
  box-shadow: none;
  color: transparent;
  overflow: hidden;
}

.question-detail-page .ai-answer-card .answer-author-link .mini-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}

.question-detail-page .ai-answer-card .ai-tutor-author { cursor: default; }
.question-detail-page .ai-answer-card .ai-tutor-author:hover { background: transparent; color: var(--ai-ink); }

.question-detail-page .ai-answer-badge {
  display: inline-flex;
  min-height: 26px;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  border: 1px solid #cfe1d8;
  border-radius: 999px;
  background: var(--ai-green-soft);
  color: var(--ai-green-deep);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
  max-width: 48%;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.question-detail-page .ai-answer-badge .icon {
  display: none;
}

.question-detail-page .ai-answer-card > .answer-content {
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--ai-paper) !important;
  padding: 0 !important;
  color: var(--ai-ink);
  white-space: normal;
}

.question-detail-page .ai-solution-column {
  display: grid;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--ai-paper);
}

.question-detail-page .ai-solution-section {
  display: grid;
  gap: 9px;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--ai-paper);
  padding: 20px 18px;
}

.question-detail-page .ai-solution-final {
  grid-template-columns: minmax(52px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border: 0 !important;
  border-bottom: 1px solid #d5e5dc !important;
  background: var(--ai-green-soft) !important;
}

.question-detail-page .ai-solution-work {
  border: 0 !important;
  background: var(--ai-paper) !important;
}

.question-detail-page .ai-solution-label {
  color: var(--ai-green-deep);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.5;
  letter-spacing: 0;
}

.question-detail-page .ai-solution-copy {
  min-width: 0;
  max-width: 76ch;
  color: var(--ai-ink);
  font-size: 15px;
  font-weight: 430;
  line-height: 1.72;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: pre-wrap;
}

.question-detail-page .ai-solution-final .ai-solution-copy {
  max-width: none;
  color: var(--ai-green-deep);
  font-size: 17px;
  font-weight: 680;
  line-height: 1.55;
}

.question-detail-page .ai-solution-legacy {
  max-width: none;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--ai-paper) !important;
  padding: 20px 18px;
}

/* KaTeX may be wider than the viewport. Only the equation scrolls. */
.question-detail-page .ai-answer-card [data-math-render],
.question-detail-page .ai-answer-card .math-content {
  min-width: 0;
  max-width: 100%;
}

.question-detail-page .ai-answer-card .katex-display,
.question-detail-page .ai-answer-card .math-block {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 15px 0;
  padding: 4px 1px 7px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.question-detail-page .ai-answer-card .katex-display > .katex {
  min-width: max-content;
  font-size: 1.02em;
}

.question-detail-page .ai-answer-card .katex-error {
  color: #9f2d2d !important;
  font-family: inherit;
  font-size: 0.95em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Future rich answers remain inside the document surface. */
.question-detail-page .ai-answer-card :where(img, video, canvas, iframe, svg) {
  max-width: 100%;
  height: auto;
}

.question-detail-page .ai-answer-card :where(pre, .code-block) {
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: #f5f7f6;
  padding: 12px;
  overscroll-behavior-inline: contain;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.question-detail-page .ai-answer-card :where(code, a) {
  overflow-wrap: anywhere;
}

.question-detail-page .ai-answer-card table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.question-detail-page .ai-answer-card th,
.question-detail-page .ai-answer-card td {
  min-width: 96px;
  border-bottom: 1px solid var(--ai-line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.question-detail-page .ai-answer-card th {
  background: var(--ai-paper-soft);
  font-size: 13px;
  font-weight: 700;
}

/* Generated graph is a figure inside the reasoning, not another card. */
.question-detail-page .ai-graph-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--ai-line-soft);
  padding: 16px 0 0;
}

.question-detail-page .ai-graph-card figcaption {
  margin: 0;
  color: var(--ai-ink);
  font-size: 13px;
  font-weight: 700;
}

.question-detail-page .ai-graph-canvas {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 9px;
  background: var(--ai-paper);
}

.question-detail-page .ai-graph-canvas svg {
  display: block;
  width: 100%;
  aspect-ratio: 680 / 390;
}

.question-detail-page .ai-graph-legend {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 13px;
  color: var(--ai-muted);
  font-size: 12px;
}

.question-detail-page .ai-answer-card > .image-preview:empty {
  display: none;
}

.question-detail-page .ai-answer-card > .image-preview:not(:empty) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.question-detail-page .ai-answer-card > .image-preview img {
  width: 100%;
  max-height: 420px;
  border: 1px solid var(--ai-line);
  border-radius: 9px;
  object-fit: contain;
}

.question-detail-page .ai-answer-card > .meta {
  min-width: 0;
  margin: 0;
  border-top: 1px solid var(--ai-line-soft);
  padding: 9px 18px 0;
  color: var(--ai-muted);
  font-size: 11px;
}

/* Existing report action doubles as a restrained answer-quality feedback row. */
.question-detail-page .ai-answer-card > .chips {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 10px 18px 14px;
}

.question-detail-page .ai-answer-card > .chips::before {
  content: "풀이가 이상하거나 도움이 되지 않았나요?";
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ai-muted);
  font-size: 12px;
  line-height: 1.45;
}

.question-detail-page .ai-answer-card > .chips .ghost {
  min-height: 34px;
  flex: 0 0 auto;
  border-color: var(--ai-line);
  border-radius: 8px;
  background: var(--ai-paper);
  color: #596760;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.question-detail-page .ai-answer-card > .chips .ghost:hover {
  border-color: #b9d4c8;
  background: var(--ai-green-soft);
  color: var(--ai-green-deep);
}

/* AI follow-up guidance is a quiet continuation of the answer document. */
.question-detail-page .ai-followup-guide {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  margin: 12px 0 0;
  border: 1px solid var(--ai-line) !important;
  border-radius: 10px !important;
  background: var(--ai-paper) !important;
  padding: 13px 15px !important;
  color: var(--ai-ink);
  box-shadow: none;
}

.question-detail-page .ai-followup-guide > div {
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  border: 1px solid #cfe1d8;
  border-radius: 12px;
  background-color: var(--ai-green-soft);
  color: transparent;
  overflow: hidden;
}

.question-detail-page .ai-followup-guide > div img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.question-detail-page .ai-followup-guide > div .icon {
  display: none;
}

.question-detail-page .ai-followup-guide p {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin: 0;
}

.question-detail-page .ai-followup-guide strong {
  color: var(--ai-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.question-detail-page .ai-followup-guide span,
.question-detail-page .ai-followup-guide small {
  min-width: 0;
  color: var(--ai-muted);
  font-size: 11.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.question-detail-page .ai-followup-guide small {
  grid-column: 2;
}

/* Additional question input reads as the next step, not a detached large card. */
.question-detail-page .question-followup-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--ai-line) !important;
  border-top: 1px solid var(--ai-line) !important;
  border-radius: 12px !important;
  background: var(--ai-paper) !important;
  padding: 18px !important;
  box-shadow: none !important;
}

.question-detail-page .question-followup-head {
  min-width: 0;
}

.question-detail-page .question-followup-head h2 {
  margin: 0;
  color: var(--ai-ink);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.35;
}

.question-detail-page .question-followup-head p {
  margin: 3px 0 0;
  color: var(--ai-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.question-detail-page .question-followup-ai-hint {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: var(--ai-green-soft);
  padding: 9px 11px;
  color: var(--ai-green-deep);
  font-size: 12px;
  line-height: 1.45;
}

.question-detail-page .question-followup-ai-hint .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
}

.question-detail-page .question-followup-form .textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--ai-line);
  border-radius: 9px;
  background: var(--ai-paper);
  padding: 12px 13px;
  color: var(--ai-ink);
  font-size: 14px;
  line-height: 1.6;
  box-shadow: none;
}

.question-detail-page .question-followup-form .textarea:focus {
  border-color: var(--ai-green);
  outline: 3px solid rgba(8, 116, 84, 0.12);
}

.question-detail-page .question-followup-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.question-detail-page .question-followup-actions > span {
  min-width: 0;
  color: var(--ai-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

.question-detail-page .question-followup-buttons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.question-detail-page .question-followup-buttons > button {
  min-height: 40px;
  border-radius: 9px;
  padding: 0 14px;
  white-space: nowrap;
}

.question-detail-page .question-followup-buttons > .ghost {
  border: 1px solid var(--ai-line);
  background: var(--ai-paper);
  color: var(--ai-ink);
  box-shadow: none;
}

.question-detail-page .question-followup-actions .primary {
  min-width: 112px;
  min-height: 40px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--ai-green);
  padding: 0 15px;
  box-shadow: none;
}

.question-detail-page .question-followup-actions .primary:hover {
  background: var(--ai-green-deep);
}

.question-detail-page :where(.ai-answer-card, .ai-followup-guide, .question-followup-form) :focus-visible {
  outline: 3px solid rgba(8, 116, 84, 0.18);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .question-detail-page .ai-answer-card {
    border-radius: 10px !important;
  }

  .question-detail-page .ai-answer-card > .card-head {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
    padding: 11px 12px !important;
  }

  .question-detail-page .ai-answer-card > .card-head > div {
    gap: 6px;
    overflow: hidden;
  }

  .question-detail-page .ai-answer-card .answer-author-link {
    min-height: 32px;
    gap: 7px;
    overflow: hidden;
    font-size: 13px;
  }

  .question-detail-page .ai-answer-card .answer-author-link .mini-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
  }

  .question-detail-page .ai-answer-badge {
    min-height: 24px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .question-detail-page .ai-solution-section,
  .question-detail-page .ai-solution-legacy {
    padding: 16px 13px;
  }

  .question-detail-page .ai-solution-final {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .question-detail-page .ai-solution-copy {
    max-width: none;
    font-size: 14px;
    line-height: 1.7;
  }

  .question-detail-page .ai-solution-final .ai-solution-copy {
    font-size: 16px;
    line-height: 1.5;
  }

  .question-detail-page .ai-answer-card .katex-display {
    margin-block: 12px;
    padding-bottom: 8px;
  }

  .question-detail-page .ai-answer-card .katex-display > .katex {
    font-size: 0.98em;
  }

  .question-detail-page .ai-answer-card > .meta {
    padding: 8px 13px 0;
  }

  .question-detail-page .ai-answer-card > .chips {
    align-items: flex-start;
    padding: 8px 13px 12px;
  }

  .question-detail-page .ai-answer-card > .chips::before {
    font-size: 11px;
  }

  .question-detail-page .ai-answer-card > .chips .ghost {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .question-detail-page .ai-followup-guide {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 3px 10px;
    padding: 11px 12px !important;
  }

  .question-detail-page .ai-followup-guide > div {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .question-detail-page .ai-followup-guide small {
    display: none;
  }

  .question-detail-page .question-followup-form {
    gap: 10px;
    border-radius: 10px !important;
    padding: 14px 13px !important;
  }

  .question-detail-page .question-followup-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

  .question-detail-page .question-followup-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .question-detail-page .question-followup-actions .primary {
    width: 100% !important;
    min-width: 0;
  }
}

@media (max-width: 390px) {
  .question-detail-page .ai-answer-card > .chips::before {
    content: "풀이가 이상한가요?";
  }

  .question-detail-page .question-followup-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-detail-page .question-followup-actions .primary {
    width: 100% !important;
  }

  .question-detail-page .question-followup-buttons {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .question-detail-page .ai-answer-card *,
  .question-detail-page .ai-followup-guide *,
  .question-detail-page .question-followup-form * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Source: /study-room-detail-reference.css?v=5 */
/*
 * Study room detail reference
 *
 * Scope: the focused timer and room-management states rendered inside
 * `.community-modern`. This layer deliberately leaves app.js, index.html,
 * and the shared community stylesheet untouched.
 */

.community-modern:has(.community-study-room),
.community-modern:has(.community-customize) {
  --study-detail-brand: #087454;
  --study-detail-brand-hover: #066247;
  --study-detail-brand-soft: #edf7f3;
  --study-detail-ink: #18211d;
  --study-detail-muted: #66736d;
  --study-detail-line: #dfe7e3;
  --study-detail-subtle: #f6f8f7;
  --study-detail-warning: #fff9e8;
  --study-detail-warning-line: #eadca6;
  display: block;
  width: min(100%, 820px);
  min-width: 0;
  margin-inline: auto;
  padding-bottom: 12px;
  color: var(--study-detail-ink);
}

/* The selected room becomes the page, instead of remaining inside the browser. */
.community-modern:has(.community-study-room) > .workspace-head,
.community-modern:has(.community-customize) > .workspace-head,
.community-modern:has(.community-study-room) .community-left-rail,
.community-modern:has(.community-customize) .community-left-rail,
.community-modern:has(.community-study-room) .community-main-panel > .community-hero,
.community-modern:has(.community-customize) .community-main-panel > .community-hero {
  display: none !important;
}

.community-modern:has(.community-study-room) .community-shell,
.community-modern:has(.community-customize) .community-shell {
  display: block;
  width: 100%;
  min-width: 0;
}

.community-modern:has(.community-study-room) .community-main-panel,
.community-modern:has(.community-customize) .community-main-panel {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: none;
  gap: 18px;
}

/* Existing section controls serve as the stable detail navigation. */
.community-modern:has(.community-study-room) .community-section-tabs,
.community-modern:has(.community-customize) .community-section-tabs {
  position: sticky;
  z-index: 12;
  top: var(--topbar-offset, 0px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  width: 100%;
  min-width: 0;
  gap: 0;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  padding: 0;
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.community-modern:has(.community-study-room) .community-section-tabs > button,
.community-modern:has(.community-customize) .community-section-tabs > button {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 10px;
  color: var(--study-detail-muted);
  box-shadow: none;
  font-size: 13px;
  font-weight: 620;
  transform: none;
}

.community-modern:has(.community-study-room) .community-section-tabs > button::after,
.community-modern:has(.community-customize) .community-section-tabs > button::after {
  position: absolute;
  right: 14px;
  bottom: -1px;
  left: 14px;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.community-modern:has(.community-study-room) .community-section-tabs > button:hover,
.community-modern:has(.community-customize) .community-section-tabs > button:hover,
.community-modern:has(.community-study-room) .community-section-tabs > button.active,
.community-modern:has(.community-customize) .community-section-tabs > button.active {
  background: transparent;
  color: var(--study-detail-brand);
  box-shadow: none;
  transform: none;
}

.community-modern:has(.community-study-room) .community-section-tabs > button.active::after,
.community-modern:has(.community-customize) .community-section-tabs > button.active::after {
  background: var(--study-detail-brand);
}

.community-modern:has(.community-study-room) .community-section-tabs > button b,
.community-modern:has(.community-customize) .community-section-tabs > button b {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: var(--study-detail-subtle);
  padding-inline: 5px;
  color: var(--study-detail-muted);
  font-size: 10px;
}

/* ---------- Focus timer ---------- */

.community-modern .community-study-room {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 18px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-study-room::before,
.community-modern .community-study-room::after {
  content: none;
}

.community-modern .community-study-room .study-room-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  padding: 10px 2px 16px;
}

.community-modern .community-study-room .study-room-head > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.community-modern .community-study-room .study-room-head .eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  color: var(--study-detail-brand);
  font-size: 11px;
  font-weight: 650;
}

.community-modern .community-study-room .study-room-head h3 {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  color: var(--study-detail-ink);
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 730;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-room-head-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.community-modern .community-study-room .study-summary-pills {
  display: grid;
  min-width: 276px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: #fff;
}

.community-modern .community-study-room .study-summary-pills > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  border: 0;
  border-right: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
}

.community-modern .community-study-room .study-summary-pills > span:last-child {
  border-right: 0;
}

.community-modern .community-study-room .study-summary-pills b {
  overflow: hidden;
  color: var(--study-detail-ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-summary-pills small {
  color: var(--study-detail-muted);
  font-size: 10px;
  font-weight: 540;
  line-height: 1.3;
}

.community-modern .community-study-room .invite-button {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: #fff;
  padding-inline: 12px;
  color: var(--study-detail-brand);
  box-shadow: none;
  font-size: 12px;
  transform: none;
}

.community-modern .community-study-room .invite-button:hover {
  border-color: #b8d8ca;
  background: var(--study-detail-brand-soft);
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .community-invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1.2fr) auto;
  min-width: 0;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: var(--study-detail-subtle);
  padding: 11px;
  box-shadow: none;
}

.community-modern .community-study-room .community-invite-box > * {
  min-width: 0;
}

.community-modern .community-study-room .community-invite-box .input {
  width: 100%;
  min-width: 0;
}

.community-modern .community-study-room .study-room-grid.visual-study-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(340px, 1.12fr);
  min-width: 0;
  gap: 20px;
  align-items: start;
}

.community-modern .community-study-room .study-side-stack,
.community-modern .community-study-room .study-priority-stack,
.community-modern .community-study-room .study-classroom-set {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.community-modern .community-study-room .study-timer-card,
.community-modern .community-study-room .study-leaderboard,
.community-modern .community-study-room .study-classroom {
  position: static;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--study-detail-line);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  box-shadow: none;
}

.community-modern .community-study-room .study-timer-card {
  display: grid;
  gap: 12px;
}

.community-modern .community-study-room .study-timer-card::after {
  content: none;
}

.community-modern .community-study-room .study-timer-card.is-active {
  border-color: #b8d8ca;
  box-shadow: none;
}

.community-modern .community-study-room .study-stopwatch-face {
  display: grid;
  min-height: 168px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px solid #b8d8ca;
  border-radius: 11px;
  background: var(--study-detail-brand-soft);
  padding: 20px 14px;
  color: var(--study-detail-ink);
  text-align: center;
  box-shadow: none;
}

.community-modern .community-study-room .study-stopwatch-face span {
  color: var(--study-detail-brand);
  font-size: 11px;
  font-weight: 680;
}

.community-modern .community-study-room .study-stopwatch-face strong {
  max-width: 100%;
  color: var(--study-detail-ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: clamp(38px, 6vw, 52px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
  white-space: nowrap;
}

.community-modern .community-study-room .study-stopwatch-face small {
  max-width: 31ch;
  color: var(--study-detail-muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.4;
}

.community-modern .community-study-room .study-start-form {
  display: grid;
  min-width: 0;
  gap: 11px;
}

.community-modern .community-study-room .study-start-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 1px 0 11px;
}

.community-modern .community-study-room .study-start-copy strong {
  color: var(--study-detail-ink);
  font-size: 15px;
  font-weight: 700;
}

.community-modern .community-study-room .study-start-copy span {
  color: var(--study-detail-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

.community-modern .community-study-room .study-goal-select,
.community-modern .community-study-room .study-advanced-start-fields label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--study-detail-ink);
  font-size: 12px;
  font-weight: 650;
}

.community-modern .community-study-room .study-goal-select .select,
.community-modern .community-study-room .study-advanced-start-fields :is(.select, .input) {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: #fff;
  color: var(--study-detail-ink);
  box-shadow: none;
}

.community-modern .community-study-room .study-start-warning,
.community-modern .community-study-room .study-confirm-alert {
  display: grid;
  gap: 5px;
  border: 1px solid var(--study-detail-warning-line);
  border-radius: 10px;
  background: var(--study-detail-warning);
  padding: 10px 11px;
  color: #745a18;
  box-shadow: none;
}

.community-modern .community-study-room .study-start-warning strong,
.community-modern .community-study-room .study-confirm-alert strong {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #745a18;
  font-size: 11.5px;
  font-weight: 680;
}

.community-modern .community-study-room .study-start-warning p,
.community-modern .community-study-room .study-confirm-alert p {
  margin: 0;
  color: #806b35;
  font-size: 10.5px;
  line-height: 1.45;
}

.community-modern .community-study-room .study-start-verify {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  color: var(--study-detail-muted);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.4;
}

.community-modern .community-study-room .study-start-verify input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--study-detail-brand);
}

.community-modern .community-study-room .study-start-main-button,
.community-modern .community-study-room .study-confirm-alert .primary {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--study-detail-brand);
  border-radius: 10px;
  background: var(--study-detail-brand);
  color: #fff;
  box-shadow: none;
  font-size: 14px;
  font-weight: 680;
  transform: none;
}

.community-modern .community-study-room .study-start-main-button:hover,
.community-modern .community-study-room .study-confirm-alert .primary:hover {
  border-color: var(--study-detail-brand-hover);
  background: var(--study-detail-brand-hover);
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-timer-card > .danger {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e8c6c2;
  border-radius: 10px;
  background: #fff;
  color: #b33d34;
  box-shadow: none;
  font-size: 14px;
  font-weight: 680;
  transform: none;
}

.community-modern .community-study-room .study-timer-card > .danger:hover {
  background: #fff5f4;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeeb;
}

.community-modern .community-study-room .study-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--study-detail-brand);
}

.community-modern .community-study-room .study-tools-toggle {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-top: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 9px 2px 0;
  color: var(--study-detail-muted);
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 590;
  transform: none;
}

.community-modern .community-study-room .study-tools-toggle:hover {
  color: var(--study-detail-brand);
  box-shadow: none;
  transform: none;
}

/* Participant/ranking rows stay scannable and do not become nested cards. */
.community-modern .community-study-room .study-leaderboard {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 0;
}

.community-modern .community-study-room .study-leaderboard .mini-title {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--study-detail-line);
  padding: 0 13px;
  color: var(--study-detail-muted);
  font-size: 10.5px;
}

.community-modern .community-study-room .study-leaderboard .mini-title strong {
  color: var(--study-detail-ink);
  font-size: 13px;
  font-weight: 700;
}

.community-modern .community-study-room .study-rank {
  display: grid;
  min-width: 0;
  min-height: 52px;
  grid-template-columns: 24px 32px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 8px 12px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-rank:last-child {
  border-bottom: 0;
}

.community-modern .community-study-room .study-rank:hover,
.community-modern .community-study-room .study-rank.me {
  background: var(--study-detail-brand-soft);
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .rank-no {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: var(--study-detail-subtle);
  color: var(--study-detail-muted);
  font-size: 10px;
  font-weight: 650;
}

.community-modern .community-study-room .study-rank .avatar {
  display: grid;
  width: 32px;
  height: 32px;
  min-width: 32px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  line-height: 1;
}

.community-modern .community-study-room .study-rank-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  place-items: center;
  line-height: 1;
  text-align: center;
}

.community-modern .community-study-room .study-rank strong {
  min-width: 0;
  overflow: hidden;
  color: var(--study-detail-ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-rank b {
  color: var(--study-detail-ink);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}

.community-modern .community-study-room .study-rank em {
  border-radius: 999px;
  background: var(--study-detail-brand-soft);
  padding: 3px 6px;
  color: var(--study-detail-brand);
  font-size: 9px;
  font-style: normal;
  font-weight: 680;
}

/* The old classroom becomes a compact participant roster. */
.community-modern .community-study-room .study-classroom {
  display: grid;
  gap: 0;
  padding: 0;
  perspective: none;
}

.community-modern .community-study-room .study-classroom::before {
  content: none;
}

.community-modern .community-study-room .classroom-board {
  display: flex;
  min-height: 48px;
  align-items: center;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: #fff;
  padding: 0 13px;
  color: var(--study-detail-ink);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  transform: none;
}

.community-modern .community-study-room .board-main-area {
  width: 100%;
  min-width: 0;
}

.community-modern .community-study-room .classroom-floor {
  max-height: 460px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 0;
  box-shadow: none;
}

.community-modern .community-study-room .is-empty-classroom .classroom-floor {
  display: grid;
  min-height: 230px;
  place-items: center;
}

.community-modern .community-study-room .study-classroom-empty {
  display: grid;
  width: min(100%, 320px);
  place-items: center;
  gap: 7px;
  padding: 24px 18px;
  color: var(--study-detail-muted);
  text-align: center;
}

.community-modern .community-study-room .study-classroom-empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--study-detail-brand-soft);
  color: var(--study-detail-brand);
}

.community-modern .community-study-room .study-classroom-empty strong {
  color: var(--study-detail-ink);
  font-size: 15px;
}

.community-modern .community-study-room .study-classroom-empty small {
  font-size: 12px;
}

.community-modern .community-study-room .seat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.community-modern .community-study-room .study-seat {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 1px 8px;
  align-items: center;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: #fff;
  padding: 8px 11px;
  color: var(--study-detail-ink);
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-seat:nth-child(odd) {
  border-right: 1px solid var(--study-detail-line);
}

.community-modern .community-study-room .study-seat::after,
.community-modern .community-study-room .focus-spark,
.community-modern .community-study-room .sleep-mark,
.community-modern .community-study-room .seat-rank {
  display: none;
}

.community-modern .community-study-room .study-seat.empty-seat {
  display: none;
}

.community-modern .community-study-room .study-seat.my-seat,
.community-modern .community-study-room .study-seat.studying-seat:hover {
  background: var(--study-detail-brand-soft);
}

.community-modern .community-study-room .desk-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  grid-row: 1 / 3;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--study-detail-line);
  border-radius: 50%;
  background: var(--study-detail-subtle);
  color: var(--study-detail-brand);
  font-size: 11px;
  font-weight: 680;
}

.community-modern .community-study-room .desk-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-modern .community-study-room .desk-avatar > .desk-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  place-items: center;
  line-height: 1;
  text-align: center;
}

.community-modern .community-study-room .study-seat > strong {
  min-width: 0;
  overflow: hidden;
  align-self: end;
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-seat > small {
  min-width: 0;
  align-self: start;
  color: var(--study-detail-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.community-modern .community-study-room .desk-note {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  min-height: 28px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: var(--study-detail-subtle);
  padding: 4px;
  color: var(--study-detail-muted);
  box-shadow: none;
}

.community-modern .community-study-room .classroom-caption {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--study-detail-line);
  padding: 0 12px;
  color: var(--study-detail-muted);
  font-size: 9.5px;
}

/* Additional tools keep their own scroll and never expand the whole viewport. */
.community-modern .community-study-room .study-advanced-panel {
  display: grid;
  min-width: 0;
  max-height: min(58vh, 520px);
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--study-detail-line);
  padding-top: 12px;
  scrollbar-gutter: stable;
}

.community-modern .community-study-room .study-extra-timers,
.community-modern .community-study-room .board-note-form {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-study-room .quick-timer-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.community-modern .community-study-room .quick-timer-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.community-modern .community-study-room .quick-timer-row .small-button,
.community-modern .community-study-room .quick-timer-custom .ghost {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--study-detail-line);
  border-radius: 9px;
  background: #fff;
  color: var(--study-detail-ink);
  box-shadow: none;
}

.community-modern .community-study-room .exam-timer {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto 34px;
  gap: 8px;
  border: 1px solid var(--study-detail-line);
  border-radius: 9px;
  background: #fff;
  padding: 7px 8px;
}

.community-modern .community-study-room .board-note-form > * {
  min-width: 0;
}

.community-modern .community-study-room .board-position-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.community-modern .community-study-room .board-note-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* ---------- Management ---------- */

.community-modern .community-customize {
  display: block;
  width: min(100%, 700px);
  min-width: 0;
  margin-inline: auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #fff;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-customize > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  background: transparent;
  padding: 0 2px;
  color: var(--study-detail-ink);
  font-size: 21px;
  font-weight: 730;
  list-style: none;
}

.community-modern .community-customize > summary::-webkit-details-marker {
  display: none;
}

.community-modern .community-customize > summary::after {
  display: none;
}

/* The settings route is already explicit, so do not require another disclosure. */
.community-modern .community-customize > form {
  display: grid !important;
  min-width: 0;
  gap: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.community-modern .community-customize > form > * {
  min-width: 0;
}

.community-modern .community-customize > form > :is(input, textarea, select, label, .blog-toolbar, .community-setting-preview, .form-actions, .join-request-box) {
  width: 100%;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--study-detail-line);
  border-radius: 0;
  background: transparent;
  padding: 15px 2px;
}

.community-modern .community-customize > form > :is(input, textarea, select) {
  margin-top: 12px;
}

.community-modern .community-customize :is(.input, .select, .textarea) {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: #fff;
  color: var(--study-detail-ink);
  box-shadow: none;
}

.community-modern .community-customize .textarea {
  min-height: 104px;
  resize: vertical;
}

.community-modern .community-customize label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--study-detail-ink);
  font-size: 13px;
  font-weight: 650;
}

.community-modern .community-customize input[type="color"] {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 0 0 1px var(--study-detail-line);
}

.community-modern .community-customize input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.community-modern .community-customize input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

.community-modern .community-customize .blog-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.community-modern .community-customize .blog-toolbar .small-button {
  min-height: 42px;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: #fff;
  color: var(--study-detail-ink);
  box-shadow: none;
}

.community-modern .community-customize .community-setting-preview {
  display: block;
  min-height: 0;
  overflow: hidden;
}

.community-modern .community-customize .community-setting-preview:empty {
  display: none;
}

.community-modern .community-customize .community-setting-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  aspect-ratio: 16 / 5;
  border: 1px solid var(--study-detail-line);
  border-radius: 10px;
  background: var(--study-detail-subtle);
  object-fit: cover;
  box-shadow: none;
}

.community-modern .community-customize .join-request-box {
  display: grid;
  gap: 0;
}

.community-modern .community-customize .join-request-box > strong {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--study-detail-line);
  color: var(--study-detail-ink);
  font-size: 14px;
  font-weight: 700;
}

.community-modern .community-customize .join-request-list {
  display: grid;
  min-width: 0;
  gap: 0;
}

.community-modern .community-customize .join-request-row {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--study-detail-line);
  padding: 9px 0;
}

.community-modern .community-customize .join-request-row.is-unavailable {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  background: #f7f9f8;
}

.community-modern .community-customize .join-request-row.is-unavailable .mini-avatar {
  opacity: .62;
}

.community-modern .community-customize .join-request-row.is-unavailable .danger {
  min-width: 64px;
}

.community-modern .community-customize .join-request-row > div {
  min-width: 0;
}

.community-modern .community-customize .join-request-row b,
.community-modern .community-customize .join-request-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-customize .form-actions {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.community-modern .community-customize .split-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 0;
  padding-top: 18px;
}

.community-modern .community-customize .form-actions > button {
  min-width: 0;
  min-height: 46px;
  border-radius: 10px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-customize .split-actions .primary {
  border-color: var(--study-detail-brand);
  background: var(--study-detail-brand);
  color: #fff;
}

.community-modern .community-customize .split-actions .danger {
  border: 1px solid #e8c6c2;
  background: #fff;
  color: #b33d34;
}

.community-modern .community-customize :is(button, input, textarea, select):focus-visible,
.community-modern .community-study-room :is(button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(8, 116, 84, 0.2);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .community-modern:has(.community-study-room),
  .community-modern:has(.community-customize) {
    width: 100%;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .community-modern:has(.community-study-room) .community-main-panel,
  .community-modern:has(.community-customize) .community-main-panel {
    gap: 14px;
  }

  .community-modern:has(.community-study-room) .community-section-tabs,
  .community-modern:has(.community-customize) .community-section-tabs {
    top: 0;
    grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  }

  .community-modern:has(.community-study-room) .community-section-tabs > button,
  .community-modern:has(.community-customize) .community-section-tabs > button {
    min-height: 44px;
    gap: 4px;
    padding-inline: 5px;
    font-size: 11.5px;
  }

  .community-modern .community-study-room {
    gap: 14px;
  }

  .community-modern .community-study-room .study-room-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
    padding: 6px 0 13px;
  }

  .community-modern .community-study-room .study-room-head h3 {
    font-size: 21px;
  }

  .community-modern .community-study-room .study-room-head-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .community-modern .community-study-room .study-summary-pills {
    width: 100%;
    min-width: 0;
  }

  .community-modern .community-study-room .study-summary-pills > span {
    padding: 7px 8px;
  }

  .community-modern .community-study-room .invite-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    font-size: 0;
  }

  .community-modern .community-study-room .invite-button .icon {
    width: 18px;
    height: 18px;
  }

  .community-modern .community-study-room .community-invite-box {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .community-modern .community-study-room .community-invite-box > div {
    grid-column: 1 / -1;
  }

  .community-modern .community-study-room .study-room-grid.visual-study-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .community-modern .community-study-room .study-stopwatch-face {
    min-height: 154px;
    padding-inline: 8px;
  }

  .community-modern .community-study-room .study-stopwatch-face strong {
    font-size: clamp(36px, 12vw, 48px);
  }

  .community-modern .community-study-room .seat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-study-room .study-seat:nth-child(odd) {
    border-right: 0;
  }

  .community-modern .community-study-room .classroom-floor {
    max-height: 360px;
  }

  .community-modern .community-study-room .study-rank {
    grid-template-columns: 22px 30px minmax(0, 1fr) auto;
  }

  .community-modern .community-study-room .study-rank em {
    display: none;
  }

  .community-modern .community-study-room .study-advanced-panel {
    max-height: min(56vh, 460px);
  }

  .community-modern .community-study-room .quick-timer-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-modern .community-customize {
    width: 100%;
  }

  .community-modern .community-customize > summary {
    min-height: 52px;
    font-size: 20px;
  }

  .community-modern .community-customize > form > :is(input, textarea, select, label, .blog-toolbar, .community-setting-preview, .form-actions, .join-request-box) {
    padding-right: 0;
    padding-left: 0;
  }

  .community-modern .community-customize .join-request-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
  }

  .community-modern .community-customize .join-request-row .danger {
    grid-column: 2 / -1;
    width: 100%;
  }

  .community-modern .community-customize .split-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-customize .split-actions > button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .community-modern:has(.community-study-room) .community-section-tabs > button b,
  .community-modern:has(.community-customize) .community-section-tabs > button b {
    display: none;
  }

  .community-modern .community-study-room .study-summary-pills > span {
    padding-inline: 6px;
  }

  .community-modern .community-study-room .study-summary-pills b {
    font-size: 12px;
  }

  .community-modern .community-study-room .study-stopwatch-face strong {
    font-size: clamp(34px, 11.5vw, 44px);
  }

  .community-modern .community-study-room .community-invite-box {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-study-room .community-invite-box > button {
    width: 100%;
  }

  .community-modern .community-study-room .classroom-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    padding-block: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-modern .community-study-room *,
  .community-modern .community-study-room *::before,
  .community-modern .community-study-room *::after,
  .community-modern .community-customize *,
  .community-modern .community-customize *::before,
  .community-modern .community-customize *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Dedicated study-room index. The existing board sessions and timer remain the source of truth. */
.community-modern.study-rooms-page {
  display: grid;
  width: min(100%, 960px);
  gap: 18px;
}

.study-rooms-page-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.study-rooms-page-head > div {
  min-width: 0;
}

.study-rooms-page-head h1 {
  margin: 2px 0 3px;
  color: #18211d;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.2;
}

.study-rooms-page-head p {
  margin: 0;
  color: #66736d;
  font-size: 13px;
}

.study-rooms-page-head .study-rooms-back,
.study-rooms-active-callout {
  min-height: 44px;
}

.study-rooms-live-total,
.study-rooms-card-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #66736d;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.study-rooms-live-total .icon,
.study-rooms-card-live .icon {
  width: 16px;
  height: 16px;
  color: #087454;
}

.study-rooms-active-callout {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 1px solid #a9d8c6;
  border-radius: 12px;
  background: #edf7f3;
  padding: 9px 12px;
  color: #066247;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.study-rooms-active-callout .icon:last-child {
  margin-left: auto;
}

.study-rooms-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  min-width: 0;
}

.study-rooms-card {
  display: grid;
  min-width: 0;
  min-height: 108px;
  gap: 10px;
  border: 1px solid #dfe7e3;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  color: #18211d;
  text-align: left;
}

.study-rooms-card:hover,
.study-rooms-card:focus-visible,
.study-rooms-card.is-selected {
  border-color: #087454;
  background: #f4faf7;
}

.study-rooms-card-top,
.study-rooms-card-bottom {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.study-rooms-card-top strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-rooms-card-top small,
.study-rooms-card-bottom small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #66736d;
  font-size: 10px;
  white-space: nowrap;
}

.study-rooms-card-live.is-live {
  color: #087454;
}

.study-rooms-avatars {
  display: flex;
  padding-left: 4px;
}

.study-rooms-avatars > :is(img, span) {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  margin-left: -4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #d8eee4;
  color: #07684b;
  object-fit: cover;
  font-size: 10px;
}

.study-rooms-detail {
  min-width: 0;
  border-top: 1px solid #dfe7e3;
  padding-top: 2px;
}

.study-keyword-filters {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid #dfe7e3;
  border-radius: 12px;
  background: #f8fbf9;
  padding: 12px 14px;
}

.study-keyword-filters > strong {
  color: #18211d;
  font-size: 12px;
}

.study-keyword-filters > div {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.study-keyword-filters .chip {
  min-height: 36px;
  flex: 0 0 auto;
}

.study-keyword-filters .chip small {
  color: inherit;
  font-size: 10px;
}

.community-modern .community-study-room .study-keyword-input {
  display: grid;
  gap: 6px;
  color: #18211d;
  font-size: 12px;
  font-weight: 700;
}

.community-modern .community-study-room .study-keyword-input > small,
.community-modern .community-study-room .study-keyword-input > span {
  color: #66736d;
  font-size: 10.5px;
  font-weight: 500;
}

.community-modern .community-study-room .study-active-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.community-modern .community-study-room .study-active-keywords span {
  border-radius: 999px;
  background: #edf7f3;
  padding: 5px 8px;
  color: #087454;
  font-size: 11px;
  font-weight: 700;
}

.community-modern .community-study-room .study-goal-status {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: #18211d;
  font-size: 12px;
}

.community-modern .community-study-room .study-goal-status strong {
  font-weight: 700;
}

.community-modern .community-study-room .study-goal-status span {
  color: #087454;
  font-weight: 650;
  white-space: nowrap;
}

.community-modern .community-study-room .study-elsewhere-gate {
  display: grid;
  gap: 8px;
  border: 1px solid #dfe7e3;
  border-radius: 12px;
  background: #f6f8f7;
  padding: 15px;
  color: #18211d;
  font-size: 12px;
}

.community-modern .community-study-room .study-elsewhere-gate span {
  color: #66736d;
}

.community-modern .community-study-room .study-elsewhere-gate button {
  min-height: 44px;
  justify-self: start;
}

.study-rooms-empty,
.study-rooms-loading {
  min-height: 96px;
  border: 1px dashed #c8d9d0;
  border-radius: 14px;
  background: #f8fbf9;
  padding: 22px;
  color: #66736d;
}

@media (max-width: 700px) {
  .study-rooms-page-head {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
  }

  .study-rooms-page-head p {
    font-size: 11px;
  }

  .study-rooms-live-total {
    grid-column: 1 / -1;
    padding-left: 4px;
  }

  .study-rooms-list {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 0 0 5px;
  }

  .study-rooms-card {
    min-width: min(72vw, 230px);
    min-height: 106px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}

/* ---------- Tablet landscape participant board ----------
 *
 * The phone keeps the existing single-column flow above. A wide landscape
 * viewport uses the extra horizontal space for the live roster: the timer
 * remains visible on the left while status, name, topic tag and elapsed time
 * stay aligned in dense, repeatable member rows on the right.
 */

.community-modern .community-study-room .study-member-name-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.community-modern .community-study-room .study-member-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-member-tag {
  max-width: min(42%, 88px);
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #c9e3d8;
  border-radius: 999px;
  background: #edf7f3;
  padding: 2px 6px;
  color: #087454;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-member-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.community-modern .community-study-room .study-member-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.community-modern .community-study-room .study-member-status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.community-modern .community-study-room .study-member-status--studying {
  color: #087454;
}

.community-modern .community-study-room .study-member-status--resting {
  color: #a15c00;
}

.community-modern .community-study-room .study-member-status--offline {
  color: #7b8781;
}

.community-modern .community-study-room .study-member-time {
  min-width: 0;
  overflow: hidden;
  color: var(--study-detail-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-study-room .study-seat.is-resting {
  background: #fffaf0;
}

.community-modern .community-study-room .study-seat.is-offline {
  background: #fafbfb;
}

.study-room-page-mascot {
  display: none;
}

.community-modern .community-study-room .study-classroom-empty-mascot {
  display: block;
  width: min(38vw, 132px);
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

@media (min-width: 900px) and (orientation: landscape) {
  .community-modern.study-rooms-page {
    width: min(100%, 1280px);
    gap: 14px;
  }

  .study-rooms-page-head {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 10px 14px;
  }

  .study-room-page-mascot {
    display: block;
    width: 82px;
    height: 62px;
    align-self: end;
    object-fit: contain;
  }

  .study-rooms-detail {
    padding-top: 0;
  }

  .community-modern .community-study-room {
    gap: 12px;
  }

  .community-modern .community-study-room .study-room-head {
    gap: 14px;
    padding-block: 8px 12px;
  }

  .community-modern .community-study-room .study-keyword-filters {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
  }

  .community-modern .community-study-room .study-keyword-filters > div {
    padding-bottom: 0;
  }

  .community-modern .community-study-room .study-keyword-filters .chip {
    min-height: 32px;
    padding-block: 5px;
  }

  .community-modern .community-study-room .study-room-grid.visual-study-grid {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.72fr);
    gap: 14px;
  }

  .community-modern .community-study-room .study-priority-stack {
    position: sticky;
    top: calc(var(--topbar-offset, 0px) + 12px);
    align-self: start;
  }

  .community-modern .community-study-room .study-timer-card {
    padding: 12px;
  }

  .community-modern .community-study-room .study-stopwatch-face {
    min-height: 142px;
    padding: 16px 10px;
  }

  .community-modern .community-study-room .study-stopwatch-face strong {
    font-size: clamp(36px, 4.2vw, 48px);
  }

  .community-modern .community-study-room .classroom-board {
    min-height: 42px;
    padding-inline: 11px;
  }

  .community-modern .community-study-room .classroom-floor {
    max-height: max(360px, calc(100dvh - 292px));
    padding: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .community-modern .community-study-room .seat-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }

  .community-modern .community-study-room .study-seat {
    min-height: 108px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 42px auto auto;
    justify-items: center;
    gap: 4px;
    border-right: 1px solid var(--study-detail-line);
    padding: 10px 8px 8px;
    text-align: center;
  }

  .community-modern .community-study-room .study-seat.is-studying,
  .community-modern .community-study-room .study-seat.studying-seat {
    background: #f6fbf8;
    box-shadow: inset 0 2px 0 var(--study-detail-brand);
  }

  .community-modern .community-study-room .study-seat.is-resting {
    box-shadow: inset 0 2px 0 #d18a22;
  }

  .community-modern .community-study-room .study-seat.is-offline,
  .community-modern .community-study-room .study-seat.sleeping-seat {
    background: #fafbfb;
    color: #69756f;
  }

  .community-modern .community-study-room .study-seat.is-offline .desk-avatar,
  .community-modern .community-study-room .study-seat.sleeping-seat .desk-avatar {
    filter: grayscale(0.72);
    opacity: 0.72;
  }

  .community-modern .community-study-room .desk-avatar {
    width: 42px;
    height: 42px;
    grid-row: auto;
    justify-self: center;
    font-size: 13px;
  }

  .community-modern .community-study-room .study-seat > strong,
  .community-modern .community-study-room .study-member-name-row {
    width: 100%;
    align-self: center;
    justify-content: center;
    font-size: 11.5px;
  }

  .community-modern .community-study-room .study-seat > small,
  .community-modern .community-study-room .study-member-meta {
    width: 100%;
    justify-content: center;
    font-size: 9.5px;
  }

  .community-modern .community-study-room .study-member-tag {
    max-width: min(46%, 62px);
  }

  .community-modern .community-study-room .desk-note {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 23px;
    height: 23px;
    min-height: 23px;
  }

  .community-modern .community-study-room .classroom-caption {
    min-height: 34px;
  }

  .community-modern .community-study-room .study-classroom-empty {
    width: min(100%, 420px);
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    column-gap: 18px;
    text-align: left;
  }

  .community-modern .community-study-room .study-classroom-empty-mascot,
  .community-modern .community-study-room .study-classroom-empty-icon {
    grid-row: 1 / 3;
  }
}

