/* ==========================================================================
   Second Shift · phone layer
   Loaded last on every page. Below 600px the pages are recomposed, not shrunk:
   one dominant idea per screen, sequences become swipeable decks, reference
   tables open one grade at a time, and the next action stays within thumb
   reach. Nothing here changes tablet or desktop, apart from the shipping-route
   rows (≤ 699px), which share the phone layout.
   ========================================================================== */

/* ---------- Phone-only components ------------------------------------- */
.dock, .grade-switch, .routes-more, .deck-meter { display: none; }
.cat-dock { display: contents; }

@media (max-width: 599px) {
  :root {
    --header-h: 4rem;
    --dock-bottom: max(0.75rem, env(safe-area-inset-bottom));
    /* the inner hairline keeps the dock's edge visible over dark sections */
    --dock-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.1), 0 1px 2px oklch(0.21 0.022 152 / 0.18), 0 18px 40px -14px oklch(0.21 0.022 152 / 0.55);
  }

  /* ---------- Type: one clear step between every level ---------------- */
  .h2 { font-size: 2.125rem; font-weight: 560; line-height: 1.04; letter-spacing: -0.032em; }
  .h3 { font-size: 1.3125rem; font-weight: 600; line-height: 1.2; }
  .h4 { font-size: 1.0625rem; font-weight: 650; line-height: 1.3; }
  .lead { font-size: 1rem; line-height: 1.6; }
  .section-head { gap: 1rem; margin-bottom: 1.75rem; }
  .section-head .lead { margin-top: 0.75rem; }

  /* Chinese system fonts only have regular and bold on Windows and Android.
     Mid weights (540–620) resolve unpredictably, so every level picks one. */
  html:lang(zh-CN) .h2 { font-size: 1.875rem; font-weight: 400; line-height: 1.34; letter-spacing: 0; }
  html:lang(zh-CN) .h3 { font-size: 1.1875rem; font-weight: 700; line-height: 1.45; }
  html:lang(zh-CN) .h4 { font-size: 1.0625rem; font-weight: 700; line-height: 1.5; }
  html:lang(zh-CN) .lead { font-size: 0.9375rem; line-height: 1.85; }

  /* ---------- Header ---------------------------------------------------- */
  .header-tools { gap: 0.5rem; }
  .menu-btn { min-height: 2.75rem; padding: 0 0.8rem; }

  /* ---------- Menu: an index of the site, ending in the one action ------ */
  .menu-links { align-content: start; gap: 0; padding-block: 1.25rem 2rem; }
  .menu-links a {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--rule-dark);
    font-size: 1.75rem;
  }
  .menu-links a::after {
    content: "";
    flex: none;
    width: 0.55rem; height: 0.55rem;
    margin-inline-end: 0.3rem;
    border-top: 1.5px solid currentColor;
    border-inline-end: 1.5px solid currentColor;
    rotate: 45deg;
    opacity: 0.5;
  }
  .menu-links a:last-child {
    justify-content: center;
    min-height: 3.5rem;
    margin-top: 1.75rem;
    border: 0;
    border-radius: var(--r-1);
    background: var(--green-300);
    color: var(--green-900);
    font-size: 1.125rem;
    letter-spacing: 0;
  }
  .menu-links a:last-child::after { display: none; }
  html:lang(zh-CN) .menu-links a { font-size: 1.5rem; letter-spacing: 0.02em; }
  html:lang(zh-CN) .menu-links a:last-child { font-size: 1.0625rem; }

  /* ---------- Dock: the next action, within thumb reach ------------------ */
  .dock {
    position: fixed;
    z-index: var(--z-sticky);
    inset-inline: 0.75rem;
    bottom: var(--dock-bottom);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0.375rem;
    padding: 0.375rem;
    border-radius: 0.875rem;
    background: var(--green-900);
    color: var(--on-dark);
    box-shadow: var(--dock-shadow);
    translate: 0 calc(100% + 1.5rem);
    visibility: hidden;
    transition: translate 520ms var(--ease-expo), visibility 0s linear 520ms;
  }
  .dock.is-on { translate: 0 0; visibility: visible; transition: translate 520ms var(--ease-expo), visibility 0s; }
  .dock-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    min-width: 0;
    min-height: 3rem;
    padding: 0 0.9rem;
    border-radius: 0.625rem;
    background: oklch(1 0 0 / 0.07);
    color: var(--on-dark);
    font-size: 0.9375rem;
    font-weight: 620;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--d-hover), scale var(--d-press) var(--ease-out);
  }
  .dock-btn:active { scale: 0.97; }
  .dock-btn .i { width: 1.15rem; height: 1.15rem; }
  .dock-btn > span { overflow: hidden; text-overflow: ellipsis; }
  .dock-primary { background: var(--green-300); color: var(--green-900); }
  .dock :focus-visible { outline-color: var(--green-300); outline-offset: 2px; }
  body:has(.dock.is-on, .buybar.is-on) .toast-region { bottom: calc(var(--dock-bottom) + 4.75rem); }

  /* ---------- Rails: swipe on touch, arrows stay on desktop ------------- */
  .rail { grid-auto-columns: min(80vw, 20rem); gap: 0.875rem; }
  .rail .unit-media { height: auto; aspect-ratio: 4 / 3; }
  .rail-progress { margin-top: 1.25rem; }
  .rail-controls .icon-btn { display: none; }

  /* ---------- Footer: two columns where the content allows --------------- */
  .site-footer { padding-top: 4rem; }
  .footer-statement { max-width: 12ch; font-size: 2.5rem; }
  html:lang(zh-CN) .footer-statement { max-width: none; font-size: 1.875rem; line-height: 1.5; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem 1rem; margin-top: 3rem; }
  .footer-grid > :nth-child(n + 3) { grid-column: 1 / -1; }
  .footer-grid h2 { margin-bottom: 0.75rem; }
  .footer-grid ul { gap: 0.15rem; }
  .footer-grid a { display: inline-block; padding-block: 0.4rem; overflow-wrap: anywhere; }
  .footer-legal { margin-top: 2.5rem; font-size: 0.8125rem; }
}

