:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-ink: #1c2b3a;
  --color-ink-soft: #46586b;
  --color-muted: #7a8a9a;
  --color-primary: #1e4d78;
  --color-primary-soft: #e7eef5;
  --color-border: #dde4ea;
  --color-correct: #1f7a4c;
  --color-correct-bg: #e7f5ec;
  --color-incorrect: #b3352a;
  --color-incorrect-bg: #fbeae8;
  --color-warn-bg: #fff6e5;
  --color-warn-border: #e8c77c;
  --radius-md: 14px;
  --radius-lg: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* ---- Stage accent colors (polish spec v1) ---- */
  --stage-a: #3b82f6;
  --stage-a-bg: #eaf2fe;
  --stage-b: #f59e0b;
  --stage-b-bg: #fef3e2;
  --stage-c: #8b5cf6;
  --stage-c-bg: #f1ecfe;
  --stage-d: #14b8a6;
  --stage-d-bg: #e6f7f5;
  --stage-e: #ec4899;
  --stage-e-bg: #fdeaf3;

  font-size: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-ink);
  -webkit-tap-highlight-color: transparent;
}

#app-shell {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.sample-banner {
  background: var(--color-warn-bg);
  border-bottom: 1px solid var(--color-warn-border);
  color: #6b5416;
  font-size: 0.72rem;
  text-align: center;
  padding: 6px 12px;
  line-height: 1.4;
}

.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.screen.is-active {
  display: flex;
}

/* ---------- Top bar ---------- */
.top-bar {
  padding: 14px 18px 10px;
  border-bottom: 2px solid var(--accent, var(--color-border));
  background: var(--color-surface);
}

.top-bar__unit {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 2px;
}

.top-bar__title-en {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-ink);
}

.top-bar__title-ja {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  margin: 1px 0 10px;
}

.progress-track {
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--color-primary-soft);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--accent, var(--color-primary));
  border-radius: 4px;
  transition: width 0.25s ease;
  width: 0%;
}

.progress-label {
  font-size: 0.72rem;
  color: var(--color-muted);
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

/* ---------- Loading ---------- */
.loading-screen {
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--color-muted);
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--color-primary-soft);
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

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

.error-box {
  margin: 24px 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- Slides ---------- */
.slides-main {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}

.slide-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 28px 22px 20px;
  overflow-y: auto;
}

.slide-tapzone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26%;
  z-index: 2;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.slide-tapzone--prev { left: 0; }
.slide-tapzone--next { right: 0; }

.slide-card__eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 10px;
}

.slide-card__heading-en {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 4px;
  color: var(--color-ink);
}

.slide-card__heading-ja {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  margin: 0 0 18px;
}

.slide-card__video.is-wide {
  aspect-ratio: 16 / 9;
  width: min(1000px, 90vw);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.slide-card__video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0d1116;
  border-radius: var(--radius-md);
  margin: 0 0 14px;
}

.slide-card__img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 0 0 14px;
}

.slide-card__body-en {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-ink);
  margin: 0 0 14px;
}

.slide-card__body-ja {
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--color-muted);
  margin: 0;
}

.slide-card__ref {
  margin-top: 20px;
  display: inline-block;
  font-size: 0.68rem;
  color: var(--color-muted);
  background: var(--color-primary-soft);
  border-radius: 999px;
  padding: 4px 10px;
  align-self: flex-start;
}

.slide-card__points {
  margin: 8px 0 4px;
  padding: 14px 16px;
  background: var(--color-primary-soft);
  border-radius: var(--radius-md);
}

.slide-card__points-label {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 10px;
}

.slide-card__points-label .ja {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 6px;
}

.slide-card__points-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slide-card__points-list li {
  position: relative;
  padding-left: 16px;
}

.slide-card__points-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

.slide-card__point-en {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-ink);
  margin: 0 0 3px;
  word-break: break-word;
}

.slide-card__point-ja {
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
  word-break: break-word;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  padding: 0;
  cursor: pointer;
}

.dot.is-active {
  background: var(--color-primary);
  width: 20px;
  border-radius: 4px;
}

