/* =========================================================
   app.css — CLEAN, DEDUPED, CANONICAL (FIXED)
   Shared across ALL pages / ALL branches
   NOTES:
   - Removes duplicate :root
   - Adds branch-tinted glass cards (keeps branch theme)
   - Darkens cards (especially Marines/Army)
   - Keeps scroll + modal behavior as-is
   - No em dashes
   ========================================================= */

/* =========================
   RESET / BASE
   ========================= */
* { box-sizing: border-box; }

/* =========================
   TOKENS (ONE :root ONLY)
   Glass uses branch tint so Marines/Army do not look washed out
   ========================= */
:root {
  color-scheme: dark;

  --safe-top-page: calc(env(safe-area-inset-top, 0px) + 5px);
  --safe-top-icons: calc(env(safe-area-inset-top, 0px) + 5px);

  /* Glass */
  --ui-glass-blur: 8px;

  /* Branch tint strength (0 = pure black, higher = more branch color bleed) */
  --ui-tint: 0.14;

  /* Base darkness */
  --ui-black-soft: 0.18;
  --ui-black: 0.28;
  --ui-black-strong: 0.38;

  /* Highlights and borders */
  --ui-highlight-top: rgba(255,255,255,0.07);
  --ui-highlight-bottom: rgba(255,255,255,0.02);

  --ui-border-soft: rgba(255,255,255,0.14);
  --ui-border: rgba(255,255,255,0.22);

  --ui-card-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 14px 34px rgba(0,0,0,0.48);

  /* Derived surfaces (tinted by branch background) */
  --ui-surface-soft: color-mix(in srgb, rgba(0,0,0,var(--ui-black-soft)) 100%, var(--branch-bg) calc(var(--ui-tint) * 100%));
  --ui-surface: color-mix(in srgb, rgba(0,0,0,var(--ui-black)) 100%, var(--branch-bg) calc(var(--ui-tint) * 100%));
  --ui-surface-strong: color-mix(in srgb, rgba(0,0,0,var(--ui-black-strong)) 100%, var(--branch-bg) calc((var(--ui-tint) + 0.06) * 100%));

  /* Footer bar */

  /* Fields */
  --field-bg: rgba(0,0,0,0.22);
  --field-border: rgba(255,255,255,0.22);

  /* Quiz explain panel */
  --panel-bg: #0b1220;
  --panel-radius: 20px;
}

/* =========================
   BRANCH-SPECIFIC ADJUSTMENTS
   ========================= */

/* Darken high-saturation branches so cards read correctly */
body[data-branch="marines"],
body[data-branch="army"] {
  --ui-tint: 0.10;
  --ui-black-soft: 0.22;
  --ui-black: 0.34;
  --ui-black-strong: 0.46;

}

/* Muted panel backgrounds per branch */
body[data-branch="navy"] {
  --panel-bg: color-mix(in srgb, var(--branch-bg-soft) 32%, #000 68%);
}

body[data-branch="airforce"] {
  --panel-bg: color-mix(in srgb, var(--branch-bg-soft) 34%, #000 66%);
}

body[data-branch="army"] {
  --panel-bg: color-mix(in srgb, var(--branch-bg-soft) 30%, #000 70%);
}

body[data-branch="coastguard"] {
  --panel-bg: color-mix(in srgb, var(--branch-bg-soft) 34%, #000 66%);
}

body[data-branch="marines"] {
  /* marines --branch-bg-soft is pure black, so tint with marines red slightly */
  --panel-bg: color-mix(in srgb, var(--branch-bg) 10%, #000 90%);
}

body[data-branch="spaceforce"] {
  --panel-bg: color-mix(in srgb, var(--branch-bg-soft) 34%, #000 66%);
}
/* =========================
   ROOT SCROLL (CANONICAL)
   ========================= */
html,
body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
}

/* MODAL SCROLL LOCK (ONLY TIME ROOT IS LOCKED) */
html.modal-open,
body.modal-open { overflow: hidden; }

/* NEVER let modal state kill page scroll */
html.modal-open .page,
body.modal-open .page { overflow: visible; }

/* =========================
   BASE LAYOUT (LOCKED)
   ========================= */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--branch-bg);
  color: #f7f9fc;
  display: block;
}

.page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(60px + var(--safe-top-page)) 16px 24px;
  position: relative;
  min-height: auto;
  overflow: visible;
}

/* =========================
   TYPOGRAPHY
   ========================= */
h1, h2, h3 {
  font-family: "Rajdhani", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

h1 { font-size: 24px; margin-bottom: 10px; text-align: center; }
h2 { font-size: 20px; margin-bottom: 16px; }
h3 { font-size: 16px; margin-bottom: 8px; }

p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--branch-text-soft);
}

/* =========================
   LOGO (LOCKED)
   ========================= */
.logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
}

