:root {
  color-scheme: dark;
  --brand: #ff6b16;
  --brand-2: #ff9a3d;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --bg: #050914;
  --bg-2: #0b1220;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: #111a2c;
  --line: rgba(255, 255, 255, 0.1);
  --soft: rgba(255, 255, 255, 0.055);
  --success: #2dd4bf;
  --warning: #fbbf24;
  --danger: #fb7185;
  --info: #60a5fa;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgba(255, 107, 22, 0.16), transparent 34rem),
    radial-gradient(circle at 95% 8%, rgba(45, 212, 191, 0.1), transparent 28rem),
    linear-gradient(145deg, var(--bg), #02050c 70%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.light {
  color-scheme: light;
  --ink: #132033;
  --muted: #526278;
  --muted-2: #718096;
  --bg: #edf3f8;
  --bg-2: #f8fbfd;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --soft: rgba(15, 23, 42, 0.045);
  --shadow: 0 22px 60px rgba(51, 65, 85, 0.13);
}

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

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 107, 22, 0.38);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.5;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.actions-center {
  justify-content: center;
  margin-top: 22px;
}

.actions-end {
  justify-content: flex-end;
  margin-top: 22px;
}

.actions-end-sm {
  justify-content: flex-end;
  margin-top: 18px;
}

.no-wrap {
  flex-wrap: nowrap;
}

.spaced-top {
  margin-top: 22px;
}

.spaced-top-sm {
  margin-top: 14px;
}

.security-note-spaced {
  margin-top: 14px;
}

.metric-ready {
  margin: 24px 0;
}

.metric-live {
  margin-bottom: 15px;
}

.section-head-tight {
  margin-bottom: 9px;
}

.login-heading {
  margin: 4px 0 0 !important;
}

.session-heading {
  margin-top: 6px;
}

.setting-toggles {
  margin: 14px 0 18px;
}

.import-textarea {
  min-height: 260px;
}

.dialog-compact {
  width: min(520px, 100%);
}

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

.student-shell {
  width: min(1180px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 36px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(130%);
}

.panel-soft {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--brand), #e34d00);
  box-shadow: 0 14px 30px rgba(255, 107, 22, 0.28);
}

.brand-mark img {
  width: 34px;
  height: 34px;
}

.brand-title {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.96;
  text-transform: uppercase;
}

.brand-title span {
  color: var(--brand);
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.tiny {
  font-size: 0.76rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.master-nav {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 680px;
  margin: 0 auto 24px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 9, 20, 0.86);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
}

body.light .master-nav {
  background: rgba(255, 255, 255, 0.9);
}

.master-tab {
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.master-tab[aria-selected="true"] {
  background: linear-gradient(135deg, var(--brand), #df5005);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 107, 22, 0.2);
}

#dashboard[data-active-view="overview"] .dashboard-grid,
#dashboard[data-active-view="create"] .dashboard-grid,
#dashboard[data-active-view="results"] .dashboard-grid {
  grid-template-columns: 1fr;
}

#dashboard[data-active-view="overview"] .content-stack,
#dashboard[data-active-view="create"] .overview-stack,
#dashboard[data-active-view="results"] .overview-stack {
  display: none;
}

#dashboard[data-active-view="overview"] .overview-stack {
  display: grid;
  grid-template-columns: minmax(360px, 1.5fr) repeat(2, minmax(260px, 0.8fr));
  align-items: start;
}

#dashboard[data-active-view="create"] .content-stack,
#dashboard[data-active-view="results"] .content-stack {
  width: min(1100px, 100%);
  margin: 0 auto;
}

.ai-generator {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0, rgba(96, 165, 250, 0.13), transparent 18rem),
    linear-gradient(145deg, rgba(139, 92, 246, 0.12), rgba(255, 255, 255, 0.02));
}

.ai-generator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(125px, 0.7fr));
  gap: 11px;
}

.btn-ai {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
}

.compact-details {
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

.compact-details > summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  list-style: none;
}

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

.compact-details > summary::after {
  content: "＋";
  color: var(--brand);
  font-size: 1.1rem;
}

.compact-details[open] > summary::after {
  content: "−";
}

.compact-details-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.compact-details-body > :first-child {
  margin-top: 16px;
}

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

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.1);
}

.connection[data-state="online"] .connection-dot {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.1);
}

.connection[data-state="reconnecting"] .connection-dot {
  background: var(--warning);
  animation: pulse 1.25s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

.btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 22, 0.35);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary {
  border-color: rgba(255, 107, 22, 0.5);
  background: linear-gradient(135deg, var(--brand), #e65305);
  color: #ffffff;
  box-shadow: 0 13px 28px rgba(255, 107, 22, 0.22);
}

.btn-success {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(45, 212, 191, 0.12);
  color: var(--success);
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.24);
  background: rgba(251, 113, 133, 0.1);
  color: var(--danger);
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
}

.btn-icon {
  width: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1.15rem;
}

.btn-large {
  min-height: 58px;
  padding: 0 26px;
  border-radius: 18px;
}

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