.slides-footer {
  padding: 10px 18px calc(16px + var(--safe-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* ---------- Buttons (shared) ---------- */
.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary .btn__en {
  font-size: 1rem;
  font-weight: 700;
}

.btn-primary .btn__ja {
  font-size: 0.72rem;
  opacity: 0.85;
}

.btn-secondary {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.btn-secondary .btn__en {
  font-size: 0.9rem;
  font-weight: 700;
}

.btn-secondary .btn__ja {
  font-size: 0.68rem;
  opacity: 0.85;
}

.btn-ghost {
  background: transparent;
  color: var(--color-ink-soft);
  border: 1px solid var(--color-border);
}

.btn-ghost .btn__en {
  font-size: 0.88rem;
  font-weight: 600;
}

.btn-ghost .btn__ja {
  font-size: 0.66rem;
  color: var(--color-muted);
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn { flex: 1; }

/* ---------- Drill ---------- */
.drill-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 20px 20px;
}

.question-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 22px 20px;
}

.question-card__label {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 12px;
}

.question-card__statement-en {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-ink);
  margin: 0 0 8px;
}

.question-card__statement-ja {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
}

.feedback-banner {
  margin-top: 18px;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.feedback-banner.is-correct {
  background: var(--color-correct-bg);
  color: var(--color-correct);
}

.feedback-banner.is-incorrect {
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect);
}

.feedback-banner__icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

@keyframes feedbackIconPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.feedback-banner.is-correct .feedback-banner__icon,
.feedback-banner.is-incorrect .feedback-banner__icon {
  animation: feedbackIconPop 0.3s ease;
}

.feedback-banner__text .en {
  font-size: 0.95rem;
}

.feedback-banner__text .ja {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}

.explanation-card {
  margin-top: 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  padding: 14px 16px;
}

.explanation-card__label {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 6px;
}

.explanation-card__en {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-ink);
  margin: 0 0 6px;
}

.explanation-card__ja {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-ink-soft);
  margin: 0;
}

.drill-footer {
  padding: 12px 18px calc(16px + var(--safe-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

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

.answer-btn {
  flex: 1;
  min-height: 76px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.answer-btn:active {
  transform: scale(0.97);
}

.answer-btn svg {
  width: 30px;
  height: 30px;
}

.answer-btn--true {
  color: var(--color-primary);
}

.answer-btn--true svg { stroke: var(--color-primary); }

.answer-btn--false {
  color: var(--color-ink-soft);
}

.answer-btn--false svg { stroke: var(--color-ink-soft); }

.answer-btn__label-en {
  font-size: 0.8rem;
  font-weight: 700;
}

.answer-btn__label-ja {
  font-size: 0.66rem;
  color: var(--color-muted);
}

.answer-btn:disabled {
  opacity: 0.35;
}

/* ---------- Results ---------- */
.results-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 20px 32px;
}

.result-hero {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 26px 20px;
  text-align: center;
}

.result-hero__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.result-hero__badge.is-pass {
  background: var(--color-correct-bg);
  color: var(--color-correct);
  animation: badgePop 0.3s ease;
}

.result-hero__badge.is-fail {
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect);
}

@keyframes badgePop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- Score ring ---- */
.score-ring {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 4px auto 10px;
}

.score-ring__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring__track {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 10;
}

.score-ring__fill {
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.73 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.7s ease, stroke 0.3s ease;
}

.score-ring.is-pass .score-ring__fill {
  stroke: var(--accent, var(--color-correct));
}

.score-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-ring__pct {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-ink);
}

/* ---- Confetti (self-contained, no libraries) ---- */
.confetti-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}

.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  opacity: 0.95;
  border-radius: 2px;
  animation-name: confettiFall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(260px) rotate(340deg); opacity: 0; }
}

.result-hero__score {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.1;
}

.result-hero__score-sub {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.result-hero__pass-line {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--color-muted);
}

.result-section-title {
  margin: 26px 0 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-ink);
}

.result-section-title .ja {
  font-weight: 500;
  color: var(--color-muted);
  font-size: 0.72rem;
  margin-left: 6px;
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-incorrect-bg);
  border-left: 4px solid var(--color-incorrect);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.review-card__q-en {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 4px;
}

.review-card__q-ja {
  font-size: 0.76rem;
  color: var(--color-muted);
  margin: 0 0 10px;
}

.review-card__answer {
  font-size: 0.74rem;
  color: var(--color-incorrect);
  font-weight: 700;
  margin: 0 0 8px;
}

.review-card__exp-en {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-ink-soft);
  margin: 0 0 4px;
}

.review-card__exp-ja {
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
}

.empty-note {
  font-size: 0.82rem;
  color: var(--color-muted);
  padding: 6px 2px;
}

