/* Shared mobile safety net. Keep desktop page-specific layouts untouched. */
.nav .nav-toggle {
  display: none;
}

#register #rxl li.mobile-reg-fallback {
  display: none;
}

#lv5[data-mobile-fallback],
#rows[data-mobile-fallback],
#stairs[data-mobile-fallback] {
  display: none;
}

@media (max-width:1023.98px) {
  :root {
    --mobile-inline-gutter: clamp(16px, 4vw, 20px);
    --mobile-section-space: clamp(56px, 12vw, 88px);
    --mobile-component-gap: clamp(24px, 6vw, 32px);
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    min-width: 0;
    max-width: 100%;
  }

  :where(main, header, footer, section, article, aside, nav, form, fieldset, figure) {
    min-width: 0;
    max-width: 100%;
  }

  :where(img, picture, video, canvas, iframe, svg) {
    max-width: 100%;
  }

  :where(h1, h2, h3, h4, h5, h6) {
    text-wrap: balance;
    overflow-wrap: break-word;
  }

  :where(p, li, td, th, label, small, a, button, code) {
    overflow-wrap: anywhere;
  }

  :where([id]) {
    scroll-margin-top: 80px;
  }

  html {
    scroll-padding-top: 80px;
  }

  :where(button, input:not([type="checkbox"]):not([type="radio"]), select, textarea, summary, [role="button"], [role="tab"]) {
    max-width: 100%;
    min-height: 44px;
  }

  .nav nav a,
  .nav-dropdown-trigger,
  .nav-dropdown-menu a,
  .nav-toggle {
    min-height: 44px;
  }

  .nav-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  body.mobile-nav-open {
    overflow-y: hidden;
    overscroll-behavior: none;
  }

  /* Outrank utility text-size classes so focusing a field does not zoom iOS. */
  :is(input, select, textarea):not([type="checkbox"]):not([type="radio"]) {
    font-size: max(16px, 1em);
  }

  #editProfileModal {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #editProfileModal > .flex {
    min-height: 100%;
    padding: 16px;
    align-items: flex-start;
  }

  #editProfileModal > .flex > .relative,
  #uploadModal > div {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin-block: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #uploadModal {
    align-items: flex-start;
  }

  .materials-hero-card {
    padding: 24px 20px !important;
  }

  .materials-hero-card .materials-progress-box {
    min-width: 0 !important;
    width: 100%;
    padding: 20px !important;
  }

  #materialsFilterBar {
    flex-wrap: wrap;
    overflow: visible;
  }

  .student-responsive-header h1 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  /* Reveal effects must not leave mobile content invisible when scripts fail. */
  .rv,
  .rv.in {
    opacity: 1;
    transform: none;
  }

  footer .ftr-tagline,
  #final .ftr-tagline,
  footer .ftr-col strong,
  #final .ftr-col strong,
  footer .ftr-bot-out,
  #final .ftr-bot-out {
    font-size: 14px;
    line-height: 1.5;
  }
}

