:root {
  --bg: #090d1f;
  --bg-2: #121938;
  --paper: rgba(18, 24, 50, 0.9);
  --paper-strong: rgba(13, 18, 39, 0.98);
  --paper-soft: rgba(25, 33, 68, 0.78);
  --ink: #eef2ff;
  --muted: #aab3d6;
  --line: rgba(168, 184, 255, 0.14);
  --line-strong: rgba(168, 184, 255, 0.26);
  --brand: #7a6cff;
  --brand-2: #ff5fa8;
  --brand-3: #26d7b2;
  --brand-4: #ffcb45;
  --danger: #ff5f8f;
  --danger-dark: #d9426e;
  --success: #27c08a;
  --shadow: 0 24px 60px rgba(3, 6, 20, 0.35);
  --radius: 16px;
  --radius-lg: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(122, 108, 255, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 95, 168, 0.18), transparent 24%),
    radial-gradient(circle at 80% 70%, rgba(38, 215, 178, 0.12), transparent 22%),
    linear-gradient(180deg, #0b1024 0%, #101631 45%, #0a1024 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.03), transparent 40%),
    linear-gradient(320deg, rgba(255,255,255,0.02), transparent 45%);
}

a { color: #b8b4ff; text-decoration: none; }
a:hover { text-decoration: none; color: #fff; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.page-wrap {
  width: min(1220px, calc(100% - 32px));
  margin: 20px auto 40px;
  display: grid;
  gap: 20px;
}
.site-header,
.site-footer {
  width: min(1220px, calc(100% - 32px));
  margin: 16px auto 0;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(18,24,50,0.88), rgba(10,14,30,0.92));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.site-footer {
  margin-top: auto;
  margin-bottom: 24px;
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(17,22,46,0.84), rgba(9,13,31,0.94));
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: #fff; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.08rem;
  color: #fff;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(122, 108, 255, 0.28);
}
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.top-nav a,
.nav-button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: #edf1ff;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.top-nav a:hover,
.nav-button-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  background: linear-gradient(135deg, rgba(122,108,255,0.28), rgba(255,95,168,0.2));
  color: #fff;
}
.inline-nav-form { display: inline-flex; margin: 0; }
.nav-button-link { appearance: none; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); cursor: pointer; }