.results-footer {
  padding: 12px 18px calc(16px + var(--safe-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-hero__srs {
  margin-top: 12px;
  font-size: 0.76rem;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-block;
}

/* ---------- Top bar back link ---------- */
.top-bar {
  position: relative;
}

.top-bar__back {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
  font-weight: 700;
}

/* ---------- Signs (slide grid) ---------- */
.slide-card__signs {
  margin: 16px 0 4px;
}

.slide-card__signs-label {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 10px;
}

.slide-card__signs-label .ja {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 6px;
}

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

.sign-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

@media (min-width: 1024px) {
  .sign-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .sign-card:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 14px rgba(20, 30, 45, 0.12);
  }
}

.sign-card__img {
  width: 100%;
  max-width: 84px;
  height: 84px;
  object-fit: contain;
  margin: 0 auto 6px;
  display: block;
}

.sign-card__name-en {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0;
  line-height: 1.35;
}

.sign-card__name-ja {
  font-size: 0.68rem;
  color: var(--color-muted);
  margin: 2px 0 0;
  line-height: 1.4;
}

/* ---------- Signs (question card — image only, no name) ---------- */
.question-card__sign {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

.question-card__sign-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

/* ---------- Review card sign (results — name allowed) ---------- */
.review-card__sign {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
}

.review-card__sign-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.review-card__sign-name {
  font-size: 0.76rem;
  color: var(--color-ink-soft);
  margin: 0;
  line-height: 1.4;
}

.review-card__unit-tag {
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 700;
  margin: 0 0 6px;
}

/* ---------- Hub ---------- */
.hub-screen {
  overflow-y: auto;
}

.hub-header {
  padding: 22px 20px 18px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

/* Banner strip: a dedicated block above the title card, not layered behind it.
   Only shown when app/assets/banner.webp loads successfully (see index.js —
   new Image() probe, hidden removed + background-image set on load, left
   untouched on 404). Height is tuned so the character's face (image
   x≈500-700, y≈190-330 of 1536x704) stays fully visible at every width;
   only the road at the very bottom of the image ever sits under the card. */
.hub-banner {
  background-size: cover;
  background-position: 50% 30%;
  background-repeat: no-repeat;
  height: 205px;
}

@media (min-width: 768px) {
  .hub-banner {
    height: 280px;
  }
}

@media (min-width: 1024px) {
  .hub-banner {
    height: 340px;
  }
}

/* Card sits in normal flow below the banner strip. When the banner is
   actually showing (hidden attribute removed by index.js), pull the card
   up slightly so it reads as a layered card over the image; the fallback
   (no-banner) layout keeps the header's own flat background untouched. */
.hub-banner:not([hidden]) + .hub-header__card {
  margin: -26px 16px 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 22px rgba(20, 30, 45, 0.16);
  padding: 16px 18px 14px;
}

.hub-header__title-en {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
  color: var(--color-ink);
}

.hub-header__title-ja {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  margin: 2px 0 16px;
}

.hub-overall {
  margin-bottom: 16px;
}

.hub-overall__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.hub-overall__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-ink);
}

.hub-overall__label .ja {
  font-weight: 500;
  color: var(--color-muted);
  font-size: 0.68rem;
  margin-left: 6px;
}

.hub-overall__count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
}

.progress-bar--hub {
  height: 8px;
}

.progress-bar--hub .progress-bar__fill {
  background: linear-gradient(90deg,
    var(--stage-a), var(--stage-b), var(--stage-c), var(--stage-d), var(--stage-e));
}

.hub-exam-btn {
  margin-top: 4px;
}

/* ---------- Hub: new-curriculum pillar (dashboard.html / contents.html) ----------
   Sits between the header card and the legacy unit-drill stages so the new
   chapter-based lessons read as an equal (or higher) pillar, not a footnote. */
.hub-newpillar {
  padding: 14px 18px 0;
}

.hub-newpillar__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px 18px;
  box-shadow: 0 6px 16px rgba(20, 30, 45, 0.08);
}

.hub-newpillar__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.hub-newpillar__badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
}

.hub-newpillar__tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-primary);
  border-radius: 999px;
  padding: 3px 9px;
  margin: 0;
}

.hub-newpillar__tag .ja {
  font-weight: 600;
  text-transform: none;
  margin-left: 4px;
}

.hub-newpillar__title-en {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-ink);
  margin: 0 0 4px;
}

.hub-newpillar__title-en .ja {
  display: block;
  font-weight: 500;
  color: var(--color-ink-soft);
  font-size: 0.76rem;
  margin-top: 2px;
}

.hub-newpillar__desc {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  line-height: 1.5;
  margin: 0 0 14px;
}

.hub-newpillar__desc .ja {
  display: block;
  color: var(--color-muted);
  font-size: 0.74rem;
  margin-top: 2px;
}

.hub-main {
  padding: 8px 18px 28px;
}

.hub-stage {
  margin-top: 22px;
}

.hub-stage__heading {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--color-ink);
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 4px solid var(--accent, var(--color-primary));
}

.hub-stage__heading .ja {
  display: block;
  font-weight: 500;
  color: var(--color-muted);
  font-size: 0.72rem;
  margin-top: 2px;
}

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

.unit-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  text-decoration: none;
  color: inherit;
}

.unit-card:active {
  transform: scale(0.98);
}

.unit-card--pass {
  border-color: var(--accent, var(--color-correct));
}

@media (min-width: 1024px) {
  .unit-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .unit-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(20, 30, 45, 0.12);
  }
}

.unit-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.unit-card__id {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent, var(--color-primary));
  background: var(--accent-bg, var(--color-primary-soft));
  border-radius: 999px;
  padding: 2px 8px;
}

.unit-card__badge {
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
}

.unit-card__badge--review {
  background: var(--stage-b);
  color: #fff;
}

.unit-card__badge--review .ja {
  margin-left: 3px;
}