@media (max-width: 767px) {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    min-width: 0;
    max-width: 100%;
  }

  body {
    margin: 0;
    width: 100%;
  }

  :where(main, header, footer, section, article, aside, nav, form, fieldset, figure) {
    min-width: 0;
    max-width: 100%;
  }

  :where(img, picture, video, canvas, iframe, svg) {
    max-width: 100%;
  }

  img,
  picture,
  video,
  canvas {
    height: auto;
  }

  :where(p, li, td, th, label, small, a, button, h1, h2, h3, h4, h5, h6) {
    /* Avoid breaking ordinary words mid-word; long unbroken values can still wrap. */
    overflow-wrap: break-word;
    word-break: normal;
  }

  pre,
  code {
    max-width: 100%;
  }

  pre {
    overflow-x: auto;
  }

  /* Inline fixed widths are common in the older landing-page markup. A max-width
     lets them shrink while preserving their intended desktop width. */
  [style*="width:"],
  [style*="width :"] {
    max-width: 100%;
  }

  :where(.container, .wrap, .page, .page-wrap, .content, .content-wrap, .section-inner, .shell) {
    max-width: 100%;
  }

  /* Reflow card and content grids; keep exam question-number controls compact. */
  .grid:not(.question-grid):not(.question-palette):not(.q-grid):not(.palette-grid):not([aria-label*="question" i]),
  .hero-grid,
  .stats-grid,
  .pgrid,
  .gov-grid,
  .blog-grid,
  .testimonial-grid,
  .credential-grid,
  .world-grid,
  .lp-route-grid,
  .lp-vs-grid,
  .gallery-grid,
  .vision-grid,
  .ee-chip-grid,
  .ee-grid-3,
  .port-grid,
  .asm-grid,
  .fx-grid,
  .tracks-grid,
  .intern-grid,
  .sheet-grid,
  .mou-value-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  }

  /* Partner logo badges: maintain a clean 2-column or 3-column grid on mobile devices */
  .gv-grid,
  .ngo-grid,
  .acad-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  @media (min-width: 540px) and (max-width: 767px) {
    .gv-grid,
    .ngo-grid,
    .acad-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }
  }

  /* Allow flex and grid items to shrink to the available phone width. */
  :where(main, header, footer, section, article, aside, nav, form, fieldset, figure, .flex, [style*="display:flex"], [style*="display: flex"]) {
    min-width: 0;
  }

  /* Admin toolbars get a second row when title and actions cannot both fit. */
  body[data-dashboard="admin"] header {
    height: auto !important;
    min-height: 64px;
    flex-wrap: wrap;
    row-gap: 8px;
    padding-block: 8px;
  }

  body[data-dashboard="admin"] header > div:first-child {
    flex: 1 1 180px;
  }

  body[data-dashboard="admin"] header > div:last-child {
    flex: 0 1 auto;
    justify-content: flex-end;
  }

  :where(button, input, select, textarea) {
    max-width: 100%;
  }

  .hero .pill {
    display: flex;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
  }

  .hero .pill b {
    flex: 0 0 auto;
  }

  .hero .sub {
    font-size: 16px;
    line-height: 1.55;
  }

  .hero .cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .hero .cta .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .hero .cue {
    font-size: 14px;
    line-height: 1.5;
  }

  .nav-dropdown-trigger,
  .nav-dropdown-menu a {
    font-size: 14px !important;
  }

  .hero .lv5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero .lv5 .lv-card {
    min-width: 0;
    padding: 12px;
  }

  .hero .lv5 span {
    font-size: 14px;
    line-height: 1.4;
  }

  .mq {
    overflow: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  }

  .mq::-webkit-scrollbar {
    display: none;
  }

  .mq div {
    animation: mq 30s linear infinite;
  }

  .mq span {
    flex-shrink: 0;
  }

  .cg {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .bw {
    height: clamp(240px, 65vw, 360px);
  }

  .bw .bd {
    z-index: 4;
    max-width: calc(48% - 8px);
    padding: 7px 9px;
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .bw .bd:nth-of-type(1) {
    top: 5% !important;
    right: auto !important;
    left: 4% !important;
    bottom: auto !important;
  }

  .bw .bd:nth-of-type(2) {
    top: 5% !important;
    right: 4% !important;
    left: auto !important;
    bottom: auto !important;
  }

  .bw .bd:nth-of-type(3) {
    top: auto !important;
    right: auto !important;
    left: 4% !important;
    bottom: 48px !important;
  }

  .tg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .tg button {
    min-width: 0;
    min-height: 44px;
    font-size: 14px;
    padding: 10px 8px;
  }

  .rows li {
    min-width: 0;
    padding: 12px;
    font-size: 14px;
  }

  .rows li em,
  .rows li .x,
  .rows li .v {
    font-size: 14px;
    line-height: 1.45;
  }

  #assessment .asm-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  #assessment .asm-card {
    width: 100%;
    min-width: 0;
  }

  #assessment .asm-chip {
    min-height: 32px;
    font-size: 14px;
    line-height: 1.35;
  }

  #fee .fx-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  #fee .fx-card {
    max-width: 100%;
    transform: none;
  }

  #fee .fx-top,
  #fee .fx-bot {
    padding-inline: clamp(16px, 5vw, 30px);
  }

  #fee .fx-amt {
    max-width: 100%;
    font-size: clamp(42px, 14vw, 60px);
  }

  #fee .fx-gst,
  #fee .fx-tot {
    font-size: 14px;
    line-height: 1.45;
  }

  #fee .fx-pm {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  #fee .fx-pm i {
    font-size: 14px;
  }

  #fee .fx-card .btn,
  #final .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  #final .fin-content {
    gap: 20px;
    padding: 32px max(var(--mobile-inline-gutter), env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom));
  }

  #final .fin-chips {
    width: 100%;
    gap: 8px;
  }

  #final .fin-chip {
    max-width: 100%;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    text-align: center;
  }

  :where(table) {
    width: 100%;
    max-width: 100%;
  }

  /* Keep native table layout; the surrounding region owns horizontal scrolling. */
  main table,
  .table-responsive table,
  .table-wrap table {
    display: table;
  }

  :where(main, section, article, .card, .panel, .container, .wrap) > * {
    min-width: 0;
  }

  /* Shared three-group footers: balance the link groups into phone columns,
     instead of leaving a blank grid cell under the shorter group. */
  #final {
    min-height: 0;
    padding-bottom: 0;
  }

  #final footer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 2;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none !important;
  }

  #final footer,
  footer .ftr-inner,
  #final .ftr-inner,
  footer .ftr-top,
  #final .ftr-top,
  footer .ftr-brand,
  #final .ftr-brand,
  footer .ftr-cols,
  #final .ftr-cols,
  footer .ftr-col,
  #final .ftr-col,
  footer .ftr-bot-out,
  #final .ftr-bot-out {
    min-width: 0;
    max-width: 100%;
  }

  #final footer {
    width: 100%;
    margin-inline: auto;
  }

  footer .ftr-inner,
  #final .ftr-inner {
    width: 100%;
    padding: 24px clamp(14px, 4vw, 24px) 18px;
  }

  footer .ftr-top,
  #final .ftr-top {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  footer .ftr-brand,
  #final .ftr-brand {
    width: 100%;
    flex: 0 0 auto;
  }

  footer .ftr-logo,
  #final .ftr-logo {
    box-sizing: border-box;
    width: min(100%, 245px);
    max-width: 100%;
  }

  footer .ftr-logo img,
  #final .ftr-logo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

  footer .ftr-tagline,
  #final .ftr-tagline {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  footer .ftr-cols,
  #final .ftr-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    column-gap: 0;
    gap: 8px clamp(10px, 3vw, 16px);
  }

  footer .ftr-col,
  #final .ftr-col {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
    margin: 0;
  }

  footer .ftr-col strong,
  footer .ftr-col a,
  #final .ftr-col strong,
  #final .ftr-col a {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  footer .ftr-col a,
  #final .ftr-col a {
    min-height: 44px;
    padding-block: 10px;
    line-height: 1.35;
  }

  footer .ftr-social,
  #final .ftr-social {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  footer .ftr-social a,
  #final .ftr-social a {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  footer .ftr-social a svg,
  #final .ftr-social a svg {
    width: 20px;
    height: 20px;
  }

  footer .ftr-bot-out,
  #final .ftr-bot-out {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  footer .ftr-out-links,
  #final .ftr-out-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  footer .ftr-cols,
  #final .ftr-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  :where(.container, .wrap, .page, .page-wrap, .content, .content-wrap, .section-inner, .shell) {
    padding-inline: max(var(--mobile-inline-gutter), env(safe-area-inset-left)) max(var(--mobile-inline-gutter), env(safe-area-inset-right));
  }

  :where(h1) {
    font-size: clamp(1.4rem, 7vw, 2rem);
    line-height: 1.15;
  }

  :where(h2) {
    font-size: clamp(1.2rem, 5.5vw, 1.65rem);
    line-height: 1.2;
  }

  /* This editorial hero has an intentional line break after its first word. */
  .reference-hero .hero-copy h1 {
    font-size: clamp(2rem, 10vw, 2.625rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
    text-wrap: balance;
  }

  /* The About vision heading is a centered flex item with an inline desktop
     size; constrain it to the text column so the long hyphenated title can wrap. */
  .vision-text-col .sp {
    width: 100%;
    max-width: 100%;
    font-size: clamp(1.65rem, 8vw, 2.25rem) !important;
    line-height: 1.12 !important;
  }

  :where(button, input, select, textarea) {
    font-size: max(16px, 1em);
  }
}