.logo-wrap a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrap img {
  height: 96px !important;
  width: auto !important;
  object-fit: contain !important;
  display: block !important;
}

/* =========================
   ICON BUTTONS (CANONICAL)
   ========================= */
.header-icon-btn,
.corner-icon-btn {
  position: static;
  z-index: auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);
  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

.header-icon-btn svg,
.corner-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}



/* =========================
   BUTTONS
   ========================= */
.small-btn {
  appearance: none;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--branch-accent);
  background: transparent;
  color: #f7f9fc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 8px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.small-btn:hover:not([disabled]) {
  background: var(--branch-accent);
  color: var(--branch-accent-contrast);
}

.small-btn:active:not([disabled]) { transform: translateY(1px); }

.small-btn.secondary {
  border-color: rgba(255,255,255,0.55);
  color: rgba(247,249,252,0.92);
}

.small-btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

.small-btn.is-locked {
  opacity: 0.65;
  pointer-events: none;
  cursor: default;
}

.small-btn[aria-current="page"] {
  background: var(--branch-accent);
  color: var(--branch-accent-contrast);
  border-color: var(--branch-accent);
}

/* =========================
   PILLS / CHIPS
   ========================= */
.pill-switch,
.category-buttons,
.chips-strip {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  padding: 10px 0 12px;
}

.pill-switch::-webkit-scrollbar,
.category-buttons::-webkit-scrollbar,
.chips-strip::-webkit-scrollbar { display: none; }

.pill, .category-btn, .chip {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid #f7f9fc;
  background: transparent;
  color: #f7f9fc;
  cursor: pointer;
  white-space: nowrap;
}

.pill.active,
.category-btn.active,
.chip.active,
[aria-selected="true"],
[aria-pressed="true"] {
  background: var(--branch-accent);
  color: var(--branch-accent-contrast);
  border-color: var(--branch-accent);
}

/* =========================
   CONTEXT BAR
   ========================= */
.context-bar {
  max-width: 740px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  border-radius: 16px;

  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);
  border: 1px solid var(--ui-border);

  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));

  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: center;
  text-align: center;
}

.ctx-chip {
  border: 1px solid var(--ui-border-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--ui-surface-soft);
  font-family: "Rajdhani", system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ctx-chip strong { color: #fff; }

.ctx-hint {
  width: 100%;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
}

/* =========================
   OVERLAYS / MODALS
   ========================= */
.overlay-panel,
.overlay-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: center;
  justify-content: center;

  padding-top: calc(var(--safe-top-icons) + 10px);
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 16px;

  background: rgba(0,0,0,0.72);

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.overlay-modal:not(.is-hidden),
.overlay-modal[aria-hidden="false"],
#aboutModal:not(.is-hidden),
#aboutModal[aria-hidden="false"] { display: flex; }

/* Overlay card */
.overlay-card {
  width: min(96vw, 900px);
  border-radius: 14px;
  background: var(--modal-card-bg);
  border: 1px solid var(--modal-card-border);
  color: var(--modal-text);
  margin: auto 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 80px);
  overflow: hidden;
}

.overlay-card.modal-sm { width: min(96vw, 520px); }
.overlay-card.modal-md { width: min(96vw, 640px); }
.overlay-card.modal-lg { width: min(96vw, 820px); }
.overlay-card.modal-about { width: min(96vw, 760px); }

.legal-header {
  padding: 16px 18px;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  background: var(--modal-header-bg);
  border-bottom: 1px solid var(--modal-divider);
  flex: 0 0 auto;
}

.legal-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--modal-footer-bg);
  border-top: 1px solid var(--modal-divider);
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.legal-btn {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--branch-accent);
  background: transparent;
  color: #f7f9fc;
  cursor: pointer;
}

.legal-btn.secondary {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.05);
}

/* Modal form controls */
.overlay-card input:not(.prt-input),
.overlay-card select:not(.prt-select),
.overlay-card textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: #f7f9fc;
  font: inherit;
  outline: none;
}

.overlay-card input:not(.prt-input)::placeholder,
.overlay-card textarea::placeholder { opacity: 0.7; }

.overlay-card input:not(.prt-input):focus,
.overlay-card select:not(.prt-select):focus,
.overlay-card textarea:focus {
  border-color: rgba(255,255,255,0.45);
}

