:root {
  --ui-scale: 0.8;
  --teacher-topbar-h: 58px;
  --font-body: "Optima", "Segoe UI", "Trebuchet MS", "Noto Sans", sans-serif;
  --font-display: "Palatino Linotype", "Book Antiqua", "Palatino", "Georgia", serif;
  --bg: #f6f8fd;
  --bg-glow-1: rgba(37, 99, 235, 0.08);
  --bg-glow-2: rgba(15, 23, 42, 0.06);
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-subtle: #f3f5fb;
  --surface-strong: #eef2ff;
  --surface-contrast: #f9fbff;
  --surface-highlight: #f3f7ff;
  --surface-soft: #fbfcfe;
  --surface-elevated: #f8fbff;
  --surface-emboss: #eef2f9;
  --surface-input: #f9fbff;
  --surface-profile: #f7f9fc;
  --profile-surface: transparent;
  --text: #0f172a;
  --text-muted: #5b647a;
  --text-subtle: #6b7280;
  --text-faint: #9ca3af;
  --text-strong: #0b1b37;
  --text-inverse: #ffffff;
  --text-accent: #1d4ed8;
  --border: #e5e9f2;
  --border-strong: #dfe5f2;
  --border-muted: #e7ebf5;
  --border-subtle: #e1e7f0;
  --border-light: #e6ebf5;
  --border-chip: #dfe5f7;
  --border-glass: rgba(255, 255, 255, 0.3);
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.14);
  --accent-soft-strong: rgba(59, 130, 246, 0.14);
  --accent-shadow: rgba(37, 99, 235, 0.24);
  --accent-shadow-strong: rgba(37, 99, 235, 0.3);
  --accent-shadow-intense: rgba(37, 99, 235, 0.36);
  --button-primary-start: #0f1c3f;
  --button-primary-end: #1f3c8a;
  --button-primary-hover-start: #142550;
  --button-primary-hover-end: #2850a3;
  --button-primary-active-start: #0c1a3a;
  --button-primary-active-end: #1b3478;
  --auth-submit-bg: #0b1b37;
  --success: #16a34a;
  --success-strong: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --success-soft-strong: rgba(34, 197, 94, 0.35);
  --success-border: rgba(34, 197, 94, 0.6);
  --danger: #dc2626;
  --danger-strong: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --danger-soft-strong: rgba(239, 68, 68, 0.35);
  --danger-border: rgba(239, 68, 68, 0.55);
  --warning: #d97706;
  --warning-strong: #f59e0b;
  --warning-soft: rgba(234, 179, 8, 0.18);
  --warning-border: rgba(234, 179, 8, 0.6);
  --neutral-border: rgba(148, 163, 184, 0.6);
  --info: #0ea5e9;
  --info-soft: rgba(14, 165, 233, 0.2);
  --info-border: rgba(59, 130, 246, 0.4);
  --funny: #c026d3;
  --funny-border: rgba(236, 72, 153, 0.4);
  --vote-up: #4ade80;
  --vote-down: #f87171;
  --tag-bg: rgba(59, 130, 246, 0.14);
  --tag-text: #1d4ed8;
  --avatar-grad-1: #fdf2f8;
  --avatar-grad-2: #e0f2fe;
  --avatar-initials-bg: #e0e7ff;
  --focus-ring: #2563eb;
  --shadow: none;
  --shadow-soft: none;
  --shadow-pop: none;
  --shadow-card: none;
  --shadow-strong: none;
  --shadow-subtle: none;
  --shadow-highlight: none;
  --shadow-accent: none;
  --shadow-accent-strong: none;
  --shadow-accent-intense: none;
  --shadow-button: none;
  --shadow-button-hover: none;
  --shadow-button-hover-strong: none;
  --shadow-topbar: none;
  --shadow-success: none;
  --shadow-danger: none;
  --shadow-warning: none;
  --shadow-neutral: none;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --topbar-shadow: none;
  --dm-list-bg: var(--surface-muted);
  --dm-form-bg: var(--surface);
  --dm-own-bg: rgba(37, 99, 235, 0.1);
  --dm-own-border: rgba(37, 99, 235, 0.2);
  --dm-own-text: #0b1b37;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-glow-1: rgba(59, 130, 246, 0.18);
  --bg-glow-2: rgba(15, 23, 42, 0.6);
  --surface: #0f172a;
  --surface-muted: #111827;
  --surface-subtle: #101827;
  --surface-strong: #1f2937;
  --surface-contrast: #0f1b2d;
  --surface-highlight: #0c162a;
  --surface-soft: #0c162a;
  --surface-elevated: #101a2f;
  --surface-emboss: #0b1220;
  --surface-input: #0f172a;
  --surface-profile: #0f172a;
  --profile-surface: var(--surface);
  --text: #e2e8f0;
  --text-muted: #9aa4b2;
  --text-subtle: #94a3b8;
  --text-faint: #64748b;
  --text-strong: #e2e8f0;
  --text-inverse: #0b1220;
  --text-accent: #93c5fd;
  --border: #1f2937;
  --border-strong: #2d3748;
  --border-muted: #263143;
  --border-subtle: #243142;
  --border-light: #1f2a3a;
  --border-chip: #1f2a44;
  --border-glass: rgba(255, 255, 255, 0.12);
  --accent: #60a5fa;
  --accent-strong: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --accent-soft-strong: rgba(59, 130, 246, 0.25);
  --accent-shadow: rgba(59, 130, 246, 0.35);
  --accent-shadow-strong: rgba(59, 130, 246, 0.45);
  --accent-shadow-intense: rgba(59, 130, 246, 0.5);
  --button-primary-start: #1f2a44;
  --button-primary-end: #27407a;
  --button-primary-hover-start: #233055;
  --button-primary-hover-end: #2c4b95;
  --button-primary-active-start: #1a253f;
  --button-primary-active-end: #223a70;
  --auth-submit-bg: #1f2937;
  --success: #34d399;
  --success-strong: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.22);
  --success-soft-strong: rgba(34, 197, 94, 0.35);
  --success-border: rgba(34, 197, 94, 0.45);
  --danger: #f87171;
  --danger-strong: #ef4444;
  --danger-soft: rgba(248, 113, 113, 0.22);
  --danger-soft-strong: rgba(248, 113, 113, 0.35);
  --danger-border: rgba(248, 113, 113, 0.45);
  --warning: #fbbf24;
  --warning-strong: #f59e0b;
  --warning-soft: rgba(250, 204, 21, 0.22);
  --warning-border: rgba(250, 204, 21, 0.5);
  --neutral-border: rgba(148, 163, 184, 0.5);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.2);
  --info-border: rgba(59, 130, 246, 0.45);
  --funny: #f472b6;
  --funny-border: rgba(236, 72, 153, 0.45);
  --vote-up: #4ade80;
  --vote-down: #f87171;
  --tag-bg: rgba(59, 130, 246, 0.25);
  --tag-text: #bfdbfe;
  --avatar-grad-1: #1f2235;
  --avatar-grad-2: #0f172a;
  --avatar-initials-bg: #1e293b;
  --focus-ring: #60a5fa;
  --shadow: none;
  --shadow-soft: none;
  --shadow-pop: none;
  --shadow-card: none;
  --shadow-strong: none;
  --shadow-subtle: none;
  --shadow-highlight: none;
  --shadow-accent: none;
  --shadow-accent-strong: none;
  --shadow-accent-intense: none;
  --shadow-button: none;
  --shadow-button-hover: none;
  --shadow-button-hover-strong: none;
  --shadow-topbar: none;
  --shadow-success: none;
  --shadow-danger: none;
  --shadow-warning: none;
  --shadow-neutral: none;
  --topbar-bg: rgba(15, 23, 42, 0.9);
  --topbar-shadow: none;
  --dm-list-bg: var(--surface-muted);
  --dm-form-bg: var(--surface);
  --dm-own-bg: rgba(59, 130, 246, 0.18);
  --dm-own-border: rgba(59, 130, 246, 0.4);
  --dm-own-text: #e2e8f0;
  --surface-strong: #2a3649;
  --border-chip: #334155;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b1220;
    --bg-glow-1: rgba(59, 130, 246, 0.18);
    --bg-glow-2: rgba(15, 23, 42, 0.6);
    --surface: #0f172a;
    --surface-muted: #111827;
    --surface-subtle: #101827;
    --surface-strong: #1f2937;
    --surface-contrast: #0f1b2d;
    --surface-highlight: #0c162a;
    --surface-soft: #0c162a;
    --surface-elevated: #101a2f;
    --surface-emboss: #0b1220;
    --surface-input: #0f172a;
    --surface-profile: #0f172a;
    --profile-surface: var(--surface);
    --text: #e2e8f0;
    --text-muted: #9aa4b2;
    --text-subtle: #94a3b8;
    --text-faint: #64748b;
    --text-strong: #e2e8f0;
    --text-inverse: #0b1220;
    --text-accent: #93c5fd;
    --border: #1f2937;
    --border-strong: #2d3748;
    --border-muted: #263143;
    --border-subtle: #243142;
    --border-light: #1f2a3a;
    --border-chip: #1f2a44;
    --border-glass: rgba(255, 255, 255, 0.12);
    --accent: #60a5fa;
    --accent-strong: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.18);
    --accent-soft-strong: rgba(59, 130, 246, 0.25);
    --accent-shadow: rgba(59, 130, 246, 0.35);
    --accent-shadow-strong: rgba(59, 130, 246, 0.45);
    --accent-shadow-intense: rgba(59, 130, 246, 0.5);
    --button-primary-start: #1f2a44;
    --button-primary-end: #27407a;
    --button-primary-hover-start: #233055;
    --button-primary-hover-end: #2c4b95;
    --button-primary-active-start: #1a253f;
    --button-primary-active-end: #223a70;
    --auth-submit-bg: #1f2937;
    --success: #34d399;
    --success-strong: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.22);
    --success-soft-strong: rgba(34, 197, 94, 0.35);
    --success-border: rgba(34, 197, 94, 0.45);
    --danger: #f87171;
    --danger-strong: #ef4444;
    --danger-soft: rgba(248, 113, 113, 0.22);
    --danger-soft-strong: rgba(248, 113, 113, 0.35);
    --danger-border: rgba(248, 113, 113, 0.45);
    --warning: #fbbf24;
    --warning-strong: #f59e0b;
    --warning-soft: rgba(250, 204, 21, 0.22);
    --warning-border: rgba(250, 204, 21, 0.5);
    --neutral-border: rgba(148, 163, 184, 0.5);
    --info: #38bdf8;
    --info-soft: rgba(56, 189, 248, 0.2);
    --info-border: rgba(59, 130, 246, 0.45);
    --funny: #f472b6;
    --funny-border: rgba(236, 72, 153, 0.45);
    --vote-up: #4ade80;
    --vote-down: #f87171;
    --tag-bg: rgba(59, 130, 246, 0.25);
    --tag-text: #bfdbfe;
    --avatar-grad-1: #1f2235;
    --avatar-grad-2: #0f172a;
    --avatar-initials-bg: #1e293b;
    --focus-ring: #60a5fa;
    --shadow: none;
    --shadow-soft: none;
    --shadow-pop: none;
    --shadow-card: none;
    --shadow-strong: none;
    --shadow-subtle: none;
    --shadow-highlight: none;
    --shadow-accent: none;
    --shadow-accent-strong: none;
    --shadow-accent-intense: none;
    --shadow-button: none;
    --shadow-button-hover: none;
    --shadow-button-hover-strong: none;
    --shadow-topbar: none;
    --shadow-success: none;
    --shadow-danger: none;
    --shadow-warning: none;
    --shadow-neutral: none;
    --topbar-bg: rgba(15, 23, 42, 0.9);
    --topbar-shadow: none;
    --dm-list-bg: var(--surface-muted);
    --dm-form-bg: var(--surface);
    --dm-own-bg: rgba(59, 130, 246, 0.18);
    --dm-own-border: rgba(59, 130, 246, 0.4);
    --dm-own-text: #e2e8f0;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  zoom: var(--ui-scale);
}