@media (max-width:1023.98px) and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile/tablet content reflow. These rules intentionally restore copy that
   older compact layouts hid and let scroll-story sections grow with content. */
@media (max-width:1023.98px) {
  .hd p,
  .ms p,
  .stp span,
  .clp p,
  #sl li .tx,
  #register #rxl li:not(.on) em,
  .intern-card .card-summary,
  .community-strip p,
  .filter-label {
    display: block;
  }

  .hd p,
  .ms p,
  .stp span,
  .clp p,
  #sl li .tx,
  #register #rxl li:not(.on) em,
  .intern-card .card-summary,
  .community-strip p,
  .filter-label {
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: max(14px, 1em);
    line-height: 1.5;
  }

  .intern-card .card-summary {
    -webkit-box-orient: initial;
    -webkit-line-clamp: unset;
  }

  .community-strip p {
    width: 100%;
    margin: 8px 0 0;
    text-align: center;
  }

  .filter-label {
    align-self: center;
  }

  .rows li,
  .rows em,
  .clp small {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Sticky pinned scroll stages for contrast and climb on mobile.
     Screen sticks in place while the interactive story plays, then unpins at the end. */
  #contrast.tall {
    height: 260vh;
    position: relative;
    padding-block: 0;
  }

  #climb.tall {
    height: 270vh;
    position: relative;
    padding-block: 0;
  }

  #contrast .stk,
  #climb .stk {
    position: sticky;
    top: 60px;
    height: calc(100svh - 60px);
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-inline: max(var(--mobile-inline-gutter), env(safe-area-inset-left)) max(var(--mobile-inline-gutter), env(safe-area-inset-right));
    padding-block: 10px;
    box-sizing: border-box;
  }

  #contrast .stk > div,
  #climb .stk > div {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  #contrast .hd {
    margin-bottom: 4px;
    text-align: center;
  }

  #contrast .hd h2 {
    font-size: clamp(19px, 4.8vw, 23px);
    line-height: 1.15;
    margin-bottom: 2px;
    font-weight: 800;
  }

  #contrast .hd p,
  #contrast .hd p.lead {
    display: block;
    font-size: clamp(11.5px, 2.9vw, 13px);
    line-height: 1.25;
    margin: 0;
    color: var(--mute, #5d6688);
  }

  #contrast .cg {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  #contrast .bw {
    width: min(100%, 280px);
    height: clamp(96px, 14vh, 120px);
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 22px rgba(0,0,0,0.16);
  }

  #contrast .bw .bd {
    font-size: 9.5px !important;
    font-weight: 700;
    padding: 2.5px 7px !important;
    border-radius: 99px;
    white-space: nowrap !important;
    max-width: none !important;
    line-height: 1.2 !important;
  }

  #contrast .bw .bd:nth-of-type(1) {
    top: 6px !important;
    left: 4% !important;
    right: auto !important;
    bottom: auto !important;
  }

  #contrast .bw .bd:nth-of-type(2) {
    top: 6px !important;
    right: 4% !important;
    left: auto !important;
    bottom: auto !important;
  }

  #contrast .bw .bd:nth-of-type(3) {
    bottom: 24px !important;
    left: 4% !important;
    top: auto !important;
    right: auto !important;
  }

  #contrast .tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    bottom: 6px;
  }

  #contrast .tg {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 2px 0 4px;
  }

  #contrast .tg button {
    min-height: 30px;
    height: 30px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
  }

  #contrast .vis {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 4px;
    justify-content: center;
  }

  #contrast .vis .bar {
    height: 6px;
    flex: 0 1 120px;
    border-radius: 99px;
  }

  #contrast #vl {
    font-size: 12px;
    font-weight: 700;
    min-width: 44px;
  }

  #contrast #rows {
    display: flex;
    flex-direction: column;
    gap: 3.5px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #contrast #rows li {
    padding: 4.5px 10px;
    border-radius: 8px;
    font-size: 11.5px;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
    align-items: center;
    transition: background .25s, border-color .25s;
    line-height: 1.25;
  }

  #contrast #rows li em {
    font-size: 11px;
    font-weight: 700;
  }

  #contrast #rows li span {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    font-size: 11.5px;
    line-height: 1.25;
    text-align: right;
  }

  /* Climb mobile sticky stage */
  #climb h2 {
    font-size: clamp(20px, 5vw, 24px);
    line-height: 1.18;
    text-align: center;
    margin-bottom: 2px;
    font-weight: 800;
  }

  #climb p.lead {
    font-size: 12.5px;
    line-height: 1.3;
    text-align: center;
    margin: 0 0 8px;
    color: #94a3b8;
  }

  #climb .cl2 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  #climb .stairs {
    display: block;
    position: relative;
    height: clamp(140px, 20vh, 168px);
    width: 100%;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    margin-bottom: 6px;
  }

  #climb .stp {
    position: absolute;
    bottom: 0;
    left: calc(var(--k) * 20%);
    width: 20%;
    height: calc(16% + var(--k) * 11%);
    background: #141c38;
    border-radius: 10px 10px 0 0;
    padding: 6px 3px;
    text-align: center;
    transition: background .3s, box-shadow .3s;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  #climb .stp.on {
    background: linear-gradient(#5b8cff, #1d4ed8);
    box-shadow: 0 -8px 24px #3b82f655;
  }

  #climb .stp b {
    font-size: 11px;
    display: block;
    color: #fff;
    line-height: 1.15;
    font-weight: 700;
  }

  #climb .stp span {
    font-size: 9px;
    color: #8fb4ff;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
  }

  #climb .hk {
    position: absolute;
    inset: auto;
    width: auto;
    height: clamp(42px, 30%, 52px);
    max-height: 52px;
    object-fit: contain;
    bottom: calc(16% + var(--f) * 11%);
    left: calc(var(--f) * 20% + 10%);
    transform: translateX(-50%);
    transition: bottom .2s ease-out, left .2s ease-out;
    z-index: 5;
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.45));
  }

  #climb .clp {
    background: #0c1538;
    border: 1px solid #233366;
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 0;
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
  }

  #climb .clp small {
    font-size: 10.5px;
    color: #7f9dff;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 800;
    display: block;
    margin-bottom: 2px;
  }

  #climb .clp b:nth-of-type(1) {
    font-size: 15px;
    color: #fff;
    display: block;
    font-weight: 800;
  }

  #climb .clp b:nth-of-type(2) {
    font-size: 13px;
    color: #8fb4ff;
    display: block;
    font-weight: 700;
    margin-top: 1px;
  }

  #climb .clp p {
    font-size: 12px;
    color: #a5b4fc;
    line-height: 1.3;
    margin-top: 3px;
  }

  /* Stacked stories no longer clip their decorative backgrounds. Keep those
     backgrounds inside the component instead of widening the whole page. */
  #contrast .stk::before,
  #climb .stk::before,
  #register .stk::before,
  #journey > .stk::before {
    right: 0;
    max-width: 100%;
    animation: none;
    transform: none;
  }

  /* The older home/recruiter pages use .stk/.jg instead of .pin/.stage. */
  #journey.tall {
    height: auto;
    min-height: 0;
    padding-block: var(--mobile-section-space);
  }

  #journey > .stk {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    display: block;
    overflow: visible;
  }

  #journey .jg {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--mobile-component-gap);
    padding-inline: max(var(--mobile-inline-gutter), env(safe-area-inset-left)) max(var(--mobile-inline-gutter), env(safe-area-inset-right));
  }

  #journey .ms {
    min-width: 0;
    padding-left: 42px;
  }

  #journey .ms li,
  #journey .ms li.on,
  #journey .ms li.cur {
    min-width: 0;
    opacity: 1;
    transform: none;
  }

  #journey .ms small {
    font-size: 14px;
    line-height: 1.4;
  }

  #journey.tall .day::before {
    left: 0;
    width: 100%;
    animation: none;
    transform: none;
  }

  /* Pinned viewport stage for journey on mobile */
  #journey {
    overflow: visible;
    scroll-margin-top: 76px;
  }

  #journey .pin {
    height: 380vh;
    position: relative;
  }

  #journey .stage {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-inline: max(var(--mobile-inline-gutter), env(safe-area-inset-left)) max(var(--mobile-inline-gutter), env(safe-area-inset-right));
    padding-block: 8px;
    isolation: isolate;
  }

  #journey .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 440px;
    margin: auto;
  }

  #journey .left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
  }

  #journey h2 {
    margin-bottom: 2px;
    font-size: clamp(20px, 5.2vw, 24px);
    line-height: 1.18;
    font-weight: 800;
  }

  #journey .left > .lc:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  #journey .numwrap {
    margin: 0;
  }

  #journey .num {
    font-size: clamp(38px, 10vw, 48px);
    line-height: 1;
    font-weight: 800;
  }

  #journey .unit {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 99px;
  }

  #journey .bar {
    margin: 4px 0 6px;
    height: 8px;
    width: min(100%, 300px);
  }

  #journey .bar b {
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-width: 3px;
  }

  #journey .tk small {
    font-size: 10px;
    top: 12px;
  }

  #journey .dayline {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    min-height: 18px;
    line-height: 1.25;
  }

  #journey .note,
  #journey .hint {
    display: none !important;
  }

  /* Countdown celebration ("3, 2, 1, DAY 1") restored on mobile */
  #journey .boom {
    position: absolute;
    inset: 0;
    z-index: 35;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
  }

  #journey .boom.on {
    opacity: 1;
  }

  #journey .boom.fl::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9), rgba(109, 61, 240, 0.24) 60%, transparent 85%);
    animation: journey-fl 1s ease-out;
  }

  #journey .bt {
    position: relative;
    font-size: clamp(64px, 18vw, 96px);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    text-align: center;
    background: linear-gradient(160deg, var(--blue), var(--vio) 55%, var(--fire));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 14px 32px rgba(109, 61, 240, 0.45));
  }

  /* Mathematical vertical center alignment along 18px axis:
     rail (16px + 2px = 18px), node (2px + 16px = 18px), dot (48px - 42px + 12px = 18px) */
  #journey .tl {
    padding-left: 48px !important;
    position: relative;
    width: 100%;
    box-sizing: border-box;
  }

  #journey .rail {
    left: 16px !important;
    width: 4px !important;
    margin-left: 0 !important;
    transform: none !important;
  }

  #journey .node {
    left: 2px !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 11px !important;
  }

  #journey .step {
    margin-bottom: 5px;
    padding: 8px 14px;
    border-width: 1.5px;
    border-radius: 14px;
    opacity: 0.6;
    transition: opacity .3s, background .3s, border-color .3s, box-shadow .3s;
  }

  #journey .step.now {
    opacity: 1;
    background: #fff;
    border-color: var(--blue);
    box-shadow: 0 4px 18px rgba(29,78,216,.18);
  }

  #journey .step .dot {
    left: -42px !important;
    top: 10px;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  #journey .step .dot svg {
    display: block !important;
    width: 13px !important;
    height: 13px !important;
    margin: auto !important;
    flex-shrink: 0 !important;
    stroke-width: 2.8 !important;
  }

  #journey .tag {
    font-size: 11px;
    padding: 2px 8px;
    font-weight: 700;
  }

  #journey .step h3 {
    font-size: 15px;
    margin-top: 2px;
    line-height: 1.2;
    font-weight: 700;
  }

  #journey .step p {
    display: none;
    font-size: 13px;
    line-height: 1.35;
    margin-top: 2px;
  }

  #journey .step.now p {
    display: block;
  }

  #journey .step .vis {
    display: none;
  }

  #journey .step.now .vis {
    display: flex;
    flex-wrap: wrap;
    position: static;
    margin-top: 6px;
    opacity: 1;
    transform: none;
    gap: 8px;
    align-items: center;
  }

  #journey .pv { font-size: 20px; font-weight: 800; }
  #journey .seat { font-size: 11px; padding: 4px 10px; font-weight: 700; }
  #journey .clk { width: 36px; height: 36px; }
  #journey .clk span { font-size: 11px; }
  #journey .lv b { width: 24px; height: 24px; font-size: 11px; border-radius: 6px; }
  #journey .up { height: 28px; }
  #journey .up i { width: 8px; }
  #journey .five { font-size: 22px; font-weight: 800; }
  #journey .five small { font-size: 10px; }

  /* Pinned viewport stage for registration on mobile */
  #register.tall {
    height: 270vh;
    position: relative;
    padding-block: 0;
    scroll-margin-top: 76px;
  }

  #register > .stk {
    position: sticky;
    top: 60px;
    height: calc(100svh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-inline: max(var(--mobile-inline-gutter), env(safe-area-inset-left)) max(var(--mobile-inline-gutter), env(safe-area-inset-right));
    padding-block: 6px;
    box-sizing: border-box;
  }

  #register .rx {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 420px;
    margin: auto;
    padding: 0;
    height: 100%;
    max-height: calc(100svh - 72px);
  }

  /* Flatten div:first-child so children can be ordered with flex */
  #register .rx > div:first-child {
    display: contents;
  }

  #register h2 {
    order: 1;
    font-size: clamp(20px, 5.2vw, 24px);
    line-height: 1.15;
    text-align: center;
    margin: 0;
    font-weight: 800;
  }

  #register #rxl:not(.mobile-registration-fallback) {
    order: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
  }

  #register #rxl:not(.mobile-registration-fallback) li {
    min-height: 36px;
    min-width: 0;
    padding: 4px 2px;
    border-radius: 8px;
    cursor: pointer;
  }

  #register #rxl:not(.mobile-registration-fallback) .ic {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  #register #rxl:not(.mobile-registration-fallback) .ic b svg {
    width: 16px;
    height: 16px;
  }

  #register #rxl:not(.mobile-registration-fallback) .ic em {
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
  }

  #register .stage {
    order: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    width: 100%;
    --nh: 0px;
  }

  #register .rxn {
    display: none !important;
  }

  #rx-cap {
    text-align: center;
    margin: 0;
    padding: 0;
  }

  #rx-ttl {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
  }

  #rx-cnt {
    font-size: 11px;
    color: var(--blue, #1d4ed8);
    font-weight: 700;
  }

  #rx-dsc {
    font-size: 12.5px;
    line-height: 1.25;
    color: #64748b;
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #register .devw {
    order: 4;
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }

  #register .dev {
    width: 100%;
    height: clamp(285px, 44vh, 325px);
    margin: 0 auto;
    border-radius: 20px;
    border: 2.5px solid #141b34;
    box-shadow: 0 12px 36px rgba(0,0,0,0.18);
    position: relative;
    overflow: hidden;
    background: #fff;
    display: block;
    min-height: 0;
    padding: 0;
    scroll-margin-top: 88px;
  }

  #register .rxb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 0;
    font-size: 12px;
    line-height: 1.2;
    color: #64748b;
    font-weight: 700;
  }

  #register .pn {
    position: absolute;
    inset: 34px 14px 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.98);
    transition: opacity .35s, transform .35s, visibility .35s;
    pointer-events: none;
    margin: 0;
    display: block !important;
  }

  #register .pn.on {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  #register .pn h3 {
    font-size: 16px;
    letter-spacing: -.02em;
    margin-bottom: 4px;
    line-height: 1.2;
  }

  #register .pn .rxsub {
    font-size: 12px;
    margin-bottom: 6px;
  }

  #register .pn .f {
    padding: 4px 10px;
    margin: 4px 0;
    border-radius: 10px;
  }

  #register .pn .f small {
    font-size: 10px;
    line-height: 1.2;
  }

  #register .pn .f .t {
    font-size: 13px;
    font-weight: 700;
    display: block;
    width: 100%;
  }

  #register .pn .amt {
    font-size: 30px;
    margin: 4px 0 2px;
  }

  #register .pn .bill {
    margin: 6px 0 8px;
    padding-top: 6px;
    font-size: 12px;
    gap: 2px;
  }

  #register .pn .bill .tot {
    font-size: 14px;
  }

  #register .pn .k {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    margin: 2px 4px 2px 0;
    border-radius: 999px;
    background: #eef3ff;
    border: 1px solid #d6e2ff;
    color: #1e3a8a;
    width: auto !important;
  }

  #register .pn .k.p {
    background: var(--bl, #1d4ed8) !important;
    color: #fff !important;
    border-color: var(--bl, #1d4ed8) !important;
  }

  #register .pn .q {
    font-size: 13px;
    margin: 4px 0;
    line-height: 1.25;
  }

  #register .pn .o {
    font-size: 12px;
    padding: 5px 10px;
    margin: 4px 0;
    border-radius: 8px;
  }

  #register .pn .prog {
    margin-top: 8px;
    height: 5px;
  }

  #register .cert {
    padding: 8px 10px;
    border-radius: 14px;
    border: 1.5px solid var(--bl);
    text-align: center;
  }

  #register .cert small {
    font-size: 10px;
    font-weight: 700;
  }

  #register .cert h4 {
    font-size: 16px;
    letter-spacing: -.02em;
    margin: 2px 0;
    font-weight: 800;
    color: var(--bl);
  }

  #register .pips {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 4px 0;
  }

  #register .pips i {
    width: 20px;
    height: 5px;
    border-radius: 6px;
  }

  #register .cert p {
    font-size: 12px !important;
    margin: 2px 0;
  }

  #register .cap.sw > * {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  #register .qr {
    width: 48px;
    height: 48px;
    margin: 4px auto;
    padding: 3px;
  }

  #register .qr i {
    opacity: 1 !important;
    animation: none !important;
  }

  #register .qr i.b {
    background: #0c1230 !important;
  }

  #register .pips i.a {
    background: var(--bl) !important;
  }

  #register .ok {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #15803d;
    background: #eaf8f0;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid #bbf7d0;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  #register .ok svg {
    width: 14px;
    height: 14px;
    stroke: #16a34a;
    stroke-width: 2.8;
    fill: none;
  }

  #register .ok circle,
  #register .ok path {
    stroke-dashoffset: 0 !important;
    animation: none !important;
  }

  /* Toasts disabled on mobile to prevent overlapping native in-card confirmation */
  #register .tt,
  #register .tt.on {
    display: none !important;
  }

  #register .tt b {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #eaf1ff;
    color: var(--blue, #1d4ed8);
    margin-right: 8px;
  }

  #register .tt b svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
  }

  #register .tt strong {
    font-size: 11.5px;
    font-weight: 800;
    display: block;
    color: #172033;
  }

  #register .tt span {
    color: #475569;
  }

  #register #rxl.mobile-registration-fallback {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin: 14px 0 26px;
  }

  #register #rxl li.mobile-reg-fallback {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    color: #172033;
    cursor: default;
  }

  #register #rxl li.mobile-reg-fallback > b {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: #eaf1ff;
    color: #1d4ed8;
  }

  #register #rxl li.mobile-reg-fallback > span {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  #register #rxl li.mobile-reg-fallback strong {
    font-size: 15px;
    line-height: 1.4;
  }

  #register #rxl li.mobile-reg-fallback em {
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
  }

  #register .rx > div:first-child > .btn {
    order: 5;
    width: min(100%, 320px);
    margin: 0 auto;
    min-height: 40px;
    height: 40px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .hero {
    padding-top: clamp(68px, 12vw, 84px) !important;
  }

  /* Candidate hero visual replicating desktop layout with floating badges around the blue orb */
  .hero .hv {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 380px !important;
    height: clamp(350px, 90vw, 420px) !important;
    margin: 18px auto 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    min-height: 0;
  }

  .hero .hv .orb {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: clamp(210px, 58vw, 260px) !important;
    height: clamp(210px, 58vw, 260px) !important;
    aspect-ratio: 1;
    transform: translate(-50%, -50%) !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 35% 30%, #8db2ff, #2557e0 70%, #1d4ed8) !important;
    box-shadow: 0 16px 44px rgba(29, 78, 216, 0.35) !important;
    opacity: 0.92 !important;
    animation: br 6s ease-in-out infinite !important;
  }

  .hero .hv .pw {
    position: absolute !important;
    inset: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  .hero .hv .pw img {
    display: block !important;
    width: auto !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: auto !important;
    filter: drop-shadow(0 14px 28px rgba(11, 28, 80, 0.28)) !important;
  }

  /* 4 floating badges around candidate - orb is div 1, pw is div 2, chips are div 3 to 6 */
  .hero .hv .ch {
    position: absolute !important;
    z-index: 3 !important;
    max-width: clamp(135px, 42vw, 168px) !important;
    min-width: 0 !important;
    width: auto !important;
    pointer-events: auto !important;
    transition: transform 0.25s;
  }

  /* Top-left chip: "Not sure where you stand?" */
  .hero .hv .ch[style*="top: 6%"],
  .hero .hv .ch:nth-of-type(3) {
    top: 7% !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
  }

  /* Top-right chip: "Need proof recruiters trust?" placed at shoulder level completely clear of candidate face */
  .hero .hv .ch.qr-proof,
  .hero .hv .ch[style*="top: 20%"],
  .hero .hv .ch:nth-of-type(4) {
    top: 28% !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    max-width: clamp(130px, 38vw, 155px) !important;
  }

  /* Bottom-left chip: "How do I get a job?" */
  .hero .hv .ch[style*="bottom: 20%"],
  .hero .hv .ch:nth-of-type(5) {
    bottom: 22% !important;
    left: 0 !important;
    right: auto !important;
    top: auto !important;
  }

  /* Bottom-right chip: "How long will it take?" */
  .hero .hv .ch[style*="bottom: 6%"],
  .hero .hv .ch:nth-of-type(6) {
    bottom: 6% !important;
    right: 0 !important;
    left: auto !important;
    top: auto !important;
  }

  .hero .hv .ch span {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 12px !important;
    padding: 7px 10px !important;
    box-shadow: 0 8px 24px rgba(29, 78, 216, 0.16), 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    color: #0b1230 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    animation: fl 5s ease-in-out infinite !important;
  }

  .hero .hv .ch small {
    display: block !important;
    font-size: clamp(9px, 2.5vw, 10.5px) !important;
    font-weight: 700 !important;
    color: #5b6690 !important;
    margin-bottom: 2px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  .hero .hv .ch b {
    display: block !important;
    font-size: clamp(10.5px, 2.9vw, 12px) !important;
    font-weight: 800 !important;
    color: #0b1230 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  #climb .stairs {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 481px) and (max-width: 820px) {
  #climb .stairs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:1023.98px) {
  #fee.fx-js:not(.go) .ln > span,
  #fee.fx-js:not(.go) .lead,
  #fee.fx-js:not(.go) .fx-card {
    opacity: 1;
    transform: none;
  }

  #fee .fx-roll,
  #fee .fx-top::before {
    animation: none;
    transition: none;
  }

}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  #journey .step,
  #journey .step.now,
  #journey .step::after {
    animation: none;
    transition: none;
  }
}

