:root {
  color-scheme: light;
  --bg: #fafafa;
  --bg-2: #f4f4f5;
  --panel: #ffffff;
  --panel-border: #e4e4e7;
  --text: #18181b;
  --muted: #52525b;
  --accent: #27272a;
  --accent-2: #3f3f46;
  --accent-light: #f4f4f5;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --shadow: 0 10px 30px -5px rgba(24, 24, 27, 0.06), 0 4px 12px -2px rgba(24, 24, 27, 0.03);
  --radius: 20px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #fafafa !important;
  color: #18181b !important;
  line-height: 1.5;
}

.bg-shape {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.06;
  pointer-events: none;
}

.bg-shape-a {
  top: 5%;
  left: 10%;
  width: 250px;
  height: 250px;
  background: #a1a1aa;
}

.bg-shape-b {
  right: 12%;
  top: 15%;
  width: 280px;
  height: 280px;
  background: #71717a;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(2rem, 3.5vw, 3.8rem);
  line-height: 1.05;
  margin: 0;
  color: #020617;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 66ch;
  color: var(--muted);
  margin: 12px 0 0;
  font-size: 1.05rem;
}

.status-card,
.panel,
.mini-card,
.question-card,
.token-box {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  padding: 14px 20px;
  border-radius: 999px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
}

.status-card p,
.panel-head p,
.mini-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.grid.two-col {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.segmented-btn,
button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: all 0.15s ease;
}

.segmented-btn {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
}

.segmented-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 280px;
  resize: vertical;
  font-family: "Fira Code", Monaco, Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  background: #ffffff;
  color: #0f172a;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(39, 39, 42, 0.12);
}

.primary,
.secondary {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
}

.primary {
  background: linear-gradient(135deg, #18181b, #27272a);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(24, 24, 27, 0.2);
}

.primary:hover {
  background: linear-gradient(135deg, #09090b, #18181b);
  box-shadow: 0 6px 18px rgba(24, 24, 27, 0.3);
}

.secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.secondary:hover {
  background: #e2e8f0;
}

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

.token-box {
  border-radius: 14px;
  padding: 14px 16px;
  background: #f8fafc;
}

.token-box span,
.console-head,
.question-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

code {
  display: block;
  margin-top: 6px;
  word-break: break-all;
  font-family: monospace;
  color: #0f172a;
}

.hidden { display: none !important; }

.view.stack {
  gap: 20px;
}

.question-card {
  border-radius: 16px;
  padding: 24px;
  background: #ffffff;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.question-card h3 {
  margin: 0;
  font-size: 1.4rem;
  color: #0f172a;
}

.question-card p {
  color: #475569;
  line-height: 1.6;
}

/* Off-white theme editor terminal console */
.console {
  border-radius: 16px;
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.console-head {
  background: #f1f5f9;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  color: #334155;
}

.console-body {
  min-height: 150px;
  max-height: 240px;
  overflow: auto;
  padding: 14px 16px;
  background: #1e293b;
  color: #f8fafc;
  display: grid;
  gap: 8px;
  font-family: "Fira Code", Monaco, monospace;
}

.event-line {
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

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

.mini-card {
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
}

.question-bank,
.list {
  display: grid;
  gap: 12px;
}

.question-chip,
.student-chip {
  padding: 12px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.student-chip strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}

@media (max-width: 1024px) {
  .hero,
  .grid.two-col,
  .subgrid {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1280px);
    padding-top: 18px;
  }

  .panel {
    padding: 18px;
  }

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

.grid.auth-only {
  grid-template-columns: 1fr;
  max-width: 480px;
  margin: 40px auto 0;
}
.grid.auth-only > :nth-child(2) {
  display: none !important;
}

.grid.workspace-only {
  grid-template-columns: 1fr;
}
.grid.workspace-only > :nth-child(1) {
  display: none !important;
}

/* Student Program tab styling */
.tab-btn {
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  color: #71717a;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: #e4e4e7;
  color: #18181b;
}

.tab-btn.active {
  background: #18181b;
  border-color: #18181b;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(24, 24, 27, 0.15);
}