.overlay-card input[type="date"]:not(.prt-input) {
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
}

.overlay-card select:not(.prt-select) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(247,249,252,0.85) 50%),
    linear-gradient(135deg, rgba(247,249,252,0.85) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Modal body scroll owner */
.legal-body,
.modal-body,
.prt-body,
.meps-body {
  padding: 16px 18px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  flex: 1 1 auto;
}

.overlay-card.modal-about { max-height: 75vh; }

/* =========================
   COMMON LAYOUT HELPERS
   ========================= */
.row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.row-flex-end {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.feature-output {
  max-width: 960px;
  margin: 14px auto 0;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1px solid var(--ui-border-soft);
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);
  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

/* Recruiter */
.recruiter-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.recruiter-actions .row {
  justify-content: center;
  gap: 10px;
}

/* =========================
   UTILITIES
   ========================= */
.meta { font-size: 12px; opacity: 0.85; }
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px !important; }
.mb-6 { margin-bottom: 6px !important; }
.list-inset { padding-left: 18px; }
.waiver-list { padding-left: 18px; margin: 8px 0 0; }
.waiver-list li { margin: 6px 0; }
.modal-body-tall { max-height: min(74vh, 620px); }

.is-hidden { display: none !important; }
.text-center { text-align: center; }
.justify-center { justify-content: center; }

/* =========================
   PRT (STRUCTURE)
   ========================= */
.prt-solid { background: var(--modal-card-bg); }

.prt-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

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

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

.prt-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 560px) {
  .prt-two-col { grid-template-columns: 1fr; }
}

.prt-input,
.prt-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: #f7f9fc;
}

.prt-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.14);
}

.prt-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.prt-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--modal-divider);
}

.prt-input.good, .prt-select.good { border-color: #2ecc71; }
.prt-input.warn, .prt-select.warn { border-color: #f5c16c; }
.prt-input.bad,  .prt-select.bad  { border-color: #ff6b6b; }

#prtResult.good { border-color: #2ecc71; }
#prtResult.warn { border-color: #f5c16c; }
#prtResult.bad  { border-color: #ff6b6b; }

#prtResult .prt-title {
  font-family: "Rajdhani", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin: 0 0 6px 0;
}

/* =========================
   MEPS
   ========================= */
.meps-step h2 { margin-bottom: 6px; }
.meps-step h3 { margin-top: 12px; }

/* =========================
   INDEX / TOOLS (SHARED)
   ========================= */
.search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.search-wrap--tight { margin-bottom: 14px; }

.search-inner {
  position: relative;
  width: 100%;
  max-width: 960px;
}

.search-inner input {
  width: 100%;
  padding: 14px 52px 14px 18px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);
  color: #f7f9fc;
  text-align: center;
  font-weight: 700;
}

.search-inner input::placeholder {
  color: rgba(247,249,252,0.92);
  font-weight: 800;
}

.search-inner input:focus { border-color: rgba(255,255,255,0.45); }

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  pointer-events: none;
}

/* search w/ left logo */
.search-inner--logo { position: relative; }

.search-inner--logo > a {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 999px;
}

.search-inner--logo > a img {
  height: 28px;
  width: auto;
  display: block;
}

.search-inner--logo input { padding-left: 68px; }

/* =========================
   TOPIC CARD / TOOLS
   ========================= */
.topic-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--ui-border);
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);
  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

#topicTitle { text-align: center; }
#topicLead { text-align: center; opacity: 0.9; }

.topic-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.tool-error {
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.30);
}

/* =========================
   TRACK (ROLE + EXAM)
   ========================= */
.track-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 16px 0 18px;
}

.track-row .track-control {
  min-width: 120px;
  text-align: center;
}

/* =========================
   DOMAIN & TOPIC ROWS
   ========================= */
#categoryButtons,
#chipsStrip {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;

  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  margin: 14px 0 12px !important;
  padding: 6px 6px !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;

  flex-wrap: nowrap !important;
  white-space: nowrap !important;

  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;

  scroll-behavior: auto !important;
  scroll-snap-type: none !important;

  touch-action: pan-x !important;
  overscroll-behavior-x: contain !important;

  transform: none !important;
  will-change: auto !important;
}

#categoryButtons::-webkit-scrollbar,
#chipsStrip::-webkit-scrollbar { display: none !important; }

#categoryButtons > *,
#chipsStrip > * { flex: 0 0 auto !important; }