@supports not (zoom: 1) {
  body {
    zoom: 1;
    transform: scale(var(--ui-scale));
    transform-origin: top left;
    width: calc(100% / var(--ui-scale));
    min-height: calc(100vh / var(--ui-scale));
  }
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--text-muted);
}

a {
  color: inherit;
}

.auto-link {
  display: inline-flex;
  align-items: flex-start;
  color: var(--accent-strong);
  text-decoration: none;
  word-break: break-word;
  max-width: 100%;
}

.auto-link:hover {
  color: var(--accent);
}

.auto-link__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.auto-link__host {
  font-size: 11px;
  line-height: 1.15;
  opacity: 0.78;
  letter-spacing: 0.02em;
}

.auto-link__label {
  display: inline-block;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--text-inverse);
  text-decoration: none;
  font-weight: 600;
  box-shadow: none;
}

.primary-link--small {
  padding: 10px 14px;
  font-size: 14px;
}

.primary-link:hover {
  transform: translateY(-1px);
}

.inline-link {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  text-transform: uppercase;
  text-decoration: none;
}

.topbar__brand.hot-takes-brand {
  text-transform: none;
  letter-spacing: 0;
  gap: 10px;
}

.topbar__brand.hot-takes-brand::before {
  content: none;
}

.topbar__brand.hot-takes-brand .hot-takes-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: url("/favicon.png") center/contain no-repeat;
  flex-shrink: 0;
  display: inline-block;
}

.topbar__brand.hot-takes-brand img {
  width: 18px;
  height: 18px;
  display: block;
}

.direct-page .topbar__brand {
  white-space: nowrap;
}

.topbar__brand::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: url("/favicon.png") center/contain no-repeat;
  flex-shrink: 0;
}

.topbar__tagline {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schools-profile-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.schools-profile-trigger {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.schools-profile-trigger img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.schools-profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  max-width: min(92vw, 320px);
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  z-index: 120;
  transition: opacity 160ms ease, transform 160ms ease;
}

.schools-profile-menu:hover .schools-profile-dropdown,
.schools-profile-menu:focus-within .schools-profile-dropdown,
.schools-profile-menu.is-open .schools-profile-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.schools-profile-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-muted);
}

.schools-profile-identity__name {
  font-weight: 700;
  line-height: 1.2;
}

.schools-profile-role-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border-subtle);
  background: var(--surface-strong);
  color: var(--text-muted);
}

.schools-profile-stats {
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
}

.schools-profile-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.schools-profile-stat strong {
  color: var(--text);
  font-weight: 700;
}

.schools-profile-item {
  width: 100%;
  justify-content: center;
  font-weight: 600;
}

.schools-profile-avatar-row {
  align-items: flex-start;
}

.topbar__quick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-user-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar-menu {
  position: relative;
  display: inline-flex;
}

.avatar-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-muted);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.avatar-menu__identity {
  padding: 4px 6px 6px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-muted);
  white-space: nowrap;
}

.avatar-menu.is-open .avatar-menu__dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.avatar-menu__item {
  justify-content: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.avatar-menu__stats {
  display: grid;
  gap: 4px;
  padding: 4px 2px 6px;
  border-bottom: 1px solid var(--border-muted);
}

.avatar-menu__stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
}

.avatar-menu__stat strong {
  color: var(--text);
  font-weight: 600;
}

#topbar-action.topbar-avatar {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  text-decoration: none;
  overflow: hidden;
}

#topbar-action.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#topbar-action.topbar-avatar .avatar-initials {
  font-size: 13px;
}

.topbar #logout-nav {
  display: none;
}

.direct-page .topbar__actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.direct-page .topbar__actions > * {
  white-space: nowrap;
}

.direct-page .pill {
  padding: 4px 8px;
  font-size: 12px;
}

.topbar__alerts {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.alert-pill {
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
}

.alert-pill--action {
  position: relative;
  width: auto;
  height: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
}

.alert-pill--action svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
}

.alert-dot {
  position: absolute;
  top: 2px;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
  border: 2px solid var(--topbar-bg);
  pointer-events: none;
}

.alert-dot.is-hidden {
  display: none;
}

.dm-thread-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dm-thread-title {
  flex: 1 1 auto;
  min-width: 0;
}

.dm-thread-header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.dm-thread-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dm-thread-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.dm-thread-position {
  font-size: 14px;
}

.dm-share-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
}

.dm-share-wrap .icon-button svg {
  width: 1em;
  height: 1em;
}

.dm-share-wrap .share-toast {
  top: calc(100% + 6px);
  right: auto;
  left: 0;
}

.alert-dropdown-wrap {
  position: relative;
}

.alert-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  z-index: 20;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid transparent;
}

.alert-dropdown a {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.alert-link {
  font-weight: 600;
}

.alert-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.alert-kind {
  font-size: 12px;
  color: var(--text-muted);
}

.alert-countdown {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.alert-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.alert-item:hover {
  border-color: var(--border);
}

.topbar__status {
  font-size: 12px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--accent-strong);
}

.lede {
  font-size: 16px;
}

.layout {
  max-width: 1380px;
  margin: 0 auto 64px;
  padding: 16px 24px 0;
  display: grid;
  gap: 24px;
}

.layout--full {
  max-width: 1472px;
}

.layout--narrow {
  max-width: 1035px;
}

.grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.dm-grid {
  grid-template-columns: minmax(360px, 1.2fr) minmax(320px, 1fr);
}

@media (max-width: 980px) {
  .dm-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-muted);
  border-radius: 18px;
  padding: 22px;
  box-shadow: none;
}

.card.highlight {
  border-color: var(--accent-soft);
  background: var(--surface-highlight);
}

.recommended-card {
  cursor: pointer;
  min-height: 0;
  display: block;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assignment-due-action,
.due-date-picker-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assignment-due-action svg,
.due-date-picker-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.due-date-field {
  gap: 8px;
}

.due-date-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.assignment-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-soft);
}

.assignment-view-toggle__button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.assignment-view-toggle__button:hover {
  color: var(--text);
}

.assignment-view-toggle__button.is-active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.schools-login-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.response-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select-field {
  border: 1px solid var(--border-subtle);
  background: var(--surface-input);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}

[data-theme="dark"] .select-field {
  background: #e2e8f0;
  border-color: #cbd5f5;
  color: #0b1220;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .select-field {
    background: #e2e8f0;
    border-color: #cbd5f5;
    color: #0b1220;
  }
}

.response-group-label {
  margin: 12px 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dm-notice {
  margin-top: 10px;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding-right: 48px;
}

.dm-notice-actions {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
}

.dm-notice-copy {
  padding: 0;
}

.dm-notice-copy svg {
  width: 14px;
  height: 14px;
}

.dm-notice-toast {
  right: 0;
  left: auto;
}

.dm-notice-tag {
  background: var(--surface-strong);
  border: 1px solid var(--border-subtle);
  color: var(--text-accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

.pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text-accent);
  font-size: 13px;
}

.card h2,
.card h3 {
  margin-bottom: 4px;
}

.hot-takes-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hot-takes-title {
  margin: 0;
}

.hot-takes-logo {
  width: 32px;
  height: 32px;
  display: block;
}

.topic-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 4px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.topic-chip input {
  margin: 0;
}

.topic-chip input:checked + span {
  color: var(--accent-strong);
  font-weight: 600;
}

.topic-chip input:disabled + span {
  color: var(--text-faint);
}

.stretch {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.stack {
  display: grid;
  gap: 10px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.auth-page {
  background: var(--bg);
}

#social-login {
  border: 1px dashed var(--border);
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-muted);
}

#google-login > div {
  width: 100% !important;
  justify-content: center;
}