.unit-card__badge--pass {
  background: var(--accent, var(--color-correct));
  color: #fff;
}

.unit-card__title-en {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 2px;
  line-height: 1.35;
}

.unit-card__title-ja {
  font-size: 0.7rem;
  color: var(--color-muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.unit-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.unit-card__count {
  font-size: 0.66rem;
  color: var(--color-muted);
}

.unit-card__status {
  font-size: 0.66rem;
  color: var(--color-ink-soft);
  font-weight: 600;
  text-align: right;
}

/* ---------- Exam ---------- */
.exam-start-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 20px 24px;
}

.exam-info-card {
  background: var(--color-surface);
  border: 2px solid var(--accent, var(--color-primary));
  border-radius: var(--radius-lg);
  padding: 18px 18px;
}

.exam-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.exam-info-row:last-child {
  margin-bottom: 0;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.exam-info-row__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-bg, var(--color-primary-soft));
  color: var(--accent, var(--color-primary));
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exam-info-card__line {
  font-size: 0.86rem;
  color: var(--color-ink);
  margin: 0;
  line-height: 1.5;
}

.exam-info-card__line .ja {
  display: block;
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.exam-info-card__note {
  color: var(--color-ink-soft);
  font-size: 0.76rem;
}

.exam-history {
  margin-top: 24px;
}

.exam-history__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-history__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.exam-history__date {
  font-size: 0.72rem;
  color: var(--color-muted);
  flex: 1;
}

.exam-history__score {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-ink);
}

.exam-history__badge {
  font-size: 0.64rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  text-transform: uppercase;
}

.exam-history__badge.is-pass {
  background: var(--color-correct-bg);
  color: var(--color-correct);
}

.exam-history__badge.is-fail {
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect);
}

/* ---------- PC layout (hub only, >=1024px) ---------- */
@media (min-width: 1024px) {
  body.page-index #app-shell {
    max-width: 1100px;
  }

  body.page-index .unit-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1440px) {
  body.page-index .unit-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ======================================================================
   Practical (technical skills / 実技) test module
   ====================================================================== */

/* ---------- shared: hub-header__card as a positioning context for the
   back link on practical_index.html (no banner strip on this page, so the
   card never gets the banner-triggered margin/shadow rule above — this
   just gives .top-bar__back somewhere to anchor). No visual change on
   index.html since position:relative with no offsets is a no-op there. */
.hub-header__card {
  position: relative;
}

/* 戻るボタンは絶対配置で右上に浮くので、同じカードの見出しはその分だけ
   右を空ける。空けないと長いタイトル（動画ページは動画名がそのまま入る）が
   ボタンの下に潜って読めなくなる。 */
.hub-header__card:has(.top-bar__back) .hub-header__title-en,
.hub-header__card:has(.top-bar__back) .hub-header__title-ja {
  padding-right: 46px;
}

/* ---------- slides: procedure steps ---------- */
/* Step text already carries its own "1. " / "2. " prefix from the source
   data, so this list intentionally has no list-style / counter of its own
   — it would double up with the embedded numbering. */
.slide-card__steps {
  margin: 8px 0 4px;
  padding: 14px 16px;
  background: var(--color-primary-soft);
  border-radius: var(--radius-md);
}

.slide-card__steps-label {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 10px;
}

.slide-card__steps-label .ja {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 6px;
}

.slide-card__steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slide-card__steps-list li {
  padding-left: 0;
}

.slide-card__steps-list li + li {
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
}

.slide-card__step-en {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--color-ink);
  margin: 0 0 3px;
  word-break: break-word;
}

.slide-card__step-ja {
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0;
  word-break: break-word;
}

/* ---------- deduction / disqualifier badges ---------- */
.slide-card__deductions {
  margin: 16px 0 4px;
}

.slide-card__deductions-label {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 10px;
}

.slide-card__deductions-label .ja {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 6px;
}

.deduction-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deduction-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-warn-bg);
  border: 1px solid var(--color-warn-border);
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font-size: 0.72rem;
}

.deduction-badge__name {
  color: #6b5416;
  font-weight: 600;
}

.deduction-badge__name .ja {
  display: block;
  font-size: 0.66rem;
  font-weight: 500;
  opacity: 0.85;
}

.deduction-badge__points {
  flex-shrink: 0;
  background: #e8c77c;
  color: #6b5416;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.66rem;
  text-align: center;
  line-height: 1.3;
}

.deduction-badge__points .ja {
  display: block;
  font-weight: 600;
  font-size: 0.6rem;
}

.deduction-badge.is-disqualifier {
  background: var(--color-incorrect-bg);
  border-color: var(--color-incorrect);
}

.deduction-badge.is-disqualifier .deduction-badge__name {
  color: var(--color-incorrect);
}

.deduction-badge.is-disqualifier .deduction-badge__points {
  background: var(--color-incorrect);
  color: #fff;
}

