/*
 * V260 final runtime repair layer.
 *
 * This file intentionally has a new URL instead of replacing an older asset.
 * It is loaded after every visual theme so deployed browsers cannot keep using
 * a stale same-name stylesheet.  The rules are presentation/input repairs only;
 * no form, canvas, authentication, QR or learning data contract is changed.
 */

/* The reported labels sit on deliberately light surfaces. */
body.app-shell.future-ui.public-app.shell-public.page-index
  .koto-experience-track > article > b,
body.app-shell.future-ui.public-app.shell-public.page-index
  .koto-experience-track > article.is-goal > b,
body.app-shell.future-ui.public-app.shell-public.page-index
  .koto-learning-range-grid > article > ul > li {
  border-color: #8cc8e8 !important;
  background: #ffffff !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  font-weight: 900 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

/* Organization entry cards were requested as white cards with black copy. */
body.app-shell.future-ui.public-app.shell-public.page-index
  .org-path-grid > .org-path-card {
  border-color: #9fc9e5 !important;
  background: #ffffff !important;
  color: #000000 !important;
}

body.app-shell.future-ui.public-app.shell-public.page-index
  .org-path-grid > .org-path-card > :is(span, h3, p, b) {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.public-app.shell-public.page-index
  .org-path-grid > .org-path-card > span {
  border: 1px solid #8cc8e8 !important;
  background: #ffffff !important;
}

/* The four-step journey stays where it occurs in the document. */
body.app-shell.future-ui.mnv-future-ui.page-study_session .mf-journey-rail {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  z-index: 20 !important;
}

/* Video controls: explicit white foreground on the dark control surface. */
body.app-shell.future-ui.mnv-future-ui:is(.page-watch, .page-study_session)
  .unified-player-controls :is(.player-tool, .player-speed-control) {
  border-color: rgba(116, 200, 255, .42) !important;
  background: #0b2b58 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.mnv-future-ui:is(.page-watch, .page-study_session)
  .unified-player-controls :is(.player-tool, .player-speed-control)
  :is(span, label, select, svg) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.mnv-future-ui:is(.page-watch, .page-study_session)
  .unified-player-controls .player-speed-control select,
body.app-shell.future-ui.mnv-future-ui:is(.page-watch, .page-study_session)
  .unified-player-controls .player-speed-control select option {
  border-color: rgba(255, 255, 255, .36) !important;
  background: #071f45 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.app-shell.future-ui.mnv-future-ui:is(.page-watch, .page-study_session)
  .unified-player-controls .player-tool svg {
  color: #ffffff !important;
  stroke: currentColor !important;
}

/* Remove both obsolete decorative discs from the preparation card. */
body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-prepare-shell .practice-processing-card::before,
body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-prepare-shell .practice-processing-card::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-prepare-shell .practice-processing-card > * {
  position: relative;
  z-index: 1;
}

body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-prepare-shell .practice-processing-card
  :is(h1, h2, h3, strong, .eyebrow) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-prepare-shell .practice-processing-card :is(p, small) {
  color: #dbe9f8 !important;
  -webkit-text-fill-color: #dbe9f8 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

/* Pen tools remain in normal document flow above their own paper. */
body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .handwriting-workspace > .handwriting-toolbar {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: auto !important;
  max-width: 100% !important;
  z-index: auto !important;
  transform: none !important;
}

/* Explicit foregrounds for pale labels inside the practice flow. */
body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-question-head .practice-step-badge {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .handwriting-problem-print > span:first-child {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-choice-assurance {
  color: #10243e !important;
  -webkit-text-fill-color: #10243e !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-result-card .notice.warning,
body.app-shell.future-ui.mnv-future-ui.page-practice_lab
  .practice-result-card .notice.warning :is(strong, span, small, b) {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

/*
 * Persistent learner rail.  At this breakpoint it is visually a desktop
 * sidebar, so it must also be an input-enabled, independently scrollable pane.
 */
@media (min-width: 1181px) {
  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header {
    z-index: 720 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    pointer-events: auto !important;
  }

  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header::before,
  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header::after {
    pointer-events: none !important;
  }

  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header-inner {
    display: flex !important;
    height: 100% !important;
    max-height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
    flex-direction: column !important;
    pointer-events: auto !important;
  }

  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header .site-nav-area,
  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header .site-nav-area.open {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: flex !important;
    width: 100% !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-gutter: stable !important;
    flex: 1 1 0 !important;
    flex-direction: column !important;
    touch-action: pan-y !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    -webkit-overflow-scrolling: touch;
  }

  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header .site-nav-area > *,
  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header .site-nav-area :is(a, button, summary, input, select, textarea) {
    pointer-events: auto !important;
  }

  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header .site-nav,
  body.app-shell.future-ui.mnv-future-ui:is(.shell-learner, .shell-immersive)
    .site-header .nav-actions {
    flex: 0 0 auto !important;
  }
}

/*
 * V261 homepage contrast hotfix.
 *
 * These three selectors deliberately depend only on the elements visible in
 * index.php.  They do not require a body theme/build class, so a partially
 * retained older presentation shell cannot turn the light labels pale again.
 */
.page-index .koto-experience-track > article > b,
.page-index .koto-experience-track > article.is-goal > b,
.page-index .koto-learning-range-grid > article > ul > li {
  border-color: #7cb8dc !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  -webkit-text-stroke-color: #000000 !important;
  text-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
}

/* The small auxiliary scene symbol now uses a dark tile and white line art. */
.page-index .koto-scene-grid .koto-scene-art > b {
  border: 2px solid #8b6cff !important;
  background: #3d247f !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(34, 18, 92, .30) !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
}

.page-index .koto-scene-grid .koto-scene-art > b > svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  filter: none !important;
  opacity: 1 !important;
}

.page-index .koto-scene-grid .koto-scene-art > b > svg [fill="currentColor"] {
  fill: #ffffff !important;
}

.page-index .koto-scene-grid .koto-scene-art > b > svg [stroke="none"] {
  stroke: none !important;
}

/*
 * V261 live grading overlay contrast.
 *
 * The older theme contributes two oversized decorative discs through the
 * card pseudo-elements. On the fixed overlay those discs sit above the live
 * status copy, producing the reported white-on-white screen. Keep the real
 * progress markup and cancellation control untouched; remove decoration only.
 */
.practice-processing-overlay .practice-processing-card::before,
.practice-processing-overlay .practice-processing-card::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

.practice-processing-overlay .practice-processing-card {
  background: linear-gradient(145deg, #071f45, #0b315c) !important;
  color: #ffffff !important;
}

.practice-processing-overlay .practice-processing-card > * {
  position: relative;
  z-index: 1;
}

.practice-processing-overlay .practice-processing-card
  :is(h1, h2, h3, strong, .eyebrow) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

.practice-processing-overlay .practice-processing-card
  :is(p, small, .practice-processing-help) {
  color: #dbe9f8 !important;
  -webkit-text-fill-color: #dbe9f8 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

.practice-processing-overlay .practice-processing-stages > li {
  border-color: #4178ad !important;
  background: #0b2b58 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

.practice-processing-overlay .practice-processing-stages > li.is-current {
  border-color: #59d8ff !important;
  background: #104a78 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.practice-processing-overlay .practice-processing-card
  :is([data-processing-cancel], [data-dekiru-processing-cancel]) {
  border-color: #6da9db !important;
  background: #0b2b58 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

@media (forced-colors: active) {
  body.app-shell.future-ui.public-app.shell-public.page-index :is(
    .koto-learning-range-grid > article > ul > li,
    .koto-experience-track > article > b,
    .org-path-grid > .org-path-card
  ) {
    border: 1px solid CanvasText !important;
    background: Canvas !important;
    color: CanvasText !important;
    -webkit-text-fill-color: CanvasText !important;
  }

  .page-index .koto-scene-grid .koto-scene-art > b,
  .page-index .koto-scene-grid .koto-scene-art > b > svg {
    border-color: CanvasText !important;
    background: Canvas !important;
    color: CanvasText !important;
    stroke: CanvasText !important;
  }

  .practice-processing-overlay .practice-processing-card,
  .practice-processing-overlay .practice-processing-stages > li,
  .practice-processing-overlay .practice-processing-card
    :is([data-processing-cancel], [data-dekiru-processing-cancel]) {
    border: 2px solid CanvasText !important;
    background: Canvas !important;
    color: CanvasText !important;
    -webkit-text-fill-color: CanvasText !important;
  }
}