.auth-shell {
  min-height: 100vh;
  max-width: 598px;
  margin: 0 auto;
  padding: 56px 16px 64px;
  display: grid;
  gap: 16px;
  align-items: start;
}

.auth-logout {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  padding: 10px 14px;
}

.auth-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 700;
  box-shadow: none;
  border: 1px solid var(--border-glass);
  transition: transform 150ms ease;
}

.auth-home::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: url("/favicon.png") center/contain no-repeat;
  flex-shrink: 0;
}

.auth-home:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.admin-entry {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
}

.admin-mode-toggle {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-mode-toggle.is-active {
  background: var(--danger-soft-strong);
  color: var(--danger);
}

.admin-logout-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.admin-logout-button:hover {
  transform: translateY(-1px);
}

.admin-mode .topbar__actions > * {
  display: none !important;
}

.admin-mode .topbar__actions #admin-mode-toggle {
  display: inline-flex !important;
}

.admin-mode .topbar__actions #admin-logout-button {
  display: inline-flex !important;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: none;
}

.mode-shell {
  max-width: 828px;
}

.mode-options {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.mode-option {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
  box-shadow: none;
}

.mode-option h3 {
  margin: 0 0 6px;
}

.mode-option p {
  margin: 0;
  color: var(--text-muted);
}

.mode-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-card--secondary {
  border-color: var(--border-light);
  background: var(--surface-soft);
  box-shadow: none;
}

.auth-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-emboss);
  box-shadow: none;
}

.auth-title {
  text-align: center;
  margin-bottom: 8px;
  font-size: 30px;
}

.auth-subtitle,
.auth-status {
  text-align: center;
  margin: 0 0 14px;
  color: var(--text-muted);
}

.auth-status {
  font-size: 14px;
}

.auth-social {
  margin-bottom: 6px;
}

.auth-card #social-login {
  border: 1px solid var(--border-subtle);
  background: var(--surface-input);
  padding: 14px;
}

.google-slot {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-form {
  margin-top: 6px;
}

.field {
  display: grid;
  gap: 6px;
}

.field + .field {
  margin-top: 8px;
}

.field-label {
  font-weight: 600;
  color: var(--text);
}

.input-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-input);
  border-radius: 12px;
  padding: 12px 14px;
}

.input-icon {
  color: var(--text-subtle);
  display: inline-flex;
}

.password-toggle-container {
  position: relative;
}

.input-field.password-toggle-container {
  gap: 8px;
}

.input-field.password-toggle-container input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
}

.password-toggle-plain {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-toggle-plain input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 44px;
}

.password-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-subtle);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.password-toggle-btn:hover {
  color: var(--text);
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle-plain .password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.input-field input {
  border: none;
  background: transparent;
  padding: 0;
  width: 100%;
}

.auth-card .primary {
  width: 100%;
}

.auth-submit {
  background: var(--auth-submit-bg);
  box-shadow: var(--shadow-button-hover);
  border: none;
  color: var(--text-inverse);
  padding: 13px 16px;
  border-radius: 12px;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-button-hover-strong);
}

.ghost-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-subtle);
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
}

.auth-links a {
  text-decoration: none;
}

.small {
  font-size: 14px;
}

.auth-card .form-message {
  min-height: 18px;
}

.profile-avatar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface-emboss);
  box-shadow: none;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
}

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

.avatar-large {
  width: 96px;
  height: 96px;
  font-size: 22px;
}

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

.profile-header {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.profile-name h2 {
  margin: 0;
}

.profile-name p {
  margin: 2px 0;
}

.profile-fields {
  display: grid;
  gap: 10px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.profile-label {
  font-weight: 700;
}

.profile-value {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-value input {
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 10px;
}

.profile-value input:focus {
  outline: 2px solid var(--focus-ring);
  background: var(--surface-profile);
}

.link-btn {
  border: none;
  background: none;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 16px;
}

.ghost-small {
  padding: 8px 12px;
  border-radius: 8px;
}

.topbar button.ghost {
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-field {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.edit-field input {
  width: 100%;
  padding-right: 44px;
  position: relative;
  z-index: 1;
}

.edit-field-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  z-index: 2;
}

.edit-field-btn:hover:not(:disabled) {
  background: var(--surface-strong);
  border-color: var(--border);
  color: var(--text);
}

.edit-field-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.7);
}

.modal-card {
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.due-date-modal-card {
  width: min(460px, 92vw);
}

.due-date-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.embed-snippet {
  display: grid;
  gap: 10px;
}

.embed-snippet textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
}

.embed-page #share-thread,
.embed-page #embed-thread {
  display: none;
}

.embed-page .layout--full {
  padding-top: 24px;
}

.admin-page {
  background: var(--bg);
  color: var(--text);
}

.admin-gate {
  max-width: 598px;
  margin: 40px auto;
}

.admin-dashboard {
  margin-top: 24px;
  display: grid;
  gap: 18px;
}

.admin-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.admin-search-controls {
  display: grid;
  gap: 12px;
}

.admin-results {
  display: grid;
  gap: 14px;
}

.admin-result-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface);
  display: grid;
  gap: 12px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.admin-embed {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.admin-empty {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px dashed var(--border);
}

.admin-json {
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  overflow-x: auto;
  margin: 0;
}

.admin-audit {
  display: grid;
  gap: 12px;
}

.admin-audit__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-audit__list {
  display: grid;
  gap: 10px;
}

.admin-audit-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface-soft);
}

.admin-audit-meta {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row button {
  flex: 1;
}

input,
textarea,
button,
.stance-options label {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  background: transparent;
  appearance: auto;
}

textarea {
  resize: vertical;
}

.reply-input {
  display: inline-block;
  width: auto;
  min-width: 18ch;
  max-width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 6px 2px;
  font: inherit;
  transition: border-color 120ms ease, background 120ms ease, width 120ms ease;
}

.reply-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}

input:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
  color: var(--text);
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.primary {
  background: var(--button-primary-end);
  box-shadow: none;
  color: var(--text-inverse);
}

button.primary:hover:not(:disabled) {
  background: var(--button-primary-hover-end);
  box-shadow: none;
}

button.primary:active:not(:disabled) {
  background: var(--button-primary-active-end);
}

button.primary.is-success {
  background: var(--success-strong);
  box-shadow: none;
  color: var(--text-inverse);
}

#thread-form button.primary,
#response-form button.primary,
#dm-stance-form button.primary,
#dm-message-form button.primary {
  background: var(--accent);
  box-shadow: none;
}

#thread-form button.primary:hover:not(:disabled),
#response-form button.primary:hover:not(:disabled),
#dm-stance-form button.primary:hover:not(:disabled),
#dm-message-form button.primary:hover:not(:disabled) {
  background: var(--accent-strong);
  box-shadow: none;
}

#thread-form button.primary:active:not(:disabled),
#response-form button.primary:active:not(:disabled),
#dm-stance-form button.primary:active:not(:disabled),
#dm-message-form button.primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: none;
}

button.ghost {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.icon-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  border-radius: 50%;
}

.thread-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.search-input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  min-width: 220px;
  font: inherit;
}

[data-theme="dark"] .search-input {
  background: #1f2937;
  border-color: #3b4a62;
  color: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .search-input {
    background: #1f2937;
    border-color: #3b4a62;
    color: #e5e7eb;
  }
}

.thread-card {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border-muted);
  background: var(--surface);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease;
  box-shadow: none;
}

.dm-card {
  position: relative;
}

.thread-card:hover,
.thread-card.active {
  border-color: var(--accent);
  box-shadow: none;
  transform: translateY(-3px);
}

.debate-card h3 {
  margin: 0 0 6px;
}

.debate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.debate-header h3 {
  flex: 1 1 auto;
  min-width: 0;
}

.debate-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.debate-topics {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.debate-topics.is-stacked {
  flex-direction: column;
  align-items: flex-end;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  position: relative;
}

.thread-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.embed-button {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.debate-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.thread-meta-actions .muted {
  white-space: nowrap;
}

.icon-button {
  width: auto;
  height: auto;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}

.icon-button svg {
  width: 28px;
  height: 28px;
  display: block;
}

.icon-button:hover {
  transform: translateY(-1px);
}

.share-toast {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border-muted);
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.debate-pill {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid var(--border-chip);
  white-space: nowrap;
}

.debate-desc {
  margin-bottom: 10px;
}

.leaderboard-card .debate-footer {
  justify-content: flex-start;
}

.debate-progress {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border-light);
  margin: 8px 0;
}

.debate-progress .segment {
  display: block;
  height: 100%;
}

.debate-progress .agree {
  background: var(--success-strong);
}

.debate-progress .neutral {
  background: var(--warning-strong);
}

.debate-progress .disagree {
  background: var(--danger-strong);
}

.debate-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.debate-stats .agree {
  color: var(--success);
}
.debate-stats .neutral {
  color: var(--warning-strong);
}
.debate-stats .disagree {
  color: var(--danger);
}

.debate-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.stance-meter {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.stance-meter-wrap {
  position: relative;
}

.impact-toast {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -60%) scale(0.98);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-contrast);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 3;
}

