/* ==========================================================================
   Tampilan siswa — mobile-first
   ========================================================================== */

body.student {
  font-size: 1.0625rem;
  min-height: 100vh;
  min-height: 100dvh;
}

.flagband {
  height: 8px;
  background: linear-gradient(var(--red-600) 50%, #fff 50%);
  border-bottom: 1px solid var(--line);
}

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

.view {
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  animation: view-in 0.3s var(--ease);
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--navy-800);
  text-decoration: none;
  letter-spacing: -0.005em;
}
.brand img {
  width: 30px;
  height: 30px;
}

/* ------------------------------------------------------------------ landing */
.landing {
  display: grid;
  gap: 1.5rem;
  padding-top: 0.25rem;
}
.hero-art {
  margin: 0 -16px;
  background: linear-gradient(#fff, #fff 70%, var(--paper));
  border-bottom: 1px solid var(--line);
}
.hero-art img {
  width: 100%;
  height: auto;
  max-width: 640px;
  margin: 0 auto;
}
.landing-title {
  font-size: clamp(2rem, 8.4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--navy-800);
}
.landing-sub {
  margin-top: 0.85rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34ch;
}
.landing-cta {
  display: grid;
  gap: 0.75rem;
}
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  border-top: 1px solid var(--line);
}
.facts li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
  color: var(--ink-2);
}
.facts .fact-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--navy-50);
  color: var(--navy-700);
  flex: none;
}
.resume-box {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1.5px solid var(--navy-200);
  border-radius: var(--radius);
  background: var(--navy-50);
}
.resume-box p {
  font-size: 0.95rem;
  color: var(--ink-2);
}

@media (min-width: 960px) {
  .wrap-wide {
    max-width: 1120px;
  }
  .landing {
    grid-template-columns: 1fr 1.15fr;
    grid-template-areas: "text art";
    align-items: center;
    gap: 3rem;
    padding-top: 2rem;
  }
  .hero-art {
    grid-area: art;
    margin: 0;
    border: 0;
    background: none;
  }
  .landing-text {
    grid-area: text;
  }
  .landing-cta .btn {
    justify-self: start;
    min-width: 260px;
  }
}

/* ------------------------------------------------------------------ halaman isian */
.page-head {
  display: grid;
  gap: 0.4rem;
  padding: 0.5rem 0 1.25rem;
}
.page-head h1 {
  font-size: 1.75rem;
  font-weight: 800;
}
.page-head p {
  color: var(--ink-2);
}
.step-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

.sheet {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
@media (min-width: 640px) {
  .sheet {
    padding: 1.75rem;
  }
}
.sheet-actions {
  display: grid;
  gap: 0.6rem;
}
.form-row-2 {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 560px) {
  .form-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------------------------------------------ petunjuk */
.guide {
  display: grid;
  gap: 1rem;
  font-size: 1.0625rem;
  line-height: 1.65;
}
.guide-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0.9rem;
}
.guide-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.8rem;
  align-items: start;
}
.guide-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}
.legend {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 600;
}
.legend abbr {
  min-width: 2.6em;
  font-weight: 800;
  text-decoration: none;
  color: var(--navy-800);
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.dot-STS {
  background: var(--opt-sts);
}
.dot-TS {
  background: var(--opt-ts);
}
.dot-S {
  background: var(--opt-s);
}
.dot-SS {
  background: var(--opt-ss);
}

/* ------------------------------------------------------------------ kepala asesmen (sticky) */
.quiz-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(245, 247, 252, 0.94);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.quiz-head-inner {
  display: grid;
  gap: 0.55rem;
  padding-block: 10px 12px;
}
.quiz-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.case-counter {
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy-800);
}
.head-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.save-state.is-saved {
  color: var(--green-700);
}
.save-state.is-offline,
.save-state.is-error {
  color: var(--amber-700);
}
.timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--navy-800);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer-chip.is-low {
  background: var(--red-600);
}
.progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
}
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--navy-100);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--navy-700), var(--navy-600));
  transition: width 0.4s var(--ease);
}
.progress-pct {
  min-width: 3.2ch;
  text-align: right;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}
.case-dots {
  display: flex;
  gap: 6px;
}
.case-dot {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.case-dot.is-done {
  background: var(--navy-100);
  border-color: var(--navy-200);
  color: var(--navy-800);
}
.case-dot.is-current {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.progress-cheer {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-700);
}

/* ------------------------------------------------------------------ kartu kasus (halaman buku tulis) */
.quiz-body {
  display: grid;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
}
.read-first {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}
.scenario {
  position: relative;
  padding: 1.1rem 1.1rem 1.25rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.scenario::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.6rem;
  width: 2px;
  background: rgba(215, 38, 61, 0.5);
}
.scenario-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.scenario-kicker {
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--red-700);
  letter-spacing: 0.04em;
}
.scenario-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--navy-900);
}
.scenario-text {
  font-size: 1.0625rem;
  line-height: 32px;
  color: var(--ink);
  background-image: linear-gradient(to bottom, transparent 31px, var(--rule) 31px);
  background-size: 100% 32px;
  padding-bottom: 1px;
}
@media (min-width: 640px) {
  .scenario {
    padding: 1.5rem 1.75rem 1.6rem 3.25rem;
  }
  .scenario::before {
    left: 2.1rem;
  }
  .scenario-text {
    font-size: 1.125rem;
    line-height: 34px;
    background-image: linear-gradient(to bottom, transparent 33px, var(--rule) 33px);
    background-size: 100% 34px;
  }
}
.prompt {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.25rem 0.1rem;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--navy-800);
}
.prompt .icon {
  margin-top: 3px;
  color: var(--navy-600);
}