/* The smallest phones (320–359px): labels win over icons */
@media (max-width: 359px) {
  .dock-btn { gap: 0.35rem; padding-inline: 0.6rem; font-size: 0.875rem; }
  .dock-btn .i, .hero-search .btn .i { display: none; }
}

@media (max-width: 599px) and (prefers-reduced-motion: no-preference) {
  .menu-dialog[open] .menu-links a { animation: menu-in 640ms var(--ease-expo) both; }
  .menu-dialog[open] .menu-links a:nth-child(2) { animation-delay: 35ms; }
  .menu-dialog[open] .menu-links a:nth-child(3) { animation-delay: 70ms; }
  .menu-dialog[open] .menu-links a:nth-child(4) { animation-delay: 105ms; }
  .menu-dialog[open] .menu-links a:nth-child(5) { animation-delay: 140ms; }
  .menu-dialog[open] .menu-links a:nth-child(6) { animation-delay: 190ms; }
}
@media (max-width: 599px) and (prefers-reduced-motion: reduce) {
  .dock { transition: opacity 200ms, visibility 0s linear 200ms; translate: none; opacity: 0; }
  .dock.is-on { opacity: 1; transition: opacity 200ms, visibility 0s; }
}
@keyframes menu-in { from { opacity: 0; translate: 0 0.9rem; } }

/* ==========================================================================
   Home
   ========================================================================== */