.impact-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -80%) scale(1);
}

.impact-toast.is-agree {
  background: var(--success-strong);
  border-color: rgba(15, 118, 51, 0.85);
  color: #0c1b12;
}

.impact-toast.is-disagree {
  background: var(--danger-strong);
  border-color: rgba(153, 27, 27, 0.85);
  color: #1f0a0a;
}

.stance-meter__bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.stance-meter__segment {
  height: 100%;
}

.stance-meter__segment.agree {
  background: var(--success-strong);
}

.stance-meter__segment.neutral {
  background: var(--warning-strong);
}

.stance-meter__segment.disagree {
  background: var(--danger-strong);
}

.stance-meter__labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.stance-meter__labels span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stance-meter__labels .agree {
  color: var(--success);
}

.stance-meter__labels .neutral {
  color: var(--warning-strong);
}

.stance-meter__labels .disagree {
  color: var(--danger);
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.badge.award-action {
  cursor: pointer;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font: inherit;
  line-height: 1;
  appearance: none;
}

.badge.award-action:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
}

.badge.award-action.active {
  border-color: var(--accent);
  color: var(--text);
}

.stance-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stance-options label {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  column-gap: 8px;
  flex: 1 1 160px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  position: relative;
}

.stance-options label input {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: transparent;
  opacity: 0.7;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}

.stance-options label input:checked {
  background: currentColor;
  box-shadow: none;
  opacity: 1;
}

.stance-options label span {
  white-space: nowrap;
}

.stance-options label.agree {
  background: var(--success-soft);
  border-color: var(--success-soft-strong);
  color: var(--success);
}

.stance-options label.neutral {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-strong);
}

.stance-options label.disagree {
  background: var(--danger-soft);
  border-color: var(--danger-soft-strong);
  color: var(--danger);
}

.response-list {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.thread-page .response-list {
  grid-template-columns: 1fr;
}

.response-card {
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-contrast);
  position: relative;
}

.response-card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.response-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.vote-btn.active-up,
.vote-btn.active-agree {
  border-color: var(--vote-up);
  color: var(--vote-up);
}

.vote-btn.active-down,
.vote-btn.active-disagree {
  border-color: var(--vote-down);
  color: var(--vote-down);
}

.vote-btn.active-neutral {
  border-color: var(--warning-border);
  color: var(--warning-strong);
}

.vote-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.response-card .stance {
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: capitalize;
}

.stance-agree {
  background: var(--success-soft);
  color: var(--success);
}

.stance-third {
  background: var(--warning-soft);
  color: var(--warning-strong);
}

.stance-disagree {
  background: var(--danger-soft);
  color: var(--danger);
}

.tag-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 600;
  font-size: 12px;
}

.award-row {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.award-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.award-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chip-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 13px;
}

.chip-btn.active,
.chip-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.chip-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.badge.award-reasoning {
  border-color: var(--info-border);
  color: var(--text-accent);
}

.badge.award-funny {
  border-color: var(--funny-border);
  color: var(--funny);
}

.badge.award-researched {
  border-color: var(--info-border);
  color: var(--info);
}

.reply-controls {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.reply-form {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface-muted);
}

.reply-form.inline {
  display: grid;
  gap: 8px;
}

.reply-form.inline input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: var(--surface);
}

.reply-actions {
  display: flex;
  gap: 8px;
}

.reply-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.reply-thread {
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

.reply-action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reply-form.nested {
  background: var(--surface-strong);
}

.reply-card {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.muted {
  color: var(--text-muted);
}

.form-message {
  min-height: 18px;
  font-size: 14px;
}
.form-message.ok {
  color: var(--success);
}
.form-message.error {
  color: var(--danger);
}

.profile-summary {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-muted);
  display: grid;
  gap: 4px;
}

.profile-summary strong {
  color: var(--text);
}

.footer {
  padding: 32px 24px 48px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .layout {
    padding: 0 16px;
  }

  .stretch {
    min-height: auto;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .thread-list {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

}

@media (min-width: 721px) {
  .topbar {
    justify-content: flex-start;
  }

  .topbar__actions {
    margin-left: auto;
  }

  .topbar__quick {
    margin-left: 8px;
  }
}
.comment-card {
  border: 1px solid var(--border-muted);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-subtle);
}

.dm-card .debate-footer {
  margin-top: 6px;
}

.dm-hero {
  display: grid;
  gap: 16px;
}

.dm-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.dm-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-muted);
}

.dm-step h4 {
  margin: 0 0 4px;
}

.dm-step__number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--text-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.dm-thread-card .comment-body {
  margin-bottom: 4px;
}

.profile-page .dm-thread-card {
  cursor: pointer;
}

.dm-thread-card.dm-outcome-win {
  border-color: var(--success-border);
  box-shadow: none;
}

.dm-thread-card.dm-outcome-loss {
  border-color: var(--danger-border);
  box-shadow: none;
}

.dm-thread-card.dm-outcome-draw {
  border-color: var(--warning-border);
  box-shadow: none;
}

.dm-thread-card.dm-outcome-undecided {
  border-color: var(--neutral-border);
  box-shadow: none;
}

.dm-thread-card.is-own {
  border-color: var(--accent);
  box-shadow: none;
  position: relative;
}

.dm-thread-card.is-own::after {
  content: "Your challenge";
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-inverse);
  background: var(--accent-strong);
  border-radius: 999px;
  padding: 4px 8px;
}

.dm-thread-card .dm-own-tag {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-inverse);
  background: var(--accent-strong);
}

.dm-outcome {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-muted);
  display: grid;
  gap: 10px;
}

.dm-vote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dm-vote-section {
  display: grid;
  gap: 8px;
}

.info-pop {
  position: relative;
}

.info-pop summary {
  list-style: none;
}

.info-pop summary::-webkit-details-marker {
  display: none;
}

.info-button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
}

.info-panel {
  position: absolute;
  right: 0;
  top: 34px;
  width: min(320px, 80vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-muted);
}

#dm-thread-panel {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

#dm-thread-panel.has-rubric-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

#dm-thread-panel.has-rubric-open .dm-thread-header {
  grid-column: 1 / -1;
}

#dm-thread-panel.is-review-mode {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

#dm-thread-panel.is-review-mode .dm-thread-header,
#dm-thread-panel.is-review-mode .dm-judge-panel {
  grid-column: 1 / -1;
}

.dm-thread-rubric-panel {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-elevated);
  padding: 12px;
  max-height: calc((100dvh / var(--ui-scale)) - 170px);
  overflow: auto;
  position: sticky;
  top: 10px;
}

.dm-thread-rubric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.dm-thread-rubric-head h4 {
  margin: 0;
}

#dm-thread-rubric-grid .rubric-grid-scroll {
  max-height: none;
}

.dm-judge-panel {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-elevated);
  padding: 12px;
}

.dm-thread-battle-column,
.dm-thread-review-sidebar {
  min-width: 0;
}

.dm-thread-review-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

#dm-thread-panel.is-review-mode .dm-thread-review-sidebar {
  position: sticky;
  top: 10px;
  max-height: calc((100dvh / var(--ui-scale)) - 170px);
  overflow: auto;
  padding-right: 4px;
}

.dm-thread-review-summary,
.dm-thread-grade-panel {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-elevated);
  padding: 12px;
}

.dm-thread-review-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--surface-contrast);
}

.dm-thread-review-card.is-active {
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px rgba(31, 78, 121, 0.12);
}

.dm-thread-review-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dm-thread-review-card__copy {
  display: grid;
  gap: 4px;
}

.dm-thread-review-card__copy p {
  margin: 0;
}

.dm-thread-review-card__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#dm-message-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 80vh;
  height: 80vh;
  overflow-y: auto;
  padding: 4px;
  border-radius: 14px;
  background: var(--dm-list-bg);
}

.dm-message-card {
  max-width: 50%;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-pop);
  position: relative;
  align-self: flex-start;
  padding: 8px 10px;
}

.dm-message-card .comment-head {
  align-items: flex-start;
}

.dm-message-card .comment-avatar {
  width: 30px;
  height: 30px;
}

.dm-message-card .comment-body {
  font-size: 13px;
  line-height: 1.35;
}

.dm-message-card .comment-meta {
  gap: 0;
}

.dm-message-type-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--tag-bg);
  color: var(--tag-text);
  margin: 6px 0 4px;
}

.dm-message-card .comment-author {
  font-size: 12px;
  color: var(--text);
}

.dm-message-card .dm-timestamp {
  font-size: 10px;
  color: var(--text-subtle);
  text-align: right;
  margin-top: 4px;
}

.dm-message-card.is-grouped .comment-head {
  display: none;
}

.dm-message-card.is-grouped {
  margin-top: -4px;
  padding-top: 6px;
}

.dm-message-card.is-group-start {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.dm-message-card.is-group-end {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.dm-message-card.is-own {
  background: var(--dm-own-bg);
  border-color: var(--dm-own-border);
}

.dm-message-card.is-challenger {
  align-self: flex-end;
}

@media (max-width: 720px) {
  .dm-message-card {
    max-width: 100%;
  }
}

.dm-message-card.is-own .comment-author span {
  color: var(--text-accent);
}

.tag-you {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--tag-bg);
  color: var(--tag-text);
  margin-left: 6px;
}

.dm-message-card.is-own .comment-body {
  color: var(--dm-own-text);
}

.dm-message-feedback-wrap {
  margin-top: 10px;
}

.dm-message-feedback-editor-slot {
  margin-top: 10px;
}

.dm-feedback-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(30, 64, 175, 0.06);
}