#categoryButtons > button,
#chipsStrip > button {
  flex: 0 0 auto !important;

  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  padding: 8px 20px;
  border-radius: 999px;

  border: 1px solid #f7f9fc;
  background: transparent;
  color: #f7f9fc;

  cursor: pointer;
  white-space: nowrap;

  touch-action: pan-x;

  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;

  scroll-snap-align: none;
}

#categoryButtons > button.active,
#chipsStrip > button.active {
  background: var(--branch-accent);
  color: var(--branch-accent-contrast);
  border-color: var(--branch-accent);
}

/* =========================
   FEATURE ACTIONS (ASSESS / PLAN / TEST)
   ========================= */
.feature-panel { margin-top: 18px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 18px;
  justify-content: center;
  align-items: center;
}

.feature-grid .small-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

/* EXAM only: the page has a single Home button in feature-grid, center it */
#setupCard ~ .feature-panel .feature-grid {
  display: flex;
  justify-content: center;
  align-items: center;
}

#setupCard ~ .feature-panel .feature-grid .small-btn {
  width: auto;
  min-width: 160px;
}

/* =========================
   ASSESSMENT (SHARED)
   ========================= */
.accordion-card {
  max-width: 960px;
  margin: 0 auto 18px;
  padding: 16px 14px 10px;
  border-radius: 18px;

  border: 1px solid var(--ui-border);
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);

  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

.panel-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.panel-wrap .panel-card {
  max-width: 960px;
  width: 100%;
  border-radius: 20px;
  padding: 18px 18px 20px;

  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface-strong);
  border: 1px solid var(--ui-border);

  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.answer-card {
  width: 100%;
  appearance: none;
  border-radius: 16px;
  padding: 16px 18px;

  color: #f7f9fc;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;

  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--ui-surface);
  border: 1px solid rgba(255,255,255,0.28);

  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.answer-card:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)), var(--ui-surface);
}

.answer-card:active:not(:disabled) { transform: translateY(1px); }

.answer-card:disabled { cursor: default; opacity: 0.9; }

.answer-card.is-correct {
  border-color: var(--branch-accent);
  color: var(--branch-accent);
}

.answer-card.is-wrong {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* Assessment chip row */
.chip-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.chip-wrap .chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 960px;
  padding: 4px 6px;
  scrollbar-width: none;
}

.chip-wrap .chip-row::-webkit-scrollbar { display: none; }

#assessmentAccordion {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.06);
}

.locked-mode,
.lock-row,
.lock-caption { display: none; }

/* =========================
   STUDY PLAN (SHARED)
   ========================= */
.plan-header { text-align: center; margin-bottom: 18px; }

.plan-note {
  max-width: 620px;
  margin: 0 auto 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--branch-text-soft);
  text-align: center;
}

.plan-summary-card,
.plan-table-card {
  max-width: 960px;
  margin: 0 auto 20px;
  padding: 20px 18px 14px;
  border-radius: 18px;

  border: 1px solid var(--ui-border);
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);

  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

/* Mastery card */
.plan-status-card {
  padding: 0;
  background: transparent;
  border-radius: 0;
  text-align: center;
}

.mastery-header {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--branch-text-soft);
  margin-bottom: 10px;
}

.mastery-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
  margin: 6px 0 14px;
}

.mastery-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.35s ease;
  background: linear-gradient(90deg, #f5c16c, #ffd27d);
}

.mastery-bar-fill.complete {
  background: linear-gradient(90deg, #58d68d, #2ecc71);
}

.mastery-metrics {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 6px;
}

.mastery-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.mastery-metric-label {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 2px;
}

.mastery-metric-value {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

/* =========================
   EXAM (CANONICAL)
   ========================= */
#setupCard,
#examCard,
#resultsCard {
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface-strong);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

#setupCard > * + * { margin-top: 10px; }
#examCard > * + * { margin-top: 12px; }
#resultsCard > * + * { margin-top: 12px; }

/* Center the HOME button row in Exam without touching Index */
#setupCard .row-flex-end,
#examCard .row-flex-end,
#resultsCard .row-flex-end {
  justify-content: center;
}

#setupStatus,
#metaLine {
  font-size: 13px;
  line-height: 1.5;
  color: var(--branch-text-soft);
  text-align: center;
}

#sectionLabel,
#progressLabel,
#timerLabel {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.9;
}

.q-text,
#questionText {
  font-size: 15px;
  line-height: 1.55;
  margin: 14px 0;
  color: #f7f9fc;
}

