﻿:root {
  --bg: #0e1319;
  --panel: #151d26;
  --panel-2: #1c2733;
  --line: #2a3a4c;
  --text: #ecf2f8;
  --muted: #b9c8d8;
  --primary: #63b3ff;
  --primary-strong: #2f92f0;
  --success: #25b26a;
  --danger: #e25858;
  --warning: #f0ab3d;
  --mobile-font-scale: 1;
  --mobile-btn-scale: 1;
  --mobile-space-scale: 1;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #0b1016 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
code, pre, input, select, textarea, button { font-family: inherit; }

.home-shortcut {
  position: fixed;
  top: 10px;
  right: 12px;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(9, 13, 18, 0.72);
  backdrop-filter: blur(8px);
  color: #ecf2f8;
  z-index: 90;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.home-shortcut svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.home-shortcut:hover {
  transform: translateY(-1px);
  background: rgba(34, 53, 72, 0.9);
  border-color: rgba(99,179,255,0.7);
}
.home-shortcut:focus-visible {
  outline: 2px solid #63b3ff;
  outline-offset: 2px;
}

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(10, 14, 19, 0.88);
  backdrop-filter: blur(10px);
}
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--muted);
  justify-content: center;
}
.brand { font-weight: 800; letter-spacing: 0.02em; }
.nav { display: flex; gap: 1rem; color: var(--muted); }
.nav a:hover { color: var(--text); }