.dm-feedback-block--teacher {
  background: rgba(176, 114, 24, 0.08);
}

.dm-feedback-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dm-feedback-block__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dm-feedback-block__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 700;
}

.dm-feedback-block__body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.dm-feedback-block__body p,
.dm-feedback-block__body ul {
  margin: 0;
}

.dm-feedback-block__body ul {
  padding-left: 18px;
}

.dm-feedback-block__time {
  font-size: 12px;
  color: var(--text-subtle);
}

.dm-feedback-editor {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-contrast);
}

.feedback-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-toolbar .ghost-button {
  min-width: 44px;
}

.dm-thread-feedback {
  margin-top: 10px;
}

.dm-feedback-thread-card {
  display: grid;
  gap: 14px;
}

.dm-feedback-thread-card__entry {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--surface-contrast);
}

.dm-feedback-thread-card__source {
  display: grid;
  gap: 4px;
}

.dm-feedback-thread-card__source-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

#dm-message-form {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: var(--dm-form-bg);
  border-top: 1px solid var(--border);
}

#dm-message-form .dm-message-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

#dm-message-form .dm-message-type {
  flex: 0 0 140px;
}

#dm-message-form .dm-message-type select {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
}

#dm-message-form .dm-message-body {
  flex: 1 1 auto;
}

#dm-message-form .dm-message-body textarea {
  width: 100%;
  min-height: 56px;
}

#dm-message-form .dm-send-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: var(--text-inverse);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

@media (max-width: 720px) {
  #dm-message-form .dm-message-row {
    flex-direction: column;
    align-items: stretch;
  }

  #dm-message-form .dm-message-type {
    flex: 1 1 auto;
  }

  #dm-message-form .dm-send-btn {
    align-self: flex-end;
  }
}

@media (max-width: 1100px) {
  #dm-thread-panel.is-review-mode,
  #dm-thread-panel.has-rubric-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .dm-thread-rubric-panel {
    position: static;
    max-height: none;
  }

  #dm-thread-panel.is-review-mode .dm-thread-review-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

.comment-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-head-actions {
  margin-left: auto;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar-initials-bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  overflow: hidden;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-initials {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: var(--text);
  background: var(--avatar-initials-bg);
  letter-spacing: 0.02em;
}

.comment-meta {
  display: grid;
  gap: 2px;
}

.comment-author {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.comment-sub {
  font-size: 12px;
  color: var(--text-subtle);
}

.comment-stance {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text-accent);
  font-size: 12px;
  text-transform: capitalize;
}

.comment-body {
  margin: 8px 0 6px;
  color: var(--text);
}

.comment-body.deleted {
  font-style: italic;
  color: var(--text-faint);
  letter-spacing: 0.01em;
  font-weight: 600;
}

.schools-action-menu {
  position: relative;
  display: inline-flex;
}

.schools-action-menu__trigger {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--text-subtle);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
}

.schools-action-menu__trigger:hover,
.schools-action-menu__trigger:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

.schools-action-menu__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  display: none;
  z-index: 40;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  box-shadow: 0 12px 28px rgba(5, 8, 20, 0.28);
}

.schools-action-menu.is-open .schools-action-menu__dropdown {
  display: grid;
  gap: 4px;
}

.schools-action-menu__item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
}

.schools-action-menu__item:hover:not(:disabled) {
  border-color: var(--border-subtle);
  background: var(--surface-soft);
}

.schools-action-menu__item.danger {
  color: var(--danger);
}

.comment-actions,
.comment-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.comment-btn {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
}

.comment-btn.vote-btn {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.comment-btn.link-btn {
  border: none;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
}

.comment-btn.danger {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.comment-btn.danger:hover:not(:disabled) {
  background: var(--danger-soft-strong);
  border-color: var(--danger-border);
  color: var(--danger);
}

.comment-btn.link-btn.danger {
  color: var(--danger);
}

.reply-list {
  margin-left: 32px;
  display: grid;
  gap: 10px;
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

.reply-thread {
  display: grid;
  gap: 6px;
}

.reply-card {
  background: var(--surface);
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  padding: 10px;
}

@media (max-width: 820px) {
  .topbar {
    padding: 8px 12px;
  }

  .topbar__actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar__brand {
    font-size: 14px;
    padding: 6px 10px;
  }

  .layout {
    padding: 12px 16px 0;
    gap: 16px;
  }

  .card {
    padding: 18px;
  }

  .card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card__actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-input,
  .select-field {
    font-size: 14px;
  }

  .primary-link,
  .ghost,
  .pill {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }

  .thread-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .thread-meta-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .share-toast {
    right: auto;
    left: 0;
  }

  .topbar__actions {
    gap: 6px;
  }

  .topbar__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .topbar__actions::before,
  .topbar__actions::after {
    content: "";
    flex-basis: 100%;
  }

  .topbar__actions::before {
    order: 5;
  }

  .topbar__actions::after {
    order: 8;
  }

  .threads-page .topbar {
    position: sticky;
    position: -webkit-sticky;
    position: relative;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .threads-page .topbar__brand {
    flex: 0 0 auto;
    width: fit-content;
    margin-right: 0;
    font-size: 13px;
    white-space: nowrap;
    max-width: none;
  }

  .threads-page .topbar__actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
  }

  .threads-page .topbar__actions::before {
    display: none;
  }

  .threads-page .topbar__actions::after {
    display: none;
  }

  .threads-page .topbar-user-stack {
    position: absolute;
    right: 12px;
    top: 12px;
  }

  .threads-page #theme-toggle {
    order: 1;
    justify-self: start;
  }

  .threads-page .mode-switch {
    order: 3;
    justify-self: end;
  }

  .threads-page #topbar-status {
    display: none;
  }

  .threads-page #logout-nav {
    order: 4;
    margin-left: 0;
    display: none;
  }

  .threads-page .topbar__actions .primary-link {
    order: 2;
    justify-self: center;
    width: auto;
    max-width: none;
  }

  .threads-page .topbar__alerts {
    order: 5;
    width: auto;
    flex: 0 0 auto;
  }

  .threads-page .topbar__alerts .alert-dropdown-wrap,
  .threads-page .topbar__alerts .alert-pill {
    width: auto;
    justify-content: center;
  }

  #theme-toggle {
    order: 1;
  }

  .mode-switch {
    order: 2;
  }

  #topbar-status {
    order: 3;
  }

  #logout-nav {
    order: 4;
    margin-left: auto;
  }

  .topbar__actions .primary-link {
    order: 6;
    flex: 1 1 45%;
    max-width: 48%;
    justify-content: center;
  }

  #topbar-action.topbar-avatar {
    flex: 0 0 auto;
    max-width: none;
  }

  .topbar__alerts {
    order: 9;
    width: auto;
  }

  .topbar__alerts .alert-dropdown-wrap,
  .topbar__alerts .alert-pill {
    width: auto;
    justify-content: center;
  }

  .direct-page .topbar__actions {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  .direct-page .topbar {
    position: relative;
  }

  .direct-page .avatar-menu {
    position: static;
    margin: 0;
  }

  .direct-page .avatar-menu__dropdown {
    right: 0;
    top: 52px;
  }

  .direct-page .topbar__actions::before,
  .direct-page .topbar__actions::after {
    content: "";
    flex-basis: 100%;
  }

  .direct-page .topbar__actions::before {
    order: 5;
  }

  .direct-page .topbar__actions::after {
    order: 9;
  }

  .direct-page #theme-toggle {
    order: 1;
  }

  .direct-page .mode-switch {
    order: 2;
  }

  .direct-page #topbar-status {
    order: 3;
  }

  .direct-page #logout-nav {
    order: 4;
    margin-left: auto;
  }

  .direct-page .topbar__actions .primary-link {
    order: 6;
    flex: 1 1 calc(50% - 6px);
    max-width: 50%;
    justify-content: center;
  }

  .direct-page .topbar__alerts {
    order: 10;
    width: auto;
  }

  .direct-page .alert-dropdown-wrap,
  .direct-page .topbar__alerts .alert-pill {
    width: auto;
    justify-content: center;
  }

  .threads-page .topbar-user-stack,
  .direct-page .topbar-user-stack {
    position: absolute;
    right: 12px;
    top: 8px;
  }

  .topbar__brand {
    max-width: 100%;
  }

  .layout {
    padding: 10px 12px 0;
  }

  .card {
    padding: 16px;
  }

  .topic-row {
    overflow-x: auto;
  }

  .stance-options {
    grid-template-columns: 1fr;
  }

  .response-list {
    gap: 10px;
  }

  .reply-list {
    margin-left: 16px;
  }
}

/* Schools section */
.schools-shell {
  max-width: 1265px;
  margin: 0 auto;
  padding: 48px 16px 80px;
  display: grid;
  gap: 24px;
}

.schools-shell--rubric-editor {
  max-width: min(96vw, 1820px);
}

.schools-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

#forum-create-panel {
  margin-top: 8px;
}

.forum-detail-topbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

#forum-thread-list.thread-list {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

#forum-thread-list.thread-list.is-detail-view {
  grid-template-columns: minmax(0, 1fr);
}

.forum-post-link {
  color: inherit;
  text-decoration: none;
}

.forum-post-link:hover,
.forum-post-link:focus-visible {
  text-decoration: underline;
}

.forum-thread-card .debate-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.forum-thread-card--detail {
  cursor: default;
}

.forum-thread-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.forum-thread-actions .reply-form {
  width: 100%;
  margin-top: 4px;
}