.choices,
#choicesWrap { display: grid; gap: 10px; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;

  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--ui-surface);
  border: 1px solid var(--ui-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);

  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.choice:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)), var(--ui-surface);
  box-shadow: var(--ui-card-shadow);
}

.choice.active {
  border-color: var(--branch-accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 12px 30px rgba(0,0,0,0.42);
}

.choice input {
  margin-top: 2px;
  flex: 0 0 auto;
  cursor: pointer;
}

.choice > div {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.45;
}

.choice.correct { border-color: #2ecc71; color: #2ecc71; }
.choice.wrong { border-color: #ff6b6b; color: #ff6b6b; }

.choice input:disabled { cursor: default; }
.choice input:disabled + div { opacity: 0.9; }


/* =========================
   MOBILE
   ========================= */
@media (max-width: 600px) {
  .page { padding-top: 32px; }

  .topic-actions .small-btn {
    font-size: 12px;
    padding: 7px 14px;
  }

  .search-inner { width: min(560px, 94%); }
}

@media (max-width: 768px) {
  .category-buttons {
    max-width: 100%;
    padding-inline: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .chips-strip {
    max-width: 100%;
    padding-inline: 10px;
    scroll-padding-inline: 10px;
    scroll-snap-type: x proximity;
  }

  .chips-strip > button {
    scroll-snap-align: start;
  }
}

/* Shared accessible media, speech, and compact tool headers. */
.jc-media-placeholder {
  min-height: 132px;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
    rgba(0,0,0,0.22);
  color: var(--branch-text-soft);
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.jc-read-aloud-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}

.jc-tool-compact-header .jc-read-aloud-row {
  margin: 0;
}

#featureBody.orientation-host .culture-text-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

#featureBody.orientation-host .culture-text-row .culture-body {
  flex: 1 1 auto;
  min-width: 0;
}

#featureBody.orientation-host .culture-text-row .jc-speech-button {
  margin-top: -4px;
}

.jc-tool-compact-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.14);
  color: var(--branch-text-soft);
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jc-tool-compact-header .jc-tool-compact-title {
  min-width: 0;
  overflow: hidden;
  color: #f7f9fc;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jc-diagram-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
}

.jc-diagram-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.jc-flashcard-shell {
  position: relative;
  display: grid;
  min-width: 0;
}

.jc-flashcard-face {
  width: 100%;
  min-width: 0;
  min-height: 76px;
  padding: 16px 104px 16px 16px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.jc-flashcard-shell.is-flipped .jc-flashcard-face {
  min-height: 92px;
  padding-right: 126px;
}

.jc-flashcard-front {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.jc-flashcard-answer {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.95;
}

.jc-flashcard-hint {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  min-width: 74px;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  color: inherit;
  font: 800 12px/1 "Rajdhani", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.jc-flashcard-face:focus-visible,
.jc-flashcard-hint:focus-visible {
  outline: 2px solid var(--branch-accent, currentColor);
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .jc-flashcard-face {
    padding-right: 92px;
  }

  .jc-flashcard-shell.is-flipped .jc-flashcard-face {
    padding-right: 112px;
  }

  .jc-flashcard-hint {
    right: 10px;
    min-width: 68px;
    min-height: 34px;
    padding-inline: 10px;
    font-size: 11px;
  }
}

/* =========================================================
   EXPLANATION OVERLAY (Quiz explain panel)
   ADD THIS BLOCK at the end of app.css
   Makes the explain overlay look like a real modal and uses branch accent colors
   ========================================================= */

/* Backdrop + container (supports multiple ids/classes safely) */
#explainOverlay,
#explanationOverlay,
#explainModal,
#explanationModal,
.explain-overlay,
.explanation-overlay,
.quiz-explain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;

  display: none;

  align-items: center;
  justify-content: center;

  padding-top: calc(var(--safe-top-icons) + 10px);
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));

  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Visible states (match your other overlays) */
#explainOverlay:not(.is-hidden),
#explanationOverlay:not(.is-hidden),
#explainModal:not(.is-hidden),
#explanationModal:not(.is-hidden),
.explain-overlay:not(.is-hidden),
.explanation-overlay:not(.is-hidden),
.quiz-explain-overlay:not(.is-hidden),
#explainOverlay[aria-hidden="false"],
#explanationOverlay[aria-hidden="false"],
#explainModal[aria-hidden="false"],
#explanationModal[aria-hidden="false"] {
  display: flex;
}

/* Card shell */
#explainOverlay .overlay-card,
#explanationOverlay .overlay-card,
#explainModal .overlay-card,
#explanationModal .overlay-card,
.explain-overlay .overlay-card,
.explanation-overlay .overlay-card,
.quiz-explain-overlay .overlay-card,
#explainOverlay .explain-card,
#explanationOverlay .explain-card,
#explainModal .explain-card,
#explanationModal .explain-card,
.explain-overlay .explain-card,
.explanation-overlay .explain-card,
.quiz-explain-overlay .explain-card {
  width: min(96vw, 760px);
  border-radius: 16px;

  background: var(--modal-card-bg);
  border: 1px solid var(--modal-card-border);
  color: var(--modal-text);

  display: flex;
  flex-direction: column;

  min-height: 0;
  max-height: calc(100vh - 80px);
  overflow: hidden;
}

/* Header row inside the explain card */
.explain-header,
.explanation-header,
#explainHeader,
#explanationHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 16px;

  background: var(--modal-header-bg);
  border-bottom: 1px solid var(--modal-divider);
}

