:root {
  /* 60-30-10 High-Contrast Learning Board Palette (Stripe Docs × Apple × Maven) */
  --hero-bg: #0d1321;
  --hero-surface: rgba(255, 255, 255, 0.08);
  --hero-border: rgba(255, 255, 255, 0.14);

  --canvas: #f0f3f8;
  --card: #ffffff;
  --card-subtle: #f8fafc;

  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Semantic Color Hierarchy */
  --indigo: #4f46e5;
  --indigo-hover: #4338ca;
  --indigo-soft: #eef2ff;
  --indigo-border: #c7d2fe;

  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eff6ff;

  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --teal-border: #99f6e4;

  --emerald: #059669;
  --emerald-bright: #10b981;
  --emerald-soft: #ecfdf5;

  --coral: #e11d48;
  --coral-soft: #fff1f2;

  /* Dark Slate Prompt Window (Stripe/OpenAI Playground contrast) */
  --term-bg: #131a27;
  --term-head: #1b2436;
  --term-border: #273247;
  --term-text: #f1f5f9;
  --term-muted: #94a3b8;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, ui-monospace, monospace;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -14px rgba(15, 23, 42, 0.10);
  --shadow-spotlight: 0 2px 6px rgba(79, 70, 229, 0.08), 0 18px 40px -18px rgba(79, 70, 229, 0.24);
  --shadow-float: 0 18px 40px -10px rgba(15, 23, 42, 0.28);
}

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

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-block-size: 100dvh;
  background: var(--canvas);
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* =========================================================
   COMPACT DARK OBSIDIAN FLAGSHIP HERO BANNER (~148px)
   ========================================================= */

.hero-banner {
  position: relative;
  background: var(--hero-bg);
  color: #ffffff;
  border-block-end: 1px solid rgba(255, 255, 255, 0.08);
  overflow: clip;
}

.hero-banner-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, #0d1321 0%, rgba(13, 19, 33, 0.94) 44%, rgba(13, 19, 33, 0.42) 70%, rgba(13, 19, 33, 0.14) 100%),
    linear-gradient(180deg, rgba(13, 19, 33, 0.15) 0%, rgba(13, 19, 33, 0.55) 100%),
    url("./hero-dark.webp");
  background-position: center, center, right center;
  background-size: 100% 100%, 100% 100%, cover;
  background-repeat: no-repeat;
}

.hero-inner {
  position: relative;
  z-index: 2;
  inline-size: 100%;
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 24px 28px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-inline-size: 0;
  flex: 1 1 460px;
}

.brand-mark {
  inline-size: 54px;
  block-size: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  box-shadow: 0 10px 24px -6px rgba(79, 70, 229, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hero-text {
  min-inline-size: 0;
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.hero-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.36);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.hero-live-pill[data-state="reconnecting"] {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.live-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.28);
  flex-shrink: 0;
}

.hero-live-pill[data-state="reconnecting"] .live-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28);
}

.hero-subtitle {
  margin: 6px 0 0;
  font-size: 0.93rem;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.55;
}

.hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.86rem;
  font-weight: 600;
}

.hero-stat-num {
  font-family: var(--font-mono);
  color: #38bdf8;
  font-weight: 700;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 40px;
  padding: 8px 16px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.36);
}

.hero-btn-accent {
  background: var(--indigo);
  border-color: rgba(129, 140, 248, 0.5);
}

.hero-btn-accent:hover {
  background: var(--indigo-hover);
}

/* =========================================================
   SPLIT LEARNING WORKSPACE (LEFT RAIL + RIGHT LIVE STREAM)
   ========================================================= */