@media (max-width: 599px) {
  /* ---------- Hero: one statement, one action, then the unit ------------ */
  .hero { padding-top: 1.5rem; }
  .hero-grid { row-gap: 2rem; }
  .hero-copy { padding: 0; }
  .hero-title {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.12em;
    font-size: clamp(2.5rem, 11.6vw, 3.1rem);
    line-height: 1;
  }
  .hero-before { font-size: 0.43em; font-weight: 450; letter-spacing: -0.01em; line-height: 1.3; }
  .hero-after { flex-basis: 100%; font-weight: 620; }
  .hero-before + .hero-after { margin-top: 0.42em; }
  html:lang(zh-CN) .hero-title { column-gap: 0; font-size: clamp(2.5rem, 12.6vw, 3.25rem); line-height: 1.22; }
  html:lang(zh-CN) .hero-before { font-size: 0.4em; line-height: 1.6; }
  html:lang(zh-CN) .hero-title .hero-after { font-weight: 700; line-height: 1.22; }
  html:lang(zh-CN) .hero-before + .hero-after { margin-top: 0.18em; }
  .hero-lead { margin-top: 1.125rem; font-size: 1rem; line-height: 1.6; }
  html:lang(zh-CN) .hero-lead { font-size: 0.9375rem; line-height: 1.85; }
  .hero-search { margin-top: 1.5rem; gap: 0.5rem; padding: 0.3125rem 0.3125rem 0.3125rem 0.875rem; }
  .hero-search input, html:lang(zh-CN) .hero-search input { font-size: 1rem; }
  .hero-search .btn { min-height: 2.875rem; padding-inline: 1rem; font-size: 0.9375rem; }
  ul.hero-quick {
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 0.875rem calc(-1 * var(--margin)) 0;
    padding-inline: var(--margin);
    scroll-padding-inline: var(--margin);
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 0.8125rem;
  }
  .hero-quick::-webkit-scrollbar { display: none; }
  .hero-quick li { flex: none; }
  .hero-quick a {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    min-height: 2.75rem;
    padding: 0 0.95rem;
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--d-hover), border-color var(--d-hover), scale var(--d-press) var(--ease-out);
  }
  .hero-quick a:active { background: var(--ghost); border-color: var(--ink); scale: 0.97; }
  .hero-standard { display: none; }

  .hero-media { margin-inline: calc(-1 * var(--margin)); }
  .hero-photo { aspect-ratio: 1; border-radius: 0; }
  .hero-tag { top: 1.75rem; inset-inline-start: var(--margin); }
  .hero-cap { gap: 0.2rem; padding: 1rem 4.5rem 1.1rem var(--margin); font-size: 0.875rem; }
  .hero-unit-link { inset-inline-end: var(--margin); }

  /* The next sailing, as one live line under the photo */
  .departure {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.15rem 0.75rem;
    margin-top: 0;
    padding-block: 1rem;
    border-top: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
  }
  .departure > .led { display: inline-block; grid-column: 1; grid-row: 1; }
  .departure p { grid-column: 2; }
  .departure p:first-of-type { flex-basis: auto; }
  .departure p:nth-of-type(n + 2) { margin: 0; color: var(--muted); }
  .departure strong { margin-inline-end: 0.45rem; }
  .departure a {
    grid-column: 3;
    grid-row: 1 / span 3;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding-bottom: 0;
    color: var(--green-600);
    background-size: 100% 1px;
    background-position: 0 75%;
  }
}