.panel,
.student-card,
.join-card,
.hero-card {
  background: linear-gradient(180deg, rgba(24, 31, 62, 0.96), rgba(12, 17, 36, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel { padding: 22px; }
.hero-card {
  padding: 30px;
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 22px;
}
.hero-student {
  background:
    radial-gradient(circle at top right, rgba(255,95,168,0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(38,215,178,0.13), transparent 28%),
    linear-gradient(135deg, rgba(122,108,255,0.24), rgba(8,12,28,0.25)),
    linear-gradient(180deg, rgba(24,31,62,0.96), rgba(12,17,36,0.98));
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .76rem;
  font-weight: 800;
  color: #ff9ec8;
  margin: 0 0 10px;
}
.lede,
.muted-text,
.muted-copy { color: var(--muted); }
.lede { font-size: 1.05rem; line-height: 1.65; }
.hero-card h1,
.panel h1,
.student-card h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
  color: #fff;
}
.panel h2,
.panel h3,
.panel h4,
.student-card h2,
.student-card h3,
.student-card h4 { color: #fff; margin-top: 0; }
.hero-actions,
.form-row,
.soft-actions,
.session-actions,
.entry-badges,
.usage-pills,
.student-banner,
.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.join-card { padding: 22px; }
.join-card h2 { margin-top: 0; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.pricing-card { display: grid; gap: 14px; }
.highlight-card { border: 2px solid rgba(122,108,255,0.4); }
.price { font-size: 2.25rem; font-weight: 900; margin: 0; color: #fff; }

.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 8px; font-weight: 700; color: #eef2ff; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1px solid rgba(168,184,255,0.24);
  border-radius: 14px;
  padding: 13px 15px;
  font: inherit;
  color: #f5f7ff;
  background: linear-gradient(180deg, rgba(13,18,39,0.95), rgba(21,28,57,0.98));
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
textarea { resize: vertical; }
input::placeholder,
textarea::placeholder { color: #8d97bf; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(122,108,255,0.9);
  box-shadow: 0 0 0 3px rgba(122,108,255,0.16);
}

.button {
  appearance: none;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #8f7dff 55%, var(--brand-2));
  color: #fff;
  font-weight: 800;
  font-size: 0.96rem;
  line-height: 1.1;
  padding: 11px 16px;
  border-radius: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(91,85,255,0.18);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.04); }
.button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.button-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  color: #eef2ff;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
}
.button-danger { background: linear-gradient(135deg, var(--danger), var(--danger-dark)); }
.button-large { padding: 13px 18px; font-size: 1rem; }
.button-small { padding: 9px 12px; border-radius: 11px; font-size: .88rem; }
.inline-form { display: inline-flex; margin: 0; }
.danger-form { margin-left: auto; }

.feature-list { margin: 0; padding-left: 18px; line-height: 1.55; }
.compact-list { padding-left: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.badge,
.student-chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 12px;
}
.badge {
  background: rgba(255,255,255,0.07);
  color: #eef2ff;
  border: 1px solid rgba(255,255,255,0.08);
}
.badge-open { background: rgba(38,215,178,0.16); color: #a2ffe7; border-color: rgba(38,215,178,0.26); }
.badge-warn { background: rgba(255,203,69,0.16); color: #ffe59b; border-color: rgba(255,203,69,0.3); }
.badge-danger { background: rgba(255,95,143,0.18); color: #ffc1d4; border-color: rgba(255,95,143,0.28); }
.badge-info { background: rgba(122,108,255,0.18); color: #d1cbff; border-color: rgba(122,108,255,0.28); }
.badge-muted { background: rgba(170,179,214,0.12); color: #d6ddfb; border-color: rgba(170,179,214,0.2); }
.student-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
}
.pill {
  background: linear-gradient(135deg, rgba(122,108,255,0.14), rgba(255,95,168,0.14));
  border: 1px solid rgba(122,108,255,0.18);
  flex-direction: column;
  align-items: flex-start;
}

.flash {
  width: min(1220px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flash-success { background: rgba(39,192,138,0.14); color: #b3f6d9; border-color: rgba(39,192,138,0.24); }
.flash-error { background: rgba(255,95,143,0.14); color: #ffd0df; border-color: rgba(255,95,143,0.24); }

.narrow-panel { width: min(640px, 100%); margin-inline: auto; }
.narrow-panel-inner { width: min(420px, 100%); }
.legal-panel p,
.legal-panel li { line-height: 1.7; color: #dbe2ff; }
.session-top { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; align-items: start; }
.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.summary-grid,
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.entry-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}
.entry-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(168,184,255,0.14);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(122,108,255,0.12), transparent 32%),
    linear-gradient(180deg, rgba(21,28,57,0.98), rgba(11,16,34,0.98));
  min-height: 100%;
}
.entry-card:hover,
.entry-card:focus-within {
  border-color: rgba(122,108,255,0.3);
  box-shadow: 0 20px 40px rgba(3,6,20,0.3);
}
.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.entry-head h3 { margin: 0 0 4px; font-size: 1rem; }
.teacher-banner { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.summary-grid > div,
.entry-grid > div {
  min-width: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px 13px;
}
.entry-grid h4,
.summary-grid h3 {
  margin: 0 0 8px;
  font-size: .93rem;
  letter-spacing: .02em;
}
.entry-grid p,
.summary-grid p,
.panel p,
.join-card p { line-height: 1.55; }
.entry-grid > div:nth-child(1) p,
.entry-grid > div:nth-child(3) p {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry-grid > div:nth-child(2) {
  position: absolute;
  top: 14px;
  right: 14px;
  width: min(420px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  z-index: 6;
  opacity: 0;
  transform: translateY(8px) scale(.98);
  pointer-events: none;
  background:
    radial-gradient(circle at top right, rgba(255,95,168,0.16), transparent 36%),
    linear-gradient(180deg, rgba(16,21,44,0.98), rgba(7,10,24,0.98));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 22px 44px rgba(2,4,12,0.45);
}
.entry-card:hover .entry-grid > div:nth-child(2),
.entry-card:focus-within .entry-grid > div:nth-child(2) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.entry-card::after {
  content: "Hover to view AI feedback";
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, rgba(122,108,255,0.86), rgba(255,95,168,0.84));
  box-shadow: 0 10px 18px rgba(12,14,32,0.28);
}
.entry-card:hover::after,
.entry-card:focus-within::after { opacity: 0; }
.entry-grid > div:nth-child(4) {
  grid-column: 1 / -1;
}
.entry-grid > div:nth-child(4) textarea {
  min-height: 76px;
}
.entry-grid > div:nth-child(4) .form-row {
  gap: 8px;
}

.student-shell {
  min-height: 100svh;
  display: block;
  padding: 0;
  background:
    radial-gradient(circle at top right, rgba(255,95,168,0.2), transparent 26%),
    radial-gradient(circle at bottom left, rgba(38,215,178,0.16), transparent 24%),
    linear-gradient(180deg, #090d20 0%, #101634 100%);
}
.student-card {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  padding: clamp(22px, 4vw, 48px);
  border-radius: 0;
  border: none;
  box-shadow: none;
  background:
    radial-gradient(circle at top left, rgba(122,108,255,0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(255,95,168,0.16), transparent 20%),
    linear-gradient(180deg, rgba(14,18,38,0.98), rgba(10,14,30,1));
}
.student-task-card h1,
.student-feedback-card h1 {
  font-size: clamp(2.1rem, 5vw, 4.1rem);
  line-height: 1.04;
  max-width: 16ch;
}
.student-banner { margin-bottom: 22px; }
.student-help {
  color: #d2d9f8;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.6;
  max-width: 56rem;
}
.student-answer-wrap textarea {
  min-height: clamp(320px, 54vh, 720px);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.55;
  border-width: 1px;
  background: linear-gradient(180deg, rgba(7,11,24,0.96), rgba(18,24,50,0.98));
}
.student-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: #dbe3ff;
  font-weight: 700;
  font-size: 1rem;
}
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.feedback-panel {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
}
.feedback-panel h2 { margin-top: 0; font-size: 1.02rem; }
.feedback-panel p { font-size: 1.03rem; line-height: 1.65; }
.positive-panel {
  background: linear-gradient(180deg, rgba(38,215,178,0.14), rgba(255,255,255,0.04));
}
.improvement-panel {
  background: linear-gradient(180deg, rgba(255,203,69,0.18), rgba(255,255,255,0.04));
}
.complete-panel,
.original-response-panel {
  background: linear-gradient(180deg, rgba(122,108,255,0.16), rgba(255,255,255,0.04));
}
.processing-box {
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(122,108,255,0.16), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.08);
}
.reflection-form { margin-top: 18px; max-width: 64rem; }
.feedback-lead { font-size: 1.15rem; font-weight: 800; }
.student-page .button,
.student-page .button-large { font-size: 1rem; }
.student-page textarea,
.student-page input,
.student-page select { border-radius: 16px; }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: rgba(7,10,24,0.96);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.whiteboard-body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(122,108,255,0.18), transparent 24%), #0a1024;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
}
.whiteboard-shell {
  min-height: 100vh;
  padding: 40px 56px;
  display: grid;
  gap: 28px;
  align-content: center;
}
.whiteboard-code {
  font-size: clamp(2.2rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: GoldenRod;
}
.whiteboard-question {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.14;
  font-weight: 800;
}
.whiteboard-timer {
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 900;
  color: #9ef3df;
}
.fullscreen-button {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  background: #fff;
  color: #121a42;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.auth-card { margin-top: 20px; }
.playful-panel {
  background:
    radial-gradient(circle at top right, rgba(255,203,69,0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(38,215,178,0.12), transparent 28%),
    linear-gradient(135deg, rgba(255,183,3,0.1), rgba(24,201,167,0.08)),
    linear-gradient(180deg, rgba(24,31,62,0.96), rgba(12,17,36,0.98));
}
.pricing-hero { text-align: center; }
.summary-panel p { line-height: 1.6; }
.tiny-status { min-height: 1.2em; }
.notice {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-weight: 700;
}
.notice-warning {
  background: rgba(255, 183, 3, 0.12);
  color: #ffe59b;
  border-color: rgba(255, 183, 3, 0.3);
}
.notice-panel {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.12), rgba(91,85,255,0.08));
}
.form-links { margin-top: 16px; text-align: center; }
.stacked-links { display: grid; gap: 8px; }
button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.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;
}

@media (max-width: 1100px) {
  .hero-card,
  .grid-two,
  .pricing-grid,
  .session-top,
  .summary-grid,
  .feedback-grid,
  .teacher-banner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .page-wrap,
  .site-header,
  .site-footer,
  .flash { width: calc(100% - 20px); }

  .site-header,
  .site-footer,
  .panel,
  .join-card,
  .hero-card { border-radius: 16px; }

  .site-header,
  .site-footer,
  .student-status-row,
  .entry-head {
    flex-direction: column;
    align-items: stretch;
  }

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

  .entry-card::after { display: none; }

  .entry-grid {
    grid-template-columns: 1fr;
  }

  .entry-grid > div:nth-child(2) {
    position: static;
    width: auto;
    max-height: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
  }

  .student-card {
    padding: 22px 18px 28px;
  }

  .student-task-card h1,
  .student-feedback-card h1 {
    max-width: none;
  }

  .student-answer-wrap textarea {
    min-height: 42svh;
  }

  .button,
  .button-large {
    padding: 11px 15px;
  }
}

@media (max-width: 640px) {
  .hero-card,
  .panel,
  .join-card { padding: 18px; }

  .top-nav {
    justify-content: stretch;
  }

  .top-nav a,
  .nav-button-link,
  .inline-nav-form {
    width: 100%;
  }

  .student-banner,
  .session-actions,
  .hero-actions,
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .feedback-grid {
    grid-template-columns: 1fr;
  }

  .whiteboard-shell { padding: 28px; }
}


/* ===== CSS-only refinement pass: lighter playful theme + denser teacher session view ===== */

:root {
  --bg: #eef3ff;
  --bg-2: #f8f4ff;
  --paper: rgba(255, 255, 255, 0.88);
  --paper-strong: rgba(255, 255, 255, 0.96);
  --paper-soft: rgba(245, 240, 255, 0.86);
  --ink: #1d2142;
  --muted: #5f658d;
  --line: rgba(92, 104, 180, 0.12);
  --line-strong: rgba(92, 104, 180, 0.22);
  --brand: #745cff;
  --brand-2: #ff6ea8;
  --brand-3: #1fc8a7;
  --brand-4: #ffcb45;
  --danger: #ef5d88;
  --danger-dark: #d74470;
  --success: #1ca46e;
  --shadow: 0 18px 42px rgba(66, 47, 124, 0.12);
  --radius: 12px;
  --radius-lg: 14px;
  --radius-sm: 10px;
}

html { color-scheme: light; }

body {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(116, 92, 255, 0.12), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 110, 168, 0.10), transparent 28%),
    radial-gradient(circle at 80% 75%, rgba(31, 200, 167, 0.08), transparent 24%),
    linear-gradient(180deg, #f7f9ff 0%, #f4f1ff 48%, #eef6ff 100%);
}

body::before {
  background:
    linear-gradient(140deg, rgba(255,255,255,0.24), transparent 40%),
    linear-gradient(320deg, rgba(255,255,255,0.12), transparent 45%);
}

a { color: #5c4ef5; }
a:hover { color: #392fbc; }

.site-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,244,255,0.94));
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.site-footer {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(247,243,255,0.95));
  border-color: var(--line);
  border-radius: 14px;
  color: var(--muted);
}

.brand {
  color: #221f45;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px rgba(116, 92, 255, 0.18);
}

.top-nav a,
.nav-button-link {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  border-color: rgba(116, 92, 255, 0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,239,255,0.9));
  color: #2b2e54;
  box-shadow: 0 6px 16px rgba(116, 92, 255, 0.08);
}

.top-nav a:hover,
.nav-button-link:hover {
  border-color: rgba(116, 92, 255, 0.24);
  background: linear-gradient(135deg, rgba(116,92,255,0.16), rgba(255,110,168,0.12));
  color: #241b6a;
}

.panel,
.student-card,
.join-card,
.hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,243,255,0.94));
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hero-student {
  background:
    radial-gradient(circle at top right, rgba(255,110,168,0.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(31,200,167,0.10), transparent 28%),
    linear-gradient(135deg, rgba(116,92,255,0.08), rgba(255,255,255,0.2)),
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(247,243,255,0.95));
}

.eyebrow { color: #db4f93; }
.lede, .muted-text, .muted-copy { color: var(--muted); }

.hero-card h1,
.panel h1,
.student-card h1,
.panel h2,
.panel h3,
.panel h4,
.student-card h2,
.student-card h3,
.student-card h4,
.join-card h2 {
  color: #1d2142;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  border-color: rgba(116, 92, 255, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  color: #24284f;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,242,255,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

input::placeholder,
textarea::placeholder { color: #8087aa; }

input:focus, select:focus, textarea:focus {
  border-color: rgba(116, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(116, 92, 255, 0.12);
}

.button {
  font-size: 0.92rem;
  padding: 10px 14px;
  border-radius: 11px;
  box-shadow: 0 10px 18px rgba(116, 92, 255, 0.16);
}

.button-large { padding: 11px 15px; font-size: 0.96rem; }
.button-small { padding: 8px 11px; border-radius: 10px; font-size: .84rem; }

.button-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(243,239,255,0.92));
  color: #262a52;
  border: 1px solid rgba(116,92,255,0.14);
}

.badge,
.student-chip,
.pill {
  color: #2b3159;
}

.badge {
  background: rgba(116,92,255,0.08);
  border-color: rgba(116,92,255,0.1);
}

.badge-open { background: rgba(31,200,167,0.14); color: #0f745e; border-color: rgba(31,200,167,0.22); }
.badge-warn { background: rgba(255,203,69,0.18); color: #8f6300; border-color: rgba(255,203,69,0.28); }
.badge-danger { background: rgba(239,93,136,0.14); color: #9e2950; border-color: rgba(239,93,136,0.22); }
.badge-info { background: rgba(116,92,255,0.14); color: #4938c9; border-color: rgba(116,92,255,0.22); }
.badge-muted { background: rgba(95,101,141,0.1); color: #535a84; border-color: rgba(95,101,141,0.16); }

.student-chip {
  background: rgba(116,92,255,0.1);
  border-color: rgba(116,92,255,0.12);
  color: #2c3260;
}

.flash {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.flash-success { background: rgba(28,164,110,0.12); color: #0e7351; border-color: rgba(28,164,110,0.2); }
.flash-error { background: rgba(239,93,136,0.12); color: #9f2852; border-color: rgba(239,93,136,0.2); }

.site-header,
.site-footer,
.panel,
.join-card,
.hero-card,
.feedback-panel,
.processing-box,
.cookie-banner,
.flash {
  backdrop-filter: blur(10px);
}

.cookie-banner {
  background: rgba(255,255,255,0.96);
  color: #262c56;
  border-radius: 14px;
}

.whiteboard-body {
  background: radial-gradient(circle at top left, rgba(116,92,255,0.14), transparent 24%), #f6f7ff;
  color: #1f2448;
}

.fullscreen-button {
  background: #ffffff;
  color: #22295a;
  border-radius: 10px;
}

.playful-panel {
  background:
    radial-gradient(circle at top right, rgba(255,203,69,0.18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(31,200,167,0.12), transparent 28%),
    linear-gradient(135deg, rgba(255,183,3,0.08), rgba(31,200,167,0.06)),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,243,255,0.94));
}

.notice {
  border-radius: 12px;
}

/* Student pages: still full-screen, but brighter and lower-stakes */
.student-shell {
  background:
    radial-gradient(circle at top right, rgba(255,110,168,0.14), transparent 26%),
    radial-gradient(circle at bottom left, rgba(31,200,167,0.12), transparent 24%),
    linear-gradient(180deg, #fbfcff 0%, #f4efff 100%);
}

.student-card {
  min-height: 100svh;
  padding: clamp(24px, 4.5vw, 54px);
  border-radius: 0;
  border: none;
  box-shadow: none;
  background:
    radial-gradient(circle at top left, rgba(116,92,255,0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(255,110,168,0.09), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,243,255,0.98));
}

.student-task-card h1,
.student-feedback-card h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
  max-width: 18ch;
}

.student-help {
  color: #555d88;
  font-size: clamp(1.08rem, 2vw, 1.34rem);
  max-width: 62rem;
}

.student-answer-wrap textarea {
  min-height: clamp(340px, 58vh, 760px);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.6;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,241,255,0.98));
}

.student-status-row {
  color: #4d547c;
  font-size: 1rem;
}

.feedback-panel {
  border-radius: 14px;
  border-color: rgba(116,92,255,0.1);
  background: rgba(255,255,255,0.74);
}

.feedback-panel p { color: #31365f; }

.positive-panel {
  background: linear-gradient(180deg, rgba(31,200,167,0.12), rgba(255,255,255,0.7));
}

.improvement-panel {
  background: linear-gradient(180deg, rgba(255,203,69,0.16), rgba(255,255,255,0.7));
}

.complete-panel,
.original-response-panel,
.processing-box {
  background: linear-gradient(180deg, rgba(116,92,255,0.11), rgba(255,255,255,0.74));
}

/* Teacher session page: compact student list with overlay detail panel */
.session-page .panel:last-of-type {
  overflow: visible;
}

.entry-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.entry-card {
  position: relative;
  overflow: visible;
  padding: 12px 14px;
  border: 1px solid rgba(116,92,255,0.12);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,241,255,0.94));
  box-shadow: 0 8px 18px rgba(66, 47, 124, 0.08);
}

.entry-card:hover,
.entry-card:focus-within {
  border-color: rgba(116,92,255,0.28);
  box-shadow: 0 16px 34px rgba(66, 47, 124, 0.12);
}

.entry-card:has(.badge-danger),
.entry-card:has(.badge-warn) {
  border-color: rgba(239,93,136,0.28);
  background:
    linear-gradient(180deg, rgba(255,247,250,0.98), rgba(255,242,246,0.96));
}

.entry-head {
  margin-bottom: 0;
  align-items: center;
}

.entry-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #22274e;
}

.entry-head .muted-text {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #6b739b;
}

.entry-badges {
  gap: 8px;
}

.entry-grid {
  display: block;
  margin-top: 0;
}

.entry-grid > div {
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.entry-grid > div:nth-child(1),
.entry-grid > div:nth-child(3),
.entry-grid > div:nth-child(4) {
  display: none;
}

.entry-grid > div:nth-child(2) {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(760px, calc(100vw - 56px));
  max-height: min(78vh, 820px);
  overflow: auto;
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  z-index: 70;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid rgba(116,92,255,0.14);
  background:
    radial-gradient(circle at top right, rgba(255,110,168,0.10), transparent 32%),
    radial-gradient(circle at bottom left, rgba(31,200,167,0.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,242,255,0.98));
  box-shadow: 0 28px 70px rgba(40, 26, 85, 0.22);
}

.entry-card:hover .entry-grid > div:nth-child(2),
.entry-card:focus-within .entry-grid > div:nth-child(2) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.entry-grid > div:nth-child(2) h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #252a52;
}

.entry-grid > div:nth-child(2) ul {
  margin: 0 0 10px;
}

.entry-grid > div:nth-child(2)::before {
  content: "AI feedback";
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(116,92,255,0.14), rgba(255,110,168,0.12));
  color: #4236bb;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.entry-card::after {
  content: "Hover for details";
  position: static;
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  color: #574cbd;
  background: rgba(116,92,255,0.08);
  box-shadow: none;
}

.entry-card:hover::after,
.entry-card:focus-within::after {
  opacity: 0.35;
}

.entry-card::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(27, 22, 64, 0.20);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  z-index: 60;
}

.entry-card:hover::before,
.entry-card:focus-within::before {
  opacity: 1;
}

.session-page .entry-grid > div:nth-child(2) p,
.session-page .entry-grid > div:nth-child(2) li,
.session-page .entry-grid > div:nth-child(2) .muted-text {
  color: #30365f;
}

/* Keep the safeguarding controls visible but much slimmer */
.entry-grid > div:nth-child(4) {
  display: block;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(116,92,255,0.14);
}

.entry-grid > div:nth-child(4) h4 {
  margin: 0 0 6px;
  font-size: 0.83rem;
  color: #363d67;
}

.entry-grid > div:nth-child(4) p {
  margin: 0 0 6px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #505881;
}

.entry-grid > div:nth-child(4) textarea {
  min-height: 62px;
  font-size: 0.9rem;
}

.entry-grid > div:nth-child(4) .form-row {
  gap: 6px;
}

.entry-grid > div:nth-child(4) .button {
  padding: 8px 10px;
  font-size: 0.8rem;
}

@media (max-width: 860px) {
  .entry-card::before,
  .entry-card::after {
    display: none;
  }

  .entry-grid > div:nth-child(1),
  .entry-grid > div:nth-child(3) {
    display: block;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(116,92,255,0.14);
  }

  .entry-grid > div:nth-child(2) {
    position: static;
    inset: auto;
    width: auto;
    max-height: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    margin-top: 10px;
    padding: 14px 15px;
    border-radius: 12px;
  }

  .entry-grid > div:nth-child(1),
  .entry-grid > div:nth-child(3),
  .entry-grid > div:nth-child(4) {
    display: block;
  }

  .student-card {
    padding: 22px 18px 28px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer,
  .panel,
  .join-card,
  .hero-card,
  .flash,
  .cookie-banner {
    border-radius: 12px;
  }

  .top-nav a,
  .nav-button-link,
  .inline-nav-form {
    width: 100%;
  }
}


/* ===== Proper teacher session review layout ===== */
.session-review-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.session-entry-sidebar {
  position: sticky;
  top: 18px;
}

.session-entry-list {
  display: grid;
  gap: 10px;
}

.session-entry-button {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(116,92,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,241,255,0.94));
  border-radius: 12px;
  padding: 12px 13px;
  color: #22274e;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(66, 47, 124, 0.08);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.session-entry-button:hover,
.session-entry-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(116,92,255,0.26);
  box-shadow: 0 14px 24px rgba(66, 47, 124, 0.12);
  outline: none;
}

.session-entry-button.is-active {
  border-color: rgba(116,92,255,0.42);
  background: linear-gradient(135deg, rgba(116,92,255,0.14), rgba(255,110,168,0.08)), linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,241,255,0.96));
  box-shadow: 0 18px 28px rgba(66, 47, 124, 0.14);
}

.session-entry-button.has-concern {
  border-color: rgba(239,93,136,0.24);
  background: linear-gradient(180deg, rgba(255,247,250,0.98), rgba(255,242,246,0.96));
}

.session-entry-button-main {
  display: grid;
  gap: 4px;
}

.session-entry-button-main strong {
  font-size: 0.98rem;
}

.session-entry-button-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.session-entry-detail-shell {
  min-width: 0;
}

.session-entry-detail {
  display: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(247,242,255,0.95));
  border: 1px solid rgba(116,92,255,0.12);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.session-entry-detail.is-active {
  display: block;
}

.session-entry-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.session-entry-detail-head h3 {
  margin: 0 0 4px;
  font-size: 1.18rem;
}

.session-entry-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-block {
  min-width: 0;
  background: rgba(255,255,255,0.74);
  border: 1px solid rgba(116,92,255,0.1);
  border-radius: 12px;
  padding: 14px;
}

.detail-block h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #252a52;
}

.detail-block p,
.detail-block li {
  color: #30365f;
}

.detail-block-answer,
.detail-block-reflection {
  min-height: 160px;
}

.detail-block-feedback {
  background: linear-gradient(180deg, rgba(116,92,255,0.09), rgba(255,255,255,0.74));
}

.detail-block-safeguarding {
  background: linear-gradient(180deg, rgba(255,203,69,0.08), rgba(255,255,255,0.78));
}

.detail-block-safeguarding-alert {
  background: linear-gradient(180deg, rgba(239,93,136,0.10), rgba(255,255,255,0.80));
  border-color: rgba(239,93,136,0.16);
}

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

  .session-entry-sidebar {
    position: static;
  }

  .session-entry-detail-grid {
    grid-template-columns: 1fr;
  }
}

.blacktext {color:black;}