.explanation-card__basis {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 77, 120, 0.15);
  font-size: 0.68rem;
  color: var(--color-ink-soft);
  line-height: 1.5;
}

/* ---------- drill: question scene ---------- */
.question-card__scene {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.question-card__scene-img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 0 0 10px;
}

.question-card__scene-caption-en {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--color-ink-soft);
  margin: 0;
}

.question-card__scene-caption-ja {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--color-muted);
  margin: 2px 0 0;
}

/* ---------- drill: choice-type answers ---------- */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
}

.choice-btn:active {
  transform: scale(0.99);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-btn__letter {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-btn__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.choice-btn__text-en {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-ink);
  font-weight: 600;
}

.choice-btn__text-ja {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.choice-btn.is-correct-answer {
  border-color: var(--color-correct);
  background: var(--color-correct-bg);
}

.choice-btn.is-correct-answer .choice-btn__letter {
  background: var(--color-correct);
  color: #fff;
}

.choice-btn.is-wrong-answer {
  border-color: var(--color-incorrect);
  background: var(--color-incorrect-bg);
}

.choice-btn.is-wrong-answer .choice-btn__letter {
  background: var(--color-incorrect);
  color: #fff;
}

.choice-btn:disabled:not(.is-correct-answer):not(.is-wrong-answer) {
  opacity: 0.55;
}

/* ---------- drill: order-type (tap-to-sequence) answers ---------- */
.order-list-wrap {
  margin-top: 18px;
}

.order-list__hint {
  font-size: 0.72rem;
  color: var(--color-muted);
  margin: 0 0 10px;
  line-height: 1.5;
}

.order-list__hint .ja {
  display: block;
  margin-top: 2px;
}

.order-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
}

.order-item:active {
  transform: scale(0.99);
}

.order-item:disabled {
  cursor: default;
}

.order-item__badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-ink-soft);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.order-item__text-en {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-ink);
  font-weight: 600;
}

.order-item__text-ja {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.order-item.is-selected {
  border-color: var(--accent, var(--color-primary));
}

.order-item.is-selected .order-item__badge {
  background: var(--accent, var(--color-primary));
  border-color: var(--accent, var(--color-primary));
  color: #fff;
}

.order-item.is-correct-answer {
  border-color: var(--color-correct);
  background: var(--color-correct-bg);
}

.order-item.is-correct-answer .order-item__badge {
  background: var(--color-correct);
  border-color: var(--color-correct);
  color: #fff;
}

.order-item.is-order-revealed {
  border-color: var(--color-incorrect);
  background: var(--color-incorrect-bg);
}

.order-item.is-order-revealed .order-item__badge {
  background: var(--color-incorrect);
  border-color: var(--color-incorrect);
  color: #fff;
}

/* ---------- practical hub: scoring explainer card ---------- */
.practical-scoring {
  margin-top: 4px;
}

.practical-scoring-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 6px 16px;
}

.practical-scoring-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.practical-scoring-row + .practical-scoring-row {
  border-top: 1px solid var(--color-border);
}

.practical-scoring-row__num {
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.practical-scoring-row__num--bands {
  font-size: 0.62rem;
}

.practical-scoring-row__num--warn {
  background: var(--color-incorrect);
  color: #fff;
}

.practical-scoring-row__line {
  font-size: 0.85rem;
  color: var(--color-ink);
  margin: 2px 0 0;
  line-height: 1.5;
}

.practical-scoring-row__line .ja {
  display: block;
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-top: 2px;
}

/* ---------- practical hub: real-test task list ---------- */
.practical-course {
  margin-top: 22px;
  margin-bottom: 8px;
}

.practical-course__note {
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  margin: 0 0 12px;
  padding-left: 10px;
}

.practical-course__note .ja {
  display: block;
  font-size: 0.7rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.practical-task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.practical-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.practical-task-row__name {
  font-size: 0.82rem;
  color: var(--color-ink);
  font-weight: 600;
}

.practical-task-row__name .ja {
  display: block;
  font-size: 0.7rem;
  color: var(--color-muted);
  font-weight: 500;
  margin-top: 1px;
}

.practical-task-row__count {
  flex-shrink: 0;
  text-align: right;
  font-size: 0.74rem;
  color: var(--color-primary);
  font-weight: 700;
}

.practical-task-row__count .ja {
  display: block;
  font-size: 0.64rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* ---------- PC layout additions (practical hub, >=1024px) ---------- */
@media (min-width: 1024px) {
  body.page-index .practical-scoring-card {
    max-width: 720px;
  }

  body.page-index .practical-task-list {
    max-width: 720px;
  }
}

/* ---------- Virtual driving test (practical_exam.html) ---------- */
.pe-points-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 4px 0 10px;
}

.pe-points {
  display: flex;
  flex-direction: column;
}

.pe-points__value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-ink);
}

@keyframes pePointsHit {
  0% { color: var(--color-incorrect); transform: scale(1.25); }
  100% { color: var(--color-ink); transform: scale(1); }
}