@media (max-width:1023.98px) {
  #lv5[data-mobile-fallback],
  #rows[data-mobile-fallback],
  #stairs[data-mobile-fallback] {
    display: grid;
  }
}

/* Keep tablet and touch-first footers in flow; preserve reveal motion on laptops. */
@media (min-width: 768px) and (max-width: 1023.98px), (pointer: coarse) and (min-width: 768px) {
  #final,
  .band {
    min-height: 0 !important;
    padding-bottom: 24px !important;
  }

  #final footer,
  .band > footer,
  footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 2 !important;
    width: min(1250px, calc(100% - var(--footer-gutter, 24px) * 2)) !important;
    max-width: 1250px !important;
    margin-inline: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }

  footer .ftr-inner,
  #final .ftr-inner {
    width: 100%;
    max-width: 100%;
    padding: 36px 40px;
  }

  footer .ftr-top,
  #final .ftr-top {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
  }

  footer .ftr-brand,
  #final .ftr-brand {
    flex: 0 1 42%;
    max-width: 340px;
    min-width: 0;
  }

  footer .ftr-cols,
  #final .ftr-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: auto;
    flex: 0 1 48%;
    min-width: 0;
    gap: 20px;
  }

  footer .ftr-col,
  #final .ftr-col {
    min-width: 0;
  }

  footer .ftr-col a,
  #final .ftr-col a {
    min-height: 36px;
    padding-block: 6px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  footer .ftr-social,
  #final .ftr-social,
  footer .ftr-bot-out,
  #final .ftr-bot-out,
  footer .ftr-out-links,
  #final .ftr-out-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
  }

  footer .ftr-bot-out,
  #final .ftr-bot-out {
    flex-direction: row;
    justify-content: space-between;
    padding: 20px 24px;
  }

  footer .ftr-col, #final .ftr-col { gap: 4px; }
  footer .ftr-col a, #final .ftr-col a { font-size: 14px; }
  footer .ftr-logo img { width: 245px; height: 74px; }
  footer .ftr-desc { font-size: 14px; line-height: 1.55; }

  footer .ftr-social a,
  #final .ftr-social a {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
}