@media (max-width: 599px) {
  /* ---------- On the floor: title and "see all" share one line --------- */
  .floor { padding-top: 4rem; padding-bottom: 4.5rem; }
  .floor .section-head { position: relative; display: block; }
  .floor .section-head > div { max-width: none; }
  .floor .section-head .h2 { padding-inline-end: 7rem; }
  .floor .rail-controls { position: absolute; top: 0; inset-inline-end: 0; }
  .floor .rail-controls .btn {
    --btn-bg: transparent;
    --btn-fg: var(--green-600);
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    font-size: 0.875rem;
    gap: 0.35rem;
  }
  .floor .rail-controls .btn:hover { --btn-bg: transparent; --btn-fg: var(--green-700); }
  .floor .rail-controls .btn .i { width: 1rem; height: 1rem; }

  /* ---------- Life: the claim, then the paperwork ----------------------- */
  .life { padding-block: 4.5rem; }
  .life-grid { row-gap: 1.25rem; }
  .life-text p + p { margin-top: 0.75em; color: var(--muted); }
  .life .lifebar { margin-top: 2rem; }
  /* room for the "Today" pill, which would otherwise sit on the second line */
  .lifebar-head { margin-bottom: 2.75rem; }
  .lifebar-track { height: 3rem; }
  .lifebar-legend { gap: 0.45rem; margin-top: 1.25rem; font-size: 0.8125rem; }
  .lifebar-legend p { gap: 0.2rem 0.5rem; }

  /* ---------- Departments: a compact index, picture first -------------- */
  .depts { padding-top: 4rem; padding-bottom: 4.5rem; }
  .depts .section-head { margin-bottom: 1.25rem; }
  .dept,
  html:lang(zh-CN) .dept {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    grid-template-areas: "thumb name count" "thumb eg eg";
    align-items: center;
    column-gap: 0.875rem;
    row-gap: 0.125rem;
    padding-block: 0.8rem;
    transition: background-color var(--d-hover);
  }
  .dept::before { inset-inline: calc(-1 * var(--margin)); }
  .dept:active::before { clip-path: inset(0 0 0 0); transition-duration: 120ms; }
  .dept-thumb { grid-area: thumb; width: 3.5rem; height: 3.5rem; border-radius: 2px; }
  .dept-name,
  html:lang(zh-CN) .dept-name { grid-area: name; font-size: 1.25rem; line-height: 1.25; }
  html:lang(zh-CN) .dept-name { font-size: 1.125rem; line-height: 1.45; }
  .dept-eg,
  html:lang(zh-CN) .dept-eg {
    grid-area: eg;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dept-count { grid-area: count; justify-self: end; font-size: 0.8125rem; color: var(--muted); }
  .dept-count .num { color: var(--ink); }
  .dept-from { display: none; }

  /* ---------- Process: six steps as one swipeable deck ----------------- */
  .process { padding-top: 4rem; padding-bottom: 4.5rem; }
  .process .section-head { margin-bottom: 1.5rem; }
  .process-grid { display: block; }
  ol.process-steps {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 21rem);
    gap: 0.75rem;
    margin-inline: calc(-1 * var(--margin));
    padding-inline: var(--margin);
    scroll-padding-inline: var(--margin);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .process-steps::-webkit-scrollbar { display: none; }
  .process-steps::before, .process-steps::after { display: none; }
  .process-steps:focus-visible { outline-offset: -2px; }
  .step,
  .step:first-child,
  .step:last-child {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "img img" "no title" "text text" "proof proof";
    grid-template-rows: auto auto 1fr auto;
    align-content: start;
    column-gap: 0.75rem;
    row-gap: 0;
    padding: 0 0 1.25rem;
    background: var(--ghost);
    scroll-snap-align: start;
  }
  /* The current step is marked by its photo and copper number; text keeps
     full contrast on every card, including the one peeking in. */
  .step-body { display: contents; }
  .step-img {
    grid-area: img;
    width: 100%;
    margin: 0 0 1.125rem;
    aspect-ratio: 4 / 3;
    transition: opacity var(--d-state) var(--ease-out), filter var(--d-state) var(--ease-out);
  }
  .js .step:not(.is-active) .step-img { opacity: 0.6; filter: saturate(0.35); }
  .step-no { grid-area: no; align-self: center; margin-inline-start: 1.125rem; }
  .step-body .h3 { grid-area: title; align-self: center; max-width: none; padding-inline-end: 1.125rem; }
  .step-body > p { margin-inline: 1.125rem; }
  .step-body > p:not(.step-proof) { grid-area: text; margin-top: 0.75rem; font-size: 0.9375rem; }
  .step-proof {
    grid-area: proof;
    align-items: flex-start;
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid var(--rule);
    font-size: 0.8125rem;
  }
  .step-proof .i { margin-top: 0.1rem; }

  .deck-meter { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
  .deck-bars { flex: 1; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.25rem; }
  .deck-bars > span { height: 2px; background: var(--rule); transition: background-color var(--d-state) var(--ease-out); }
  .deck-bars > span.is-on { background: var(--ink); }
  .deck-count { font-size: 0.8125rem; color: var(--muted); }
  .deck-count [data-deck-now] { color: var(--ink); font-weight: 750; }

  /* ---------- Grades: open one grade at a time -------------------------- */
  .standard { padding-top: 4rem; padding-bottom: 4.5rem; }
  .standard .section-head { margin-bottom: 1.5rem; }
  .grade-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.625rem;
  }
  .grade-switch button {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 0.5rem;
    min-height: 6rem;
    padding: 0.875rem 0.375rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: var(--r-2);
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 560;
    line-height: 1.3;
    text-align: center;
    transition: border-color var(--d-hover), background-color var(--d-hover), color var(--d-hover), scale var(--d-press) var(--ease-out);
  }
  .grade-switch button:active { scale: 0.97; }
  .grade-switch .grade-chip {
    width: 2.75rem; height: 2.75rem;
    margin: 0;
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--field);
    color: var(--muted);
    font-size: 1.375rem;
    transition: background-color var(--d-state) var(--ease-out), box-shadow var(--d-state), color var(--d-state);
  }
  .grade-switch [aria-pressed="true"] { border-color: var(--ink); background: var(--white); color: var(--ink); }
  .grade-switch [aria-pressed="true"] .grade-chip { background: var(--tag); box-shadow: none; color: var(--ink); }

  .js .grades[data-switch] tbody tr:not([data-on]) { display: none; }
  .grades tbody { border-top: 0; }
  .grades tr,
  .grades tbody tr:hover { padding: 0.25rem 1.25rem 0.75rem; border: 0; border-radius: var(--r-2); background: var(--white); }
  .grades tbody th {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--rule);
  }
  .grades tbody th .grade-chip { width: 2.5rem; height: 2.5rem; font-size: 1.25rem; }
  .grades td,
  html:lang(zh-CN) .grades td {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
    padding-block: 0.55rem;
    font-size: 0.9375rem;
  }
  .grades td::before { font-size: 0.75rem; }
  .includes { gap: 0.75rem; margin-top: 2.25rem; }
  .includes ul { display: grid; gap: 0.6rem; font-size: 0.9375rem; }
  .includes li { align-items: flex-start; }
  .includes .i { margin-top: 0.15rem; }
}