.pe-points__value--hit {
  display: inline-block;
  animation: pePointsHit 0.6s ease;
}

.pe-points__label {
  font-size: 0.68rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.pe-points__label .ja {
  margin-left: 4px;
}

.pe-node-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.pe-node-progress__count {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-ink);
}

.pe-node-progress__label {
  font-size: 0.66rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.pe-node-progress__label .ja {
  margin-left: 4px;
}

/* ---- mini course map (run header): a row of dots+lines for every stop in
   this run's route. Dots are fixed-size, lines are flexible, so up to ~14
   stops still fit a 375px screen without wrapping or overflow. ---- */
.pe-minimap {
  display: flex;
  align-items: center;
  padding: 5px 1px 1px;
}

.pe-minimap__node {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.pe-minimap__node--ok {
  background: var(--accent, var(--color-primary));
  border-color: var(--accent, var(--color-primary));
}

.pe-minimap__node--deduct {
  background: var(--color-incorrect);
  border-color: var(--color-incorrect);
}

.pe-minimap__node--current {
  width: 11px;
  height: 11px;
  border-color: var(--accent, var(--color-primary));
  box-shadow: 0 0 0 3px var(--accent-bg, var(--color-primary-soft));
  animation: peMinimapPulse 1.6s ease-in-out infinite;
}

.pe-minimap__node--current.pe-minimap__node--deduct {
  border-color: var(--color-incorrect);
  box-shadow: 0 0 0 3px var(--color-incorrect-bg);
  animation-name: peMinimapPulseDeduct;
}

@keyframes peMinimapPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-bg, var(--color-primary-soft)); }
  50% { box-shadow: 0 0 0 5px var(--accent-bg, var(--color-primary-soft)); }
}

@keyframes peMinimapPulseDeduct {
  0%, 100% { box-shadow: 0 0 0 3px var(--color-incorrect-bg); }
  50% { box-shadow: 0 0 0 5px var(--color-incorrect-bg); }
}

.pe-minimap__line {
  flex: 1 1 auto;
  min-width: 3px;
  height: 2px;
  background: var(--color-border);
  margin: 0 1px;
  transition: background 0.2s ease;
}

.pe-minimap__line--done {
  background: var(--accent, var(--color-primary));
}

/* ---- big course map (results / stop screens): a vertical timeline, one
   row per stop, with the task name and (if any) points lost there. ---- */
.pe-route-map {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.pe-route-map__row {
  display: flex;
  gap: 12px;
}

.pe-route-map__rail {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  display: flex;
  justify-content: center;
}

.pe-route-map__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.pe-route-map__row--done .pe-route-map__rail::before {
  background: var(--accent, var(--color-primary));
}

.pe-route-map__row:first-child .pe-route-map__rail::before { top: 50%; }
.pe-route-map__row:last-child .pe-route-map__rail::before { bottom: 50%; }

.pe-route-map__dot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  box-sizing: border-box;
}

.pe-route-map__dot--ok {
  background: var(--accent, var(--color-primary));
  border-color: var(--accent, var(--color-primary));
}

.pe-route-map__dot--deduct {
  background: var(--color-incorrect);
  border-color: var(--color-incorrect);
}

.pe-route-map__content {
  flex: 1;
  min-width: 0;
  padding-bottom: 16px;
}

.pe-route-map__name-en {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0;
}

.pe-route-map__name-ja {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-top: 1px;
}

.pe-route-map__deduct {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-incorrect);
  margin: 4px 0 0;
}

.pe-route-map__stop-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--color-incorrect);
  border-radius: 999px;
  padding: 3px 10px;
  margin-top: 6px;
}

.pe-route-map__stop-tag .ja {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.6rem;
  margin-top: 1px;
  opacity: 0.92;
}

.pe-route-map__row--future .pe-route-map__content {
  opacity: 0.4;
}

/* results screen: white cards, dark text (default palette already matches) */

/* stop screen: on the dark-red background, restyle the map for contrast */
.pe-stop-map-block {
  width: 100%;
  text-align: left;
  margin-top: 18px;
}

.pe-stop-map-block__label {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 10px;
}

.pe-route-map--on-stop .pe-route-map__rail::before {
  background: rgba(255, 255, 255, 0.3);
}

.pe-route-map--on-stop .pe-route-map__row--done .pe-route-map__rail::before {
  background: rgba(255, 255, 255, 0.85);
}

.pe-route-map--on-stop .pe-route-map__dot {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
}

.pe-route-map--on-stop .pe-route-map__dot--ok {
  background: #fff;
  border-color: #fff;
}

.pe-route-map--on-stop .pe-route-map__dot--deduct {
  background: #ffd9d3;
  border-color: #ffd9d3;
}

.pe-route-map--on-stop .pe-route-map__name-en {
  color: #fff;
}

.pe-route-map--on-stop .pe-route-map__name-ja {
  color: rgba(255, 255, 255, 0.78);
}

