/* Mobile parity with the approved desktop, retaining native vertical scrolling. */
@media (max-width: 899px), (max-aspect-ratio: 999/1000), (max-height: 519px) {
  :root {
    --mobile-header-h: calc(124px + env(safe-area-inset-top, 0px));
    --mobile-copy-gap: clamp(24px, 5vw, 36px);
    --mobile-section-gap: clamp(56px, 9svh, 96px);
    --mobile-robot-space: clamp(64px, 12svh, 120px);
  }
  .sidebar {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 96px;
    grid-template-rows: 72px 52px;
    column-gap: 8px;
    row-gap: 0;
    align-items: center;
    height: var(--mobile-header-h);
    padding: env(safe-area-inset-top, 0px) var(--m) 0;
    color: var(--white);
    background: var(--ink-2);
    border-bottom-color: color-mix(in srgb, var(--white) 12%, transparent);
  }
  .side-logo { grid-column: 1; grid-row: 1; width: 52px; height: 52px; }
  .side-logo-mark { width: 38px; }
  .side-brand { grid-column: 2; grid-row: 1; font-size: 23px; white-space: nowrap; }
  .sidebar > .fair-link {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    width: auto;
    margin: 0;
    padding: 4px 0;
    min-height: 44px;
    text-align: center;
    font-size: clamp(15px, 4vw, 18px);
    font-weight: 600;
    line-height: 1.25;
  }
  .side-contact { display: none; }
  .side-contact summary { justify-content: flex-end; gap: 8px; font-size: 16px; }
  .side-contact summary::after {
    content: "";
    width: 9px;
    height: 9px;
    background: currentColor;
    clip-path: polygon(43% 0, 57% 0, 57% 43%, 100% 43%, 100% 57%, 57% 57%, 57% 100%, 43% 100%, 43% 57%, 0 57%, 0 43%, 43% 43%);
    transition: transform 160ms var(--control-ease);
  }
  .side-contact[open] summary::after { transform: rotate(45deg); }
  .side-contact__body {
    top: 100%;
    background: var(--ink-2);
    color: var(--white);
    border-bottom-color: color-mix(in srgb, var(--white) 14%, transparent);
  }
  .side-contact__body p { color: color-mix(in srgb, var(--white) 80%, transparent); }
  .side-contact__body .contact-fair-link { display: none; }
  .side-contact summary:hover, .side-contact__body a:hover { color: var(--royal-300); }
  .side-contact summary:focus-visible, .side-contact__body a:focus-visible { outline-color: var(--royal-300); }
  .script-switch {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: var(--m);
    background: var(--ink-2);
    color: var(--white);
  }
  .script-switch button, .script-switch > span { color: color-mix(in srgb, var(--white) 72%, transparent); }
  .script-switch button[aria-pressed="true"] { color: var(--white); }
  .script-switch button:hover { color: var(--royal-300); }
  .script-switch button:focus-visible { outline-color: var(--royal-300); }

  .panel--hero { gap: 0; justify-content: flex-start; padding-top: calc(var(--mobile-header-h) + 24px); padding-bottom: var(--mobile-copy-gap); }
  .hero-title { margin-bottom: var(--mobile-section-gap); }
  .hero-subtitle { margin-bottom: 20px; }
  .set { padding: var(--mobile-section-gap) var(--m) 0; }
  .set-head { margin-bottom: var(--mobile-copy-gap); }
  .set-meta { margin-top: 24px; }
  .plates { gap: var(--mobile-copy-gap); }
  .set--fair { display: flex; flex-direction: column; gap: var(--mobile-section-gap); padding-top: 0; }
  .set--fair > .plates { display: contents; }
  .set--fair > .plates > .plate { order: 0; }
  .set--fair > .fair-story { order: 1; margin-top: 0; }
  .panel--hero > .robot-stage {
    --mobile-robot-h: min(440px, max(120px, calc(100svh - var(--mobile-header-h) - 220px)));
    display: block;
    position: relative;
    order: 0;
    flex: none;
    align-self: center;
    width: min(100%, calc(var(--mobile-robot-h) * 1.08));
    height: var(--mobile-robot-h);
    margin: 0 0 24px;
  }
  .robot-stage > .robot-arm {
    position: relative;
    inset: auto;
    translate: none;
    width: 100%;
    height: 100%;
    max-block-size: none;
    aspect-ratio: auto;
    margin: 0;
  }
  /* The opening stays in view until the full robot motion returns to rest.
     Removing this native document cap never advances the page automatically. */
  .is-shop-waiting .track { max-height: var(--mobile-shop-cap, none); overflow: clip; }
  .track { overflow-anchor: none; }
  .is-shop-waiting #prodavnica { visibility: hidden; }
  .panel--brands { padding: var(--mobile-section-gap) var(--m) 0; }
  .brands-grid { margin-top: 32px; }
  .showcase .plate--portrait { align-self: flex-end; }
  #pametne-table .plate--portrait { align-self: flex-start; }

  .panel--closing {
    display: flex;
    position: relative;
    isolation: isolate;
    align-items: center;
    width: auto;
    min-height: max(460px, calc(100svh - var(--mobile-header-h)));
    margin: var(--mobile-section-gap) 0 0;
    padding: 48px var(--m) 110px;
    overflow: hidden;
    background: var(--royal-900);
    color: var(--white);
  }
  .closing-image { position: absolute; inset: 0; z-index: -1; }
  .closing-image img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(.55); }
  .closing-image::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--royal-900) 72%, transparent); }
  .closing-copy { position: relative; padding: 24px 0; }
  .closing-title { max-width: 10ch; font-size: clamp(44px, 12.5vw, 80px); font-weight: 700; line-height: .98; letter-spacing: -.04em; text-wrap: balance; }
  .closing-subtitle { margin-top: 24px; font-size: 17px; line-height: 1.5; }
  .closing-credit { position: absolute; inset-inline: var(--m); bottom: max(20px, env(safe-area-inset-bottom, 0px)); min-height: 44px; display: flex; align-items: center; max-width: 42ch; font-size: 13px; line-height: 1.45; text-decoration: none; }
  .closing-credit:hover { color: var(--royal-100); text-decoration: underline; }
  .closing-credit:focus-visible { outline-color: var(--royal-100); }
  .closing-credit:active { opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
  .side-contact summary::after { transition: none; }
}