@media (max-width: 599px) {
  /* ---------- Shipping: one picture, then the timetable ---------------- */
  .shipping { padding-top: 4rem; padding-bottom: 4.5rem; }
  .ship-head { row-gap: 1rem; margin-bottom: 2rem; }
  .shipping-photo { margin: 0 calc(-1 * var(--margin)) 2.25rem; }
  .shipping-photo img { height: auto; aspect-ratio: 16 / 10; }
  .shipping-photo figcaption { padding: 0.875rem var(--margin) 0; }
  .routes-note { font-size: 0.8125rem; }
  .js .routes:not(.is-open) .route:nth-child(n + 6) { display: none; }
  .routes-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    margin-top: 0.75rem;
    color: var(--green-300);
    font-size: 0.875rem;
    font-weight: 620;
  }
  .routes-more .i { width: 1rem; height: 1rem; rotate: 90deg; transition: rotate var(--d-state) var(--ease-out); }
  .routes.is-open .routes-more .i { rotate: -90deg; }
  .terms { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 2.5rem; }
  .terms div {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1rem;
    align-items: baseline;
    padding-block: 1rem;
    border-top-color: var(--rule-dark);
  }
  .terms div:last-child { border-bottom: 1px solid var(--rule-dark); }
  .terms dt { font-size: 1.75rem; }
  .terms dd { margin: 0; max-width: none; font-size: 0.875rem; }

  /* ---------- Voice: the quote leads, the picture follows -------------- */
  .voice { padding-top: 4.5rem; padding-bottom: 0; background: var(--white); }
  .voice-grid { row-gap: 2.5rem; }
  .voice-media { order: 0; width: auto; margin-inline: calc(-1 * var(--margin)); }
  .voice-media img { aspect-ratio: 16 / 10; }
  .voice-quote p { font-size: 1.625rem; line-height: 1.24; }
  html:lang(zh-CN) .voice-quote p { font-size: 1.375rem; line-height: 1.75; }
  .voice-cap { margin-top: 1.5rem; }

  /* ---------- Promises + questions -------------------------------------- */
  .protect { padding-top: 4rem; padding-bottom: 4.5rem; }
  .protect-grid { row-gap: 3.5rem; }
  .promises { gap: 0; margin-top: 1.5rem; border-top: 1px solid var(--ink); }
  .promises li {
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: 0.875rem;
    padding-block: 1.125rem;
    border-bottom: 1px solid var(--rule);
  }
  .promises .i { width: 1.4rem; height: 1.4rem; }
  .promises p { font-size: 0.875rem; }
  .faq-title { margin-bottom: 1rem; }
  .disclosure summary { gap: 1rem; padding-block: 1.1rem; font-size: 1.0625rem; }
  .disclosure-body { font-size: 0.9375rem; }

  /* ---------- Quote: the form gets the whole width --------------------- */
  .quote { padding-top: 4rem; padding-bottom: 0; }
  .quote-grid { row-gap: 1.75rem; }
  .quote-intro .lead { margin-top: 1rem; }
  .contact-alt { margin-top: 1.5rem; }
  .contact-alt div { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0.75rem; padding-block: 0.75rem; }
  .quote-form { margin-inline: calc(-1 * var(--margin)); padding: 1.5rem var(--margin) 2.5rem; }
  .form-foot .btn { width: 100%; }
}