/* Left title group (icon + title) */
.explain-title,
.explanation-title,
#explainTitle,
#explanationTitle {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Status pill on right (Wrong Answer) */
.explain-status,
.explanation-status,
#explainStatus,
#explanationStatus {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  padding: 7px 12px;
  border-radius: 999px;

  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.22);
  color: rgba(247,249,252,0.92);

  white-space: nowrap;
}

/* Body scroll owner */
.explain-body,
.explanation-body,
#explainBody,
#explanationBody {
  padding: 14px 16px 16px;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  min-height: 0;
  flex: 1 1 auto;
}

/* Picked / Correct rows use branch-aware styling */
.explain-picked,
.explain-correct,
.explanation-picked,
.explanation-correct,
#explainPicked,
#explainCorrect,
#explanationPicked,
#explanationCorrect {
  border-radius: 14px;
  padding: 14px 14px;
  margin: 10px 0;

  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.18);

  font-size: 14px;
  line-height: 1.35;
}

/* Picked is red */
.explain-picked,
.explanation-picked,
#explainPicked,
#explanationPicked {
  border-color: rgba(255,107,107,0.60);
  background: rgba(255,107,107,0.10);
  color: rgba(255,255,255,0.94);
}

/* Correct is accent-driven (matches branch theme) */
.explain-correct,
.explanation-correct,
#explainCorrect,
#explanationCorrect {
  border-color: color-mix(in srgb, var(--branch-accent) 70%, rgba(255,255,255,0.20));
  background: color-mix(in srgb, var(--branch-accent) 14%, rgba(0,0,0,0.18));
  color: rgba(255,255,255,0.96);
}



/* Mobile sizing */
@media (max-width: 600px) {
  #explainOverlay .overlay-card,
  #explanationOverlay .overlay-card,
  #explainModal .overlay-card,
  #explanationModal .overlay-card,
  .explain-overlay .overlay-card,
  .explanation-overlay .overlay-card,
  .quiz-explain-overlay .overlay-card,
  #explainOverlay .explain-card,
  #explanationOverlay .explain-card,
  #explainModal .explain-card,
  #explanationModal .explain-card,
  .explain-overlay .explain-card,
  .explanation-overlay .explain-card,
  .quiz-explain-overlay .explain-card {
    width: min(96vw, 640px);
    max-height: calc(100vh - 68px);
  }

}

/* =========================
   ORIENTATION CULTURE (ARTICLE LIST + ACCORDION, NO CARDS)
   FIXED:
   - Top controls stay fixed (page does not scroll)
   - Only .culture-list scrolls UNDER the fixed top controls
   - Bottom fades into footer (true opacity fade via mask, no phantom blocks)
   - Removes fixed ::after overlay that caused the solid blue block
   - Footer remains solid and correct
   ========================= */


/* HARD KILL any old overlay fades that create phantom blocks */
#featureBody.orientation-host::before,
#featureBody.orientation-host::after {
  content: none !important;
}

/* =========================
   CULTURE LIST (ONLY VERTICAL SCROLLER)
   Works with orientation.js culture markup:
   .culture-list
     - .culture-row (section) for short items
       - .culture-article
     - details.culture-row.culture-accordion for long items
       - summary.culture-summary
         - .culture-title
         - .culture-caret
       - .culture-article
   Also supports search wrapper:
   .culture-row-wrap[data-cat-id] > (section|details).culture-row
   ========================= */