.field label,
.field-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.14);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

body.light .input,
body.light .select,
body.light .textarea {
  background: rgba(255, 255, 255, 0.66);
}

.input,
.select {
  padding: 0 15px;
}

.textarea {
  min-height: 96px;
  padding: 14px 15px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(255, 107, 22, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 107, 22, 0.09);
}

.grid-2,
.grid-3,
.dashboard-grid,
.exam-layout,
.login-grid {
  display: grid;
  gap: 18px;
}

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

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

.dashboard-grid {
  grid-template-columns: minmax(300px, 0.72fr) minmax(520px, 1.6fr);
  align-items: start;
}

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

.section-card {
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.section-title span {
  color: var(--brand);
}

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

.metric {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 950;
}

.metric-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.student-list {
  display: grid;
  gap: 9px;
  max-height: 310px;
  overflow: auto;
}

.student-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 107, 22, 0.15);
  color: var(--brand);
  font-weight: 950;
}

.student-name {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.67rem;
}

.status-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  color: var(--info);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill[data-tone="success"] {
  background: rgba(45, 212, 191, 0.12);
  color: var(--success);
}

.status-pill[data-tone="warning"] {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
}

.empty-state {
  padding: 28px 14px;
  color: var(--muted-2);
  text-align: center;
  font-size: 0.78rem;
}

.builder-toolbar {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(120px, 0.65fr));
  gap: 12px;
  margin-bottom: 16px;
}

.question-list {
  display: grid;
  gap: 14px;
}

.question-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--soft);
}

.question-editor summary {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}

.question-editor summary::-webkit-details-marker {
  display: none;
}

.question-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--brand), #db4b00);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 950;
}

.question-summary {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 17px;
  border-top: 1px solid var(--line);
}

.question-body > :first-child {
  margin-top: 16px;
}

.option-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.option-radio {
  width: 19px;
  height: 19px;
  accent-color: var(--brand);
}

.image-preview {
  width: 100%;
  max-height: 260px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #070b13;
}

.payload-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.payload-meter span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  transition: width 240ms ease;
}

.publish-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(255, 107, 22, 0.28);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 107, 22, 0.12), rgba(255, 255, 255, 0.025));
}

.table-wrap {
  overflow: auto;
}

.results-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.results-table th {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-table td {
  font-size: 0.78rem;
}

.score {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 950;
}

.integrity-review {
  color: var(--warning);
}

.integrity-ok {
  color: var(--success);
}

.login-overlay,
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 5, 12, 0.9);
  backdrop-filter: blur(18px);
}

.login-card,
.dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: clamp(22px, 5vw, 38px);
}

.login-card h1,
.dialog h2 {
  margin: 14px 0 8px;
  font-size: clamp(1.7rem, 6vw, 2.7rem);
  letter-spacing: -0.06em;
}

.dialog {
  width: min(760px, 100%);
}

.qr-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 22px;
}

.qr-box {
  width: 210px;
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
}

.qr-box img,
.qr-box canvas {
  max-width: 100%;
}

.join-url {
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.setup-card {
  width: min(850px, 100%);
  margin: 4vh auto 0;
  padding: clamp(22px, 5vw, 48px);
}

.setup-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.setup-hero h1 {
  margin: 8px 0;
  font-size: clamp(2.3rem, 8vw, 4.6rem);
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.setup-hero h1 span {
  color: var(--brand);
}

.hero-badge {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 107, 22, 0.28);
  border-radius: 38px;
  background: rgba(255, 107, 22, 0.09);
  transform: rotate(5deg);
}

.hero-badge img {
  width: 84px;
  height: 84px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.choice {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
}

.choice[aria-pressed="true"] {
  border-color: rgba(255, 107, 22, 0.75);
  background: rgba(255, 107, 22, 0.14);
  color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 107, 22, 0.07);
}

.compat-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 15px;
  background: rgba(96, 165, 250, 0.08);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.waiting-card,
.ready-card,
.submitted-card {
  width: min(720px, 100%);
  margin: 9vh auto 0;
  padding: clamp(24px, 6vw, 48px);
  text-align: center;
}

.waiting-orbit {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  border: 7px solid rgba(255, 107, 22, 0.13);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ready-title {
  margin: 14px 0 8px;
  font-size: clamp(2rem, 8vw, 3.5rem);
  letter-spacing: -0.065em;
}

.exam-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(5, 9, 20, 0.88);
  backdrop-filter: blur(20px);
}

body.light .exam-header {
  background: rgba(255, 255, 255, 0.88);
}

.exam-title {
  overflow: hidden;
  margin: 0;
  font-size: clamp(0.92rem, 3vw, 1.18rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer {
  min-width: 104px;
  color: var(--brand);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.42rem;
  font-weight: 950;
  text-align: right;
}

.exam-layout {
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
}

.exam-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 13px;
  padding: 16px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 250ms var(--ease);
}

.navigator {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.nav-dot {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 900;
}

.nav-dot.is-current {
  border-color: var(--brand);
  color: var(--brand);
}

.nav-dot.is-answered {
  background: rgba(45, 212, 191, 0.14);
  color: var(--success);
}

.question-card {
  min-height: min(680px, calc(100vh - 125px));
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vw, 38px);
}

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

.question-kicker span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-prompt {
  margin: 0 0 22px;
  font-size: clamp(1.35rem, 4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.question-image {
  width: 100%;
  max-height: 330px;
  margin-bottom: 20px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #070a10;
}

.answer-grid {
  display: grid;
  gap: 11px;
  margin-bottom: 26px;
}

.answer {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--soft);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 170ms var(--ease), border-color 170ms ease, background 170ms ease;
}

.answer:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 107, 22, 0.28);
}

.answer.is-selected {
  border-color: var(--brand);
  background: rgba(255, 107, 22, 0.12);
}

.answer-letter {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 107, 22, 0.12);
  color: var(--brand);
  font-weight: 950;
}

