/* Keep the tablet composition for tablet widths; 1024px laptops use desktop layouts. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  #contrast .stk, #climb .stk, #register > .stk, #journey .stage {
    top: 76px;
    height: auto;
    min-height: calc(100svh - 76px);
    padding: 28px 32px;
    overflow: visible;
    box-sizing: border-box;
  }
  #contrast .stk > div, #climb .stk > div, #register .rx, #journey .wrap {
    width: 100%;
    max-width: 1040px;
    min-width: 0;
    margin-inline: auto;
  }
  #contrast .stk::before, #climb .stk::before, #register .stk::before {
    right: 0;
    max-width: 100%;
    animation: none;
    transform: none;
  }
  #journey .stage::before, #journey .stage::after {
    left: 0;
    right: 0;
    max-width: 100%;
    animation: none;
    transform: none;
  }
  #journey .follow { right: 0; max-width: 100%; }
  #contrast .hd h2, #climb h2, #journey h2, #register h2 {
    font-size: clamp(32px, 3.7vw, 42px);
    line-height: 1.15;
    margin-bottom: 12px;
  }
  #contrast .hd p.lead, #climb p.lead {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 24px;
  }

  #contrast .cg {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 28px;
    align-items: center;
  }
  #contrast .cg > * { min-width: 0; }
  #contrast .bw {
    width: 100%;
    height: clamp(300px, 38svh, 440px);
    border-radius: 22px;
  }
  #contrast .bw .bd { font-size: 12px !important; padding: 6px 9px !important; }
  #contrast .bw .bd:nth-of-type(3) { bottom: 56px !important; }
  #contrast .tag { bottom: 14px; padding: 6px 10px; font-size: 13px; }
  #contrast .tg { gap: 8px; margin: 0 0 14px; }
  #contrast .tg button { min-height: 44px; height: auto; padding: 10px 14px; font-size: 15px; }
  #contrast .vis { gap: 10px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
  #contrast .vis .bar { flex: 1 1 80px; height: 8px; }
  #contrast #vl { font-size: 14px; }
  #contrast #rows { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; list-style: none; }
  #contrast #rows li {
    display: grid;
    align-items: center;
    min-height: 68px;
    padding: 10px 12px;
    grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr);
    gap: 10px;
    border-radius: 12px;
  }
  #contrast #rows li em { grid-column: 1; grid-row: 1; font-size: 15px; line-height: 1.45; }
  #contrast #rows li span { grid-column: 2; grid-row: 1; min-width: 0; width: 100%; text-align: right; font-size: 16px; line-height: 1.45; }

  #climb .cl2 { display: flex; flex-direction: column; gap: 20px; padding-top: 30px; }
  #climb .stairs { display: block; width: 100%; height: clamp(280px, 38svh, 360px); margin: 0; }
  #climb .stp {
    position: absolute;
    bottom: 0;
    left: calc(var(--k) * 20%);
    width: 20%;
    height: calc(32% + var(--k) * 12%);
    min-height: 0;
    padding: 12px 8px;
    border-radius: 14px 14px 0 0;
  }
  #climb .stp b { font-size: 17px; line-height: 1.3; }
  #climb .stp span {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    line-height: 1.35;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
  #climb .hk {
    inset: auto;
    left: calc(var(--f) * 20% + 10%);
    bottom: calc(32% + var(--f) * 12%);
    height: 90px;
    width: auto;
    max-height: none;
    transform: translateX(-50%);
  }
  #climb .clp { width: 100%; padding: 20px 24px; border-radius: 20px; }
  #climb .clp small { font-size: 13px; margin-bottom: 8px; }
  #climb .clp b:nth-of-type(1) { font-size: 24px; }
  #climb .clp b:nth-of-type(2) { font-size: 18px; margin-top: 5px; }
  #climb .clp p { font-size: 16px; line-height: 1.5; margin-top: 8px; }

  #journey .stage { padding-block: 20px; }
  #journey .wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #journey .left { width: 100%; gap: 12px; text-align: left; }
  #journey .left > .lc { width: 100%; }
  #journey .left > .lc:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; }
  #journey h2 { grid-row: 1 / 3; margin: 0; text-align: left; }
  #journey .numwrap { margin: 0; }
  #journey .num { font-size: 72px; }
  #journey .unit { display: inline-block; grid-column: 2; padding: 4px 10px; font-size: 14px; }
  #journey .bar { width: 100%; margin: 12px 0 26px; }
  #journey .tk small { font-size: 12px; }
  #journey .dayline { display: block; font-size: 15px; line-height: 1.4; }
  #journey .tl { width: 100%; padding-left: 56px !important; }
  #journey .rail { left: 20px !important; width: 4px !important; margin-left: 0; transform: none; }
  #journey .node { left: 4px !important; width: 36px !important; height: 36px !important; font-size: 12px !important; }
  #journey .step { min-height: 96px; padding: 14px 20px; margin-bottom: 10px; border-radius: 18px; opacity: 1; }
  #journey .step:last-child { margin-bottom: 0; }
  #journey .step .dot { left: -48px !important; top: 18px; width: 28px !important; height: 28px !important; }
  #journey .step .tag { font-size: 12px; padding: 3px 9px; }
  #journey .step h3 { font-size: 20px; line-height: 1.25; margin-top: 5px; }
  #journey .step p, #journey .step.now p { display: block; font-size: 15px; line-height: 1.45; margin-top: 5px; max-height: none; }
  #journey .step .vis { display: none; position: static; transform: none; margin-top: 8px; opacity: 1; }
  #journey .step.now .vis { display: flex; flex-wrap: wrap; gap: 8px; }

  #register .rx {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 32px;
    height: auto;
    max-height: none;
    padding: 0;
  }
  #register .rx > div:first-child { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
  #register h2 { order: 0; margin: 0; text-align: left; }
  #register .stage { order: 1; display: block; margin: 0; width: 100%; }
  #register .rxn { display: none !important; }
  #register #rx-cap { text-align: left; }
  #register #rx-ttl { font-size: 22px; line-height: 1.3; }
  #register #rx-dsc { display: block; font-size: 16px; line-height: 1.5; -webkit-line-clamp: unset; overflow: visible; }
  #register #rxl:not(.mobile-registration-fallback) { order: 2; display: grid; width: 100%; max-width: none; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #register #rxl:not(.mobile-registration-fallback) li { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; }
  #register #rxl:not(.mobile-registration-fallback) .ic { width: 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; }
  #register #rxl:not(.mobile-registration-fallback) .ic b svg { width: 24px; height: 24px; }
  #register #rxl:not(.mobile-registration-fallback) .ic em { font-size: 16px; line-height: 1.3; text-align: left; }
  #register #rxl .rxs { display: none; }
  #register .rx > div:first-child > .btn { order: 3; width: 100%; max-width: none; min-height: 48px; height: auto; margin: 0; font-size: 16px; }
  #register .devw { width: 100%; max-width: 440px; margin: 0 auto; }
  #register .dev { height: clamp(460px, 54svh, 540px); width: 100%; border-radius: 24px; }
  #register .rxb { padding: 14px 18px 0; font-size: 12px; }
  #register .pn { inset: 48px 20px 18px; }
  #register .pn h3 { font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
  #register .pn .f { margin: 12px 0; }
  #register .pn .f small { font-size: 14px; }
  #register .pn .f .t { font-size: 17px; padding: 9px 10px; }
  #register .pn .rxsub, #register .pn .bill, #register .pn .k, #register .pn .ok { font-size: 14px; line-height: 1.45; }
  #register .pn .amt { font-size: 36px; }
}

/* Landscape tablets have enough width for a readable side-by-side timeline. */
@media (min-width: 1000px) and (max-width: 1023.98px) {
  #journey .wrap { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 36px; }
  #journey .left > .lc:first-child { display: flex; flex-direction: column; align-items: flex-start; }
  #journey .step { min-height: 90px; padding: 8px 16px; margin-bottom: 8px; }
  #journey .step h3 { font-size: 19px; }
}

@media (min-width: 1000px) and (max-width: 1023.98px) and (max-height: 820px) {
  #journey .step .vis, #journey .step.now .vis { display: none; }
}

/* Keep all enlarged content reachable on short landscape screens. */
@media (min-width: 768px) and (max-width: 1023.98px) and (max-height: 700px) {
  #contrast.tall, #climb.tall, #register.tall { height: auto; padding-block: 24px; }
  #contrast .stk, #climb .stk, #register > .stk, #journey .stage { position: relative; top: auto; min-height: 0; }
  #journey .pin { height: auto; }
}