.workspace-grid {
  inline-size: 100%;
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 24px 28px 72px;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Left Sticky Navigation & Directory Rail */
.sidebar-rail {
  position: sticky;
  inset-block-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-block-end: 14px;
}

.search-icon {
  position: absolute;
  inset-inline-start: 11px;
  color: var(--ink-3);
  pointer-events: none;
  display: flex;
}

.search-field {
  inline-size: 100%;
  min-block-size: 38px;
  padding-block: 6px;
  padding-inline: 34px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-subtle);
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.search-field:focus {
  background: #ffffff;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

.search-field::placeholder {
  color: var(--ink-3);
}

.rail-section-title {
  margin: 0 0 8px;
  padding-inline: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.nav-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-filter-btn {
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-block-size: 38px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: start;
  transition: background-color 130ms ease, color 130ms ease;
}

.nav-filter-btn:hover {
  background: var(--card-subtle);
  color: var(--ink);
}

.nav-filter-btn[aria-pressed="true"] {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.nav-filter-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink-3);
}

.nav-filter-btn[aria-pressed="true"] .nav-count {
  background: #ffffff;
  color: var(--indigo);
}

.rail-divider {
  border: 0;
  border-block-start: 1px solid var(--border);
  margin: 14px 0;
}

/* Clickable Live Lesson Directory */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-block-size: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.toc-item {
  inline-size: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.85rem;
  text-align: start;
  transition: background-color 120ms ease, color 120ms ease;
}

.toc-item:hover {
  background: var(--card-subtle);
  color: var(--ink);
}

.toc-item.is-active {
  background: var(--indigo-soft);
  color: var(--indigo);
  font-weight: 600;
}

.toc-num {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--canvas);
  color: var(--ink-3);
  flex-shrink: 0;
}

.toc-item.is-active .toc-num {
  background: var(--indigo);
  color: #ffffff;
}

.toc-title {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-full-btn {
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-block-size: 38px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-subtle);
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 600;
  transition: border-color 140ms ease, color 140ms ease;
}

.sort-full-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

/* =========================================================
   RIGHT MAIN STREAM COLUMN (流式信息向下)
   ========================================================= */

.stream-column {
  min-inline-size: 0;
}

.stream-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 14px;
  padding-inline: 4px;
  flex-wrap: wrap;
}

.stream-bar-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.stream-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Individual Content Card */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: clip;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.card.is-spotlight {
  border-color: var(--indigo-border);
  box-shadow: var(--shadow-spotlight);
}

.card.is-spotlight::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 4px;
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 100%);
}

.card.is-spotlight.is-pinned::before {
  background: linear-gradient(90deg, #e11d48 0%, #f59e0b 100%);
}

.card.just-arrived {
  animation: card-enter 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes card-enter {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-flash {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.32), var(--shadow-spotlight) !important;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seq-chip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--canvas);
  color: var(--ink);
}

.card.is-spotlight .seq-chip {
  background: var(--indigo);
  color: #ffffff;
}

.card.is-spotlight.is-pinned .seq-chip {
  background: var(--coral);
  color: #ffffff;
}

.kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
}

.kind-pill[data-type="prompt"] {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.kind-pill[data-type="url"] {
  background: var(--blue-soft);
  color: var(--blue);
}

.kind-pill[data-type="note"] {
  background: var(--teal-soft);
  color: var(--teal);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--emerald-soft);
  color: var(--emerald);
}

.status-pill::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: var(--emerald-bright);
}

.status-pill.is-pin {
  background: var(--coral-soft);
  color: var(--coral);
}

.status-pill.is-pin::before {
  background: var(--coral);
}

.day-pill-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.card-time {
  font-size: 0.82rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.card-title {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.38rem);
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: -0.015em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* One-Line Action Step Strip (Crisp, Zero-Fluff) */
.action-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
}

.action-strip-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 7px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-size: 0.86rem;
  font-weight: 600;
}

.action-strip-arrow {
  color: var(--ink-3);
  font-weight: 700;
}