/* Footer feedback works with a mouse, keyboard and touch. */
footer .ftr-col a:is(:hover, :focus-visible, :active),
footer .ftr-out-links a:is(:hover, :focus-visible, :active) {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
  transform: translateX(2px);
}
footer .ftr-social a:is(:hover, :focus-visible, :active) {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .35);
  transform: translateY(-2px);
}

@media (max-width:1023.98px) and (prefers-reduced-motion: reduce) {
  #register .pn.on .ok {
    opacity: 1;
    transform: none;
  }

  #register .pn.on .ok circle,
  #register .pn.on .ok path {
    stroke-dashoffset: 0;
  }
}

@media (max-width:1023.98px) {
  /* The auth shell sits inside an already padded main/card, not another gutter. */
  .auth .main {
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
  }

  .auth .shell {
    padding-inline: 0;
  }

  .auth .card .body {
    padding-inline: clamp(16px, 4vw, 24px);
  }

  .auth .card .body h2 {
    font-size: clamp(26px, 6vw, 34px);
    line-height: 1.2;
  }

  /* These two declarations override presentation values on the source inputs. */
  .auth .ctl.pw input {
    padding-right: 56px !important;
  }

  .auth .field label {
    font-size: 14px !important;
    justify-content: flex-start !important;
    gap: 8px !important;
  }

  .auth .otp-mail {
    align-items: flex-start;
    border-radius: 16px;
  }

  .auth .otp-mail strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 375px) {
  .auth .otp-boxes {
    grid-template-columns: repeat(3, minmax(44px, 1fr));
    gap: 8px;
  }
}