@media (max-width: 599px) and (prefers-reduced-motion: no-preference) {
  /* Each step comes into focus as it reaches the start of the deck */
  @supports (animation-timeline: view()) {
    /* the shorthand resets the timeline, so the longhands come after it */
    .step { animation: deck-depth linear both; }
    .js .step .step-img { animation: deck-photo linear both; }
    .step, .js .step .step-img { animation-timeline: view(inline); animation-range: cover 0% cover 100%; }
  }
}
@media (max-width: 599px) and (prefers-reduced-motion: reduce) {
  .step-img { transition: none; }
  .routes-more .i { transition: none; }
}
@keyframes deck-depth {
  0%, 100% { scale: 0.95; }
  30%, 62% { scale: 1; }
}
@keyframes deck-photo {
  0%, 100% { opacity: 0.55; filter: saturate(0.3); }
  30%, 62% { opacity: 1; filter: none; }
}

/* Shipping routes: two lines per port on narrow screens. The origin label
   sits in front of its own track, so no English "from" is needed. */
@media (max-width: 699px) {
  .route {
    grid-template-columns: 4.25rem minmax(0, 1fr) auto;
    grid-template-areas: "dest dest days" "origin line line";
    column-gap: 0.75rem;
    row-gap: 0.3rem;
    min-height: 0;
    padding-block: 0.8rem;
  }
  .route-origin { font-size: 0.75rem; }
  .route-origin::before { content: none; }
  .route-days { font-size: 0.9375rem; }
}

/* ==========================================================================
   Catalog
   ========================================================================== */
/* Filter and sort share a wrapper so phones can lift them into the dock;
   wider screens keep the original toolbar order. */
@media (min-width: 600px) {
  .toolbar .filter-open { order: 0; }
  .toolbar .result-count { order: 1; }
  .toolbar .sort { order: 2; margin-inline-start: auto; }
  .toolbar .toolbar-right { order: 3; margin-inline-start: calc(var(--s-3) - var(--s-5)); }
}