.forum-thread-card .reply-list {
  margin-top: 10px;
}

body.forum-post-detail-page #forum-create-panel,
body.forum-post-detail-page #forum-create-reopen,
body.forum-post-detail-page #forum-create-state,
body.forum-post-detail-page #detail-eyebrow,
body.forum-post-detail-page #detail-date,
body.forum-post-detail-page #detail-topics,
body.forum-post-detail-page #detail-status-badge,
body.forum-post-detail-page #forum-detail-state,
body.forum-post-detail-page #user-stance-status,
body.forum-post-detail-page #hot-take-grading {
  display: none !important;
}

.forum-post-detail-page #forum-feed-panel {
  margin-top: 4px;
}

.forum-post-detail-page #forum-feed-panel > .card__header {
  align-items: flex-start;
}

.forum-post-detail-page #forum-feed-panel > .card__header h3 {
  margin-bottom: 2px;
}

.forum-detail-comments {
  display: grid;
  gap: 12px;
}

.forum-detail-comments .reply-list {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}

.teacher-class-shell {
  min-height: calc((100dvh / var(--ui-scale)) - var(--teacher-topbar-h, 58px));
  width: 100%;
  position: relative;
}

body.has-teacher-class-dock .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
}

body.has-teacher-class-dock .teacher-class-shell {
  padding-top: var(--teacher-topbar-h, 58px);
}

body.has-teacher-class-dock .layout {
  padding-top: calc(16px + var(--teacher-topbar-h, 58px));
}

.teacher-class-sidebar {
  position: fixed;
  top: calc(var(--teacher-topbar-h, 58px) - 1px);
  left: 0;
  bottom: 0;
  width: 262px;
  transform: translateX(calc(-100% + 56px));
  transition: transform 170ms ease;
  z-index: 22;
  border-top: 1px solid var(--border-strong);
  border-right: 2px solid var(--border-strong);
  background:
    var(--scoreboard-pattern),
    linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface-muted) 58%, var(--surface-subtle) 100%);
  background-size: auto, cover;
  background-repeat: repeat-x, no-repeat;
  background-position: top left, center;
  padding: 14px 10px 24px;
  display: grid;
  align-content: start;
}

.teacher-class-sidebar:hover,
.teacher-class-sidebar:focus-within {
  transform: translateX(0);
}

.teacher-class-nav {
  display: grid;
  gap: 10px;
}

.teacher-class-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 9px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  background: var(--surface-soft);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, color 120ms ease;
}

.teacher-class-nav__item--button {
  width: 100%;
  appearance: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-dark {
  background: #101a2c;
  color: #e7edf8;
  border-color: #2f4567;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-dark .teacher-class-nav__icon {
  background: #16253b;
  border-color: #3a5376;
  color: #e7edf8;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-dark:hover {
  background: #14223a;
  color: #f2f7ff;
  border-color: #3c5880;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-dark:hover .teacher-class-nav__icon {
  background: #1a2c45;
  border-color: #436084;
  color: #f2f7ff;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-light {
  background: #f3f0ea;
  color: #5a5248;
  border-color: #d8d0c3;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-light .teacher-class-nav__icon {
  background: #ece7de;
  border-color: #d0c5b4;
  color: #5a5248;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-light:hover {
  background: #f8f5ef;
  color: #4f473f;
  border-color: #d4c9b7;
}

.teacher-class-nav__item--theme.teacher-class-nav__item--preview-light:hover .teacher-class-nav__icon {
  background: #f1ebe1;
  border-color: #ccbfa9;
  color: #4f473f;
}

.teacher-class-nav__item:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
  transform: translateX(2px);
}

.teacher-class-nav__item.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.teacher-class-nav__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.teacher-class-nav__label {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.teacher-class-sidebar:hover .teacher-class-nav__label,
.teacher-class-sidebar:focus-within .teacher-class-nav__label {
  opacity: 1;
  transform: translateX(0);
}

.teacher-class-content {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 16px;
  padding: 24px 22px 80px 76px;
  min-width: 0;
}

body.has-teacher-class-dock .schools-shell {
  padding-left: 74px;
}

body.has-teacher-class-dock .layout {
  padding-left: 74px;
}

.teacher-class-info-card {
  padding: 16px 18px 12px;
}

.teacher-class-info-card .card__header {
  margin-bottom: 6px;
}

.teacher-class-info-card .schools-code {
  padding-top: 6px;
}

.teacher-class-info-card .form-message {
  min-height: 0;
  margin-top: 4px;
}

.teacher-class-info-card .form-message:empty {
  display: none;
}

.gradebook-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
  gap: 10px;
}

.gradebook-student-row:hover {
  border-color: var(--accent);
}

.gradebook-student-row.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.gradebook-student-row__name {
  font-weight: 700;
}

.gradebook-student-row__meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.gradebook-assignment {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-soft);
}

.gradebook-assignment > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.gradebook-assignment > summary::-webkit-details-marker {
  display: none;
}

.gradebook-assignment-summary {
  display: grid;
  gap: 3px;
}

.gradebook-assignment-summary--right {
  text-align: right;
  justify-items: end;
}

.gradebook-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.gradebook-status--on_time {
  border-color: #1f9d5a;
  color: #1f9d5a;
  background: rgba(31, 157, 90, 0.14);
}

.gradebook-status--late {
  border-color: #d17d15;
  color: #d17d15;
  background: rgba(209, 125, 21, 0.14);
}

.gradebook-status--missing {
  border-color: var(--danger-border);
  color: var(--danger);
  background: var(--danger-soft);
}

.thread-status-row {
  margin: 10px 0 0;
}

.thread-status-row .gradebook-status {
  font-size: 14px;
  padding: 4px 12px;
}

.assignment-card-status {
  margin-top: 8px;
}

.feedback-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(30, 64, 175, 0.1);
  color: #1e40af;
}

.feedback-pill--teacher {
  background: rgba(176, 114, 24, 0.12);
  color: #8a5a14;
  border-color: rgba(176, 114, 24, 0.3);
}

.feedback-pill__icon {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.gradebook-assignment-body {
  border-top: 1px solid var(--border-subtle);
  padding: 10px 12px 12px;
  display: grid;
  gap: 10px;
}

.gradebook-assignment-actions {
  display: flex;
  justify-content: flex-start;
}

.gradebook-assignment-rubric {
  border-top: 1px dashed var(--border-strong);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.student-grades-card {
  padding: 16px 18px;
}

.student-grade-list {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-soft);
}

.student-grade-row {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.student-grade-row:last-child {
  border-bottom: 0;
}

.student-grade-row > summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
}

.student-grade-row > summary::-webkit-details-marker {
  display: none;
}

.student-grade-row[open] > summary {
  background: var(--surface-highlight);
}

.student-grade-row__left {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.student-grade-row__title {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.1;
}

.student-grade-row__meta {
  font-size: 15px;
  color: var(--text-muted);
}

.student-grade-row__right {
  display: grid;
  justify-items: end;
  gap: 6px;
  white-space: nowrap;
}

.student-grade-row__score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  color: var(--text-strong);
}

.student-grade-row__body {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px 16px;
  display: grid;
  gap: 10px;
}

.student-grades-rollup-card {
  padding: 0;
  overflow: hidden;
}

.student-grades-rollup-card .card__header {
  padding: 16px 18px 0;
}

.student-grades-rollup {
  display: grid;
}

.student-grades-rollup__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 220px;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
}

.student-grades-rollup__label {
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-display);
}

.student-grades-rollup__percent,
.student-grades-rollup__points {
  text-align: right;
  font-size: 15px;
  font-family: var(--font-display);
}

.student-grades-rollup__row--total {
  border-top: 2px solid var(--accent);
  background: var(--surface-highlight);
}

.student-grades-rollup__row--total .student-grades-rollup__label,
.student-grades-rollup__row--total .student-grades-rollup__percent,
.student-grades-rollup__row--total .student-grades-rollup__points {
  font-weight: 800;
  color: var(--text-strong);
}

.rubric-editor-page {
  display: grid;
  gap: 16px;
}

.rubric-library-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px 12px;
}

.rubric-library-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.rubric-library-panel[open] {
  display: grid;
  gap: 12px;
}

.schools-rubrics .rubric-builder-grid {
  min-width: 1280px;
}

.schools-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 0;
}

.schools-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.schools-table th,
.schools-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
}

.roster-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ghost-button.danger {
  border-color: var(--danger-border);
  background: var(--danger-soft);
  color: var(--danger);
}

.ghost-button.danger:hover:not(:disabled) {
  background: var(--danger-soft-strong);
  border-color: var(--danger-border);
  color: var(--danger);
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text);
}

#dm-topic-judge-students {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-soft);
}

#dm-topic-judge-students .checkbox-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}

#dm-topic-judge-students .checkbox-row:last-child {
  border-bottom: none;
}

.schools-votes,
.schools-awards {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.schools-replies {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.schools-reply {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border-subtle);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.schools-analytics {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
}

.schools-analytics + .schools-analytics {
  margin-top: 12px;
}

.schools-analytics summary {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schools-analytics-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 12px;
}

.schools-analytics-grid ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.schools-rubric-builder {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-soft);
}

.rubric-template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.rubric-level-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 120px auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  background: var(--surface);
}

.rubric-criterion-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  display: grid;
  gap: 10px;
}

.rubric-builder-grid-note {
  margin: 0;
}

.rubric-builder-grid-wrap {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-elevated);
  overflow-x: auto;
}

.rubric-builder-grid {
  min-width: 920px;
}

.rubric-builder-grid th,
.rubric-builder-grid td {
  padding: 10px;
}