.pe-route-map--on-stop .pe-route-map__deduct {
  color: #ffd9d3;
}

.pe-route-map--on-stop .pe-route-map__stop-tag {
  background: #fff;
  color: var(--color-incorrect);
}

/* ---- stop screen: full-screen red terminal state ---- */
.pe-stop-screen {
  background: var(--color-incorrect);
  color: #fff;
}

.pe-stop-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 44px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pe-stop-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 0 0 20px;
}

.pe-stop-badge .ja {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.62rem;
  margin-top: 2px;
  opacity: 0.9;
}

.pe-stop-reason-en {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 6px;
}

.pe-stop-reason-ja {
  font-size: 0.92rem;
  margin: 0 0 26px;
  opacity: 0.92;
}

.pe-stop-card {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.pe-stop-card__label {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 8px;
}

.pe-stop-card__en {
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 8px;
}

.pe-stop-card__ja {
  font-size: 0.78rem;
  line-height: 1.6;
  margin: 0;
  opacity: 0.92;
}

.pe-stop-card__basis {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.66rem;
  line-height: 1.5;
  opacity: 0.85;
}

.pe-stop-footer {
  padding: 12px 18px calc(16px + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pe-stop-btn-primary {
  background: #fff;
  color: var(--color-incorrect);
}

.pe-stop-btn-primary .btn__en {
  font-size: 1rem;
  font-weight: 700;
}

.pe-stop-btn-primary .btn__ja {
  font-size: 0.72rem;
  opacity: 0.8;
}

.pe-stop-btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.pe-stop-btn-ghost .btn__en {
  font-size: 0.88rem;
  font-weight: 600;
}

.pe-stop-btn-ghost .btn__ja {
  font-size: 0.66rem;
  opacity: 0.8;
}

/* ---- results: pass-line comparison bar ---- */
.pe-pass-bar {
  margin-top: 18px;
}

.pe-pass-bar__track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: var(--color-primary-soft);
}

.pe-pass-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--color-incorrect);
  transition: width 0.6s ease;
  width: 0%;
}

.pe-pass-bar__fill.is-pass {
  background: var(--color-correct);
}

.pe-pass-bar__line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  border-radius: 2px;
  background: var(--color-ink);
}

.pe-pass-bar__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.66rem;
  color: var(--color-muted);
}

.pe-pass-bar__pass-label {
  text-align: center;
  font-weight: 700;
  color: var(--color-ink-soft);
}

.pe-pass-bar__pass-label .ja {
  display: block;
  font-weight: 500;
  font-size: 0.6rem;
}

/* ---- hub: virtual driving test entry card ---- */
.pe-hub-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 16px;
}

.pe-hub-card:active {
  transform: scale(0.99);
}

.pe-hub-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pe-hub-card__title-en {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.pe-hub-card__title-ja {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 2px 0 0;
}

.pe-hub-card__arrow {
  flex-shrink: 0;
  font-size: 1.3rem;
  color: #fff;
}

.pe-hub-card__note {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 10px 0 0;
  line-height: 1.5;
}

.pe-hub-card__note .ja {
  display: block;
  margin-top: 4px;
}

.pe-hub-history {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pe-hub-history__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.pe-hub-history__date {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
}

.pe-hub-history__score {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.pe-hub-history__badge {
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-primary);
}

.pe-hub-history__badge.is-fail {
  background: rgba(255, 255, 255, 0.5);
  color: #fff;
}

@media (min-width: 1024px) {
  body.page-index .pe-hub-card {
    max-width: 720px;
  }
}

/* ---- hub: examiner's-Japanese (listening) entry card ---- */
.pe-hub-card--listening {
  background: var(--stage-d);
  margin-top: 12px;
}

/* ======================================================================
   Examiner's Japanese (listening) module — practical_listening.html
   ====================================================================== */

.listening-intro {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-ink-soft);
  background: var(--color-primary-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin: 4px 0 16px;
}

.listening-intro .ja {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
}

/* ---- big tap-to-listen button ---- */
.audio-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 8px 22px;
  text-align: center;
}

.audio-play-btn {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: none;
  background: var(--accent, var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(20, 30, 45, 0.2);
  font-family: inherit;
  flex-shrink: 0;
}

.audio-play-btn:active {
  transform: scale(0.96);
}

.audio-play-btn__icon {
  width: 42px;
  height: 42px;
}

.audio-play-btn__icon--wave {
  width: 34px;
  height: 34px;
}

@keyframes audioPulseRing {
  0% { box-shadow: 0 8px 20px rgba(20, 30, 45, 0.2), 0 0 0 0 rgba(20, 30, 45, 0.28); }
  100% { box-shadow: 0 8px 20px rgba(20, 30, 45, 0.2), 0 0 0 16px rgba(20, 30, 45, 0); }
}

.audio-play-btn.is-playing {
  animation: audioPulseRing 1s ease-out infinite;
}

.audio-player__label-en {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-ink);
  margin: 10px 0 0;
}

.audio-player__label-ja {
  font-size: 0.76rem;
  color: var(--color-muted);
  margin: 1px 0 8px;
}

.audio-player__hint {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--color-muted);
  max-width: 300px;
  margin: 0;
}