@media (max-width:1023.98px) {
  /* Some pages place the footer's social/legal row after the footer element. */
  .ftr-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .ftr-social a {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .ftr-social a svg {
    width: 20px;
    height: 20px;
  }

  .ftr-col a,
  .ftr-out-links a,
  .lk,
  .nl {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 10px;
  }

  .student-nav-toggle,
  #menuButton {
    min-width: 44px;
    width: 44px;
  }

  .lt-pp {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .lt-now {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.4;
  }
}

/* Fit each protected PDF page inside the space between the reader bars. */
#studyModal > section,
#viewerContainer,
#protectedPdfViewer { min-width:0; min-height:0; }
#protectedPdfViewport {
  min-width:0;
  min-height:0;
  overflow:hidden;
  padding:clamp(8px, 1.5vw, 16px);
  display:flex;
  align-items:center;
  justify-content:center;
}
.protected-pdf-page {
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  flex:none;
}

/* Keep protected reader controls and full titles reachable on narrow screens. */
@media (max-width:1023.98px) {
  #studyReaderHeader { height:auto; flex-direction:column; align-items:stretch; gap:10px; padding:12px 16px; }
  #studyReaderHeader > div { width:100%; min-width:0; }
  #studyReaderHeader > div:first-child > div:last-child { flex:1; flex-direction:column; align-items:flex-start; gap:4px; }
  #studyReaderHeader > div:first-child > div:nth-child(2) { display:none; }
  #closeModalBtn { width:44px; height:44px; flex-shrink:0; padding:0; justify-content:center; }
  #closeModalBtn span { display:none; }
  #currentMaterialTitle { white-space:normal; overflow:visible; max-width:100%; overflow-wrap:anywhere; line-height:1.3; }
  #studyReaderHeader > div:last-child { justify-content:space-between; gap:8px; }
  #viewTimeRequirement { min-width:0; }
  #viewTimeText { overflow-wrap:anywhere; }
  #studyModal > section, #viewerContainer { min-height:0; }
  #protectedPdfToolbar { height:auto; min-height:44px; flex-wrap:wrap; gap:8px; padding:8px 12px; }
  #protectedPdfToolbar > div { flex-shrink:0; white-space:nowrap; }
  #protectedPdfToolbar > span { flex-basis:100%; line-height:1.4; font-size:11px; }
  #protectedPdfToolbar button { min-width:44px; min-height:44px; }
}