@media (max-width: 599px) {
  .cat-head { padding-top: 1rem; }
  .cat-head-row { gap: 1.25rem; margin-top: 1.25rem; }
  .cat-title { font-size: 2.375rem; }
  html:lang(zh-CN) .cat-title { font-size: 1.875rem; font-weight: 400; line-height: 1.34; }
  .cat-intro { margin-top: 0.625rem; font-size: 0.9375rem; text-wrap: balance; }
  .cat-tabs { gap: 1.25rem; margin: 1.5rem calc(-1 * var(--margin)) 0; padding-inline: var(--margin); }
  .cat-tab { min-height: 3rem; padding-block: 0.75rem 0.8rem; }
  .cat-body { padding-top: 0.75rem; padding-bottom: 6.5rem; }

  /* In the page: the count and the layout switch. In the dock: the rest. */
  .toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.75rem;
  }
  .toolbar .result-count,
  .catalog-page .toolbar .result-count {
    order: 0;
    width: auto;
    padding: 0;
    border: 0;
    font-size: 0.875rem;
    color: var(--muted);
  }
  .result-count .num { color: var(--ink); font-weight: 700; }
  .toolbar .toolbar-right { display: flex; order: 1; margin-inline-start: auto; }
  .toolbar [aria-label="Layout"] { order: 0; margin: 0; }

  .cat-dock {
    position: fixed;
    z-index: var(--z-sticky);
    inset-inline: 0.75rem;
    bottom: var(--dock-bottom);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.375rem;
    padding: 0.375rem;
    border-radius: 0.875rem;
    background: var(--green-900);
    color: var(--on-dark);
    box-shadow: var(--dock-shadow);
    translate: 0 calc(100% + 1.5rem);
    visibility: hidden;
    transition: translate 520ms var(--ease-expo), visibility 0s linear 520ms;
  }
  .cat-dock.is-on { translate: 0 0; visibility: visible; transition: translate 520ms var(--ease-expo), visibility 0s; }
  .cat-dock .filter-open,
  .cat-dock .filter-open:hover {
    --btn-bg: oklch(1 0 0 / 0.07);
    --btn-fg: var(--on-dark);
    --btn-bd: transparent;
    order: 0;
    justify-self: stretch;
    min-height: 3rem;
    padding: 0 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
  }
  .cat-dock .filter-open .count { background: oklch(1 0 0 / 0.16); color: var(--on-dark); }
  .cat-dock .filter-open .count[data-filled] { background: var(--tag); color: var(--ink); }
  .cat-dock .sort { order: 0; flex: none; grid-column: auto; grid-row: auto; min-width: 0; margin: 0; }
  .cat-dock .sort .input {
    width: 100%;
    min-height: 3rem;
    padding: 0 2.25rem 0 0.9rem;
    border: 0;
    border-radius: 0.625rem;
    background-color: oklch(1 0 0 / 0.07);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4f4e9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 0.75rem center;
    color: var(--on-dark);
    font-size: 0.9375rem;
    font-weight: 620;
  }
  .cat-dock .sort .input:focus { box-shadow: 0 0 0 2px var(--green-300); }
  .cat-dock .sort option { background: var(--white); color: var(--ink); }
  .cat-dock :focus-visible { outline-color: var(--green-300); }
  body:has(.cat-dock.is-on) .toast-region { bottom: calc(var(--dock-bottom) + 4.75rem); }

  /* Two machines per row: picture, name, the one spec that matters */
  .unit-grid:not(.is-list) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 0.75rem;
    margin-top: 1rem;
  }
  .unit-grid:not(.is-list) .unit { gap: 0.7rem; }
  .unit-grid:not(.is-list) .unit-media { height: auto; aspect-ratio: 1; }
  .unit-grid:not(.is-list) .unit .tag-wrap { top: 1.6rem; inset-inline-start: 0.5rem; }
  .unit-grid:not(.is-list) .tag-sm .tag { padding-inline-end: 0.55rem; }
  .unit-grid:not(.is-list) .tag-sm .tag-body { display: none; }
  /* the pin keeps a 44px target but draws a smaller plate on small photos */
  .unit-grid:not(.is-list) .unit-pin,
  .unit-grid:not(.is-list) .unit-pin:hover { top: 0; inset-inline-end: 0; background: none; color: var(--ink); }
  .unit-grid:not(.is-list) .unit-pin[aria-pressed="true"] { background: none; color: var(--white); }
  .unit-grid:not(.is-list) .unit-pin::before {
    content: "";
    position: absolute;
    inset: 0.375rem;
    z-index: -1;
    border-radius: var(--r-1);
    background: var(--white);
    transition: background-color var(--d-hover);
  }
  .unit-grid:not(.is-list) .unit-pin[aria-pressed="true"]::before { background: var(--green-600); }
  .unit-grid:not(.is-list) .unit-pin .i { width: 1.1rem; height: 1.1rem; }
  .unit-grid:not(.is-list) .unit-body { gap: 0.3rem; }
  .unit-grid:not(.is-list) .unit-meta { overflow: hidden; font-size: 0.75rem; white-space: nowrap; text-overflow: ellipsis; }
  .unit-grid:not(.is-list) .unit-name,
  html:lang(zh-CN) .unit-grid:not(.is-list) .unit-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 0.9375rem;
    line-height: 1.32;
  }
  html:lang(zh-CN) .unit-grid:not(.is-list) .unit-name { line-height: 1.55; }
  .unit-grid:not(.is-list) .unit-specs,
  html:lang(zh-CN) .unit-grid:not(.is-list) .unit-specs { gap: 0.1rem 0.6rem; font-size: 0.75rem; }
  .unit-grid:not(.is-list) .unit-specs div:nth-child(3) { display: none; }
  .unit-grid:not(.is-list) .unit-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-top: 0.2rem;
    padding-top: 0.55rem;
  }
  .unit-grid:not(.is-list) .unit-foot .status { order: -1; font-size: 0.75rem; }
  .unit-grid:not(.is-list) .inquiry-link { font-size: 0.8125rem; }
  .unit:active .unit-media img { scale: 1.03; transition-duration: 300ms; }

  .more { margin-top: 3rem; }
  .shortlist { padding-block: 3.5rem; }
}