.container {
  width: min(1280px, calc(100% - 2rem));
  margin: 1.25rem auto 2rem;
}
.start-main {
  width: min(900px, calc(100% - 2rem));
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  background: linear-gradient(180deg, rgba(25,34,44,0.95), rgba(17,24,31,0.98));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 22px;
  padding: 1.3rem;
  box-shadow: 0 18px 45px rgba(0,0,0,0.26);
}
.grid { display: grid; gap: 1rem; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
.stat-box, .metric-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  min-height: 120px;
}
.stat-number, .metric-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
}
.stat-label, .metric-label { color: var(--muted); }
.metric-delta {
  font-weight: 800;
  font-size: 1rem;
}
.metric-delta.up { color: #97f3c3; }
.metric-delta.down { color: #ffc2c2; }
.metric-delta.flat { color: var(--muted); }
.eyebrow {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 700;
}
.start-screen {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.start-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: min(900px, 100%);
}
.start-title {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  text-align: center;
}
.start-challenge {
  width: min(860px, 100%);
  display: grid;
  gap: 0.85rem;
}

.start-challenge h2 {
  margin: 0;
  font-size: 1.35rem;
}

.start-challenge-meter {
  margin-top: 0.2rem;
}

.start-challenge-copy {
  margin: 0;
  text-align: left;
  line-height: 1.55;
}
h1, h2, h3 { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; }
.lead {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}
.muted { color: var(--muted); }

.inline-actions, .result-actions, .admin-actions, .center-action, .admin-header-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.center-action { justify-content: center; }
.admin-header-row { justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.admin-header-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.admin-filter-form label {
  display: grid;
  gap: 0.3rem;
}
.section-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

.btn {
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  background: rgba(255,255,255,0.04);
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
  color: #06111b;
  border-color: transparent;
}
.btn-danger {
  background: rgba(226,88,88,0.14);
  border-color: rgba(226,88,88,0.4);
}
.btn-large {
  min-height: 64px;
  min-width: 220px;
  font-size: 1.15rem;
}
.btn-xl {
  min-height: 84px;
  min-width: 260px;
  font-size: 1.5rem;
  border-radius: 18px;
}

.flash-stack { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.flash {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}
.flash.success { background: rgba(37,178,106,0.14); border-color: rgba(37,178,106,0.35); }
.flash.error { background: rgba(226,88,88,0.14); border-color: rgba(226,88,88,0.35); }

.quiz-card, .feedback-card, .result-hero { max-width: 980px; margin: 0 auto 1rem; }
.quiz-card {
  display: block;
  max-height: none;
  overflow: visible;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.progress-pill {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  color: var(--muted);
}
.progress-bar {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #85d6ff);
}
.media-stage {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.quiz-media {
  display: block;
  width: 100%;
  max-height: min(48vh, calc(100vh - 430px));
  object-fit: contain;
  border-radius: 14px;
  background: #06090d;
}
.quiz-card.is-answered .quiz-media {
  max-height: min(38vh, calc(100vh - 560px));
}
.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 3;
  margin-top: 0.2rem;
}
.answer-btn {
  min-height: 102px;
  border: none;
  border-radius: 20px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
}
.answer-ai { background: linear-gradient(180deg, #ab78ff, #7b4ed9); color: white; }
.answer-real { background: linear-gradient(180deg, #44d290, #239663); color: white; }

.feedback-card.correct { border-color: rgba(37,178,106,0.35); }
.feedback-card.wrong { border-color: rgba(226,88,88,0.35); }
.feedback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.feedback-box {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.feedback-box .label { display: block; color: var(--muted); margin-bottom: 0.35rem; }
.feedback-note {
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 1rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.answer-grid-locked {
  margin-bottom: 1rem;
}
.disabled-answer {
  cursor: not-allowed;
}
.unselected-answer {
  opacity: 0.28;
  filter: grayscale(0.1);
}
.selected-answer {
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.18), 0 16px 34px rgba(0,0,0,0.26);
  transform: scale(1.01);
  animation: selectedPulse 220ms ease-out;
}
.inline-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  animation: feedbackReveal 220ms ease-out;
}
.inline-feedback.correct {
  border-color: rgba(37,178,106,0.65);
  background: rgba(37,178,106,0.20);
}
.inline-feedback.wrong {
  border-color: rgba(226,88,88,0.65);
  background: rgba(226,88,88,0.20);
}
.inline-feedback-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.inline-feedback-head.simple {
  justify-content: center;
  text-align: center;
  margin-bottom: 0.35rem;
}
.inline-feedback-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
}
.inline-feedback.correct .inline-feedback-head h2 {
  color: #b8ffd9;
}
.inline-feedback.wrong .inline-feedback-head h2 {
  color: #ffd1d1;
}
.inline-feedback-result {
  color: var(--muted);
  font-weight: 700;
}
.feedback-grid.compact {
  margin-top: 0;
}
.top-gap {
  margin-top: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}
.badge.good { background: rgba(37,178,106,0.16); color: #97f3c3; }
.badge.bad { background: rgba(226,88,88,0.16); color: #ffc2c2; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}
th, td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-size: 0.92rem; }
tr:last-child td { border-bottom: none; }

.stack-form { display: grid; gap: 1rem; }
.stack-form label { display: grid; gap: 0.4rem; }
.check-row { display: flex !important; align-items: center; gap: 0.6rem; }
.checkbox-cell { text-align: center; }
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
}
input[type="checkbox"] { transform: scale(1.2); }
.narrow-form { max-width: 420px; }
.admin-login-card { max-width: 520px; margin: 4rem auto; }

.bars { display: grid; gap: 0.9rem; }
.distribution-bars .bar-track span {
  background: linear-gradient(90deg, #58b3ff, #239663);
}
.bar-row {
  display: grid;
  grid-template-columns: 1.4fr 2fr auto;
  gap: 0.8rem;
  align-items: center;
}
.bar-track {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff9074, #f0ab3d);
}

@media (max-width: 900px) {
  .two-col, .metrics-grid, .feedback-grid, .answer-grid {
    grid-template-columns: 1fr;
  }
  .progress-row, .admin-header-row, .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-header-actions, .admin-filter-form {
    width: 100%;
  }
  .bar-row { grid-template-columns: 1fr; }
  .site-header, .site-footer { padding-inline: 1rem; }
}


.comparison-note {
  margin-top: 0.75rem;
}
.result-comparison-wrap {
  margin: 1rem 0 1.25rem;
}
.comparison-meter {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.comparison-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}
.comparison-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(226,88,88,0.18), rgba(240,171,61,0.18) 50%, rgba(37,178,106,0.22));
  border: 1px solid rgba(255,255,255,0.08);
  overflow: visible;
}
.comparison-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
.comparison-marker::before {
  content: "";
  display: block;
  width: 4px;
  height: 30px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 0 0 3px rgba(8,12,16,0.55);
}
.comparison-marker.avg::before {
  background: #f0ab3d;
}
.comparison-marker.current::before {
  background: var(--primary);
}
.comparison-tag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 0.55rem);
  white-space: nowrap;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 800;
  background: rgba(14,19,25,0.96);
  border: 1px solid rgba(255,255,255,0.1);
}
.comparison-marker.current .comparison-tag {
  bottom: auto;
  top: calc(100% + 0.55rem);
}
.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}
.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: 0.4rem;
  vertical-align: -1px;
}
.legend-dot.avg {
  background: #f0ab3d;
}
.legend-dot.current {
  background: var(--primary);
}


textarea { min-height: 110px; resize: vertical; }
.start-secondary { min-width: 260px; text-align: center; }
.guide-hero { max-width: 980px; margin: 0 auto 1rem; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.guide-card { display: grid; gap: 1rem; }
.guide-media-stage {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 1rem;
}
.guide-media {
  display: block;
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 14px;
  background: #06090d;
}
.guide-copy h2 { margin-bottom: 0.65rem; }
.guide-copy p { margin: 0; color: var(--muted); line-height: 1.7; white-space: pre-line; }
@media (max-width: 900px) {
  .guide-grid { grid-template-columns: 1fr; }
}

.auto-return-note {
  margin: 1rem 0 1.2rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(99,179,255,0.12);
  border: 1px solid rgba(99,179,255,0.26);
  color: var(--text);
  text-align: center;
  font-weight: 700;
}
.wait-more-btn {
  margin-left: 0.8rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
}

.result-accordion {
  display: grid;
  gap: 0.7rem;
}

.result-item {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

.result-item-head {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.result-item-head:hover {
  background: rgba(255,255,255,0.04);
}

.result-item-head.open {
  background: rgba(99,179,255,0.12);
}

.result-item-title {
  font-weight: 800;
  font-size: 1.1rem;
}

.result-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  white-space: nowrap;
}

.result-item-panel {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.result-item-media-stage {
  margin-top: 0.9rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  padding: 0.6rem;
}

.result-item-media {
  width: 100%;
  max-height: min(56vh, 700px);
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.result-item-copy {
  margin-top: 0.75rem;
  color: var(--muted);
}

.result-item-copy p {
  margin: 0.3rem 0;
}

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

@keyframes selectedPulse {
  from {
    transform: scale(0.985);
  }
  to {
    transform: scale(1.01);
  }
}

.story-main {
  width: min(1080px, calc(100% - 1.2rem));
  margin-top: 0.7rem;
}

.guide-intro {
  max-width: 980px;
  margin: 0 auto 1rem;
  text-align: center;
}
.guide-intro .eyebrow {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  letter-spacing: 0.12em;
}

.guide-story {
  display: grid;
  gap: 1rem;
  scroll-snap-type: y mandatory;
}

.guide-slide {
  min-height: 88vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.guide-slide-top h2 {
  margin: 0.2rem 0 0;
  font-size: clamp(2.1rem, 3.8vw, 3.2rem);
  line-height: 1.16;
}

.guide-slide-media {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  background: transparent;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.guide-media {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 14px;
  background: transparent;
}

.guide-slide-copy {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.8rem;
}

.guide-slide-copy p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.9vw, 1.45rem);
  line-height: 1.55;
  white-space: pre-line;
}

.guide-slide-actions {
  margin-top: 0.9rem;
  display: block;
  width: 100%;
}

.guide-slide-actions form {
  width: 100%;
}

.guide-slide-actions .btn {
  width: 100%;
  display: block;
}

.final-quiz-btn {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  font-size: 1.7rem;
  border-radius: 20px;
}

@media (orientation: portrait) and (min-height: 1500px) {
  .story-main {
    width: min(1040px, calc(100% - 1rem));
  }
  .guide-slide {
    min-height: 90vh;
  }
  .guide-slide-copy p {
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  }
}

/* Result Upgrade: Hero + Rich Accordion */
.result-hero-upgrade {
  animation: resultHeroIn 280ms ease-out;
}

.result-hero-grid {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 1fr;
  gap: 1rem;
  align-items: center;
}

.result-score-ring {
  --score: 0;
  width: min(210px, 45vw);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  padding: 10px;
  background:
    conic-gradient(from -90deg, #63b3ff calc(var(--score) * 1%), rgba(255,255,255,0.08) 0),
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.22), rgba(255,255,255,0.04));
  box-shadow: 0 16px 34px rgba(0,0,0,0.28);
}

.result-score-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(8,12,17,0.92), rgba(12,18,25,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  display: grid;
  place-content: center;
  text-align: center;
}

.result-score-value {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
}

.result-score-label {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-hero-copy h1 {
  margin-bottom: 0.2rem;
}

.result-badge-chip {
  display: inline-flex;
  margin-top: 0.55rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(99,179,255,0.17);
  border: 1px solid rgba(99,179,255,0.4);
}

.result-actions.result-hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.result-actions.result-hero-actions form {
  width: 100%;
}

.result-actions.result-hero-actions .btn {
  width: 100%;
  min-height: 68px;
  font-size: 1.2rem;
}

.result-accordion {
  gap: 0.9rem;
}

.result-item {
  border-width: 1px;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.result-item.good {
  border-color: rgba(37,178,106,0.36);
  background: linear-gradient(180deg, rgba(37,178,106,0.08), rgba(17,24,31,0.95));
}

.result-item.bad {
  border-color: rgba(226,88,88,0.36);
  background: linear-gradient(180deg, rgba(226,88,88,0.08), rgba(17,24,31,0.95));
}

.result-item-head {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
}

.result-item-head.open {
  background: rgba(99,179,255,0.1);
}

.result-item-thumb-wrap {
  width: 92px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35);
}

.result-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-item-main {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.result-item-title {
  font-size: 1.08rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item-sub {
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-item-chevron {
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform 180ms ease;
}

.result-item-head.open .result-item-chevron {
  transform: rotate(180deg);
}

.result-item-panel {
  animation: resultPanelIn 220ms ease-out;
}

.result-item-media-stage {
  background: rgba(0,0,0,0.3);
}

.result-ai-note {
  margin-top: 0.8rem;
  border: 1px solid rgba(99,179,255,0.32);
  background: rgba(99,179,255,0.11);
  color: #d9ecff;
}

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

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

@media (max-width: 900px) {
  .result-hero-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .result-actions.result-hero-actions {
    grid-template-columns: 1fr;
  }

  .result-item-head {
    grid-template-columns: 74px 1fr auto;
    gap: 0.7rem;
  }

  .result-item-thumb-wrap {
    width: 74px;
    height: 58px;
  }
}

/* Admin Media Workspace */
.media-workspace {
  display: grid;
  gap: 1rem;
}

.media-tab-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.media-tab-btn {
  min-height: 46px;
}

.media-admin-panel {
  display: grid;
  gap: 0.8rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
}

.media-admin-panel.active {
  border-color: rgba(99,179,255,0.35);
  background: rgba(99,179,255,0.06);
}

.compact-head {
  margin-bottom: 0;
}

.media-tools {
  display: grid;
  gap: 0.8rem;
}

.upload-card {
  display: grid;
  gap: 0.9rem;
  border: 1px solid rgba(99,179,255,0.24);
  border-radius: 16px;
  padding: 0.95rem;
  background: rgba(99,179,255,0.05);
}

.upload-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.upload-head h4 {
  margin: 0;
}

.upload-duplicate-mode {
  display: grid;
  gap: 0.35rem;
  min-width: 180px;
}

.media-dropzone {
  border: 1px dashed rgba(99,179,255,0.58);
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(6, 11, 18, 0.52);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.media-dropzone:hover,
.media-dropzone.dragover {
  border-color: rgba(99,179,255,0.95);
  background: rgba(22, 50, 82, 0.42);
  transform: translateY(-1px);
}

.media-dropzone p {
  margin: 0.2rem 0;
}

.upload-queue {
  display: grid;
  gap: 0.65rem;
}

.upload-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}

.upload-queue-list {
  display: grid;
  gap: 0.6rem;
  max-height: 38vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.upload-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.8rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.55rem;
  background: rgba(255,255,255,0.02);
}

.upload-item-preview {
  border-radius: 9px;
  overflow: hidden;
  background: rgba(4,8,13,0.9);
  aspect-ratio: 4 / 3;
}

.upload-item-preview img,
.upload-item-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-item-content {
  display: grid;
  gap: 0.35rem;
}

.upload-item-title {
  font-weight: 700;
  word-break: break-word;
}

.upload-item-status {
  font-size: 0.9rem;
  color: var(--muted);
}

.upload-item-status.ok {
  color: #71f0b8;
}

.upload-item-status.warn {
  color: #ffd57b;
}

.upload-item-status.error {
  color: #ff8f8f;
}

.upload-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}

.upload-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2d8eff 0%, #69beff 100%);
  transition: width 140ms linear;
}

.upload-item-warnings {
  margin: 0;
  padding-left: 1.05rem;
  display: grid;
  gap: 0.2rem;
  color: #ffd57b;
  font-size: 0.86rem;
}

.media-search {
  display: grid;
  gap: 0.35rem;
}

.media-bulk-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.media-bulk-tools label {
  display: grid;
  gap: 0.35rem;
  min-width: 130px;
}

.media-admin-form .table-wrap {
  max-height: 68vh;
  overflow: auto;
}

.media-admin-form thead th {
  position: sticky;
  top: 0;
  background: rgba(14,19,25,0.96);
  z-index: 2;
}

.file-preview-trigger {
  display: inline-block;
  cursor: zoom-in;
  text-decoration: underline dotted rgba(99,179,255,0.7);
  text-underline-offset: 2px;
}

.file-preview-popover {
  position: fixed;
  left: 0;
  top: 0;
  width: min(360px, 40vw);
  aspect-ratio: 16 / 10;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(99,179,255,0.45);
  background: rgba(8,12,17,0.94);
  box-shadow: 0 18px 46px rgba(0,0,0,0.45);
  z-index: 120;
  pointer-events: none;
}

.file-preview-popover img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: contain;
  background: #06090d;
  display: block;
}

.file-preview-popover video {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: contain;
  background: #06090d;
  display: block;
}

.file-preview-popover img[hidden],
.file-preview-popover video[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  body {
    font-size: calc(14px * var(--mobile-font-scale));
  }

  body .container {
    width: calc(100% - 0.75rem);
    margin: 0.55rem auto 0.95rem;
    padding-bottom: 0.9rem;
  }

  body .start-main {
    width: calc(100% - 0.75rem);
    min-height: calc(100vh - 120px);
  }

  body .card {
    border-radius: 16px;
    padding: calc(0.85rem * var(--mobile-space-scale));
    box-shadow: 0 12px 28px rgba(0,0,0,0.24);
  }

  body h1 {
    font-size: clamp(1.6rem, 8vw, 2.25rem);
  }

  body h2 {
    font-size: 1.1rem;
  }

  body .lead {
    font-size: calc(0.97rem * var(--mobile-font-scale));
    line-height: 1.45;
  }

  body .home-shortcut {
    width: 40px;
    height: 40px;
    top: 8px;
    right: 8px;
    border-radius: 10px;
  }

  body .home-shortcut svg {
    width: 18px;
    height: 18px;
  }

  body .start-form {
    gap: 1rem;
  }

  body .start-title {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  body .btn {
    padding: calc(0.58rem * var(--mobile-btn-scale)) calc(0.85rem * var(--mobile-btn-scale));
    border-radius: 12px;
    font-size: calc(0.96rem * var(--mobile-font-scale));
  }

  body .btn-large,
  body .start-secondary {
    min-width: 0;
    width: 100%;
    min-height: calc(52px * var(--mobile-btn-scale));
    font-size: calc(1rem * var(--mobile-font-scale));
  }

  body .btn-xl {
    min-width: 0;
    width: min(100%, 340px);
    min-height: calc(62px * var(--mobile-btn-scale));
    font-size: calc(1.15rem * var(--mobile-font-scale));
    border-radius: 14px;
  }

  body .quiz-media {
    max-height: min(42vh, calc(100vh - 320px));
    border-radius: 10px;
  }

  body .quiz-card.is-answered .quiz-media {
    max-height: min(35vh, calc(100vh - 440px));
  }

  body .media-stage {
    border-radius: 14px;
    padding: 0.65rem;
  }

  body .answer-grid {
    gap: 0.6rem;
  }

  body .answer-btn {
    min-height: calc(74px * var(--mobile-btn-scale));
    border-radius: 14px;
    font-size: clamp(1.08rem, 6vw, 1.42rem);
  }

  body .inline-feedback {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 14px;
  }

  body .inline-feedback-head h2 {
    font-size: clamp(1.45rem, 7.2vw, 2rem);
  }

  body .feedback-note {
    font-size: calc(0.98rem * var(--mobile-font-scale));
    line-height: 1.45;
    padding: 0.8rem;
    border-radius: 12px;
  }

  body .comparison-meter {
    padding: 0.75rem;
    border-radius: 14px;
  }

  body .comparison-track {
    height: 14px;
  }

  body .comparison-tag {
    font-size: 0.74rem;
    padding: 0.22rem 0.44rem;
  }

  body .final-quiz-btn {
    min-height: calc(70px * var(--mobile-btn-scale));
    font-size: clamp(1.15rem, 6vw, 1.45rem);
    border-radius: 14px;
  }

  body .result-actions.result-hero-actions .btn {
    min-height: calc(54px * var(--mobile-btn-scale));
    font-size: calc(1rem * var(--mobile-font-scale));
  }

  body .guide-slide {
    min-height: auto;
  }

  body .guide-slide-top h2 {
    font-size: clamp(1.42rem, 8vw, 2rem);
    line-height: 1.22;
  }

  body .guide-slide-copy p {
    font-size: clamp(0.97rem, 4vw, 1.14rem);
    line-height: 1.45;
  }

  body input[type="text"],
  body input[type="number"],
  body input[type="password"],
  body select,
  body textarea {
    padding: 0.58rem 0.68rem;
    border-radius: 10px;
    font-size: calc(0.95rem * var(--mobile-font-scale));
  }

  body th,
  body td {
    padding: 0.52rem 0.55rem;
    font-size: calc(0.85rem * var(--mobile-font-scale));
  }

  body .media-admin-form .table-wrap {
    max-height: 52vh;
  }

  body .upload-queue-list {
    max-height: 32vh;
  }
}

@media (max-width: 900px) {
  .upload-item {
    grid-template-columns: 1fr;
  }

  .upload-item-preview {
    max-width: 180px;
  }

  .media-bulk-tools {
    width: 100%;
  }
  .media-bulk-tools label {
    min-width: 0;
    flex: 1 1 140px;
  }
}