.rubric-builder-grid thead th {
  vertical-align: top;
}

.rubric-builder-level-editor {
  display: grid;
  gap: 8px;
  min-width: 140px;
}

.rubric-builder-level-points {
  max-width: 90px;
}

.rubric-builder-level-actions,
.rubric-builder-criterion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rubric-mini-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.1;
  cursor: pointer;
}

.rubric-mini-btn:hover:not(:disabled) {
  border-color: var(--accent);
}

.rubric-mini-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rubric-mini-btn.danger {
  border-color: var(--danger-border);
  color: var(--danger);
  background: var(--danger-soft);
}

.rubric-builder-criterion-cell {
  min-width: 300px;
  display: grid;
  gap: 8px;
}

.rubric-builder-criterion-cell--main {
  vertical-align: top;
}

.rubric-builder-grid-rating-cell {
  min-width: 140px;
  vertical-align: top;
}

.rubric-builder-grid-rating {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.rubric-builder-grid-rating strong {
  font-size: 13px;
}

.rubric-builder-grid-rating span {
  font-size: 12px;
  color: var(--text-muted);
}

.rubric-builder-grid-rating textarea {
  width: 100%;
  resize: vertical;
  min-height: 54px;
  font-size: 12px;
}

.rubric-builder-inline-add-col,
.rubric-builder-inline-add-row {
  text-align: center;
  vertical-align: middle;
}

.rubric-builder-inline-add-col {
  min-width: 140px;
}

.rubric-inline-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.rubric-inline-add-btn:hover {
  border-color: var(--accent);
}

.rubric-builder-inline-add-row {
  padding: 12px;
}

.rubric-builder-comment-row td {
  border-bottom: 1px solid var(--border-strong);
}

.rubric-builder-comment-cell {
  background: var(--surface-elevated);
}

.rubric-builder-comment-cell textarea {
  resize: vertical;
  min-height: 62px;
}

.rubric-builder-comment-cell .stack > span {
  font-size: 12px;
  color: var(--text-muted);
}

.rubric-builder-grid-cell,
.rubric-builder-points-col {
  text-align: center;
  vertical-align: middle;
}

.rubric-builder-grid-cell span {
  color: var(--text-muted);
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: grab;
  font-weight: 700;
  user-select: none;
}

.submission-student-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-soft);
  text-align: left;
}

button.submission-student-row {
  cursor: pointer;
}

button.submission-student-row:hover {
  border-color: var(--accent);
}

.submission-student-meta {
  display: grid;
  gap: 4px;
}

.submission-student-stats {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.rubric-grade-card {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-elevated);
  display: grid;
  gap: 10px;
}

.rubric-grade-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.rubric-grade-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-strong);
}

.rubric-grade-option input {
  margin: 0;
  accent-color: var(--accent-strong);
}

.rubric-grade-option input:checked + span {
  color: var(--text-strong);
  font-weight: 700;
}

.rubric-grade-option-note {
  display: block;
  margin-top: 4px;
}

.rubric-grid-table {
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.rubric-grid-table th,
.rubric-grid-table td {
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.rubric-grid-table th:last-child,
.rubric-grid-table td:last-child {
  border-right: 0;
}

.rubric-grid-table thead th {
  background: var(--surface-strong);
  color: var(--text-strong);
  font-weight: 800;
}

.rubric-grid-table tbody tr:nth-child(even) td {
  background: var(--surface-highlight);
}

.rubric-grid-table td {
  vertical-align: top;
}

.rubric-grid-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface-elevated);
}

.rubric-grid-scroll .rubric-grid-table {
  width: max-content;
  min-width: 940px;
  table-layout: fixed;
}

.rubric-grid-scroll .rubric-grid-table th,
.rubric-grid-scroll .rubric-grid-table td {
  min-width: 118px;
}

.rubric-grid-scroll .rubric-grid-table th:first-child,
.rubric-grid-scroll .rubric-grid-table td:first-child {
  min-width: 230px;
}

.rubric-grid-scroll .rubric-grid-table th:last-child,
.rubric-grid-scroll .rubric-grid-table td:last-child {
  min-width: 72px;
}

.rubric-cell-description {
  margin-top: 6px;
}

.rubric-picked {
  color: #0f8f46;
  font-weight: 700;
}

@media (max-width: 720px) {
  .rubric-template-row,
  .rubric-level-row {
    grid-template-columns: 1fr;
  }

  .rubric-builder-grid {
    min-width: 760px;
  }

  .rubric-grid-scroll .rubric-grid-table {
    min-width: 860px;
  }

  .student-grade-row > summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .student-grade-row__right {
    justify-items: start;
  }

  .student-grades-rollup__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label label"
      "percent points";
    gap: 6px 12px;
  }

  .student-grades-rollup__label {
    grid-area: label;
    font-size: 15px;
  }

  .student-grades-rollup__percent {
    grid-area: percent;
    text-align: left;
    font-size: 15px;
  }

  .student-grades-rollup__points {
    grid-area: points;
    text-align: right;
    font-size: 15px;
  }

  .submission-student-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .submission-student-stats {
    justify-items: start;
  }

  .judge-assignment-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .teacher-class-sidebar {
    width: 250px;
    transform: translateX(calc(-100% + 52px));
    border-right: 1px solid var(--border-subtle);
    padding: 10px 8px 18px;
  }

  .teacher-class-nav {
    gap: 8px;
  }

  .teacher-class-content {
    padding: 14px 10px 56px 66px;
  }

  body.has-teacher-class-dock .schools-shell {
    padding-left: 62px;
  }

  body.has-teacher-class-dock .layout {
    padding-left: 62px;
  }
}

.auth-shell--wide {
  max-width: 1127px;
}

.dm-topic-actions {
  margin-top: 8px;
}

.dm-topic-actions button.active {
  border-color: var(--accent);
  background: var(--surface-contrast);
}

.dm-topic-panel-header h3 {
  margin: 0;
}

.dm-topic-status {
  margin: 8px 0;
}

#dm-topic-guard.dm-topic-choice-lock {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: var(--surface-contrast);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dm-topic-other-thread-card {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
}

.dm-topic-other-thread-card:hover {
  border-color: var(--accent);
  background: var(--surface-contrast);
}

.dm-topic-other-thread-card__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dm-topic-other-thread-card__summary {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dm-topic-other-thread-card__actions {
  flex: 0 0 auto;
}

.dm-topic-other-thread-card__title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.dm-topic-other-thread-card__meta {
  font-size: 12px;
  color: var(--text-muted);
}

.dm-peer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-soft);
}

.dm-peer-row span {
  font-weight: 600;
}

.judge-assignment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-soft);
}

.judge-assignment-row__meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