/* Native <select> styling */
.form-select {
  inline-size: 100%;
  font-size: max(1rem, 1em);
  min-block-size: 46px;
  padding: 10px 36px 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background-color: var(--card-subtle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  appearance: none;
  color: var(--ink);
  cursor: pointer;
}

.form-select:focus {
  background-color: #ffffff;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

/* Clean Prompt Box (No redundant fake header bar) */
.prompt-window {
  border-radius: 14px;
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  overflow: clip;
}

.prompt-body {
  padding: 18px 20px;
  font-size: 0.98rem;
  line-height: 1.78;
  color: var(--term-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.placeholder-mark {
  background: rgba(251, 191, 36, 0.20);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 600;
}

/* =========================================================
   ARTIFACT 2: URL LAUNCHER TILE (Vibrant Royal Blue)
   ========================================================= */

.url-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #dbe4f0;
  transition: border-color 150ms ease;
}

.url-tile:hover {
  border-color: #93c5fd;
}

.url-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-inline-size: 0;
  flex: 1 1 260px;
}

.url-icon-tile {
  inline-size: 44px;
  block-size: 44px;
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.url-meta {
  min-inline-size: 0;
}

.url-host {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink);
  margin-block-end: 2px;
}

.url-href {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}

.url-href:hover {
  text-decoration: underline;
}

.url-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* =========================================================
   ARTIFACT 3: CLASSROOM TAKEAWAY NOTE (Teal-Emerald)
   ========================================================= */

.note-surface {
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  border-inline-start: 4px solid var(--teal);
  font-size: 1rem;
  line-height: 1.84;
  color: #134e4a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Card Primary Action Row */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.action-hint {
  font-size: 0.84rem;
  color: var(--ink-3);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 42px;
  padding: 9px 18px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease, box-shadow 140ms ease;
}

.btn:active {
  transform: scale(0.985);
}

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

.btn-indigo {
  background: var(--indigo);
  color: #ffffff;
  box-shadow: 0 6px 18px -6px rgba(79, 70, 229, 0.55);
}

.btn-indigo:hover:not(:disabled) {
  background: var(--indigo-hover);
}

.btn-blue {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, 0.50);
}

.btn-blue:hover:not(:disabled) {
  background: var(--blue-hover);
}

.btn-outline {
  background: var(--card);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--card-subtle);
  border-color: #94a3b8;
}

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
}

.btn-quiet:hover:not(:disabled) {
  background: var(--canvas);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

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

.btn-danger-outline:hover:not(:disabled) {
  background: #fee2e2;
}

.btn-lg {
  min-block-size: 46px;
  padding: 10px 22px;
  font-size: 0.95rem;
}

.btn-sm {
  min-block-size: 36px;
  padding: 6px 13px;
  font-size: 0.84rem;
  border-radius: 9px;
}

.btn-copied {
  background: var(--emerald) !important;
  border-color: var(--emerald) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px -6px rgba(5, 150, 105, 0.52) !important;
}

/* =========================================================
   ANTI-JUMP NEW ARRIVAL PILL
   ========================================================= */

.new-arrival-bar {
  position: fixed;
  inset-block-start: 18px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.45);
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-float);
}

.new-arrival-bar::before {
  content: "";
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: #38bdf8;
}

/* Empty & Footer */
.empty-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 56px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.empty-card h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.empty-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.94rem;
}

.site-footer {
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 0 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--ink-3);
}

/* =========================================================
   TEACHER CONSOLE (/admin) — MATCHING DARK HERO + CRISP WORKSPACE
   ========================================================= */

.admin-gate {
  min-block-size: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(79, 70, 229, 0.14), transparent 65%),
    var(--canvas);
}

.gate-card {
  inline-size: 100%;
  max-inline-size: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-block-start: 4px solid var(--indigo);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-spotlight);
}

.gate-eyebrow {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--indigo);
  margin-block-end: 8px;
}

.gate-card h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
}

.gate-card p {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 0.93rem;
}