/* Safari landscape can keep the About vision in two columns: allow its
   animated words to shrink/wrap inside the available text column. */
@media (max-width:1023.98px) {
  .vision-grid > *, .vision-text-col { min-width:0; }
  .vision-text-col .sp { width:100%; max-width:100%; font-size:clamp(1.65rem, 4vw, 2.25rem) !important; overflow-wrap:anywhere; }
  .vision-text-col .sp .w { max-width:100%; overflow-wrap:anywhere; }
}

/* Avoid repainting large decorative blur layers during mobile scrolling. */
@media (max-width:1023.98px) {
  #final::before, #final::after { animation:none !important; filter:blur(24px); }
  #final .fin-rings { animation:none !important; }
}

/* Keep hero visual backdrop subtle and clean */
@media (max-width: 820px) {
  .hero .hv::before { display: none !important; }
}
@media (max-width:1023.98px) {
  /* Visible fallback; the optional mobile observer animates with WAAPI only
     while a target enters view, without hiding waiting/offline content. */
  body:not([data-dashboard]) .rv { opacity:1; transform:none; transition:none; }
  body:not([data-dashboard]) .sp .w { opacity:1 !important; transform:none !important; transition:none !important; }
  #pg, .fx-progress { display:none; }
  /* The three legal tabs must shrink inside a narrow phone viewport. */
  .docswitch.refund-switch { width:100%; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .docswitch.refund-switch a { min-width:0; padding:9px 4px; white-space:normal; display:grid; place-items:center; }
}
@media (max-width: 768px) {
  #interns-globe .gl-gw { aspect-ratio:auto; padding-top:100%; }
  #interns-globe .gl-cv { inset:0 0 auto; height:auto; aspect-ratio:1; }
  #interns-globe .gl-card { position:relative; left:auto !important; right:auto !important; bottom:auto !important; transform:none !important; width:100% !important; max-width:380px; margin:12px auto 0; }
  #interns-globe .gl-cd { max-height:none; height:auto; overflow:visible; }
  #interns-globe .hero-globe-col { padding-bottom:0; }
}
@media (max-width:1023.98px) {
  header.nav { background:rgba(255,255,255,.97); -webkit-backdrop-filter:none; backdrop-filter:none; }
}

/* Readable data tables scroll locally on phones, tablets and narrow workspaces. */
.table-scroll-region {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-region:focus-visible {
  outline: 3px solid #7ca2ff;
  outline-offset: 2px;
}
@media (min-width: 768px) and (max-width: 1199.98px) {
  body[data-dashboard] main :is(button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])) {
    min-height: 44px;
  }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  body[data-dashboard] main :is(.flex, .grid) > * {
    min-width: 0;
  }
  body[data-dashboard="admin"] > div > header {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 8px;
  }
}