/* ==========================================================================
   Equipment dossier
   ========================================================================== */
@media (max-width: 599px) {
  .eq-page .crumbs { padding-top: 1rem; }
  .eq-top { margin-top: 1rem; row-gap: 1.75rem; }
  .stage { margin-inline: calc(-1 * var(--margin)); aspect-ratio: 4 / 4.4; }
  .eq-tag { inset-inline-start: var(--margin); }
  .stage-tools { inset-inline-end: var(--margin); }
  .stage-count { inset-inline-start: var(--margin); }
  .thumbs { gap: 0.375rem; margin-top: 0.5rem; }
  .gallery-note { margin-top: 0.75rem; }
  .eq-title { font-size: 2.25rem; line-height: 1.06; }
  /* break model names at their spaces, not inside a Chinese word */
  html:lang(zh-CN) .eq-title { font-size: 1.75rem; font-weight: 700; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
  .facts dd { font-size: 1.0625rem; }
  .inquiry-title { font-size: 1.375rem; }
  html:lang(zh-CN) .inquiry-title { font-size: 1.25rem; font-weight: 400; line-height: 1.6; }
  .assure li { font-size: 0.8125rem; }
  .eq-page .inquiry-panel { padding-top: 0; border-top: 0; }
  .eq-nav a { padding-block: 1rem 0.95rem; }
  .eq-sec { padding-block: 3.5rem; scroll-margin-top: 3.5rem; }
  .eq-h, html:lang(zh-CN) .eq-h { font-size: 1.625rem; }
  html:lang(zh-CN) .eq-h { font-weight: 400; }
  .spec div { grid-template-columns: 6.25rem minmax(0, 1fr); gap: 1rem; padding-block: 0.85rem; }
  .spec dt { font-size: 0.8125rem; }
  .spec dd { font-size: 0.9375rem; }
  .docs a { font-size: 0.9375rem; }
  .docs .plate { font-size: 0.75rem; font-weight: 500; }
  .similar .section-head { margin-bottom: 1.25rem; }

  /* The enquiry bar floats like the other docks */
  .buybar {
    left: 0.75rem;
    right: 0.75rem;
    bottom: var(--dock-bottom);
    padding: 0.375rem 0.375rem 0.375rem 1.1rem;
    border: 0;
    border-radius: 0.875rem;
    background: var(--green-900);
    color: var(--on-dark);
    box-shadow: var(--dock-shadow);
    translate: 0 calc(100% + 1.5rem);
    visibility: hidden;
    transition: translate 520ms var(--ease-expo), visibility 0s linear 520ms;
  }
  .buybar.is-on { translate: 0 0; visibility: visible; transition: translate 520ms var(--ease-expo), visibility 0s; }
  .buybar-inquiry strong { color: var(--on-dark); font-size: 0.875rem; }
  .buybar-inquiry > span { color: var(--on-dark-muted); }
  .buybar .btn,
  .buybar .btn:hover {
    --btn-bg: var(--green-300);
    --btn-fg: var(--green-900);
    --btn-bd: var(--green-300);
    min-height: 3rem;
    padding-inline: 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
  }
  .buybar :focus-visible { outline-color: var(--green-300); }
}
@media (max-width: 599px) and (prefers-reduced-motion: reduce) {
  .cat-dock, .buybar { translate: none; opacity: 0; transition: opacity 200ms, visibility 0s linear 200ms; }
  .cat-dock.is-on, .buybar.is-on { opacity: 1; transition: opacity 200ms, visibility 0s; }
  .unit:active .unit-media img { scale: 1; }
}