.admin-workspace {
  inline-size: 100%;
  max-inline-size: 1220px;
  margin-inline: auto;
  padding: 24px 28px 72px;
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.composer-card {
  position: sticky;
  inset-block-start: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.composer-card h2 {
  margin: 0 0 18px;
  font-size: 1.18rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-block-end: 16px;
}

.form-field label,
.form-fieldset legend {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.form-hint {
  font-size: 0.81rem;
  color: var(--ink-3);
}

.form-input,
.form-textarea {
  inline-size: 100%;
  font-size: max(1rem, 1em);
  min-block-size: 46px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--card-subtle);
  color: var(--ink);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.form-textarea {
  min-block-size: 124px;
  resize: vertical;
  line-height: 1.68;
}

.form-textarea.is-compact {
  min-block-size: 76px;
}

.form-input:focus,
.form-textarea:focus {
  background: #ffffff;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

.form-input:user-invalid,
.form-textarea:user-invalid {
  border-color: var(--danger);
}

.form-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}

.form-fieldset legend {
  margin-block-end: 8px;
}

.radio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-chip {
  position: relative;
}

.radio-chip input {
  position: absolute;
  clip-path: inset(50%);
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
}

.radio-chip label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 42px;
  padding-inline: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
}

.radio-chip input:checked + label {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #ffffff;
}

.radio-chip input:focus-visible + label {
  outline: 2.5px solid var(--indigo);
  outline-offset: 2px;
}

.composer-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-block-end: 18px;
}

.day-strip {
  display: flex;
  gap: 6px;
}

.day-pill {
  min-block-size: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.day-pill[aria-pressed="true"] {
  background: var(--indigo-soft);
  border-color: var(--indigo-border);
  color: var(--indigo);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}

.checkbox-inline input {
  inline-size: 17px;
  block-size: 17px;
  accent-color: var(--indigo);
}

.composer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.composer-actions .btn-indigo {
  flex: 1 1 180px;
}

.error-msg {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 500;
}

.admin-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 16px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #e2e8f0;
}

.seg-btn {
  min-block-size: 36px;
  padding: 6px 14px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
}

.seg-btn[aria-pressed="true"] {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.admin-card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--border);
}

/* =========================================================
   NATIVE <dialog> MODALS
   ========================================================= */

dialog {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  inline-size: min(560px, calc(100% - 32px));
  max-block-size: calc(100dvh - 48px);
  box-shadow: var(--shadow-float);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(13, 19, 33, 0.58);
  backdrop-filter: blur(5px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-block-end: 1px solid var(--border);
}

.dialog-head h1 {
  margin: 0;
  font-size: 1.12rem;
}

.dialog-body {
  padding: 22px 24px;
  overflow-y: auto;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-block-start: 1px solid var(--border);
  background: var(--card-subtle);
}

.qr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding-block: 10px;
}

.qr-frame {
  padding: 20px;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 16px;
}

.qr-frame svg {
  display: block;
  inline-size: min(260px, 65dvw);
  block-size: auto;
}

.qr-url-big {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.28rem);
  font-weight: 700;
  color: var(--indigo);
  word-break: break-all;
  padding: 10px 18px;
  background: var(--indigo-soft);
  border-radius: 10px;
}

/* =========================================================
   TOAST POPOVER NOTIFICATIONS
   ========================================================= */

.toast-region {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-inline-size: min(360px, calc(100dvw - 32px));
}

.toast-item {
  pointer-events: auto;
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0f172a;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: opacity 180ms ease, transform 180ms ease;
  transition-behavior: allow-discrete;
}

.toast-item[popover] {
  position: fixed;
  inset: auto 20px 20px auto;
  max-inline-size: min(360px, calc(100% - 32px));
}

.toast-item[popover]:is(:popover-open, .\:popover-open) {
  display: flex;
}

@supports not selector(:popover-open) {
  .toast-item[popover]:not(.\:popover-open) {
    display: none;
  }
}

.toast-close {
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 1.1rem;
  line-height: 1;
  min-inline-size: 32px;
  min-block-size: 32px;
  border-radius: 6px;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

/* =========================================================
   RESPONSIVE & REDUCED MOTION
   ========================================================= */

@media (max-width: 960px) {
  .workspace-grid,
  .admin-workspace {
    grid-template-columns: 1fr;
  }
  .sidebar-rail,
  .composer-card {
    position: static;
  }
  .toc-card {
    display: none;
  }
  .nav-filter-list {
    flex-direction: row;
    flex-wrap: wrap;
    flex-wrap: balance;
  }
  .nav-filter-btn {
    inline-size: auto;
    flex: 1 1 auto;
  }
}

@media (max-width: 640px) {
  .hero-inner,
  .workspace-grid,
  .admin-workspace,
  .site-footer {
    padding-inline: 14px;
  }
  .card {
    padding: 18px 16px;
    border-radius: 16px;
  }
  .card-actions .btn-lg,
  .url-btns .btn-lg {
    inline-size: 100%;
  }
  .new-arrival-bar {
    inset-block-start: auto;
    inset-block-end: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card.just-arrived {
    animation: none;
  }
  .btn,
  .toast-item,
  .card {
    transition: none;
  }
}