/* ------------------------------------------------------------------ kartu pernyataan */
.item-card {
  margin: 0;
  padding: 1.1rem 1rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  scroll-margin-top: 170px;
  scroll-margin-bottom: 120px;
  transition: border-color 0.2s;
  min-inline-size: 0;
}
.item-card.is-answered {
  border-color: var(--navy-200);
}
.item-card.is-missing {
  border-color: var(--amber-600);
  box-shadow: 0 0 0 3px var(--amber-50);
}
.item-card legend {
  display: contents;
}
.item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--navy-700);
}
.item-state {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted);
}
.item-card.is-answered .item-state {
  color: var(--green-700);
}
.item-statement {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.5;
  color: var(--ink);
}
.options {
  display: grid;
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .options {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 760px) {
  .options {
    grid-template-columns: repeat(4, 1fr);
  }
}
.option {
  position: relative;
  display: block;
}
.option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.option-face {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 54px;
  height: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.option-face .dot {
  width: 16px;
  height: 16px;
}
.option-label {
  flex: 1;
}
.option-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
  flex: none;
}
.option:hover .option-face {
  border-color: var(--navy-600);
}
.option input:focus-visible + .option-face {
  box-shadow: var(--focus-ring);
}
.option input:checked + .option-face {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
  animation: pick 0.24s var(--ease);
}
.option input:checked + .option-face .dot {
  box-shadow: 0 0 0 2px #fff;
}
.option input:checked + .option-face .option-check {
  background: #fff;
  border-color: #fff;
  color: var(--navy-800);
}
@keyframes pick {
  0% {
    transform: scale(0.97);
  }
  60% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}
@media (min-width: 760px) {
  .option-face {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0.45rem;
    min-height: 92px;
    padding: 0.75rem 0.6rem;
  }
  .option-check {
    display: none;
  }
}

/* ------------------------------------------------------------------ navigasi bawah */
.quiz-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20, 32, 73, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
}
.quiz-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding-block: 10px;
}
.quiz-nav-inner .btn {
  padding-inline: 0.75rem;
  white-space: nowrap;
}
.reread {
  position: fixed;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 29;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--navy-200);
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy-800);
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: var(--shadow-2);
  cursor: pointer;
}
@media (min-width: 900px) {
  .reread {
    right: calc(50% - 340px - 150px);
  }
}
.sheet-scenario {
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ review */
.tally {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.tally > div {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 0.75rem;
  text-align: center;
}
.tally > div + div {
  border-left: 1px solid var(--line);
}
.tally strong {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--navy-800);
  font-variant-numeric: tabular-nums;
}
.tally span {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}
.tally .is-warn strong {
  color: var(--amber-600);
}
.case-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.case-list li + li {
  border-top: 1px solid var(--line);
}
.case-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.case-row:hover {
  background: var(--navy-50);
}
.case-row-title {
  display: grid;
  gap: 0.1rem;
}
.case-row-title strong {
  font-size: 0.98rem;
  color: var(--navy-900);
}
.case-row-title span {
  font-size: 0.85rem;
  color: var(--muted);
}
.case-row-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.case-row-status.is-done {
  color: var(--green-700);
}
.case-row-status.is-missing {
  color: var(--amber-600);
}
.missing-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.missing-chips button {
  min-height: 36px;
  padding: 0.3rem 0.7rem;
  border: 1.5px solid #F0C982;
  border-radius: 10px;
  background: #fff;
  color: var(--amber-700);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}

/* ------------------------------------------------------------------ sukses */
.done {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 2.5rem 0 1rem;
  text-align: center;
}
.done-badge {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #fff;
  box-shadow: 0 0 0 10px var(--navy-100);
  animation: badge-in 0.5s var(--ease);
}
@keyframes badge-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
.done h1 {
  font-size: 1.6rem;
  font-weight: 800;
  max-width: 22ch;
}
.done p {
  color: var(--ink-2);
  max-width: 40ch;
}
.receipt {
  display: grid;
  gap: 0.35rem;
  width: 100%;
  max-width: 420px;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  font-size: 0.95rem;
}
.receipt div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.receipt dt {
  color: var(--muted);
}
.receipt dd {
  margin: 0;
  font-weight: 800;
  color: var(--navy-900);
  text-align: right;
}
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}
.confetti i {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0.9;
  }
}

/* ------------------------------------------------------------------ status/pesan */
.center-state {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 3.5rem 0;
  text-align: center;
}
.center-state .icon-wrap {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--navy-50);
  color: var(--navy-700);
}
.center-state h1 {
  font-size: 1.4rem;
}
.center-state p {
  color: var(--ink-2);
  max-width: 40ch;
}
.loading-screen {
  display: grid;
  place-items: center;
  min-height: 60vh;
}
.mode-ribbon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.35rem 1rem;
  background: var(--sun-50);
  border-bottom: 1px solid #F3D48A;
  color: #6A4300;
  font-size: 0.8125rem;
  font-weight: 700;
}
.debug-panel {
  position: fixed;
  left: 8px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 320px;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: rgba(15, 24, 56, 0.92);
  color: #DDE5FF;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