#featureBody.orientation-host .culture-list {
  height: auto;
  width: 100%;

  overflow-y: visible;
  overflow-x: hidden;

  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;

  display: flex;
  flex-direction: column;
  gap: 12px;

  /* bottom room so last item clears footer */
  padding: 2px;

  /* HARD KILL ALL FADES */
  -webkit-mask-image: none !important;
  mask-image: none !important;
  -webkit-mask-repeat: initial !important;
  mask-repeat: initial !important;
  -webkit-mask-size: initial !important;
  mask-size: initial !important;
}

#featureBody.orientation-host .culture-row-wrap {
  width: 100%;
}

#featureBody.orientation-host .culture-row {
  width: 100%;
}

/* Base surface for both section rows and details accordions */
#featureBody.orientation-host .culture-row,
#featureBody.orientation-host details.culture-accordion {
  border-radius: 18px;

  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);
  border: 1px solid var(--ui-border);

  backdrop-filter: blur(var(--ui-glass-blur));
  -webkit-backdrop-filter: blur(var(--ui-glass-blur));
}

/* Remove default details marker */
#featureBody.orientation-host details.culture-accordion summary::-webkit-details-marker { display: none; }
#featureBody.orientation-host details.culture-accordion summary::marker { content: ""; }

/* Summary header (tap target) - CENTERED + ONE LINE */
#featureBody.orientation-host .culture-summary {
  list-style: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;

  padding: 14px 14px;
  border-radius: 18px;

  user-select: none;
  -webkit-tap-highlight-color: transparent;

  text-align: center;
}

/* Divider appears only when open */
#featureBody.orientation-host details.culture-accordion[open] .culture-summary {
  border-bottom: 1px solid rgba(255,255,255,0.14);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Content block */
#featureBody.orientation-host .culture-article {
  width: 100%;
  padding: 14px 14px 16px;
}

/* For non-accordion short items, keep padding on the card itself */
#featureBody.orientation-host section.culture-row .culture-article {
  padding: 14px 14px 16px;
}

/* Title centered, FORCE SINGLE LINE */
#featureBody.orientation-host .culture-title {
  width: 100%;
  margin: 0;

  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;

  color: #f7f9fc;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* If short item uses section markup, add spacing below title */
#featureBody.orientation-host section.culture-row .culture-title {
  margin-bottom: 10px;
}

/* Chevron removed */
#featureBody.orientation-host .culture-caret {
  display: none !important;
}

/* If anything else exists in summary besides title, hide it */
#featureBody.orientation-host details.culture-accordion summary > :not(.culture-title) {
  display: none !important;
}

/* Media */
#featureBody.orientation-host .culture-media {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;

  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.14);

  margin: 0 0 12px;
}

#featureBody.orientation-host .culture-media img {
  width: 100%;
  height: auto;
  display: block;
}

/* Body */
#featureBody.orientation-host .culture-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--branch-text-soft);
}

/* Center body when orientation.js applies .is-centered */
#featureBody.orientation-host .culture-body.is-centered {
  text-align: center;
}

/* Empty */
#featureBody.orientation-host .culture-empty {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 16px;

  border-radius: 18px;
  border: 1px solid var(--ui-border-soft);
  background: linear-gradient(180deg, var(--ui-highlight-top), var(--ui-highlight-bottom)), var(--ui-surface);

  color: rgba(247,249,252,0.85);
}

/* =========================
   ORIENTATION SUBNAV / SWIPE (FORCE ONE LINE)
   FIXED:
   - Prevents ANY wrapping regardless of other global flex rules
   - Forces chips to stay auto-width (never 100%)
   - NO OTHER CHANGES
   ========================= */


#orientationChipsStrip.orientation-subnav,
#chipsStrip.orientation-subnav,
.orientation-subnav {
  display: flex !important;
  flex-direction: row !important;

  gap: 10px !important;
  align-items: center !important;
  justify-content: flex-start !important;

  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  margin: 0 auto 10px !important;
  padding: 6px 6px !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;

  flex-wrap: nowrap !important;
  white-space: nowrap !important;

  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;

  touch-action: pan-x !important;
  overscroll-behavior-x: contain !important;
}

/* FORCE every direct child into single-row inline flow */
#orientationChipsStrip.orientation-subnav > *,
#chipsStrip.orientation-subnav > *,
.orientation-subnav > * {
  flex: 0 0 auto !important;
  display: inline-flex !important;

  width: auto !important;
  max-width: none !important;
  min-width: max-content !important;

  white-space: nowrap !important;
}