.audio-player__hint .ja {
  display: block;
  margin-top: 2px;
}

/* ---- post-answer reveal: instruction text + key words ---- */
.reveal-card {
  margin-top: 16px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  padding: 14px 16px;
}

.reveal-card__label {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 8px;
}

.reveal-card__ja {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--color-ink);
  margin: 0 0 4px;
}

.reveal-card__romaji {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--color-ink-soft);
  margin: 0 0 4px;
}

.reveal-card__en {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-ink-soft);
  margin: 0 0 12px;
}

.reveal-card__kw-label {
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  font-weight: 700;
  margin: 0 0 6px;
}

.key-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.key-words--review {
  margin: 0 0 10px;
}

.key-word-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 5px 11px;
}

.key-word-chip__ja {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
}

.key-word-chip__en {
  font-size: 0.64rem;
  color: var(--color-muted);
  line-height: 1.3;
}

/* ---------- Virtual driving test: start banner ----------
   画像が読めたときだけ practical_exam.js が hidden を外す。
   404時は hidden のままで、従来どおりの説明カードだけの画面になる。 */
.pe-banner {
  position: relative;
  height: 150px;
  margin: 0 0 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-image: url("assets/practical/exam_banner.webp");
  background-size: cover;
  background-position: 50% 62%;
  background-repeat: no-repeat;
  box-shadow: 0 6px 18px rgba(20, 30, 45, 0.14);
}

.pe-banner__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 12px;
  background: linear-gradient(to top, rgba(12, 22, 34, 0.78), rgba(12, 22, 34, 0));
}

.pe-banner__lead {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.pe-banner__lead-ja {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.74rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .pe-banner { height: 200px; }
  .pe-banner__lead { font-size: 1.05rem; }
  .pe-banner__lead-ja { font-size: 0.8rem; }
}

/* ---------- Virtual driving test: car moving along the minimap ---------- */
.pe-minimap-wrap {
  position: relative;
  padding-top: 15px; /* 車アイコンの高さ分だけ点の上に余白を取る */
}

.pe-minimap-car {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-primary);
  line-height: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
  pointer-events: none;
  will-change: transform;
}

.pe-minimap-car svg { display: block; }

/* 技能トップ: 3つのパート */
.part { margin: 26px 0 30px; }
.part__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.part__no {
  flex: 0 0 34px; height: 34px; line-height: 34px; text-align: center;
  border-radius: 17px; background: #1f3a5f; color: #fff; font-size: 17px; font-weight: 800;
}
.part__title-en { font-size: 21px; font-weight: 800; line-height: 1.2; }
.part__title-ja { font-size: 13px; color: var(--muted, #667); }
.part__lead { font-size: 13px; color: var(--muted, #667); line-height: 1.55; margin: 0 0 14px 46px; }
.part__lead .ja { display: block; }
.part__sub {
  font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #5b6b7c; margin: 18px 0 10px;
}
.part__sub .ja { text-transform: none; letter-spacing: 0; font-weight: 600; margin-left: 8px; color: var(--muted, #667); }

/* 動画一覧（横スクロール。本数が増えても縦に伸びない） */
.vid-row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.vid-card {
  flex: 0 0 208px; scroll-snap-align: start; text-decoration: none; color: inherit;
}
.vid-card__thumb {
  position: relative; display: block; width: 208px; height: 117px;
  background-size: cover; background-position: center; border-radius: 10px; background-color: #0d1116;
}
.vid-card__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; line-height: 42px; text-align: center; border-radius: 21px;
  background: rgba(13, 17, 22, .62); color: #fff; font-size: 15px;
}
.vid-card__time {
  position: absolute; right: 6px; bottom: 6px; background: rgba(13, 17, 22, .78);
  color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px;
}
.vid-card__title-en { display: block; font-size: 14px; font-weight: 700; margin-top: 8px; line-height: 1.3; }
.vid-card__title-ja { display: block; font-size: 12px; color: var(--muted, #667); margin-top: 2px; }

/* 動画再生ページ */
.watch-main { padding: 16px; }
.watch-video { display: block; width: 100%; aspect-ratio: 1 / 1; background: #0d1116; border-radius: var(--radius-md); }
.watch-video.is-wide { aspect-ratio: 16 / 9; }
.watch-title-en { font-size: 20px; font-weight: 800; margin-top: 14px; }
.watch-title-ja { font-size: 14px; color: var(--muted, #667); margin-top: 2px; }
.watch-note { font-size: 13px; color: var(--muted, #667); line-height: 1.6; margin-top: 10px; }
.watch-note .ja { display: block; margin-top: 2px; }