/* === Debate arena visual pass === */
:root {
  --bg: #f4efe5;
  --surface: #fffdf7;
  --surface-muted: #f8f2e8;
  --surface-subtle: #f0e8dc;
  --surface-strong: #eee4d4;
  --surface-contrast: #fff7ee;
  --surface-highlight: #f8f2e8;
  --surface-soft: #fffdf9;
  --surface-elevated: #f9f2e7;
  --surface-emboss: #efe5d4;
  --surface-input: #fffdf5;
  --surface-profile: #f6efe4;
  --text: #1c1a15;
  --text-muted: #5f564b;
  --text-subtle: #6f675c;
  --text-faint: #9c9488;
  --text-strong: #15130f;
  --text-accent: #1f3a8a;
  --border: #e0d5c4;
  --border-strong: #d6cbb8;
  --border-muted: #e3d8c7;
  --border-subtle: #d9cfbd;
  --border-light: #e7ddcb;
  --border-chip: #b9a78a;
  --accent: #1f3a8a;
  --accent-strong: #13244f;
  --accent-soft: rgba(31, 58, 138, 0.16);
  --accent-soft-strong: rgba(31, 58, 138, 0.28);
  --accent-shadow: rgba(31, 58, 138, 0.24);
  --accent-shadow-strong: rgba(31, 58, 138, 0.34);
  --accent-shadow-intense: rgba(31, 58, 138, 0.45);
  --button-primary-start: #1f3a8a;
  --button-primary-end: #1f3a8a;
  --button-primary-hover-start: #2746a4;
  --button-primary-hover-end: #2746a4;
  --button-primary-active-start: #162a6b;
  --button-primary-active-end: #162a6b;
  --auth-submit-bg: #1f3a8a;
  --tag-bg: rgba(31, 58, 138, 0.18);
  --tag-text: #13244f;
  --focus-ring: #1f3a8a;
  --topbar-bg: rgba(255, 253, 247, 0.96);
  --dm-own-bg: rgba(31, 58, 138, 0.1);
  --dm-own-border: rgba(31, 58, 138, 0.22);
  --dm-own-text: #162a6b;
  --arena-pattern: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%3E%3Cpath%20d='M0%2024.5H48M24.5%200V48'%20stroke='%23d6cbb8'%20stroke-opacity='0.35'%20stroke-width='1'/%3E%3Ccircle%20cx='24.5'%20cy='24.5'%20r='1.4'%20fill='%23cbbfae'%20fill-opacity='0.45'/%3E%3C/svg%3E");
  --scoreboard-pattern: url("data:image/svg+xml,%3Csvg%20width='80'%20height='12'%20viewBox='0%200%2080%2012'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M0%200V12M20%200V12M40%200V12M60%200V12M80%200V12'%20stroke='%23d6cbb8'%20stroke-width='1'%20stroke-opacity='0.4'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
  --bg: #0b1119;
  --surface: #121a28;
  --surface-muted: #0f1726;
  --surface-subtle: #0d1624;
  --surface-strong: #1c2636;
  --surface-contrast: #0f1b2c;
  --surface-highlight: #121c2d;
  --surface-soft: #101827;
  --surface-elevated: #141f30;
  --surface-emboss: #0c131f;
  --surface-input: #0f1726;
  --surface-profile: #101827;
  --text: #e6eaf2;
  --text-muted: #9aa6b8;
  --text-subtle: #8b96a9;
  --text-faint: #637089;
  --text-strong: #f8fafc;
  --text-accent: #fbbf24;
  --border: #25324a;
  --border-strong: #2a3851;
  --border-muted: #223048;
  --border-subtle: #1d2a3f;
  --border-light: #24324a;
  --border-chip: #8b6217;
  --accent: #f59e0b;
  --accent-strong: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.2);
  --accent-soft-strong: rgba(245, 158, 11, 0.32);
  --accent-shadow: rgba(245, 158, 11, 0.24);
  --accent-shadow-strong: rgba(245, 158, 11, 0.34);
  --accent-shadow-intense: rgba(245, 158, 11, 0.48);
  --button-primary-start: #f59e0b;
  --button-primary-end: #f59e0b;
  --button-primary-hover-start: #fbbf24;
  --button-primary-hover-end: #fbbf24;
  --button-primary-active-start: #d97706;
  --button-primary-active-end: #d97706;
  --auth-submit-bg: #f59e0b;
  --tag-bg: rgba(245, 158, 11, 0.3);
  --tag-text: #fde68a;
  --focus-ring: #fbbf24;
  --topbar-bg: rgba(13, 20, 34, 0.96);
  --dm-own-bg: rgba(245, 158, 11, 0.12);
  --dm-own-border: rgba(245, 158, 11, 0.25);
  --dm-own-text: #fef3c7;
  --arena-pattern: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%3E%3Cpath%20d='M0%2024.5H48M24.5%200V48'%20stroke='%232a3851'%20stroke-opacity='0.45'%20stroke-width='1'/%3E%3Ccircle%20cx='24.5'%20cy='24.5'%20r='1.4'%20fill='%233b4a63'%20fill-opacity='0.5'/%3E%3C/svg%3E");
  --scoreboard-pattern: url("data:image/svg+xml,%3Csvg%20width='80'%20height='12'%20viewBox='0%200%2080%2012'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M0%200V12M20%200V12M40%200V12M60%200V12M80%200V12'%20stroke='%232a3851'%20stroke-width='1'%20stroke-opacity='0.55'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0b1119;
    --surface: #121a28;
    --surface-muted: #0f1726;
    --surface-subtle: #0d1624;
    --surface-strong: #1c2636;
    --surface-contrast: #0f1b2c;
    --surface-highlight: #121c2d;
    --surface-soft: #101827;
    --surface-elevated: #141f30;
    --surface-emboss: #0c131f;
    --surface-input: #0f1726;
    --surface-profile: #101827;
    --text: #e6eaf2;
    --text-muted: #9aa6b8;
    --text-subtle: #8b96a9;
    --text-faint: #637089;
    --text-strong: #f8fafc;
    --text-accent: #fbbf24;
    --border: #25324a;
    --border-strong: #2a3851;
    --border-muted: #223048;
    --border-subtle: #1d2a3f;
    --border-light: #24324a;
    --border-chip: #8b6217;
    --accent: #f59e0b;
    --accent-strong: #fbbf24;
    --accent-soft: rgba(245, 158, 11, 0.2);
    --accent-soft-strong: rgba(245, 158, 11, 0.32);
    --accent-shadow: rgba(245, 158, 11, 0.24);
    --accent-shadow-strong: rgba(245, 158, 11, 0.34);
    --accent-shadow-intense: rgba(245, 158, 11, 0.48);
    --button-primary-start: #f59e0b;
    --button-primary-end: #f59e0b;
    --button-primary-hover-start: #fbbf24;
    --button-primary-hover-end: #fbbf24;
    --button-primary-active-start: #d97706;
    --button-primary-active-end: #d97706;
    --auth-submit-bg: #f59e0b;
    --tag-bg: rgba(245, 158, 11, 0.3);
    --tag-text: #fde68a;
    --focus-ring: #fbbf24;
    --topbar-bg: rgba(13, 20, 34, 0.96);
    --dm-own-bg: rgba(245, 158, 11, 0.12);
    --dm-own-border: rgba(245, 158, 11, 0.25);
    --dm-own-text: #fef3c7;
    --arena-pattern: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%3E%3Cpath%20d='M0%2024.5H48M24.5%200V48'%20stroke='%232a3851'%20stroke-opacity='0.45'%20stroke-width='1'/%3E%3Ccircle%20cx='24.5'%20cy='24.5'%20r='1.4'%20fill='%233b4a63'%20fill-opacity='0.5'/%3E%3C/svg%3E");
    --scoreboard-pattern: url("data:image/svg+xml,%3Csvg%20width='80'%20height='12'%20viewBox='0%200%2080%2012'%20xmlns='http://www.w3.org/2000/svg'%3E%3Cpath%20d='M0%200V12M20%200V12M40%200V12M60%200V12M80%200V12'%20stroke='%232a3851'%20stroke-width='1'%20stroke-opacity='0.55'/%3E%3C/svg%3E");
  }
}

body {
  background-image: var(--arena-pattern);
  background-size: 48px 48px;
  background-attachment: fixed;
}

html[data-theme="dark"] body {
  background-image: var(--arena-pattern);
}

.topbar {
  border-bottom: 2px solid var(--border-strong);
}

.topbar__brand {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  background: var(--surface-contrast);
}

.primary-link {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid var(--border-chip);
    font-size: 13px;
    font-weight: 700;
  }

.card {
  position: relative;
  overflow: hidden;
}

.card.card--clickable {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.card.card--clickable:hover,
.card.card--clickable:focus-visible {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-soft-strong);
}

.thread-card {
  position: relative;
  border-left: 4px solid var(--accent);
  background: var(--surface-contrast);
}

.thread-card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.5;
}

.thread-card:hover,
.thread-card.active {
  border-color: var(--accent-strong);
  transform: translateY(-2px);
}

.debate-header h3,
.card h2,
.card h3 {
  font-family: var(--font-display);
}

.debate-progress,
.stance-meter__bar {
  position: relative;
  height: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
}

.debate-progress::before,
.stance-meter__bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--scoreboard-pattern);
  background-size: 80px 12px;
  opacity: 0.7;
  pointer-events: none;
}

.debate-progress::after,
.stance-meter__bar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 1px;
  height: 26px;
  background: var(--border-strong);
  opacity: 0.7;
}

.debate-progress .segment,
.stance-meter__segment {
  position: relative;
  z-index: 1;
}

.stance-meter__labels {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.pill {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.comment-card {
  border-left: 3px solid var(--accent-soft-strong);
  background: var(--surface-contrast);
}

.comment-author span,
.comment-stance {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.comment-stance {
  font-size: 11px;
}

.dm-message-card {
  border-left: 3px solid var(--border-subtle);
}

.dm-message-card.is-own {
  border-left-color: var(--accent);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 var(--accent-shadow);
  }
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.thread-card,
.response-card,
.dm-thread-card,
.dm-message-card,
.reply-card {
  animation: riseIn 0.35s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .thread-card,
  .response-card,
  .dm-thread-card,
  .dm-message-card,
  .reply-card {
    animation: none;
  }
}

.thread-card.is-live::after {
  animation: pulseGlow 1.6s infinite;
  box-shadow: 0 0 0 0 rgba(31, 58, 138, 0.35);
}

[data-theme="dark"] .thread-card.is-live::after {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
}

.thread-card.is-live::before {
  content: "LIVE";
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.dm-thread-card.is-live {
  border-left: 3px solid var(--accent);
  position: relative;
}

.dm-thread-card.is-live::after {
  content: "LIVE";
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--text-inverse);
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.thread-page #detail-card {
  position: relative;
}

.thread-page #detail-card::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 220px;
  background: radial-gradient(circle at center, rgba(31, 58, 138, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .thread-page #detail-card::after {
  background: radial-gradient(circle at center, rgba(245, 158, 11, 0.18), transparent 70%);
}

.thread-page #detail-card > * {
  position: relative;
  z-index: 1;
}

.thread-page .response-list {
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.08) 0%,
    transparent 50%,
    rgba(239, 68, 68, 0.08) 100%
  );
  border-radius: 16px;
  padding: 16px;
}

[data-theme="dark"] .thread-page .response-list {
  background: linear-gradient(
    90deg,
    rgba(34, 197, 94, 0.12) 0%,
    transparent 50%,
    rgba(239, 68, 68, 0.12) 100%
  );
}

.response-card.response-card--agree {
  border-left: 4px solid var(--success);
}

.response-card.response-card--third {
  border-left: 4px solid var(--warning-strong);
}

.response-card.response-card--disagree {
  border-left: 4px solid var(--danger);
}

.response-card.is-top-response::after {
  content: "Judge's pick";
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-strong);
  transform: rotate(-2deg);
}

.stance-meter::after {
  content: "";
  display: block;
  height: 10px;
  margin-top: 8px;
  background-image: radial-gradient(circle, var(--border-strong) 2px, transparent 3px);
  background-size: 16px 10px;
  opacity: 0.6;
}

.topic-row .pill,
.topic-chip {
  position: relative;
  border-radius: 10px 6px 6px 10px;
  padding-right: 16px;
}

.topic-row .pill::after,
.topic-chip::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--border-strong);
  opacity: 0.7;
}

button.primary {
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] button.primary {
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