.answer.is-selected .answer-letter {
  background: var(--brand);
  color: #fff;
}

.question-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.motivation {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

[data-experience="explorer"] {
  --brand: #ff7a18;
  --brand-2: #ffd166;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 209, 102, 0.16), transparent 26rem),
    radial-gradient(circle at 90% 5%, rgba(6, 214, 160, 0.12), transparent 25rem),
    #07101c;
}

[data-experience="explorer"] .question-card {
  border-color: rgba(255, 209, 102, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 122, 24, 0.08), transparent 42%),
    var(--panel);
}

[data-experience="explorer"] .answer {
  min-height: 70px;
  font-size: 1.02rem;
}

[data-experience="quest"] {
  --brand: #8b5cf6;
  --brand-2: #38bdf8;
}

[data-experience="quest"] .progress-fill {
  background: linear-gradient(90deg, #8b5cf6, #38bdf8);
}

[data-experience="focus"] {
  --brand: #f97316;
  --brand-2: #fb923c;
}

.result-score {
  margin: 18px 0 8px;
  color: var(--brand);
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 950;
  letter-spacing: -0.08em;
}

.feedback-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  text-align: left;
}

.feedback-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
  font-size: 0.77rem;
}

.security-note {
  padding: 11px 13px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.08);
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.45;
}

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 4000;
  width: min(380px, calc(100% - 32px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-error {
  border-left-color: var(--danger);
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 3500;
  overflow: hidden;
  pointer-events: none;
}

.confetti i {
  --drift: 0;
  position: absolute;
  top: -20px;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  animation: confetti-fall 2.8s ease-in forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--drift), 110vh, 0) rotate(720deg);
  }
}

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

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

  #dashboard[data-active-view="overview"] .overview-stack {
    grid-template-columns: 1fr 1fr;
  }

  #dashboard[data-active-view="overview"] .overview-stack > :first-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 780px) {
  .shell,
  .student-shell {
    width: min(100% - 20px, 100%);
    padding-top: 10px;
  }

  .page-header {
    align-items: flex-start;
  }

  .page-header,
  .setup-hero,
  .qr-stage {
    grid-template-columns: 1fr;
  }

  .master-nav {
    top: 6px;
  }

  #dashboard[data-active-view="overview"] .overview-stack {
    grid-template-columns: 1fr;
  }

  #dashboard[data-active-view="overview"] .overview-stack > :first-child {
    grid-column: auto;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .header-actions .connection {
    order: -1;
    width: 100%;
    justify-content: center;
  }

  .grid-2,
  .grid-3,
  .login-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-badge {
    display: none;
  }

  .exam-layout {
    grid-template-columns: 1fr;
  }

  .exam-side {
    position: static;
  }

  .exam-side .navigator {
    grid-template-columns: repeat(10, minmax(28px, 1fr));
  }

  .question-card {
    min-height: calc(100vh - 300px);
  }

  .qr-box {
    width: min(240px, 100%);
    min-height: auto;
    margin: auto;
  }
}

@media (max-width: 560px) {
  :root {
    --radius-xl: 24px;
    --radius-lg: 18px;
  }

  .brand-mark {
    width: 45px;
    height: 45px;
    border-radius: 15px;
  }

  .brand-mark img {
    width: 29px;
    height: 29px;
  }

  .header-actions {
    gap: 7px;
  }

  .header-actions .btn {
    min-height: 40px;
    padding: 0 12px;
    font-size: 0.68rem;
  }

  .section-card,
  .setup-card,
  .question-card {
    padding: 18px;
  }

  .builder-toolbar {
    grid-template-columns: 1fr;
  }

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

  .ai-generator-head {
    flex-direction: column;
  }

  .metric-grid {
    gap: 6px;
  }

  .metric {
    padding: 11px 8px;
  }

  .metric-value {
    font-size: 1.25rem;
  }

  .choice-row {
    grid-template-columns: 1fr;
  }

  .exam-header {
    top: 6px;
  }

  .exam-side .navigator {
    grid-template-columns: repeat(6, minmax(32px, 1fr));
  }

  .question-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .question-actions .inline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .question-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