/* Certificate Landscape Aspect Ratio & Viewport Responsive Guarantees (Point 11) */
.certificate-preview-container,
.cert-preview-wrapper,
.verifier-preview-box {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  aspect-ratio: 2000 / 1414;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.cert-preview-img,
.certificate-preview-container img,
.verifier-preview-box img,
.certificate-landscape-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 2000 / 1414 !important;
  object-fit: contain !important;
  display: block;
}

/* Certificate View / Download Mobile Experience (320-430px) */
@media (max-width: 480px) {
  body[data-dashboard-page="certificate"] section.p-5 {
    padding-left: 16px !important;
    padding-right: 16px !important;
    overflow-x: hidden;
  }
  .certificate-preview-container,
  .cert-preview-wrapper {
    padding: 0 8px;
    margin: 24px auto;
    width: 100%;
    max-width: 100%;
  }
  .cert-preview-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2000 / 1414 !important;
    display: block;
    object-fit: contain !important;
  }
}


/* Decorative hero artwork must not occupy the mobile reading area. */
@media (max-width: 640px) {
  body[data-dashboard="student"] main section[class*="bg-gradient"][class*="text-white"] > div.absolute[class*="border"] {
    display: none;
  }
}

/* Profile-only PDF dialog: fit the usable Safari viewport, not a fixed 550px body. */
#resumePreviewModal .resume-preview-shell { min-height: 100dvh; padding: 16px; }
#resumePreviewModal .resume-preview-panel { height: min(760px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); }
#resumePreviewModal .resume-preview-header { flex: 0 0 auto; flex-wrap: wrap; gap: 8px; }
#resumePreviewModal .resume-preview-header > div:last-child { margin-left: auto; }
#resumePreviewModal .resume-preview-header :is(a, button) { min-height: 44px; }
#resume-preview-body { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#resume-preview-iframe { flex: 1 1 auto; min-height: 0; }

/* Auth pages (Login & Register) prominent mobile logo and padding from form card */
@media (max-width: 940px) {
  .auth .main {
    padding-top: max(20px, env(safe-area-inset-top)) !important;
    gap: 0 !important;
  }
  .auth .top {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: auto !important;
    height: auto !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto 24px auto !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
  }
  .auth .top .m-logo {
    display: block !important;
    height: 56px !important;
    width: auto !important;
    max-width: 155px !important;
    background: #ffffff !important;
    padding: 8px 18px !important;
    border-radius: 14px !important;
    object-fit: contain !important;
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.25) !important;
    margin: 0 !important;
  }
  .auth .shell {
    flex: 0 0 auto !important;
    margin: 0 auto !important;
  }
}

/* Common footer spacing: phone <768, tablet 768-1199, laptop/desktop >=1200. */
#final, .band {
  --footer-gutter: clamp(12px, 2vw, 32px);
  --footer-inline: 48px;
  --footer-block: 40px;
}
#final { padding-inline: 0; }
#final footer, .band > footer {
  box-sizing: border-box;
  width: calc(100% - var(--footer-gutter) * 2);
  max-width: 1250px;
  margin-inline: auto;
  margin-bottom: 0;
}
footer .ftr-inner {
  box-sizing: border-box;
  width: 100%;
  padding: var(--footer-block) var(--footer-inline);
}
footer .ftr-bot-out {
  box-sizing: border-box;
  padding: 16px var(--footer-inline) max(16px, env(safe-area-inset-bottom));
  gap: 12px 24px;
}
@media (min-width: 768px) and (max-width: 1366.98px), (pointer: coarse) and (min-width: 768px), (max-height: 850px) and (min-width: 768px) {
  #final, .band { --footer-inline: clamp(24px, 3vw, 36px); --footer-block: 32px; }
  #final .ftr-inner { padding: var(--footer-block) var(--footer-inline); }
  #final .ftr-bot-out { padding: 16px var(--footer-inline) max(16px, env(safe-area-inset-bottom)); }
  footer .ftr-top, #final .ftr-top { gap: clamp(24px, 3vw, 36px); }
}
@media (max-width: 767.98px) {
  #final, .band { --footer-inline: clamp(16px, 4vw, 24px); --footer-block: 24px; }
  #final .ftr-inner { padding: var(--footer-block) var(--footer-inline); }
  footer .ftr-inner { border-radius: 24px; }
  footer .ftr-top, #final .ftr-top { gap: 24px; }
  footer .ftr-logo, #final .ftr-logo { margin-bottom: 16px; }
  footer .ftr-cols, #final .ftr-cols { gap: 20px 16px; }
  footer .ftr-col, #final .ftr-col { gap: 4px; }
  footer .ftr-bot-out, #final .ftr-bot-out {
    padding: 16px var(--footer-inline) max(20px, env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}