/* HARD LOCK common chip / button elements */
#orientationChipsStrip .chip,
#chipsStrip .chip,
.orientation-subnav .chip,
#orientationChipsStrip button,
#chipsStrip button,
.orientation-subnav button {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap !important;
}

#orientationChipsStrip::-webkit-scrollbar,
#chipsStrip::-webkit-scrollbar,
.orientation-subnav::-webkit-scrollbar {
  display: none !important;
}

/* =========================
   SWIPE STRIP (UNCHANGED)
   ========================= */

.orientation-strip {
  height: 100%;
  width: 100%;
  display: flex;
  gap: 12px;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;

  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
}

.orientation-strip::-webkit-scrollbar { display: none; }

.orientation-snap {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;

  scroll-snap-align: start;
  scroll-snap-stop: always;

  display: flex;
}

.panel-card.orientation-card {
  width: 100%;
  height: 100%;
  margin: 0;

  border-radius: 22px;
  overflow: hidden;

  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    rgba(10,16,26,0.55);

  border: 1px solid rgba(255,255,255,0.28);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 16px 34px rgba(0,0,0,0.55);

  display: flex;
  flex-direction: column;
}

.panel-card.orientation-card .card-media {
  width: 100%;
  aspect-ratio: 1 / 1;

  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.10), rgba(255,255,255,0.02)),
    rgba(0,0,0,0.22);

  border-bottom: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
}

.panel-card.orientation-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

#featureBody.orientation-host .culture-media img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.panel-card.orientation-card .panel-header {
  position: relative;
  padding: 12px 14px 6px;
}

.panel-card.orientation-card .panel-header .card-title-btn {
  padding-inline: 36px;
}

.panel-card.orientation-card .panel-header .jc-speech-button {
  position: absolute;
  top: 7px;
  right: 10px;
}

.panel-card.orientation-card .card-title-btn {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
}

.panel-card.orientation-card .panel-body {
  padding: 0 14px 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}



/* =========================================================
   BRANCH HEADER: ISOLATED LOGO + SEARCH
   The logo remains the drawer trigger but is no longer
   visually or physically inside the search pill.
========================================================= */

.search-inner--logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-inner--logo > a {
  position: static;
  left: auto;
  top: auto;
  transform: none;

  flex: 0 0 46px;

  width: 46px;
  height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 7px;

  border: 1px solid var(--ui-border);
  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      var(--ui-highlight-top),
      var(--ui-highlight-bottom)
    ),
    var(--ui-surface);

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
}

.search-inner--logo > a img {
  width: 100%;
  height: 100%;

  display: block;
  object-fit: contain;
}

.search-inner--logo input {
  flex: 1 1 auto;

  width: auto;
  min-width: 0;

  padding-left: 18px;
}

.search-inner--logo .search-icon {
  right: 14px;
}

/* Prevent the logo from being interpreted as part of
   the search hit area on touch devices. */
.search-inner--logo > a {
  position: relative;
  z-index: 2;
}

@media (max-width: 520px) {

  .search-inner--logo {
    gap: 8px;
  }

  .search-inner--logo > a {
    flex-basis: 44px;

    width: 44px;
    height: 44px;

    padding: 7px;
  }

  .search-inner--logo input {
    min-height: 44px;
  }
}
/* Accessible text that remains available to screen readers. */
.jc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Keep quiz explanation actions on one compact mobile row. */
@media (max-width: 600px) {
  .topic-actions {
    display: grid;
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    gap: 6px;
    width: 100%;
  }

  .topic-actions .small-btn {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 7px 2px;
    line-height: 1;
    white-space: nowrap;
  }

  [data-jc-speaker],
  [data-jc-pause],
  [data-jc-next] {
    flex: 1 1 0;
    box-sizing: border-box;
    min-width: 0 !important;
    min-height: 42px;
    padding: 8px 5px !important;
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: .04em !important;
    white-space: nowrap;
    touch-action: manipulation;
  }

  [data-jc-speaker],
  [data-jc-next] {
    flex-grow: 1.15;
  }

  [data-jc-speaker] {
    gap: 4px !important;
  }

  [data-jc-speaker] svg,
  [data-jc-pause] svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }
}

@media (max-width: 340px) {
  [data-jc-speaker],
  [data-jc-pause],
  [data-jc-next] {
    padding-inline: 3px !important;
    font-size: 9px;
    letter-spacing: .02em !important;
  }

  [data-jc-speaker] {
    gap: 2px !important;
  }

  [data-jc-speaker] svg,
  [data-jc-pause] svg {
    width: 15px;
    height: 15px;
  }
}
