/* MIRAI TENCHO — post-recovery UX refinements */
@media (min-width: 961px) {
  .lead-page__grid {
    grid-template-columns: minmax(0, 500px) minmax(0, 1fr) !important;
    gap: 62px !important;
  }

  .lead-page__copy {
    min-width: 0 !important;
    max-width: 500px !important;
    padding-right: 0 !important;
  }

  .lead-page__copy h1 {
    display: block !important;
    width: 100% !important;
    max-width: 500px !important;
    font-size: 38px !important;
    line-height: 1.18 !important;
    letter-spacing: -0.04em !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .lead-page__copy p {
    max-width: 490px !important;
  }
}

@media (max-width: 960px) {
  .lead-page__grid {
    grid-template-columns: 1fr !important;
  }

  .lead-page__copy h1 {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

/* Desktop-first density: preserve content, remove avoidable vertical travel. */
@media (min-width: 961px) {
  .site-nav {
    min-height: 64px !important;
  }

  .site-context-bar,
  .site-breadcrumb {
    min-height: 38px !important;
  }

  .hero-rebuild.hero-slider {
    height: 570px !important;
    min-height: 570px !important;
    max-height: 570px !important;
  }

  .hero-rebuild__grid.hero-slider__grid {
    height: 472px !important;
    min-height: 472px !important;
    max-height: 472px !important;
    align-items: center !important;
  }

  .hero-slider__copy {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .hero-slider__copy h1 {
    min-height: 0 !important;
    max-height: none !important;
    font-size: clamp(36px, 3vw, 42px) !important;
    line-height: 1.18 !important;
    margin: 0 0 8px !important;
  }

  .hero-slider__copy .hero-rebuild__lead {
    min-height: 2.9em !important;
    margin: 0 0 6px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .hero-slider__copy .hero-noncomm__sublead {
    min-height: 2.1em !important;
    margin: 0 0 8px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
  }

  .hero-slider__copy .hero-actions {
    min-height: 48px !important;
    margin-top: 0 !important;
  }

  .hero-slider__copy .hero-actions button {
    min-height: 48px !important;
    padding-inline: 18px !important;
  }

  .hero-slider__controls {
    min-height: 28px !important;
    margin-top: 8px !important;
  }

  .hero-slider__visual {
    height: 382px !important;
    min-height: 382px !important;
    max-height: 382px !important;
  }

  .hero-slider__visual .mirai-hero-human-visual {
    height: 294px !important;
    bottom: 8px !important;
  }

  .hero-slider__visual .hero-phone {
    transform: translateX(-18px) scale(0.7) !important;
    transform-origin: center bottom !important;
  }

  /* Actual public-page hero classes: override the recovered base stylesheet directly. */
  .hero-rebuild {
    height: 570px !important;
    min-height: 570px !important;
    max-height: 570px !important;
    padding-top: 28px !important;
    padding-bottom: 20px !important;
  }

  .hero-rebuild__grid {
    height: 472px !important;
    min-height: 472px !important;
    max-height: 472px !important;
    align-items: center !important;
    gap: clamp(30px, 4vw, 54px) !important;
    overflow: visible !important;
  }

  .hero-rebuild__copy {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .hero-rebuild__copy h1 {
    max-width: 560px !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    font-size: clamp(36px, 3vw, 42px) !important;
    line-height: 1.18 !important;
  }

  .hero-rebuild__lead {
    max-width: 500px !important;
    margin-bottom: 0 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .hero-rebuild__promise {
    margin-top: 10px !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
  }

  .hero-rebuild .hero-actions {
    gap: 10px !important;
    margin-top: 12px !important;
  }

  .hero-rebuild__visual {
    height: 382px !important;
    min-height: 382px !important;
    max-height: 382px !important;
    overflow: visible !important;
  }

  .hero-rebuild__photo {
    inset: 0 0 12px 8% !important;
    border-radius: 24px !important;
  }

  .hero-rebuild__handoff {
    top: 18px !important;
    padding: 11px !important;
  }

  .hero-rebuild__product {
    right: 12px !important;
  }

  .visual-page-hero,
  .structured-page__lead,
  .feature-showcase,
  .trust-rebuild,
  .pricing--visual,
  .industry-index {
    padding-top: 54px !important;
    padding-bottom: 54px !important;
  }

  .feature-showcase {
    padding-top: 72px !important;
    padding-bottom: 72px !important;
  }

  .cases-page__gallery > *,
  .industry-card,
  .price-card,
  .process-step,
  .trust-rebuild__list,
  .feature-stage,
  .feature-tool-rail,
  .feature-boundary {
    padding: 20px !important;
  }
}

/* Top-page quality-gate fixes: do not let text fall through light surfaces. */
.noncomm-demos .eyebrow,
.noncomm-demos .noncomm-demos__phone > .eyebrow,
.noncomm-demos .noncomm-demos__phone small {
  color: #14548d !important;
}

.noncomm-demos .avatar.coral {
  color: #963b34 !important;
}

.noncomm-demos .avatar.coral::before,
.noncomm-demos .avatar.coral::after {
  color: inherit !important;
}

.noncomm-demos > .noncomm-demos__head .eyebrow {
  color: #c9f7e6 !important;
}

.noncomm-demos .noncomm-demos__head .eyebrow {
  color: #c9f7e6 !important;
}

.candidate-row .avatar.coral {
  color: #963b34 !important;
}

.cockpit-topbar b {
  color: #102c58 !important;
}

/* Keep independent hero information surfaces from occupying the same space. */
@media (min-width: 761px) {
  .hero-rebuild.hero-slider .hero-rebuild__grid {
    overflow: visible !important;
  }

  .hero-rebuild__visual .hero-noncomm__outcome {
    position: absolute !important;
    right: 0 !important;
    bottom: 12px !important;
    left: auto !important;
    top: auto !important;
    z-index: 3 !important;
    width: min(220px, 36%) !important;
    margin: 0 !important;
  }

  .hero-rebuild__visual .hero-phone__label {
    top: -42px !important;
  }
}

/* Major actions retain a 44px minimum physical click target. */
.site-nav .nav-login,
.site-nav .nav-login--guided,
.industry-live-preview__contact,
button.text-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
}

.hero-slider__pause,
.demo-tabs button,
.cockpit-window button:not([role="tab"]) {
  min-height: 44px !important;
}

.candidate-row button {
  min-width: 44px !important;
}

/* Public-page quality gate fixes: opaque text surfaces and usable action targets. */
.service-summary__scope .lead-eyebrow {
  color: #155786 !important;
}

.demo-visual-hero figure figcaption {
  background: rgba(7, 34, 75, 0.92) !important;
  color: #ffffff !important;
  border: 1px solid rgba(189, 244, 226, 0.38) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
}

.demo-visual-hero figure figcaption span {
  color: #d0f9e9 !important;
}

.demo-visual-hero figure figcaption b {
  color: #ffffff !important;
}

.lead-form__topics > button,
.document-actions > button,
.document-actions > a,
.login-sidebar > button,
.auth-tabs > button,
.login-google .google-button {
  min-height: 44px !important;
}

.document-actions > button,
.document-actions > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Standalone guidance pages: preserve contrast in cards and prevent footer text collisions. */
.hero + .section .cards article.card > span:first-child {
  color: #2d5f98 !important;
}

/* Question maker: every instructional state keeps AA contrast on its own surface. */
.question-maker-steps button {
  color: #365273 !important;
}

.question-maker-steps button > span {
  background: #245b95 !important;
  color: #ffffff !important;
}

.question-maker-panel__label > span {
  color: #24568c !important;
}

.question-maker-purpose-grid button small {
  color: #465e7a !important;
}

.question-maker-primary {
  background: #1d5b96 !important;
  color: #ffffff !important;
}

.question-maker-note,
.question-maker-page .question-maker-steps + p {
  color: #465e7a !important;
}

/* Mobile: keep the product preview within its own hero surface and preserve readable line spacing. */
@media (max-width: 760px) {
  footer.footer {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  footer.footer strong,
  footer.footer span {
    display: block !important;
    margin: 0 !important;
  }

  .lead-page .page-wrap,
  .lead-page__grid,
  .lead-page__copy,
  .lead-form {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .lead-page__copy {
    padding-right: 0 !important;
  }

  .hero-rebuild.hero-slider {
    height: auto !important;
    min-height: 1px !important;
    max-height: none !important;
    padding-bottom: 24px !important;
  }

  .hero-rebuild.hero-slider .hero-rebuild__grid,
  .hero-rebuild.hero-slider .hero-rebuild__grid.hero-slider__grid {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .hero-rebuild.hero-slider .hero-rebuild__copy h1,
  .hero-rebuild.hero-slider .hero-slider__copy h1 {
    line-height: 1.12 !important;
  }

  .hero-rebuild.hero-slider .hero-rebuild__copy h1 > span,
  .hero-rebuild.hero-slider .hero-slider__copy h1 > span {
    display: block !important;
    line-height: 1.12 !important;
    margin: 0 0 4px !important;
  }

  .hero-rebuild__visual {
    height: 420px !important;
    min-height: 420px !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  .hero-rebuild__visual .hero-phone {
    transform: translateX(-50%) scale(0.78) !important;
    transform-origin: center top !important;
    left: 50% !important;
  }

  .hero-rebuild.hero-slider .hero-slider__caption,
  .hero-rebuild__visual .hero-slider__caption {
    display: none !important;
  }

  .hero-rebuild__visual .hero-phone__label {
    display: none !important;
  }

  .hero-rebuild__visual .hero-noncomm__outcome {
    display: none !important;
  }

  .hero-rebuild.hero-slider .hero-slider__pause {
    left: 14px !important;
    right: auto !important;
  }

  .story-preview .story-preview__grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .story-preview .story-preview__grid > * {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .nav-menu-toggle {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

.trust-rebuild .section-title h2,
.trust-rebuild .section-title h2 em,
.trust-rebuild .section-title > p:not(.eyebrow) {
  color: #102c58 !important;
  text-shadow: none !important;
}

.trust-rebuild .section-title .eyebrow {
  color: #1b5f9d !important;
}

.trust-rebuild__list {
  gap: 16px !important;
}

.trust-rebuild__list article {
  display: grid !important;
  align-content: start !important;
  gap: 8px !important;
  min-width: 0 !important;
  min-height: 156px !important;
  padding: 22px !important;
  background: #ffffff !important;
  color: #102c58 !important;
  border: 1px solid #b8d9ec !important;
  box-shadow: 0 10px 24px rgba(31, 103, 161, 0.08) !important;
}

.trust-rebuild__list article b {
  display: block !important;
  color: #102c58 !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
}

.trust-rebuild__list article p {
  margin: 0 !important;
  color: #345575 !important;
  font-size: 14px !important;
  line-height: 1.75 !important;
}

/* Visual quality gate: final conversion panel on a dark surface. */
.final-cta {
  color: #ffffff !important;
}

.final-cta .eyebrow {
  color: #b9f3df !important;
  text-shadow: none !important;
}

.final-cta h2,
.final-cta h2 em {
  color: #ffffff !important;
  text-shadow: none !important;
}

.final-cta p:not(.eyebrow) {
  color: #e1edff !important;
  text-shadow: none !important;
}

/* Visual quality gate: footer hierarchy on the existing navy surface. */
.site-footer {
  color: #e7f1ff !important;
}

.site-footer .brand,
.site-footer a {
  color: #f7fbff !important;
}

.site-footer p {
  color: #d7e6f8 !important;
}

.site-footer b {
  display: block !important;
  color: #b9f3df !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  letter-spacing: 0.01em !important;
}

.site-footer__grid a {
  color: #edf6ff !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.site-footer__grid a:hover,
.site-footer__grid a:focus-visible {
  color: #b9f3df !important;
  text-decoration: underline !important;
  text-underline-offset: 4px !important;
}

.site-footer__bottom {
  color: #d7e6f8 !important;
  border-color: rgba(215, 230, 248, 0.28) !important;
}

.site-footer__bottom span {
  color: #d7e6f8 !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
}

@media (max-width: 760px) {
  .trust-rebuild__list article {
    min-height: 0 !important;
    padding: 20px !important;
  }

  .site-footer__grid a {
    font-size: 14px !important;
  }
}

/* Visual quality gate: Story page copy must never sit directly on imagery. */
.story-visual-hero {
  display: grid !important;
  align-items: center !important;
  min-height: 520px !important;
  background: #eaf7ff !important;
}

.story-visual-hero > img {
  opacity: 0.56 !important;
  object-position: right center !important;
}

.story-visual-hero__copy {
  position: relative !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  width: min(560px, calc(100% - 48px)) !important;
  max-width: 560px !important;
  margin: 0 auto 0 max(32px, calc((100vw - 1200px) / 2)) !important;
  padding: 42px 44px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid #b8d9ec !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 42px rgba(25, 83, 132, 0.14) !important;
}

.story-visual-hero__copy .eyebrow,
.story-interview-ready .eyebrow {
  color: #1d5f99 !important;
  text-shadow: none !important;
}

.story-visual-hero__copy h1,
.story-visual-hero__copy h1 em,
.story-interview-ready h2,
.story-interview-ready h2 em {
  color: #102c58 !important;
  text-shadow: none !important;
}

.story-visual-hero__copy p:not(.eyebrow),
.story-interview-ready p:not(.eyebrow) {
  color: #345575 !important;
  text-shadow: none !important;
}

/* The historical image includes legacy lettering; hide only that duplicate layer. */
.story-visual-hero .hero-copy,
.story-visual-hero .story-visual-hero__legacy-copy {
  display: none !important;
}

@media (max-width: 760px) {
  .story-visual-hero {
    min-height: 0 !important;
    padding: 28px 0 34px !important;
  }

  .story-visual-hero > img {
    opacity: 0.24 !important;
    object-position: center !important;
  }

  .story-visual-hero__copy {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    margin: 0 16px !important;
    padding: 26px 22px !important;
    border-radius: 16px !important;
  }

  .story-visual-hero__copy h1 {
    font-size: clamp(34px, 10vw, 45px) !important;
    line-height: 1.13 !important;
    overflow-wrap: anywhere !important;
  }
}

/* Quality-gate batch 2: selectors measured from the live public DOM. */
.service-summary__scope .lead-eyebrow {
  color: #b9f3df !important;
}

p.lead-eyebrow {
  color: #0d3f70 !important;
}

[data-loc="client/src/pages/LeadPages.tsx:62"] > button[type="button"][aria-pressed] {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
}

.demo-visual-hero figure figcaption[data-loc="client/src/pages/Home.tsx:202"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  max-width: calc(100% - 32px) !important;
  padding: 9px 12px !important;
  background: #07224b !important;
  border: 1px solid rgba(208, 249, 233, 0.46) !important;
  border-radius: 10px !important;
}

.demo-visual-hero figure figcaption[data-loc="client/src/pages/Home.tsx:202"] span {
  color: #d0f9e9 !important;
}

.demo-visual-hero figure figcaption[data-loc="client/src/pages/Home.tsx:202"] b {
  color: #ffffff !important;
}

.question-maker-demo__head > p[data-loc="client/src/pages/QuestionMaker.tsx:59"] {
  color: #465e7a !important;
}
