/* Saghri × UniFi-style design system
   Layout concept: quiet white canvas, products floating on soft grey wells, one blue for action,
   motion that only ever moves transform and opacity. Token values mirror the ui.com scale
   (neutral hue 214°/8% saturation, 4/8/16 px radii, 0.25 s standard curve).

   One file for every page, cascade layers in priority order (later wins, whatever the specificity); checkout.css adds
   the checkout's and the receipt's page rules to the pages layer on those two pages only:
     tokens      custom properties only
     reset       element defaults
     base        layout primitives, buttons, section headings
     components  shared UI: nav, tabs, cards, accordion, footer, compare table
     scenes      the animated product mock-ups inside device frames
     pages       page sections: home, store, security
     utilities   single-purpose helpers and the reduced-motion kill switch
   Responsive and reduced-motion overrides sit next to the rule they change. */
@layer tokens, reset, base, components, scenes, pages, utilities;

/* cross-page transitions (Chrome 126+, ignored elsewhere); the header stays put */
@view-transition { navigation: auto; }

/* =====================================================================
   TOKENS
   ===================================================================== */
@layer tokens {
  :root {
    --blue: #0063f2;          /* fills + text (AA on white) */
    --blue-bright: #006fff;   /* lines, progress, glow */
    --blue-hover: #0055d4;
    --blue-fill: #0063f2;     /* fills under white text, both themes (5.2:1 with white) */
    --blue-fill-hover: #0055d4;
    --blue-soft: #e6f0ff;
    --blue-glow: rgba(0, 111, 255, .35);

    --bg: #ffffff;
    --bg-sunk: #f4f5f6;
    --bg-sunk-2: #eef0f1;
    --surface: #ffffff;
    --line: #dee0e3;
    --line-soft: #eceef0;
    --text: #212327;
    --text-2: #50565e;
    --text-3: #676e78;        /* AA on white, --bg-sunk and --bg-sunk-2 */
    --ok: #187f3e;
    --ok-dot: #38cc65;
    --warn: #9a5a00;
    --warn-soft: #fff3df;
    --red: #e5383b;
    --red-fill: #d32f2f;      /* fills under white text, both themes (4.98:1 with white) */
    --danger-text: #c62828;   /* error text and remove icons (--red-fill stays for fills under white) */
    --ok-soft: #eef6f1;       /* behind --ok text, like --warn-soft */
    --line-strong: #858b94;   /* control boundaries (inputs, selects, the stepper): ≥ 3:1; --line stays for dividers */
    --on-fill: #fff;          /* text and marks on --blue-fill (the same in both themes) */
    --on-fill-faint: rgba(255, 255, 255, .45);   /* a faint mark on --blue-fill: the busy spinner's track */

    --night: #0b0d10;
    --night-text: #f4f5f6;
    --night-text-2: #a9b0b8;

    --shadow-1: 0 4px 12px hsla(214, 8%, 14%, .08), 0 0 1px hsla(214, 8%, 14%, .18);
    --shadow-2: 0 8px 24px hsla(214, 8%, 14%, .08), 0 0 1px hsla(214, 8%, 14%, .18);
    --shadow-3: 0 12px 48px hsla(214, 8%, 14%, .12), 0 0 1px hsla(214, 8%, 14%, .22);

    --r-1: 4px;
    --r-2: 8px;
    --r-3: 16px;

    /* motion: durations (enter slower than exit; exits use literal .12–.3 s) */
    --t-1: .2s;    /* colour and background changes */
    --t-2: .25s;   /* small UI movement */
    --t-3: .35s;   /* accordions, larger reveals */
    --t-loop: .8s; /* one turn of a busy spinner (the checkout's pay button) */
    /* motion: curves (ui.js reads --ease-enter/-exit/-emph/-spring for WAAPI) */
    --ease: cubic-bezier(.4, 0, .6, 1);              /* ui.com standard */
    --ease-out: cubic-bezier(0, 0, .5, 1);           /* ui.com card hover */
    --ease-standard: cubic-bezier(.2, 0, .38, .9);   /* Carbon productive standard */
    --ease-enter: cubic-bezier(0, 0, .3, 1);         /* Carbon expressive entrance */
    --ease-exit: cubic-bezier(.4, .14, 1, 1);        /* Carbon expressive exit */
    --ease-emph: cubic-bezier(.05, .7, .1, 1);       /* Material 3 emphasized decelerate */
    --ease-spring: cubic-bezier(.25, 0, .3, 1);      /* replaced by linear() below where supported */

    --font: "Vazirmatn", "Vazirmatn Fallback", "Segoe UI", Tahoma, sans-serif;   /* fallback face: see fonts.css */
    --mono: "JetBrains Mono", "Vazirmatn", ui-monospace, Menlo, monospace;

    --fs-cap: .8125rem;
    --fs-sm: .875rem;
    --fs-md: .9375rem;
    --fs-lg: 1.0625rem;
    --fs-xl: 1.25rem;
    --fs-h2: clamp(1.55rem, 1.05rem + 1.9vw, 2.45rem);
    --fs-h1: clamp(1.9rem, 1.05rem + 3vw, 3.35rem);

    --nav-h: 56px;
    --wrap: 1260px;
    --gutter: clamp(16px, 3vw, 32px);
    color-scheme: light;
  }
  /* calm spring, ≤1.5% overshoot (Ubiquiti indicators don't bounce) */
  @supports (transition-timing-function: linear(0, 1)) {
    :root { --ease-spring: linear(0, .19 6%, .57 15%, .84 25%, .96 35%, 1.01 46%, 1.005 60%, 1); }
  }
  :root[data-theme="dark"] {
    --blue: #3d8bff;
    --blue-hover: #5c9dff;
    --blue-soft: #10264a;
    --bg: #131416;
    --bg-sunk: #1b1d20;
    --bg-sunk-2: #222428;
    --surface: #1c1e21;
    --line: #2f3237;
    --line-soft: #26292d;
    --text: #f4f5f6;
    --text-2: #b7bcc2;
    --text-3: #8c939c;
    --ok: #4fd67b;
    --warn: #f2b14c;
    --warn-soft: #33270f;
    --danger-text: #ff8a80;
    --ok-soft: #1b3324;
    --line-strong: #646a73;
    --shadow-1: 0 4px 12px rgba(0, 0, 0, .4), 0 0 1px rgba(255, 255, 255, .08);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .45), 0 0 1px rgba(255, 255, 255, .1);
    --shadow-3: 0 12px 48px rgba(0, 0, 0, .55), 0 0 1px rgba(255, 255, 255, .12);
    color-scheme: dark;
  }
}

/* =====================================================================
   RESET
   ===================================================================== */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  /* no grey/blue tap box on phones: buttons and cards give their own :active feedback */
  html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
  body {
    margin: 0; overflow-x: clip; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-md); line-height: 1.85;
    -webkit-font-smoothing: antialiased; transition: background-color var(--t-1) ease-in-out, color var(--t-1) ease-in-out;
  }
  img { max-width: 100%; height: auto; display: block; }
  a { color: var(--blue); text-decoration: none; }
  @media (hover: hover) { a:hover { color: var(--blue-hover); } }
  button { font: inherit; color: inherit; }
  :focus { outline: none; }
  :focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; border-radius: var(--r-1); }
  /* Persian-friendly line-heights; display weights stay at 700 */
  h1, h2, h3, h4 { margin: 0; line-height: 1.4; text-wrap: balance; font-weight: 700; }
  h1, h2 { line-height: 1.35; }
  h4 { font-weight: 800; }
  p { margin: 0; }
  input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }
}

/* =====================================================================
   BASE
   ===================================================================== */
@layer base {
  .wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
  .icon { width: 20px; height: 20px; flex-shrink: 0; }
  .sku { font-family: var(--mono); font-size: .75rem; color: var(--text-3); direction: ltr; unicode-bidi: isolate; letter-spacing: .01em; }

  /* ---------- sections ---------- */
  .section { padding-block: clamp(56px, 8vw, 112px); }
  .section.tight { padding-block: clamp(40px, 5vw, 72px); }
  .sunk { background: var(--bg-sunk); }
  .head { text-align: center; display: grid; justify-items: center; gap: 12px; margin-bottom: clamp(24px, 3vw, 40px); }
  .head h2 { font-size: var(--fs-h2); }
  .head p { color: var(--text-2); max-width: 40em; font-size: var(--fs-lg); }
  .head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
  .head-row h2 { font-size: var(--fs-h2); }
  .head-row p { color: var(--text-2); margin-top: 6px; }
  .series { display: flex; align-items: center; gap: 16px; color: var(--blue); font-weight: 700; font-size: var(--fs-md); margin-bottom: 16px; }
  .series::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to left, var(--blue-bright), transparent); }

  /* ---------- buttons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--r-1);
    border: 1px solid transparent; font-size: var(--fs-sm); font-weight: 600; line-height: 1.5; cursor: pointer; white-space: nowrap;
    transition: background-color var(--t-1) ease-in-out, border-color var(--t-1) ease-in-out, color var(--t-1) ease-in-out, transform .15s var(--ease-out);
  }
  .btn:active { transform: scale(.98); }
  .btn .icon { width: 16px; height: 16px; }
  .btn .icon.sm { width: 14px; height: 14px; }
  .btn-primary { background: var(--blue-fill); color: #fff; }
  @media (hover: hover) { .btn-primary:hover { background: var(--blue-fill-hover); color: #fff; } }
  .btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
  @media (hover: hover) { .btn-outline:hover { background: var(--blue-soft); color: var(--blue); } }
  .btn-quiet { border-color: var(--line); color: var(--text); background: var(--surface); }
  @media (hover: hover) { .btn-quiet:hover { border-color: var(--text-3); color: var(--text); } }
  .btn-glass { border-color: rgba(255, 255, 255, .35); color: #fff; background: rgba(255, 255, 255, .06); }
  @media (hover: hover) { .btn-glass:hover { background: rgba(255, 255, 255, .16); color: #fff; } }
  .btn-lg { height: 44px; padding: 0 22px; font-size: var(--fs-md); }
  .link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); }
  .link-arrow .icon { width: 16px; height: 16px; transition: transform var(--t-2) var(--ease); }
  @media (hover: hover) { .link-arrow:hover .icon { transform: translateX(-3px); } }

  /* ---------- a button's busy and done mark (ui.js and admin.js build it) ----------
     after React Bits Status Mark (MIT + Commons Clause), ported: a ring that turns while busy, then a tick. The tick is
     wiped in by two boxes moving by equal and opposite translates, so only transform moves. Under reduced motion the
     global rule stops the turn and the wipe; the label and the status text carry the state. */
  .bmark { display: none; position: relative; flex: none; inline-size: 16px; block-size: 16px; overflow: hidden; }
  [data-state="busy"] > .bmark, [data-state="done"] > .bmark { display: block; }
  [data-state="busy"], [data-state="busy"]:active { cursor: progress; transform: none; }
  [data-state="busy"] > .icon, [data-state="done"] > .icon { display: none; }
  /* «کپی شماره» beside a number: small, and it keeps the number's line */
  .copy-btn { height: 28px; padding: 0 10px; margin-inline-start: 8px; font-size: var(--fs-cap); vertical-align: middle; }
  .bmark-ring { position: absolute; inset: 0; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; opacity: 0; }
  [data-state="busy"] > .bmark .bmark-ring { opacity: 1; animation: bmark-turn var(--t-loop) linear infinite; }
  @keyframes bmark-turn { to { transform: rotate(1turn); } }
  .bmark-tick, .bmark-tick svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; }
  .bmark-tick { overflow: hidden; transform: translateX(-100%); }
  .bmark-tick svg { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transform: translateX(100%); }
  [data-state="done"] > .bmark .bmark-tick, [data-state="done"] > .bmark .bmark-tick svg { transform: none; transition: transform var(--t-2) var(--ease-enter); }
  @starting-style {
    [data-state="done"] > .bmark .bmark-tick { transform: translateX(-100%); }
    [data-state="done"] > .bmark .bmark-tick svg { transform: translateX(100%); }
  }
}

/* =====================================================================
   COMPONENTS
   ===================================================================== */
@layer components {
  .skip { position: absolute; inset-inline-start: 12px; top: -64px; z-index: 100; background: var(--blue-fill); color: #fff; padding: 8px 14px; border-radius: var(--r-1); }
  .skip:focus { top: 12px; color: #fff; }

  /* ---------- concept bar ---------- */
  .concept { background: var(--bg-sunk); color: var(--text-2); font-size: var(--fs-cap); border-bottom: 1px solid var(--line-soft); }
  .concept .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-block: 6px; }
  .concept nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .concept a { color: var(--text-2); }
  .concept a[aria-current] { color: var(--blue); font-weight: 700; }

  /* ---------- nav ---------- */
  .nav {
    position: sticky; top: 0; z-index: 50; height: var(--nav-h); view-transition-name: site-nav;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--line-soft);
    transition: background-color var(--t-1) ease-in-out, border-color var(--t-1) ease-in-out, color var(--t-1) ease-in-out;
  }
  .nav.over-dark { background: rgba(11, 13, 16, .55); border-bottom-color: rgba(255, 255, 255, .08); color: var(--night-text); }
  /* without JS (or when ui.js never loaded) nothing turns a dark header light past its dark section: it scrolls away with
     the hero instead of staying, dark, over white content (T4 M2) */
  html:not(.js) .nav.over-dark { position: relative; }
  .nav-in { height: 100%; display: flex; align-items: center; gap: 24px; }
  /* 961–1279 px: the box is narrower than --wrap and the nav links are shown, so the nav closes up (LAUNCH-04) */
  /* min-width 960.02px, not range syntax (Safari < 16.4 ignores it): a zoomed window's fractional width (960.5 px) falls
     on one side of 960, and only a 0.02 px sliver is left between this and the drawer's max-width: 960px */
  @media (min-width: 960.02px) and (max-width: 1279.98px) { .nav-in { gap: 16px; } }
  .logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 1.3rem; letter-spacing: 0; flex-shrink: 0; }
  .logo:hover { color: inherit; }
  .logo svg { width: 30px; height: 30px; }
  .logo small { font-size: .72rem; font-weight: 600; color: var(--text-3); border-inline-start: 1px solid var(--line); padding-inline-start: 10px; }
  .over-dark .logo small { color: var(--night-text-2); border-color: rgba(255, 255, 255, .2); }
  /* hidden on phones, and on narrow desktops, where the nav links need its room (LAUNCH-04); tablets keep it */
  @media (min-width: 960.02px) and (max-width: 1100px), (max-width: 640px) { .logo small { display: none; } }
  /* static, so the mega panel inside the products <li> is placed against header.nav (sticky), and the glide
     highlight's offsetLeft is measured from the same box */
  .nav-links { position: static; isolation: isolate; display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
  .nav-link {
    display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px; border-radius: var(--r-1); border: 0; background: none;
    color: inherit; font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; cursor: pointer; white-space: nowrap;
    transition: background-color var(--t-1) ease-in-out, color var(--t-1) ease-in-out;
  }
  /* every link stays in the nav from 961 px up (the drawer takes over below), the longest menu (the home page's eight)
     included: tighter below 1280 px, and a step down the type scale below 1024 px (LAUNCH-04) */
  @media (min-width: 960.02px) and (max-width: 1279.98px) { .nav-link { padding-inline: 8px; } }
  @media (min-width: 960.02px) and (max-width: 1023.98px) { .nav-link { font-size: var(--fs-cap); } }
  .nav-link[aria-expanded="true"] { background: var(--bg-sunk); color: inherit; }
  @media (hover: hover) { .nav-link:hover { background: var(--bg-sunk); color: inherit; } }
  .over-dark .nav-link[aria-expanded="true"] { background: rgba(255, 255, 255, .12); }
  @media (hover: hover) { .over-dark .nav-link:hover { background: rgba(255, 255, 255, .12); } }
  /* "page" on the section's own page, "true" on its sub-pages (alarm-sim.html) */
  .nav-link[aria-current] { color: var(--blue); }
  .over-dark .nav-link[aria-current] { color: #fff; background: rgba(255, 255, 255, .14); }
  /* with a mouse, one highlight glides between links instead of per-link hover fills */
  @media (hover: hover) { .nav-links .nav-link:hover { background: transparent; } }
  .nav-link .chev { width: 14px; height: 14px; transition: transform var(--t-2) var(--ease); }
  .nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .nav-hl {
    position: absolute; z-index: -1; left: 0; top: 50%; height: 34px; margin-top: -17px; width: var(--w, 0); border-radius: var(--r-1);
    background: var(--bg-sunk); opacity: 0; transform: translateX(var(--x, 0));
    transition: transform .42s var(--ease-spring), width .42s var(--ease-spring), opacity .42s var(--ease-standard);
  }
  .nav-links.hl-on .nav-hl { opacity: 1; }
  .over-dark .nav-hl { background: rgba(255, 255, 255, .12); }
  .nav-end { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
  @media (max-width: 360px) { .nav-end { gap: 0; } }   /* five 36px controls fit 320px only without the gaps */
  .icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-1); border: 0; background: none; color: inherit; cursor: pointer;
    position: relative; transition: background-color var(--t-1) ease-in-out;
  }
  @media (hover: hover) { .icon-btn:hover { background: var(--bg-sunk); color: inherit; } }
  @media (hover: hover) { .over-dark .icon-btn:hover { background: rgba(255, 255, 255, .12); } }
  /* the header cart's count: white on --blue-fill, 11px, in the button's top corner so it covers only the icon's corner
     and never the basket or the next button. Empty (before ui.js fills it, and at 0) it isn't shown.
     Scoped to .has-badge, so the store's .filter-btn .badge keeps its own box */
  .has-badge > .badge {
    position: absolute; top: 0; inset-inline-end: 0; min-width: 1rem; height: 1rem; padding: 0 .25rem; border-radius: 999px;
    background: var(--blue-fill); color: #fff; font-size: .6875rem; font-weight: 700; line-height: 1rem; text-align: center;
    box-shadow: 0 0 0 2px var(--bg); font-variant-numeric: tabular-nums;
  }
  .has-badge > .badge:empty { display: none; }
  .menu-btn { display: none; }
  /* home and security: the number beside «بازدید رایگان» on wide screens; on phones and tablets it is the call icon */
  .nav-tel { display: none; align-items: center; gap: 6px; padding-inline: 6px; color: inherit; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
  .nav-tel .icon { width: 16px; height: 16px; color: var(--blue); }
  .over-dark .nav-tel .icon { color: inherit; }
  @media (min-width: 1280px) { .nav-tel { display: inline-flex; } }
  /* the call button stays on phones, tablets and narrow desktops (up to 1100 px, where the nav links need the room;
     LAUNCH-04), as an icon */
  @media (max-width: 1100px) {
    .nav-end .btn { display: inline-flex; font-size: 0; gap: 0; width: 36px; padding: 0; }
    .nav-end .btn .icon { width: 18px; height: 18px; }
    .nav-end .nav-visit { display: none; }   /* the call icon (.nav-tel) stands in for it */
    .nav-tel { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: var(--r-1); background: var(--blue-fill); color: #fff; font-size: 0; }
    .nav-tel .icon, .over-dark .nav-tel .icon { width: 18px; height: 18px; color: inherit; }
  }
  @media (max-width: 960px) {
    .nav-links { display: none; }
    .menu-btn { display: inline-grid; }
  }

  /* mega menu: unfolds on grid rows like ui.com */
  .mega {
    position: absolute; inset-inline: 0; top: 100%; display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
    background: var(--bg); border-bottom: 1px solid var(--line-soft); box-shadow: var(--shadow-2); color: var(--text);
    transition: grid-template-rows .3s var(--ease), opacity var(--t-2) ease-out 80ms, visibility 0s linear .3s;
  }
  .mega.open { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .3s var(--ease), opacity var(--t-2) ease-out 80ms, visibility 0s; }
  .mega > div { overflow: hidden; }
  .mega-in { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding-block: 20px 24px; }
  .mega-item {
    display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: var(--r-2); color: var(--text); text-align: center; font-size: var(--fs-sm); font-weight: 600;
    transform: translateY(8px); opacity: 0; transition: background-color var(--t-1), transform .3s var(--ease-out), opacity .3s var(--ease-out);
  }
  .mega.open .mega-item { transform: none; opacity: 1; }
  .mega.open .mega-item:nth-child(2) { transition-delay: 30ms; }
  .mega.open .mega-item:nth-child(3) { transition-delay: 60ms; }
  .mega.open .mega-item:nth-child(4) { transition-delay: 90ms; }
  .mega.open .mega-item:nth-child(5) { transition-delay: 120ms; }
  .mega.open .mega-item:nth-child(6) { transition-delay: 150ms; }
  @media (hover: hover) { .mega-item:hover { background: var(--bg-sunk); color: var(--text); } }
  .mega-item img { width: 76px; height: 76px; object-fit: contain; transition: transform .3s var(--ease-out); }
  @media (hover: hover) { .mega-item:hover img { transform: translateY(-3px) scale(1.04); } }
  .mega-item small { font-size: .72rem; color: var(--text-3); font-weight: 500; }
  @media (max-width: 1100px) { .mega-in { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

  /* ---------- mobile drawer ---------- */
  /* --drawer-top is the nav's real bottom edge, set by ui.js on open (the nav sits lower while
     anything above it is still on screen). The panel fades in first and its links follow, so
     the links never cross-fade over the page text; on close the links go first. */
  .drawer {
    position: fixed; inset: var(--drawer-top, var(--nav-h)) 0 0 0; z-index: 49; background: var(--bg); padding: 12px var(--gutter) 40px; overflow-y: auto;
    opacity: 0; visibility: hidden;
    transition: opacity .18s var(--ease-exit) .1s, visibility 0s linear .28s;
  }
  .drawer.open { opacity: 1; visibility: visible; transition: opacity .2s var(--ease-enter), visibility 0s; }
  .drawer > * { opacity: 0; transform: translateY(-8px); transition: opacity .1s var(--ease-exit), transform .1s var(--ease-exit); }
  .drawer.open > * { opacity: 1; transform: none; transition: opacity .3s var(--ease-enter) calc(.15s + var(--i, 0) * 30ms), transform .3s var(--ease-enter) calc(.15s + var(--i, 0) * 30ms); }
  @media (prefers-reduced-motion: reduce) { .drawer, .drawer.open, .drawer > *, .drawer.open > * { transition-delay: 0s; } }
  .drawer a:not(.btn) { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-weight: 600; font-size: var(--fs-lg); }
  .drawer .btn { margin-top: 20px; width: 100%; }

  /* ---------- sticky contact bar on phones ---------- */
  .callbar { display: none; }
  @media (max-width: 640px) {
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    .callbar {
      display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; position: fixed; z-index: 55; inset-inline: 0; bottom: 0;
      padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 94%, transparent);
      backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    }
    .callbar a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border-radius: var(--r-2); color: var(--text); font-weight: 600; font-size: var(--fs-sm); background: var(--bg-sunk); }
    .callbar a:first-child { background: var(--blue-fill); color: #fff; }
    .callbar .icon { width: 18px; height: 18px; }
  }

  /* ---------- pill tabs with auto-advance progress ---------- */
  .pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
  .pill {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; flex-shrink: 0;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer;
    transition: color var(--t-1) ease-in-out, border-color var(--t-1) ease-in-out, background-color var(--t-1) ease-in-out;
  }
  @media (hover: hover) { .pill:hover { color: var(--text); border-color: var(--text-3); } }
  .pill .icon { width: 16px; height: 16px; }
  .pill[aria-selected="true"] { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); background: color-mix(in srgb, var(--blue-soft) 55%, var(--surface)); }
  .pill .prog { position: absolute; top: 0; inset-inline: 14px; height: 2px; overflow: hidden; border-radius: 2px; pointer-events: none; }
  .pill .prog::after { content: ""; position: absolute; inset: 0; background: var(--blue-bright); transform: scaleX(0); transform-origin: right; }
  .pill[aria-selected="true"] .prog::after { transform: scaleX(1); }
  [data-auto] .pill[aria-selected="true"] .prog::after { animation: prog var(--auto, 5s) linear forwards; }
  [data-auto].paused .pill[aria-selected="true"] .prog::after,
  [data-auto].user-paused .pill[aria-selected="true"] .prog::after { animation-play-state: paused; }
  /* pause for a mouse resting on the tabs or keyboard focus in them; a tap on a phone leaves
     :hover and :focus-within stuck, which froze the auto-advance with no sign it was paused */
  @media (hover: hover) { [data-auto]:hover .pill[aria-selected="true"] .prog::after { animation-play-state: paused; } }
  [data-auto]:has(:focus-visible) .pill[aria-selected="true"] .prog::after { animation-play-state: paused; }
  @keyframes prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .on-night .pill { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .78); backdrop-filter: blur(10px); }
  @media (hover: hover) { .on-night .pill:hover { color: #fff; border-color: rgba(255, 255, 255, .5); } }
  .on-night .pill[aria-selected="true"] { color: #fff; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .55); }
  .on-night .pill .prog::after { background: #fff; }
  @media (max-width: 640px) {
    .pills { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-inline: var(--gutter); margin-inline: calc(var(--gutter) * -1); }
    .pills::-webkit-scrollbar { display: none; }
  }

  /* pause control for auto-advancing tabs (WCAG 2.2.2) */
  .tabs-pause {
    display: grid; place-items: center; width: 32px; height: 32px; margin: 10px auto 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer;
    transition: border-color var(--t-2) var(--ease-standard), color var(--t-2) var(--ease-standard);
  }
  @media (hover: hover) { .tabs-pause:hover { border-color: var(--text-3); color: var(--text); } }
  .tabs-pause .icon { width: 14px; height: 14px; }
  .on-night .tabs-pause, .eco .tabs-pause, .plan .tabs-pause { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); color: #fff; }

  /* panels: the outgoing panel exits while the new one enters (RTL: forward = from the left) */
  .panels { position: relative; display: grid; }
  .panels > [role="tabpanel"] { grid-area: 1 / 1; min-width: 0; }
  .panels > [role="tabpanel"][hidden] { display: block !important; visibility: hidden; opacity: 0; pointer-events: none; }
  .panels > .principle[hidden], .panels > .app-main[hidden] { display: grid !important; }
  .panels > [role="tabpanel"].enter { animation: panelIn .6s var(--ease-enter) both; }
  .panels > [role="tabpanel"].leave { visibility: visible; animation: panelOut .3s var(--ease-exit) both; pointer-events: none; }
  @keyframes panelIn { from { opacity: 0; transform: translateX(-3%); } to { opacity: 1; transform: none; } }
  @keyframes panelOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(3%); } }

  /* segmented control with sliding thumb */
  .seg {
    position: relative; display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-2); background: var(--bg-sunk-2); isolation: isolate;
    max-width: 100%; overflow-x: auto; scrollbar-width: none;
  }
  .seg::-webkit-scrollbar { display: none; }
  .seg button {
    position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; background: none; border-radius: 6px; flex-shrink: 0;
    color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; cursor: pointer; white-space: nowrap; transition: color var(--t-1) ease-in-out;
  }
  .seg button[aria-selected="true"], .seg button[aria-pressed="true"] { color: var(--blue); font-weight: 600; }
  .seg button .icon { width: 16px; height: 16px; }
  .seg .thumb {
    position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: var(--w, 0); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-1);
    transform: translateX(var(--x, 0)); transition: transform .42s var(--ease-spring), width .42s var(--ease-spring);
  }

  /* underline tabs; the bar scales instead of animating width (compositor only) */
  .utabs { position: relative; display: flex; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .utabs::-webkit-scrollbar { display: none; }
  .utabs button { height: 42px; padding: 0 14px; border: 0; background: none; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: color var(--t-1); }
  @media (hover: hover) { .utabs button:hover { color: var(--text); } }
  .utabs button[aria-selected="true"], .utabs button[aria-pressed="true"] { color: var(--blue); font-weight: 600; }
  .utabs .bar {
    position: absolute; bottom: -1px; left: 0; height: 2px; width: 100px; background: var(--blue-bright); transform-origin: 0 0;
    transform: translateX(var(--x, 0)) scaleX(calc(var(--wn, 0) / 100)); transition: transform .42s var(--ease-spring);
  }

  /* indicators jump without animating on first layout and resize (ui.js adds .snap) */
  .snap .thumb, .snap .bar, .snap .ind, .nav-hl.snap { transition: none !important; }

  /* numbers that roll */
  #count, #series-label { display: inline-block; }

  /* ---------- horizontal rail ---------- */
  .rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 18px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail > * { scroll-snap-align: start; }
  .rail.narrow { grid-auto-columns: minmax(190px, 1fr); }
  /* rails bleed to the viewport edge like ui.com */
  .rail.bleed {
    margin-inline: calc(50% - 50vw);
    padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
    scroll-padding-inline: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  }
  .rail-btns { display: flex; gap: 8px; }
  .rail-btns button {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text);
    transition: opacity var(--t-1), border-color var(--t-1), background-color var(--t-1);
  }
  @media (hover: hover) { .rail-btns button:hover:not(:disabled) { border-color: var(--text-3); } }
  .rail-btns button:disabled { opacity: .35; cursor: default; }
  .rail-btns .icon { width: 16px; height: 16px; }

  /* ---------- product card (home rail) ---------- */
  .pcard {
    position: relative; display: flex; flex-direction: column; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line-soft);
    overflow: hidden; color: var(--text); min-width: 0;
    transition: box-shadow .3s var(--ease-out), transform .3s var(--ease-out), border-color .3s var(--ease-out);
  }
  @media (hover: hover) { .pcard:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); border-color: transparent; color: var(--text); } }
  @media (hover: none) { .pcard:active { transform: scale(.98); } }
  .pcard .well { background: var(--bg-sunk); aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative; }
  .pcard .well img { width: 64%; filter: drop-shadow(0 12px 16px rgba(16, 24, 40, .14)); transition: transform .5s var(--ease-out); }
  @media (hover: hover) { .pcard:hover .well img { transform: scale(1.05); } }
  .pcard .body { padding: 14px 16px 16px; display: grid; gap: 4px; }
  .pcard h3 { font-size: var(--fs-md); font-weight: 700; line-height: 1.6; }
  .pcard .price { font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
  .pcard .price small { color: var(--text-3); font-weight: 400; font-size: .75rem; }
  /* the count line beside a price (render/qty-note.js): quiet text, in the same place on every card and the buy box */
  .qty-note { margin: 0; color: var(--text-2); font-size: var(--fs-cap); font-weight: 500; line-height: 1.5; white-space: normal; }

  .tag {
    display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 3px; font-size: .66rem; font-weight: 700; letter-spacing: 0;
    border: 1px solid currentColor; line-height: 1; white-space: nowrap;
  }
  .tag.in { color: var(--ok); }
  .well .tag { position: absolute; top: 12px; inset-inline-start: 12px; background: var(--surface); }

  /* ---------- guide card (guides.html and the «راهنمای خرید» bands): cover, title, lede, published date ---------- */
  .gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
  .gcard {
    display: flex; flex-direction: column; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line-soft);
    overflow: hidden; color: var(--text); min-width: 0;
    transition: transform var(--t-3) var(--ease-out), box-shadow var(--t-3) var(--ease-out), border-color var(--t-1) var(--ease-out);
  }
  @media (hover: hover) { .gcard:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); border-color: transparent; color: var(--text); } }
  @media (hover: none) { .gcard:active { transform: scale(.98); } }
  .gcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg-sunk); }
  .gcard .body { display: grid; gap: 6px; padding: 14px 16px 16px; }
  .gcard h3 { font-size: var(--fs-lg); line-height: 1.6; }
  .gcard p { color: var(--text-2); font-size: var(--fs-sm); }
  .gcard time { color: var(--text-3); font-size: var(--fs-cap); }

  /* ---------- bento cards ---------- */
  .bcard {
    position: relative; display: grid; align-content: space-between; gap: 18px; min-height: 260px; padding: 22px; border-radius: var(--r-3); background: var(--bg-sunk);
    overflow: hidden; transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
  }
  @media (hover: hover) { .bcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); } }
  @media (hover: none) { .bcard:active { transform: scale(.98); } }
  .bcard .icon { width: 34px; height: 34px; }
  .bcard h3 { font-size: var(--fs-xl); line-height: 1.45; }
  .bcard p { color: var(--text-2); font-size: var(--fs-sm); }
  .bcard .lede { max-width: 22em; margin-top: 6px; }
  /* the "+" sits at the inline end so it never covers the title */
  .bcard .plus {
    position: absolute; bottom: 16px; inset-inline-end: 16px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); cursor: pointer;
    display: grid; place-items: center; transition: transform var(--t-3) var(--ease), background-color var(--t-1);
  }
  @media (hover: hover) { .bcard .plus:hover { background: var(--blue); } }
  .bcard .plus .icon { width: 16px; height: 16px; }
  /* the detail layer wipes open from the "+"; closed, it is not focusable */
  .bcard .more {
    position: absolute; inset: 0; padding: 22px; background: var(--surface); display: grid; align-content: start; gap: 10px; visibility: hidden;
    clip-path: circle(0 at 32px calc(100% - 32px)); transition: clip-path .55s var(--ease), visibility 0s linear .55s;
  }
  .bcard.open .more { visibility: visible; clip-path: circle(150% at 32px calc(100% - 32px)); transition: clip-path .55s var(--ease), visibility 0s; }
  .bcard.open .plus { transform: rotate(45deg); z-index: 2; }
  .bcard .more p { color: var(--text-2); }
  .bcard .more .mt { font-weight: 700; font-size: var(--fs-xl); }
  .bcard .art { position: absolute; inset-inline-end: -4%; bottom: -8%; width: 58%; filter: drop-shadow(0 18px 24px rgba(16, 24, 40, .18)); transition: transform .5s var(--ease-out); }
  .bcard.big .art { width: 42%; }
  @media (hover: hover) { .bcard:hover .art { transform: translateY(-6px) rotate(-2deg); } }
  @media (max-width: 640px) {
    .bcard { min-height: 150px; gap: 10px; }
    .bcard.big { min-height: 220px; }
    .bcard .art { width: 34%; }
  }

  /* ---------- accordion (grid rows like ui.com) ---------- */
  .faq { max-width: 860px; margin-inline: auto; }
  .ask {
    display: flex; align-items: center; gap: 10px; padding: 6px; padding-inline-start: 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    box-shadow: var(--shadow-1); margin-bottom: 28px; transition: border-color var(--t-1), box-shadow var(--t-2);
  }
  .ask:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-bright) 22%, transparent); }
  .ask .icon { color: var(--blue); }
  .ask input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: max(16px, var(--fs-md)); color: var(--text); height: 40px; }   /* 16px: below it iOS Safari zooms the page on focus */
  .ask input::placeholder { color: var(--text-3); }
  .ask .btn { border-radius: 999px; }
  .acc { border-bottom: 1px solid var(--line); }
  .acc:first-of-type { border-top: 1px solid var(--line); }
  .acc > button {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 2px; border: 0; background: none; text-align: start;
    font-size: var(--fs-lg); font-weight: 600; cursor: pointer; color: var(--text);
  }
  .acc > button .pm { width: 20px; height: 20px; position: relative; flex-shrink: 0; }
  .acc > button .pm::before, .acc > button .pm::after { content: ""; position: absolute; top: 9px; left: 3px; width: 14px; height: 2px; border-radius: 1px; background: currentColor; transition: transform var(--t-3) var(--ease); }
  .acc > button .pm::after { transform: rotate(90deg); }
  .acc > button[aria-expanded="true"] .pm::after { transform: rotate(0deg); }
  /* collapsed answers are not focusable */
  .acc-body {
    display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden;
    transition: grid-template-rows var(--t-3) var(--ease), opacity .4s ease-in-out, visibility 0s linear var(--t-3);
  }
  .acc-body > div { overflow: hidden; }
  .acc-body p { padding: 0 2px 20px; color: var(--text-2); max-width: 48em; }
  .acc > button[aria-expanded="true"] + .acc-body {
    grid-template-rows: 1fr; opacity: 1; visibility: visible;
    transition: grid-template-rows var(--t-3) var(--ease), opacity .4s ease-in-out, visibility 0s;
  }

  /* ---------- comparison table (store dialog + security lineup) ---------- */
  .ctable-wrap { overflow-x: auto; }
  .ctable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
  .ctable th, .ctable td { padding: 14px 12px; border-bottom: 1px solid var(--line-soft); text-align: center; vertical-align: middle; }
  .ctable th[scope="row"] { text-align: start; font-weight: 600; white-space: nowrap; color: var(--text); }
  .ctable th[scope="row"] span { display: inline-flex; align-items: center; gap: 10px; }
  .ctable th[scope="row"] .icon { color: var(--text-3); }
  .ctable thead th { font-weight: 700; vertical-align: bottom; min-width: 170px; }
  .ctable thead img { width: 110px; margin: 0 auto 8px; filter: drop-shadow(0 10px 14px rgba(16, 24, 40, .14)); }
  .ctable thead a { color: var(--blue); }
  .ctable td.yes { color: var(--text); }
  .ctable td.no { color: var(--text-3); }
  .ctable td.diff { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--blue-soft) 40%, transparent); }

  /* ---------- footer ---------- */
  .foot { border-top: 1px solid var(--line-soft); background: var(--bg-sunk); color: var(--text-2); font-size: var(--fs-sm); }
  .foot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 28px; padding-block: 48px 32px; }
  .foot .fh { font-size: var(--fs-sm); color: var(--text); margin: 0 0 12px; font-weight: 700; }
  .foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .foot a { color: var(--text-2); }
  @media (hover: hover) { .foot a:hover { color: var(--blue); } }
  .foot a[href^="tel:"] { color: var(--text); font-weight: 600; }
  .foot .logo, .foot .logo:hover { color: var(--text); }
  .foot .about p { margin-top: 12px; max-width: 28em; line-height: 1.9; }
  .foot .nap { margin-top: 14px; display: grid; gap: 4px; }
  .foot-bottom { border-top: 1px solid var(--line); padding-block: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .78rem; color: var(--text-3); }
  /* eNamad's badge (once its code is set) replaces the trust text: its logo is 125×136, shown at half size */
  .foot-bottom .enamad { align-self: center; }
  .foot-bottom .enamad img { inline-size: 63px; block-size: auto; }
  /* plain-text social links (no fake logo badges) */
  .socials { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; }
  .socials a { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); transition: color var(--t-1); }
  @media (hover: hover) { .socials a:hover { color: var(--blue); } }
  @media (max-width: 1100px) {
    .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .foot .about { grid-column: 1 / -1; }
  }
  @media (max-width: 640px) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

  /* ---------- video: a 16:9 thumbnail linking to Aparat; ui.js puts Aparat's player in its place when tapped ---------- */
  .video-load, .video-frame {
    position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--r-3); overflow: hidden; background: var(--bg-sunk);
    box-shadow: var(--shadow-1); transition: box-shadow var(--t-2) var(--ease-out);
  }
  .video-frame { background: var(--night); }
  .video-load img { width: 100%; height: 100%; object-fit: contain; }
  .video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
  /* one line: a long title ends in an ellipsis (the link's name keeps all of it) */
  .video-play {
    position: absolute; inset-block-end: 16px; inset-inline-start: 16px; max-width: calc(100% - 32px);
    padding-block: 8px; padding-inline: 14px 16px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: var(--blue-fill); color: #fff; font-size: var(--fs-sm); font-weight: 700; line-height: 1.6; box-shadow: var(--shadow-2);
    transition: transform var(--t-2) var(--ease-spring);
  }
  .video-play .icon { width: 18px; height: 18px; margin-inline-end: 8px; vertical-align: -4px; }
  @media (hover: hover) { .video-load:hover { box-shadow: var(--shadow-2); } }
  /* only the badge moves, and not under reduced motion */
  @media (hover: hover) and (prefers-reduced-motion: no-preference) { .video-load:hover .video-play { transform: scale(1.06); } }
  @media (hover: none) and (prefers-reduced-motion: no-preference) { .video-load:active .video-play { transform: scale(.96); } }
  @media (max-width: 640px) { .video-play { inset-block-end: 10px; inset-inline-start: 10px; max-width: calc(100% - 20px); } }

  /* theme switch cross-fade (View Transitions API) */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease-standard); }

  /* ---------- cart panel: a modal <dialog> from the inline end, a bottom sheet on phones (ui.js fills it).
     Motion copies the store's filter sheet: in .38s --ease-emph, out .2s --ease-exit, the backdrop fading with
     --ease-enter / --ease-exit. The enter runs from @starting-style; overlay and display transition with allow-discrete,
     each declared once without them first for engines that don't know them. Under reduced motion the utilities' kill
     switch makes it instant. In RTL the inline end is the left edge; translateX has no logical form, hence [dir="ltr"]. */
  .cart {
    position: fixed; inset-block: 0; inset-inline: auto 0; margin: 0; padding: 0; border: 0;
    inline-size: 420px; max-inline-size: 100%; block-size: auto; max-block-size: none;
    flex-direction: column; overflow: hidden; background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
    transform: translateX(-100%);
    transition: transform .2s var(--ease-exit);
    transition: transform .2s var(--ease-exit), overlay .2s var(--ease-exit) allow-discrete, display .2s var(--ease-exit) allow-discrete;
  }
  .cart[open] {
    display: flex; transform: none;
    transition: transform .38s var(--ease-emph);
    transition: transform .38s var(--ease-emph), overlay .38s var(--ease-emph) allow-discrete, display .38s var(--ease-emph) allow-discrete;
  }
  @starting-style { .cart[open] { transform: translateX(-100%); } }
  [dir="ltr"] .cart { transform: translateX(100%); }
  [dir="ltr"] .cart[open] { transform: none; }
  @starting-style { [dir="ltr"] .cart[open] { transform: translateX(100%); } }
  .cart::backdrop {
    background: rgba(10, 12, 16, .45); opacity: 0;
    transition: opacity .2s var(--ease-exit);
    transition: opacity .2s var(--ease-exit), overlay .2s var(--ease-exit) allow-discrete, display .2s var(--ease-exit) allow-discrete;
  }
  .cart[open]::backdrop {
    opacity: 1;
    transition: opacity .3s var(--ease-enter);
    transition: opacity .3s var(--ease-enter), overlay .3s var(--ease-enter) allow-discrete, display .3s var(--ease-enter) allow-discrete;
  }
  @starting-style { .cart[open]::backdrop { opacity: 0; } }
  /* the kill switch's * doesn't reach ::backdrop */
  @media (prefers-reduced-motion: reduce) { .cart::backdrop, .cart[open]::backdrop { transition-duration: .01ms; } }
  .cart-head { display: flex; align-items: center; gap: 8px; padding-block: 14px 10px; padding-inline: 20px 12px; }
  .cart-head h2 { margin: 0; font-size: var(--fs-lg); }
  .cart-head .icon-btn { margin-inline-start: auto; }
  .cart-body { display: flex; flex-direction: column; flex: 1; min-block-size: 0; }
  .cart .added {
    display: flex; align-items: center; gap: 8px; margin: 0 20px 4px; padding: 10px 12px; border-radius: var(--r-2);
    background: var(--ok-soft); color: var(--ok); font-size: var(--fs-sm); font-weight: 600;
  }
  .cart .added .icon { width: 16px; height: 16px; flex-shrink: 0; }
  .cart-notes { display: grid; gap: 8px; margin: 4px 20px; }
  .cart-notes:empty { display: none; }
  /* a price that moved, a line that left, a refused quote: the amber notice the checkout shares (main.checkout) */
  :is(.cart, .checkout) .changed {
    display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-2);
    background: var(--warn-soft); color: var(--warn); font-size: var(--fs-cap); font-weight: 600;
  }
  :is(.cart, .checkout) .changed a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
  :is(.cart, .checkout) .changed .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
  .cart .lines { flex: 1; min-block-size: 0; list-style: none; margin: 0; padding: 0 20px; overflow-y: auto; overscroll-behavior: contain; }
  .cart .line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line-soft); }
  .cart .lines > li:last-child { border-bottom: 0; }
  /* the thumbnail well, shared with the checkout's summary (.co-sum), which sizes it down */
  :is(.cart, .co-sum) .thumb { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-2); background: var(--bg-sunk); }
  :is(.cart, .co-sum) .thumb img { width: 60px; height: 60px; object-fit: contain; }
  .cart .name { display: block; font-size: var(--fs-md); font-weight: 600; color: var(--text); text-wrap: pretty; }
  .cart .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: var(--fs-cap); color: var(--text-3); }
  .cart .meta .sku { font-family: var(--mono); }
  .cart .meta .ok { color: var(--ok); font-weight: 600; }
  /* the bottom row wraps, so at 320px the price drops under the stepper */
  .cart .bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
  .cart .lp { margin-inline-start: auto; text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
  .cart .lp small { font-size: var(--fs-cap); font-weight: 500; color: var(--text-3); }
  .offer-tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-1); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-cap); font-weight: 600; }
  .offer-tag.sale { background: var(--red-fill); color: var(--on-fill); }
  .offer-box { border: 1px solid var(--line); border-radius: var(--r-2); padding: 12px 16px; display: grid; gap: 6px; margin-block-start: 12px; }
  .offer-box p { margin: 0; }
  .offer-head { font-weight: 600; }
  .offer-ends, .offer-terms, .offer-sum { color: var(--text-2); font-size: .875rem; }
  .offer-over[hidden] { display: none; }
  /* past the end (ui.js, by the server's time): an element carrying the end is hidden; a box with a count keeps its title
     and shows its closing note, without the tag or the saving; a discounted price shows the regular price, no longer struck,
     as the price, and the campaign price goes (LAUNCH-05) */
  [data-offer-ends][hidden], [data-offer].is-over .offer-tag, [data-offer].is-over .offer-save, [data-offer-price].is-over .now { display: none; }
  [data-offer-price].is-over .was { color: inherit; font-weight: inherit; text-decoration: none; margin-inline-end: 0; }
  /* the announcement strip: one line above every header; the wrap lets a long text fall onto more lines (320px) */
  .offer-strip { background: var(--night); color: var(--night-text); font-size: var(--fs-sm); padding-block: 6px; text-align: center; }
  .offer-strip a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
  /* the home feature: one card (copy, and the photo when there is one), then the other offers as links */
  .offer-feature-card { display: grid; gap: 20px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); padding: clamp(20px, 3vw, 36px); }
  @media (min-width: 640px) { .offer-feature-card.has-photo { grid-template-columns: minmax(0, 1fr) minmax(0, 240px); } }
  .offer-feature-copy { display: grid; justify-items: start; gap: 10px; }
  .offer-feature-copy h2 { font-size: var(--fs-h2); }
  .offer-feature-copy p { margin: 0; }
  .offer-photo { width: 100%; max-width: 240px; height: auto; justify-self: center; }
  .offer-all { font-size: var(--fs-sm); }
  .offer-more { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 14px 0 0; color: var(--text-2); font-size: var(--fs-sm); }
  /* the offers page: a grid of cards per kind, the first one across both columns on wide screens */
  .offer-grid { display: grid; gap: 16px; }
  @media (min-width: 960px) { .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .offer-card.lead { grid-column: 1 / -1; } }
  .offer-card { display: grid; align-content: start; justify-items: start; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); padding: clamp(18px, 2.5vw, 28px); scroll-margin-block-start: 88px; }
  .offer-card p { margin: 0; }
  .offer-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .offer-card h3 { font-size: var(--fs-xl); }
  .offer-card .offer-photo { justify-self: start; max-width: 200px; }
  .offer-body { display: grid; gap: 8px; }
  .offer-products { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); gap: 10px; align-self: stretch; width: 100%; }
  .offer-product { display: grid; justify-items: center; align-content: start; gap: 4px; height: 100%; padding: 10px 8px; text-align: center; border: 1px solid var(--line-soft); border-radius: var(--r-2); color: inherit; }
  .offer-product img { width: 88px; height: auto; }
  .offer-product .n { font-size: var(--fs-sm); font-weight: 600; line-height: 1.6; text-wrap: pretty; }
  .offer-product .price { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
  .offer-product .price small { color: var(--text-3); font-weight: 400; }
  .offers-empty { margin: 0; text-align: center; color: var(--text-2); font-size: var(--fs-lg); }
  .was { color: var(--text-2); text-decoration-thickness: 1px; margin-inline-end: 6px; font-weight: 400; }
  .cart .each { display: block; font-size: var(--fs-cap); font-weight: 500; color: var(--text-3); }
  .cart .limit { flex-basis: 100%; margin: 0; font-size: var(--fs-cap); color: var(--text-2); }
  /* the stepper: at 1 the minus removes; the same hover and press as .icon-btn */
  .qty { display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--surface); }
  .qty button {
    display: grid; place-items: center; width: 40px; height: 38px; border: 0; border-radius: var(--r-2); background: none; color: var(--text); cursor: pointer;
    transition: background-color var(--t-1) ease-in-out, transform .15s var(--ease-out);
  }
  @media (hover: hover) { .qty button:not([aria-disabled="true"]):hover { background: var(--bg-sunk); } }
  .qty button:not([aria-disabled="true"]):active { transform: scale(.98); }
  .qty button[aria-disabled="true"] { color: var(--text-3); cursor: not-allowed; opacity: .55; }
  .qty button .icon { width: 16px; height: 16px; }
  .qty button.rm { color: var(--danger-text); }
  .qty output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
  /* the undo row takes the removed line's place until the panel closes */
  .cart .undo {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-block: 12px; padding: 12px 14px;
    border-radius: var(--r-2); background: var(--bg-sunk); color: var(--text-2); font-size: var(--fs-sm);
  }
  .cart .undo button { padding: 8px 6px; border: 0; border-radius: var(--r-1); background: none; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; }
  .cart-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line-soft); background: var(--surface); }
  /* the totals, the same three rows and the total in the panel and in the checkout's summary */
  :is(.cart, .co-sum) .sum { display: grid; gap: 6px; margin: 0 0 14px; font-size: var(--fs-sm); }
  :is(.cart, .co-sum) .sum div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
  :is(.cart, .co-sum) .sum dt { color: var(--text-2); }
  :is(.cart, .co-sum) .sum dt small { display: block; font-size: var(--fs-cap); color: var(--text-3); }
  :is(.cart, .co-sum) .sum dd { margin: 0; font-variant-numeric: tabular-nums; }
  :is(.cart, .co-sum) .sum .total { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: var(--fs-lg); font-weight: 800; }
  :is(.cart, .co-sum) .sum .total dt { color: var(--text); }
  .cart-foot .btn { width: 100%; }
  .cart-closed, .cart-ceiling { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-2); }
  .cart-closed { margin: 0; }
  .cart .secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: var(--fs-cap); color: var(--text-3); }
  .cart .secure .icon { width: 14px; height: 14px; }
  .cart .empty { display: grid; justify-items: center; gap: 8px; padding: 40px 24px 48px; text-align: center; }
  :is(.cart, .co-empty) .ring { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; background: var(--bg-sunk); color: var(--text-3); }
  :is(.cart, .co-empty) .ring .icon { width: 28px; height: 28px; }
  .cart .empty b { font-size: var(--fs-lg); }
  .cart .empty p { max-width: 32ch; margin: 0 0 12px; font-size: var(--fs-sm); color: var(--text-2); }
  .cart-offline { margin: 0; padding: 14px 20px 20px; border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--text-2); }
  .cart-offline:not([hidden]) { display: flex; flex-wrap: wrap; gap: 10px; }
  .cart-offline .btn { flex: 1 1 160px; }
  /* phones: the same panel as a bottom sheet, sized like the store's filter sheet; its page doesn't scroll behind it */
  @media (max-width: 640px) {
    .cart, [dir="ltr"] .cart {
      inset-block-start: auto; inset-inline: 0; inline-size: auto; max-block-size: min(86dvh, 720px);
      border-radius: var(--r-3) var(--r-3) 0 0; transform: translateY(100%);
    }
    .cart[open], [dir="ltr"] .cart[open] { transform: none; }
    @starting-style { .cart[open], [dir="ltr"] .cart[open] { transform: translateY(100%); } }
    .cart-head { position: relative; padding-block-start: 22px; }
    .cart-head::before { content: ""; position: absolute; top: 8px; inset-inline: 0; width: 36px; height: 4px; margin-inline: auto; border-radius: 2px; background: var(--line); }
    .cart .lines { padding-inline: 16px; }
    .cart .added, .cart-notes { margin-inline: 16px; }
    .cart-foot { padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
    .cart-offline { padding-inline: 16px; padding-block-end: calc(18px + env(safe-area-inset-bottom, 0px)); }
    :root:has(.cart[open]) { overflow: hidden; }
  }
  /* short screens (a landscape phone, a laptop at 200% zoom): the whole panel scrolls as one column, so the lines never collapse */
  @media (max-height: 700px) {
    .cart { overflow-y: auto; overscroll-behavior: contain; }
    .cart-body { flex: none; }
    .cart .lines { flex: none; overflow: visible; }
  }
}

/* =====================================================================
   SCENES — mock-up UI inside the laptop, monitor and phone frames.
   Loops run only while the frame carries .playing (ui.js, ≥50% visible).
   ===================================================================== */
@layer scenes {
  /* ---------- device frames ---------- */
  .laptop { position: relative; max-width: 1040px; margin-inline: auto; }
  .laptop .bezel { background: #0e1013; border-radius: 18px 18px 6px 6px; padding: 12px 12px 14px; box-shadow: var(--shadow-3); }
  .laptop .base { height: 16px; margin-inline: -4%; background: linear-gradient(#d9dce0, #b9bdc3); border-radius: 0 0 18px 18px; position: relative; }
  .laptop .base::before { content: ""; position: absolute; top: 0; left: 50%; width: 14%; height: 6px; transform: translateX(-50%); background: #a6abb2; border-radius: 0 0 8px 8px; }
  :root[data-theme="dark"] .laptop .base { background: linear-gradient(#3a3e44, #24272b); }
  .screen { aspect-ratio: 16 / 9.6; border-radius: 6px; overflow: hidden; background: var(--bg); position: relative; }
  .phone {
    position: absolute; width: clamp(130px, 18%, 190px); aspect-ratio: 9 / 19; inset-inline-start: -2%; bottom: 6%; z-index: 3;
    background: #0e1013; border-radius: 28px; padding: 7px; box-shadow: var(--shadow-3);
  }
  .phone .ph { width: 100%; height: 100%; border-radius: 22px; overflow: hidden; background: var(--bg-sunk); position: relative; display: flex; flex-direction: column; }
  .phone .notch { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 34%; height: 14px; border-radius: 10px; background: #0e1013; z-index: 2; }
  .monitor { max-width: 1080px; margin-inline: auto; }
  .monitor .bezel { background: #0e1013; border-radius: 14px; padding: 12px; box-shadow: var(--shadow-3); }
  .monitor .stand { width: 18%; height: 70px; margin: 0 auto; background: linear-gradient(90deg, #b8bcc2, #e3e6e9 50%, #b8bcc2); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
  .monitor .foot-plate { width: 30%; height: 10px; margin: 0 auto; border-radius: 6px 6px 2px 2px; background: linear-gradient(#d8dbdf, #a9aeb4); }
  :root[data-theme="dark"] .monitor .stand, :root[data-theme="dark"] .monitor .foot-plate { background: linear-gradient(90deg, #2b2e33, #44484e 50%, #2b2e33); }
  :root[data-theme="dark"] .laptop .bezel, :root[data-theme="dark"] .monitor .bezel, :root[data-theme="dark"] .phone { box-shadow: var(--shadow-3), 0 0 0 1px rgba(255, 255, 255, .08); }
  @media (max-width: 640px) {
    .phone { display: none; }
    .screen { aspect-ratio: 4 / 3.6; }
  }

  /* ---------- app chrome inside the screen ---------- */
  .app { display: grid; grid-template-columns: 44px minmax(0, 1fr); height: 100%; font-size: 11px; line-height: 1.5; color: var(--text); background: var(--bg); }
  .app-side { background: var(--bg-sunk); border-inline-end: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 12px; color: var(--text-3); }
  .app-side i { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid currentColor; opacity: .7; }
  .app-side i.on { color: var(--blue-bright); opacity: 1; background: var(--blue-soft); }
  .app-main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; }
  .app-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
  .app-top b { font-size: 12px; }
  .app-top .chip { margin-inline-start: auto; }
  .chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; background: var(--bg-sunk-2); color: var(--text-2); font-size: 10.5px; white-space: nowrap; }
  .chip.blue { background: var(--blue-soft); color: var(--blue-hover); }   /* 5.6:1 light, 5.5:1 dark (--blue is 4.49 at this size) */
  .chip.ok::before, .chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok-dot); }
  .chip.live::before { background: var(--red); animation: blink 1.6s steps(2, start) infinite; }
  @keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }
  .stage { position: relative; min-height: 0; padding: 10px; overflow: hidden; }
  .box { border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px; background: var(--surface); min-width: 0; }
  .box .bt { margin: 0 0 6px; font-size: 10.5px; color: var(--text-3); font-weight: 600; }
  @media (max-width: 640px) { .app { grid-template-columns: 32px minmax(0, 1fr); } }

  /* ---------- camera feeds ---------- */
  .feeds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; height: 100%; align-content: start; }
  .feed { position: relative; aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; color: #7fa2b8;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 40%, #1f3442 0%, #0f1a22 75%); }
  .feeds .feed { aspect-ratio: auto; }
  .feed svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .feed .lbl { position: absolute; top: 4px; right: 6px; color: #fff; font-size: 10.5px; text-shadow: 0 1px 2px #000; }
  .feed .ts { position: absolute; bottom: 3px; left: 6px; color: #c8d4dc; font: 8px var(--mono); direction: ltr; }
  @media (max-width: 640px) {
    .feeds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feeds .feed:nth-child(n + 5) { display: none; }
  }

  /* detection box: tracks the walker / tags the car once it stops */
  .det { position: absolute; border: 1.5px solid var(--blue-bright); border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), 0 0 12px var(--blue-glow); opacity: 0; }
  .det span { position: absolute; top: -14px; right: -1.5px; background: var(--blue-bright); color: #fff; font-size: 8px; padding: 0 4px; border-radius: 2px; white-space: nowrap; line-height: 13px; }

  /* a person crosses the frame */
  .walker { position: absolute; bottom: 8%; left: 0; width: 8%; height: 44%; color: #a9c4d4; opacity: 0; }
  .walker svg { width: 100%; height: 100%; fill: currentColor; opacity: .75; }
  .walker .det { inset: -10% -45%; }
  .playing .walker { animation: walk var(--dur, 10s) linear infinite; animation-delay: var(--wd, 0s); }
  .playing .walker .det { animation: detOn var(--dur, 10s) linear infinite; animation-delay: var(--wd, 0s); }
  @keyframes walk { 0% { transform: translateX(-140%); opacity: 0; } 5% { opacity: 1; } 93% { opacity: 1; } 100% { transform: translateX(1240%); opacity: 0; } }
  @keyframes detOn { 0%, 12% { opacity: 0; transform: scale(1.15); } 16% { opacity: 1; transform: none; } 90% { opacity: 1; } 96%, 100% { opacity: 0; } }

  /* a car pulls in and parks */
  .car { position: absolute; left: 28%; top: 60%; width: 24%; height: 24%; color: #a9c4d4; opacity: 0; }
  .car svg { width: 100%; height: 100%; fill: currentColor; opacity: .7; }
  .car .det { inset: -18% -8%; }
  .playing .car { animation: park 9s infinite; }
  .playing .car .det { animation: carDet 9s infinite; }
  @keyframes park {
    0% { transform: translateX(260%); opacity: 0; animation-timing-function: cubic-bezier(.05, .7, .1, 1); }
    4% { opacity: 1; }
    34% { transform: none; opacity: 1; animation-timing-function: linear; }
    90% { transform: none; opacity: 1; }
    100% { transform: none; opacity: 0; }
  }
  @keyframes carDet { 0%, 35% { opacity: 0; transform: scale(1.12); } 39% { opacity: 1; transform: none; } 88% { opacity: 1; } 92%, 100% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) {
    .walker, .car { opacity: 1; animation: none !important; }
    .walker { left: 58%; }
  }

  /* ---------- phone: alerts stack in from the top (ui.js pushNote) ---------- */
  .notes { display: grid; gap: 6px; padding: 26px 8px 8px; font-size: 9px; }
  .note { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; align-items: center; background: var(--surface); border-radius: 10px; padding: 6px; box-shadow: var(--shadow-1); }
  .note i { width: 22px; height: 22px; border-radius: 6px; background: var(--blue-soft); display: grid; place-items: center; color: var(--blue); font-style: normal; font-weight: 800; font-size: 10px; }
  .note i .icon { width: 13px; height: 13px; }
  .note b { display: block; font-size: 10.5px; }
  .note small { color: var(--text-3); font-size: 10px; }
  .notes .note { transition: opacity .45s var(--ease-enter), transform .6s var(--ease-spring); }
  .notes .note.arriving { opacity: 0; transform: translateY(-16px) scale(.96); }
  .notes .note.leaving { opacity: 0; transform: translateY(8px) scale(.95); transition-duration: .3s; }

  /* ---------- alarm panel: zones arm one after another, one sweep, then still ---------- */
  .alarm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; height: 100%; }
  .zone { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
  .zone:last-child { border-bottom: 0; }
  .tog { width: 22px; height: 12px; border-radius: 6px; background: var(--line); position: relative; flex-shrink: 0; }
  .tog::after { content: ""; position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; transition: transform .45s var(--ease-spring); }
  .tog.on { background: var(--blue-bright); }
  .tog.on::after { transform: translateX(-10px); }
  .playing .zone .tog.on { animation: armBg .35s var(--ease-standard) both; animation-delay: calc(var(--i, 0) * .32s + .3s); }
  .playing .zone .tog.on::after { animation: armKnob .5s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * .32s + .3s); }
  @keyframes armBg { from { background: var(--line); } to { background: var(--blue-bright); } }
  @keyframes armKnob { from { transform: none; } to { transform: translateX(-10px); } }
  .armed { display: grid; place-items: center; gap: 8px; text-align: center; height: 100%; }
  .armed b { font-size: 12px; }
  .playing .armed > div:last-child { animation: fadeUp .5s var(--ease-enter) 1.7s both; }
  .arm { width: 46%; aspect-ratio: 1; position: relative; display: grid; place-items: center; }
  .arm svg.ringsvg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
  .arm .trk { fill: none; stroke: var(--line-soft); stroke-width: 6; }
  .arm .arc { fill: none; stroke: var(--blue-bright); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 277; stroke-dashoffset: 277; }
  /* sweeps once, then turns amber when the door event arrives */
  .playing .arm .arc { animation: armSweep .9s cubic-bezier(.2, 0, 0, 1) 1.5s forwards, armAlert .5s var(--ease-standard) 3.3s forwards; }
  @keyframes armSweep { to { stroke-dashoffset: 0; } }
  @keyframes armAlert { to { stroke: #f2a516; } }
  .arm .lock { width: 40%; height: 40%; color: var(--blue); }
  .log { display: grid; gap: 5px; }
  .log div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 6px; border-radius: 4px; background: var(--bg-sunk); font-size: 10px; }
  .log div.hot { background: var(--warn-soft); color: var(--warn); }
  .playing .log div { animation: logIn .5s var(--ease-enter) both; animation-delay: var(--t, calc(var(--i) * .25s)); }
  @keyframes logIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
  /* event rows with thumbnails (security alerts) */
  .log.thumbs div { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px; }
  .log.thumbs svg.th { width: 54px; height: 34px; border-radius: 3px; color: #7fa2b8; background: radial-gradient(ellipse at 50% 40%, #1f3442, #0f1a22); }
  .log.thumbs b { display: block; font-size: 10px; }
  .log.thumbs small { color: var(--text-3); font-size: 9px; }
  .log.thumbs div.hot small { color: inherit; }
  @media (max-width: 960px) {
    .alarm { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .alarm .box:last-child { display: none; }
  }
  @media (max-width: 640px) {
    .alarm { grid-template-columns: minmax(0, 1fr); }
    .alarm .box:first-child { display: none; }
  }

  /* ---------- topology flow (the ui.com "particles along lines" effect) ---------- */
  .topo { width: 100%; height: 100%; }
  .topo .glow { fill: none; stroke: color-mix(in srgb, var(--blue-bright) 12%, transparent); stroke-width: 9; }
  .topo .wire { fill: none; stroke: color-mix(in srgb, var(--blue-bright) 35%, var(--line)); stroke-width: 1.4; }
  .topo .wire-label { font: 10px var(--font); fill: var(--text-3); }
  .topo .flow { fill: none; stroke: var(--blue-bright); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0 9; stroke-dashoffset: 180; }
  /* one accent: blue + neutrals (backup power = dashed neutral) */
  .topo .flow.alt { stroke-dasharray: 2 7; stroke: var(--text-3); }
  .playing .topo .flow { animation: flow 4.3s linear infinite; }
  .playing .topo .flow.rev { animation-direction: reverse; }
  @keyframes flow { to { stroke-dashoffset: 0; } }
  .topo .node rect { fill: var(--surface); stroke: var(--line); }
  .topo .node text { fill: var(--text); font: 600 11px var(--font); }
  .topo .node .t2 { fill: var(--text-3); font: 400 9.5px var(--font); }
  .topo .pulse { fill: var(--blue-bright); opacity: .25; transform-box: fill-box; transform-origin: center; }
  .playing .topo .pulse { animation: pulse 2.4s var(--ease-out) infinite; }
  @keyframes pulse { from { opacity: .45; transform: scale(.6); } to { opacity: 0; transform: scale(1.8); } }
  .topo .pkt { fill: var(--blue-bright); filter: drop-shadow(0 0 4px var(--blue-glow)); }
  .topo .pkt.alt { fill: var(--text-3); }

  /* ---------- power gauge ---------- */
  .power { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; height: 100%; align-items: stretch; }
  .gauge { display: grid; place-items: center; text-align: center; }
  .gauge svg { width: 62%; }
  .gauge .track { fill: none; stroke: var(--line-soft); stroke-width: 10; }
  .gauge .val { fill: none; stroke: var(--blue-bright); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 302; stroke-dashoffset: 302; transform: rotate(-90deg); transform-origin: center; }
  .playing .gauge .val { animation: fill 2.2s var(--ease) forwards; }
  @keyframes fill { to { stroke-dashoffset: 66; } }
  .gauge b { font-size: 20px; display: block; line-height: 1; }
  @media (max-width: 640px) {
    .power { grid-template-columns: minmax(0, 1fr); }
    .power .box:not(.gauge) { display: none; }
  }

  /* ---------- security: alerts (feeds + event log) ---------- */
  .alerts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; height: 100%; }
  .alerts .feeds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (max-width: 640px) {
    .alerts { grid-template-columns: minmax(0, 1fr); }
    .alerts .box { display: none; }
  }

  /* ---------- security: night-vision compare slider ---------- */
  .nv { position: relative; height: 100%; border-radius: 6px; overflow: hidden; background: #0b1016; --pos: 50%; }
  .nv .layer { position: absolute; inset: 0; }
  .nv .layer svg { width: 100%; height: 100%; }
  .nv .ir { filter: grayscale(1) contrast(1.1) brightness(1.15); }
  .nv .color { clip-path: inset(0 0 0 var(--pos)); }
  .nv .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; background: #fff; transform: translateX(-1px); box-shadow: 0 0 12px rgba(0, 0, 0, .6); pointer-events: none; }
  .nv .handle::after {
    content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; box-shadow: var(--shadow-2);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7l-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 16px no-repeat;
  }
  .nv input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
  .nv .cap { position: absolute; bottom: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; }
  .nv .cap.l { left: 8px; }
  .nv .cap.r { right: 8px; }

  /* ---------- security: solar camera at dusk (the cropped photo blends into the dark) ---------- */
  .solar {
    position: relative; height: 100%; border-radius: 6px; overflow: hidden;
    background: radial-gradient(50% 40% at 16% 95%, rgba(255, 160, 60, .26), transparent 70%), linear-gradient(#081019, #020304 70%);
  }
  .solar .sun {
    position: absolute; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #ffd27a, #ff9f2e 60%, transparent 62%);
    box-shadow: 0 0 36px 10px rgba(255, 150, 40, .35); offset-path: path("M 30 190 Q 150 90 300 150"); offset-distance: 30%;
  }
  .playing .solar .sun { animation: sunArc 9s var(--ease) infinite alternate; }
  @keyframes sunArc { from { offset-distance: 12%; } to { offset-distance: 88%; } }
  .solar .bars { display: flex; align-items: end; gap: 2px; height: 14px; }
  .solar .bars i { width: 3px; background: var(--ok-dot); border-radius: 1px; }
  .solar .bars i:nth-child(1) { height: 30%; }
  .solar .bars i:nth-child(2) { height: 55%; }
  .solar .bars i:nth-child(3) { height: 80%; }
  .solar .bars i:nth-child(4) { height: 100%; opacity: .35; }
  .playing .solar .bars i:nth-child(4) { animation: sig 2.4s steps(2, end) infinite; }
  @keyframes sig { 50% { opacity: 1; } }
  .solar .panel-card { position: absolute; top: 12px; inset-inline-end: 12px; background: var(--surface); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow-2); display: grid; gap: 4px; font-size: 10px; min-width: 150px; }
  .solar .sig { display: flex; align-items: center; gap: 6px; }
  .solar-cam {
    position: absolute; inset-inline-start: 4%; bottom: 0; width: 58%;
    -webkit-mask-image: linear-gradient(to left, transparent, #000 16%, #000 88%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 80%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to left, transparent, #000 16%, #000 88%, transparent), linear-gradient(to bottom, transparent, #000 14%, #000 80%, transparent);
    mask-composite: intersect;
  }
  @media (max-width: 640px) {
    .solar-cam { width: 74%; }
    .solar .panel-card { min-width: 0; }
  }

  /* ---------- security: "view on mobile" ---------- */
  .mobile-demo { display: grid; grid-template-columns: auto minmax(0, 320px); justify-content: center; gap: 36px; align-items: center; height: 100%; padding: 2px 10px; }
  .mphone { height: 100%; aspect-ratio: 9 / 18.5; background: #0e1013; border-radius: 22px; padding: 6px; box-shadow: var(--shadow-2); }
  .mscreen { height: 100%; border-radius: 17px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; overflow: hidden; font-size: 9px; }
  .mtop { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px 0; }
  .mtop b { font-size: 10px; }
  .mscreen .feed { aspect-ratio: 16 / 11; border-radius: 0; flex-shrink: 0; }
  .mscreen .feed .walker { width: 9%; }
  .mtl { position: relative; height: 20px; margin: 4px 8px 0; border-radius: 4px; background: var(--bg-sunk-2); overflow: hidden; direction: ltr; }
  .mtl .mk { position: absolute; top: 4px; bottom: 4px; left: var(--x); width: 7%; border-radius: 2px; background: color-mix(in srgb, var(--blue-bright) 40%, transparent); }
  .mtl .mk.hot { background: rgba(242, 165, 22, .6); }
  .mtl .fillx { position: absolute; inset: 0; background: color-mix(in srgb, var(--blue-bright) 14%, transparent); transform-origin: 0 50%; transform: scaleX(0); }
  .playing .mtl .fillx { animation: fillx 9s linear infinite; }
  @keyframes fillx { to { transform: scaleX(1); } }
  .mtimes { display: flex; justify-content: space-between; padding: 0 8px; color: var(--text-3); font: 8px var(--mono); }
  .mbtns { display: flex; gap: 5px; padding: 2px 8px 10px; margin-top: auto; }
  .mbtns span { flex: 1; text-align: center; padding: 5px 0; border-radius: 7px; background: var(--bg-sunk); color: var(--text-2); }
  .mfeatures { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 12px; color: var(--text-2); max-width: 34em; }
  .mfeatures li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
  .mfeatures .icon { width: 20px; height: 20px; color: var(--blue); }
  .mfeatures b { display: block; color: var(--text); font-size: 13px; }
  @media (max-width: 640px) {
    .mobile-demo { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .mfeatures { display: none; }
  }

  @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes floatIn { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }
  @keyframes chipIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
  @keyframes rise { from { opacity: 0; translate: 0 32px; } to { opacity: 1; translate: 0 0; } }
}

/* =====================================================================
   PAGES
   ===================================================================== */
@layer pages {
  /* ---------- home: hero ---------- */
  .hero { position: relative; overflow: hidden; padding-block: clamp(36px, 5vw, 64px) 0; background:
    radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--blue-soft) 80%, transparent) 0%, transparent 70%), var(--bg); }
  .hero > .wrap { position: relative; z-index: 1; }
  .hero h1 { font-size: var(--fs-h1); text-align: center; max-width: 18em; margin-inline: auto; }
  .hero .sub { text-align: center; color: var(--text-2); font-size: var(--fs-lg); margin: 12px auto 0; max-width: 38em; }
  .hero .pills { margin-top: 24px; }
  .hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
  .showcase { position: relative; z-index: 1; margin-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(40px, 6vw, 72px); }
  .showcase-note { text-align: center; font-size: .75rem; color: var(--text-3); margin-top: 12px; }
  /* first-load entrance: the LCP text stays static, only the actions and devices move */
  .js .hero .hero-actions { animation: fadeUp .6s var(--ease-enter) .12s both; }
  .js .hero .laptop { animation: rise .9s var(--ease-emph) .12s both; }
  .js .hero .phone { animation: rise .9s var(--ease-emph) .34s both; }
  @media (prefers-reduced-motion: reduce) {
    .js .hero .hero-actions, .js .hero .laptop, .js .hero .phone { animation: none; }
  }

  /* ---------- home: product family tiles (core business gets the wide tiles) ---------- */
  .family { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .fam {
    position: relative; display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 22px 22px 0; border-radius: var(--r-3); background: var(--bg-sunk);
    color: var(--text); overflow: hidden; min-height: 260px; isolation: isolate;
    transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), background-color var(--t-1);
  }
  .fam.wide { grid-column: span 2; min-height: 320px; }
  @media (hover: hover) { .fam:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); color: var(--text); background: var(--surface); } }
  @media (hover: none) { .fam:active { transform: scale(.98); } }
  .fam h3 { font-size: var(--fs-xl); }
  .fam:not(.wide) h3 { font-size: var(--fs-lg); }
  .fam p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }
  .fam .count { font-size: .75rem; color: var(--text-3); }
  .fam .shots { position: relative; align-self: end; height: 170px; }
  .fam:not(.wide) .shots { height: 130px; }
  .fam .shots img { position: absolute; bottom: -6px; width: 46%; filter: drop-shadow(0 14px 18px rgba(16, 24, 40, .16)); transition: transform .5s var(--ease-out); }
  .fam .shots img:nth-child(1) { inset-inline-start: 6%; z-index: 2; }
  .fam .shots img:nth-child(2) { inset-inline-start: 38%; bottom: 14px; width: 40%; z-index: 1; }
  .fam .shots img:nth-child(3) { inset-inline-end: -4%; bottom: 0; width: 34%; }
  @media (hover: hover) { .fam:hover .shots img:nth-child(1) { transform: translateY(-6px) scale(1.03); } }
  @media (hover: hover) { .fam:hover .shots img:nth-child(2) { transform: translateY(-10px); } }
  @media (hover: hover) { .fam:hover .shots img:nth-child(3) { transform: translateY(-4px); } }
  .fam .go { position: absolute; top: 20px; inset-inline-end: 20px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--blue); box-shadow: var(--shadow-1); transition: transform var(--t-2) var(--ease); }
  @media (hover: hover) { .fam:hover .go { transform: translateX(-3px); } }
  .fam .go .icon { width: 16px; height: 16px; }
  .js .family .fam:nth-child(3n + 2) { --d: .07s; }
  .js .family .fam:nth-child(3n) { --d: .14s; }
  @media (max-width: 1100px) { .family { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 640px) {
    .family { gap: 10px; }
    .fam { min-height: 200px; padding: 14px 14px 0; }
    .fam.wide { min-height: 230px; padding: 18px 18px 0; }
    .fam.wide .shots { height: 130px; }
    .fam:not(.wide) .shots { height: 100px; }
    .fam:not(.wide) p { display: none; }
    .fam:not(.wide) .shots img:nth-child(n + 2) { display: none; }
    .fam:not(.wide) .shots img:nth-child(1) { width: 70%; inset-inline-start: 15%; }
    .fam .go { display: none; }
  }

  /* ---------- home: process tabs (principle panels) ---------- */
  .steps > .pills { margin-bottom: 24px; }
  .principle { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 56px); align-items: center;
    background: var(--bg-sunk); border-radius: var(--r-3); padding: clamp(24px, 4vw, 48px); min-height: 420px; overflow: hidden; }
  .principle h3 { font-size: clamp(1.35rem, 1rem + 1vw, 1.75rem); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .principle ul { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; gap: 16px; }
  .principle li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; color: var(--text-2); }
  .principle li .icon { width: 24px; height: 24px; color: var(--text); }
  /* collage positions are per-image art direction, set inline */
  .collage { position: relative; height: 340px; }
  .collage img { position: absolute; filter: drop-shadow(0 18px 28px rgba(16, 24, 40, .18)); }
  .enter .collage img { animation: floatIn .9s var(--ease-enter) both; }
  .enter .collage img:nth-child(2) { animation-delay: .08s; }
  .enter .collage img:nth-child(3) { animation-delay: .16s; }
  .enter .collage img:nth-child(4) { animation-delay: .24s; }
  @media (max-width: 960px) {
    .principle { grid-template-columns: minmax(0, 1fr); }
    .collage { height: 260px; }
  }

  /* ---------- home: topology section (vertical steps on phones) ---------- */
  .eco { position: relative; border-radius: var(--r-3); overflow: hidden; background: var(--night); color: var(--night-text); padding: clamp(28px, 4vw, 56px); }
  .eco .head p { color: var(--night-text-2); }
  .eco .topo .node rect { fill: #161a1f; stroke: rgba(255, 255, 255, .14); }
  /* the diagram scales with its 1100-wide viewBox and is shown only above 1100px, so these sizes render at 11–13 and 10–12px */
  .eco .topo .node text { fill: #f4f5f6; font-size: 13px; }
  .eco .topo .node .t2 { fill: #9aa3ad; font-size: 12px; }
  .eco .topo .wire { stroke: rgba(120, 170, 255, .28); }
  .eco .topo .flow.alt { stroke: #8c939c; }
  .eco .topo .pkt { fill: #9ec5ff; }
  .eco .topo .pkt.alt { fill: #8c939c; }
  .eco-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-top: 16px; font-size: var(--fs-cap); color: var(--night-text-2); }
  .eco-legend span { display: inline-flex; align-items: center; gap: 8px; }
  .eco-legend i { width: 18px; height: 2px; background: var(--blue-bright); border-radius: 2px; }
  .eco-legend i.alt { background: repeating-linear-gradient(90deg, #8c939c 0 4px, transparent 4px 8px); }
  .eco-steps { display: none; }
  /* below 1100px the diagram's labels would shrink under 11px, so the steps stand in for it */
  @media (max-width: 1100px) {
    .eco svg.topo { display: none; }
    .eco-legend .backup { display: none; }   /* the steps leave the power station out */
    .eco-steps { display: grid; gap: 0; list-style: none; margin: 8px auto 0; padding: 0; max-width: 300px; }
    .eco-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: #161a1f; border: 1px solid rgba(255, 255, 255, .12); font-size: var(--fs-sm); }
    .eco-steps li small { color: #9aa3ad; margin-inline-start: auto; font-size: .72rem; }
    .eco-steps li + li { margin-top: 26px; }
    .eco-steps li + li::before { content: ""; position: absolute; top: -26px; right: 50%; height: 26px; width: 2px; background-image: linear-gradient(var(--blue-bright) 40%, transparent 40%); background-size: 2px 8px; }
    .playing .eco-steps li + li::before { animation: dropFlow .8s linear infinite; }
    @keyframes dropFlow { to { background-position: 0 8px; } }
  }

  /* ---------- home: projects wall ---------- */
  .wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 28px; }
  .wall a {
    display: grid; place-items: center; text-align: center; min-height: 96px; padding: 12px; color: var(--text-3); font-weight: 800; font-size: 1.02rem; line-height: 1.5;
    border-inline-start: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
    transition: color var(--t-1) ease-in-out, background-color var(--t-1) ease-in-out, opacity .35s var(--ease), transform .35s var(--ease);
  }
  .wall a:nth-child(4n + 1) { border-inline-start: 0; }
  .wall a small { display: block; font-size: .72rem; font-weight: 500; color: var(--text-3); }
  @media (hover: hover) { .wall a:hover { color: var(--text); background: var(--bg-sunk); } }
  .wall a[hidden] { display: none; }
  @media (max-width: 960px) {
    .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wall a:nth-child(4n + 1) { border-inline-start: 1px solid var(--line-soft); }
    .wall a:nth-child(2n + 1) { border-inline-start: 0; }
  }

  /* ---------- home: free-visit request (the enquiry form, sent to /api/enquiry like a product page's) ---------- */
  .visit-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
  .visit h2 { font-size: var(--fs-h2); }
  .visit-copy p { margin-top: 12px; max-width: 32em; color: var(--text-2); font-size: var(--fs-lg); }
  .visit-or a { color: var(--blue); font-weight: 600; }
  .visit-box { padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-1); }
  .visit-box .enq-form { margin-top: 0; }
  .visit-box .enq-msg:target { margin-top: 12px; }
  @media (max-width: 900px) { .visit-in { grid-template-columns: minmax(0, 1fr); } }

  /* ---------- site visit (site-visit.html): the home's hero, process panel and visit form, plus three lists ---------- */
  .sv-hero { padding-block-end: clamp(40px, 6vw, 72px); }
  .sv-hero .crumbs { text-align: center; margin-block-end: 12px; }
  .sv-fits, .sv-steps, .sv-ready { list-style: none; margin: 0; padding: 0; display: grid; }
  /* where it suits: one card per kind of place, as many to a row as fit */
  .sv-fits { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
  .sv-fits li { display: grid; align-content: start; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
  .sv-fits .icon { width: 28px; height: 28px; color: var(--blue); }
  .sv-fits h3, .sv-steps h3 { font-size: var(--fs-md); }
  .sv-fits p, .sv-steps p { color: var(--text-2); font-size: var(--fs-sm); }
  /* request → visit → pre-invoice → install: four in a row, two on tablets, one on phones */
  .sv-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .sv-steps li { display: grid; align-content: start; gap: 8px; padding: 20px; border-radius: var(--r-2); background: var(--bg-sunk); }
  .sv-steps .n { display: grid; place-items: center; inline-size: 32px; block-size: 32px; border-radius: 50%; background: var(--blue-fill); color: var(--on-fill); font-weight: 700; }
  @media (max-width: 960px) { .sv-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 560px) { .sv-steps { grid-template-columns: minmax(0, 1fr); } }
  /* what to think about before the visit, beside the form */
  .sv-ready-title { font-size: var(--fs-md); margin-block-start: 24px; }
  .sv-ready { gap: 10px; margin-block-start: 12px; max-width: 32em; }
  .sv-ready li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; color: var(--text-2); }
  .sv-ready .icon { color: var(--blue); margin-block-start: 3px; }

  /* ---------- about (about.html): site visit's hero, the five services as cards, support beside the benefits, a closing
     call; contact (contact.html): the ways in from the settings beside the enquiry form. Nothing here moves ---------- */
  .ab-services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
  .ab-services > li { display: grid; align-content: start; gap: 8px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); }
  .ab-services .icon { width: 28px; height: 28px; color: var(--blue); }
  .ab-services h3 { font-size: var(--fs-md); }
  .ab-tag { color: var(--blue); font-size: var(--fs-sm); font-weight: 600; }
  .ab-services > li > p:not(.ab-tag) { color: var(--text-2); font-size: var(--fs-sm); }
  .ab-services ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 8px; color: var(--text-2); font-size: var(--fs-sm); }
  .ab-services b { color: var(--text); font-weight: 600; }
  .ab-split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
  .ab-split h2 { font-size: var(--fs-h2); }
  .ab-split > div > p { margin-block-start: 12px; max-width: 32em; color: var(--text-2); font-size: var(--fs-lg); }
  .ab-benefits { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
  .ab-benefits li { display: grid; align-content: start; gap: 6px; padding: 20px; border-radius: var(--r-2); background: var(--surface); }
  .ab-benefits h3 { font-size: var(--fs-md); }
  .ab-benefits p { color: var(--text-2); font-size: var(--fs-sm); }
  @media (max-width: 900px) { .ab-split { grid-template-columns: minmax(0, 1fr); } }
  .ab-cta { display: grid; justify-items: center; gap: 12px; text-align: center; }
  .ab-cta h2 { font-size: var(--fs-h2); max-width: 20em; }
  .ab-cta p { color: var(--text-2); font-size: var(--fs-lg); }
  .ab-cta .hero-actions { margin-top: 8px; }

  .ct-ways h2, .ct-form-title { font-size: var(--fs-h2); }
  .ct-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 20px; }
  .ct-list > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .ct-list .icon { width: 24px; height: 24px; margin-block-start: 4px; color: var(--blue); }
  .ct-list h3, .ct-socials h3 { font-size: var(--fs-md); }
  .ct-list p, .ct-msgs { color: var(--text-2); }
  .ct-list a, .ct-socials a { color: var(--blue); font-weight: 600; }
  .ct-nums { display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .ct-nums a, .ct-msgs a { display: inline-flex; align-items: center; min-height: 32px; }
  .ct-msgs { list-style: none; margin: 0; padding: 0; display: grid; }
  .ct-socials { display: grid; gap: 6px; margin-block-start: 24px; padding-block-start: 20px; border-top: 1px solid var(--line-soft); }
  .ct-socials p { display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .ct-socials a { display: inline-flex; align-items: center; min-height: 32px; }
  .ct-form-lead { margin-block-start: 8px; color: var(--text-2); }

  /* ---------- alarm installation (alarm-system-kerman.html): a static hero beside the panel photo, the three kinds of
     alarm, the picks (store-look .pcard) and the visit buttons; its place cards and steps are site visit's .sv-fits and
     .sv-steps. Nothing here moves: the hero is not .hero, so its actions don't take the home's entrance ---------- */
  .al-hero { padding-block: clamp(36px, 5vw, 64px); background:
    radial-gradient(60% 60% at 50% 0%, color-mix(in srgb, var(--blue-soft) 80%, transparent) 0%, transparent 70%), var(--bg); }
  .al-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 4vw, 56px); }
  .al-hero .crumbs { margin-block-end: 12px; }
  .al-hero h1 { font-size: var(--fs-h1); max-width: 14em; }
  .al-hero .sub { color: var(--text-2); font-size: var(--fs-lg); margin-block-start: 12px; max-width: 34em; }
  .al-hero .hero-actions { justify-content: flex-start; }
  .al-hero-img { inline-size: clamp(200px, 24vw, 300px); filter: drop-shadow(0 18px 28px rgba(16, 24, 40, .16)); }
  @media (max-width: 760px) {
    .al-hero-in { grid-template-columns: minmax(0, 1fr); }
    .al-hero-img { inline-size: 168px; justify-self: center; }
  }
  /* wired, wireless, SIM: three cards, one column on phones */
  .al-types { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .al-types li { display: grid; align-content: start; gap: 8px; padding: 24px; border: 1px solid var(--line-soft); border-radius: var(--r-2); background: var(--surface); }
  .al-types .icon { width: 28px; height: 28px; color: var(--blue); }
  .al-types h3 { font-size: var(--fs-md); }
  .al-types p { color: var(--text-2); font-size: var(--fs-sm); }
  .al-types a { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
  @media (max-width: 860px) { .al-types { grid-template-columns: minmax(0, 1fr); } }
  /* the picks: as many store cards to a row as fit, two on phones */
  .al-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
  .al-picks .blurb { color: var(--text-2); font-size: var(--fs-sm); }
  /* blurbs differ in length: the prices line up at the foot of each card */
  .al-picks .pcard .body { flex: 1; display: flex; flex-direction: column; }
  .al-picks .pcard .price { margin-block-start: auto; padding-block-start: 6px; }
  /* an out-of-stock pick's price is the last one sold at, labelled on its own line as the store card does */
  .al-picks .pcard .price .last { display: block; }
  @media (max-width: 560px) { .al-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
  .al-visit .hero-actions { margin-top: 0; }
  .al-or { text-align: center; color: var(--text-2); margin-block-start: 16px; }
  /* links inside a sentence are told apart by more than colour */
  :is(.al-lead, .al-or) a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

  /* ---------- home: coverage plan ---------- */
  .plan { background: var(--night); color: var(--night-text); overflow: hidden; }
  .plan .wrap { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-block: clamp(56px, 8vw, 104px); }
  .plan h2 { font-size: var(--fs-h2); }
  .plan p { color: var(--night-text-2); margin-top: 12px; max-width: 32em; }
  .plan .legend { list-style: none; margin: 22px 0 26px; padding: 0; display: grid; gap: 10px; font-size: var(--fs-sm); color: var(--night-text-2); }
  .plan .legend li { display: flex; align-items: center; gap: 10px; }
  /* each key has its cone's shape, since the three blues alone can't be told apart: a wide wedge (bullet), a circle
     (dome) and a narrow wedge (speed dome); the wedges open from the camera on the start side, as on the plan */
  .plan .legend i { flex-shrink: 0; width: 22px; height: 14px; }
  .plan .legend i.bullet { background: linear-gradient(270deg, rgba(0, 111, 255, .95), rgba(0, 111, 255, .3)); clip-path: polygon(100% 50%, 0 0, 0 100%); }
  .plan .legend i.dome { width: 14px; margin-inline: 4px; border-radius: 50%; background: radial-gradient(circle, rgba(71, 151, 255, .95), rgba(71, 151, 255, .35)); }
  .plan .legend i.speed { background: linear-gradient(270deg, rgba(102, 168, 255, .95), rgba(102, 168, 255, .3)); clip-path: polygon(100% 50%, 0 32%, 0 68%); }
  .plan figure { margin: 0; }
  .plan .showcase-note { color: var(--night-text-2); }
  .plan-art { width: 100%; height: auto; display: block; }
  .plan-art .wall-line { fill: none; stroke: rgba(158, 197, 255, .55); stroke-width: 2; }
  .plan-art .wall-line.dash { stroke-dasharray: 4 5; }
  .plan-art .thin { fill: none; stroke: rgba(158, 197, 255, .25); stroke-width: 1; }
  /* the plan's column draws it at 0.86–1.2 of its viewBox above 640px, so these render at 11px and up */
  .plan-art .room { fill: rgba(158, 197, 255, .7); font: 500 13px var(--font); }
  .plan-art .room.sm { font-size: 13px; }
  /* at 640px and below the plan is drawn at about half its viewBox, so these render at about 11–12px */
  @media (max-width: 640px) { .plan-art .room, .plan-art .room.sm { font-size: 22px; } }
  @media (max-width: 380px) { .plan-art .room, .plan-art .room.sm { font-size: 25px; } }
  /* cones grow from their camera (transform-origin set inline per cone) */
  .plan-art .cone { transform-box: view-box; opacity: 0; transform: scale(.2); }
  .playing .plan-art .cone { animation: coneIn .9s var(--ease-emph) both; animation-delay: calc(var(--i, 0) * .22s + .2s); }
  .playing .plan-art .sweep { animation: coneIn .9s var(--ease-emph) both, sweep 7s var(--ease-standard) 1.4s infinite alternate; animation-delay: calc(var(--i, 0) * .22s + .2s), 1.4s; }
  @keyframes coneIn { to { opacity: 1; transform: none; } }
  @keyframes sweep { from { rotate: -22deg; } to { rotate: 22deg; } }
  .plan-art .cam { fill: #fff; stroke: var(--blue-bright); stroke-width: 2; }
  :root[data-theme="dark"] .eco, :root[data-theme="dark"] .plan { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
  @media (max-width: 900px) { .plan .wrap { grid-template-columns: minmax(0, 1fr); } }
  @media (prefers-reduced-motion: reduce) { .plan-art .cone { opacity: 1; transform: none; } }

  /* ---------- store: category page ---------- */
  .store-head { padding-block: 24px 0; }
  .crumbs { font-size: var(--fs-cap); color: var(--text-3); }
  .crumbs a { color: var(--text-3); }
  @media (hover: hover) { .crumbs a:hover { color: var(--blue); } }
  .crumbs span + span::before { content: "‹"; margin-inline: 8px; color: var(--line); }
  .store-head h1 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.2rem); margin-top: 6px; }
  .store-head .intro { color: var(--text-2); max-width: 52em; margin-top: 6px; }
  /* link between a category and its sub-category (alarm.html ⇄ alarm-sim.html) */
  .store-head .link-arrow { margin-top: 10px; }
  .store-head .link-arrow .n { color: var(--text-3); font-weight: 400; }
  /* sub-tabs: one pill slides between the pressed buttons */
  .subtabs { position: relative; isolation: isolate; display: flex; gap: 6px; overflow-x: auto; padding: 18px 0 12px; scrollbar-width: none; border-bottom: 1px solid var(--line-soft); }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs button {
    height: 34px; padding: 0 14px; border-radius: var(--r-1); border: 0; background: none; color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
    transition: background-color var(--t-1), color var(--t-1);
  }
  @media (hover: hover) { .subtabs button:hover { background: var(--bg-sunk); color: var(--text); } }
  .subtabs button[aria-pressed="true"] { background: transparent; color: var(--blue); font-weight: 600; }
  .subtabs .n { color: var(--text-3); font-size: .78rem; margin-inline-start: 2px; }
  .subtabs .ind {
    position: absolute; z-index: -1; left: 0; top: 18px; height: 34px; width: var(--w, 0); border-radius: var(--r-1); background: var(--blue-soft);
    transform: translateX(var(--x, 0)); transition: transform .42s var(--ease-spring), width .42s var(--ease-spring);
  }

  /* filters: one row on desktop; on phones the same element becomes a bottom sheet.
     relative so the visually-hidden group titles can't escape the row */
  .filters { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 12px; }
  .sheet-head, .sheet-foot, .results-bar, .sheet-scrim { display: none; }
  .sheet-body, .fgroup { display: contents; }
  .dd-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dd { position: relative; }
  .dd > button, .fchip {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-1); border: 1px solid var(--line); background: var(--surface);
    color: var(--text); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; transition: border-color var(--t-1), background-color var(--t-1), opacity var(--t-1);
  }
  @media (hover: hover) { .dd > button:hover, .fchip:hover { border-color: var(--text-3); } }
  .dd > button .icon { width: 14px; height: 14px; transition: transform var(--t-2) var(--ease); }
  .dd > button[aria-expanded="true"] .icon { transform: rotate(180deg); }
  .dd-menu {
    position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 20; min-width: 210px; padding: 6px; border-radius: var(--r-2); background: var(--surface);
    box-shadow: var(--shadow-3); opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .12s var(--ease-exit), transform .12s var(--ease-exit), visibility 0s linear .12s;
  }
  .dd-menu.open { opacity: 1; visibility: visible; transform: none; transition: opacity .28s var(--ease-enter), transform .28s var(--ease-enter), visibility 0s; }
  .dd-menu label { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: var(--r-1); font-size: var(--fs-sm); cursor: pointer; transition: opacity var(--t-1); }
  @media (hover: hover) { .dd-menu label:hover { background: var(--bg-sunk); } }
  .dd-menu .n { margin-inline-start: auto; color: var(--text-3); font-size: .75rem; font-variant-numeric: tabular-nums; }
  .fchip input { width: 14px; height: 14px; }
  /* the filters' checkboxes, drawn here so the check can come in: the fill grows from the centre and the tick follows.
     after React Bits Spring Check (MIT + Commons Clause), ported: the native input stays, the bounce is --ease-spring,
     and only scale and opacity move. Leaving is quicker than arriving. */
  .filters input[type="checkbox"] {
    appearance: none; position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden;
    border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--surface); cursor: pointer;
  }
  .filters input[type="checkbox"]:checked { border-color: var(--blue-fill); }
  .filters input[type="checkbox"]:disabled { cursor: default; }
  .filters input[type="checkbox"]::before {
    content: ""; position: absolute; inset: -1.5px; background: var(--blue-fill); scale: 0; transition: scale var(--t-1) var(--ease-exit);
  }
  .filters input[type="checkbox"]::after {
    content: ""; position: relative; inline-size: 28%; block-size: 56%; margin-block-end: 12%; border: solid var(--on-fill); border-width: 0 2px 2px 0;
    rotate: 45deg; opacity: 0; scale: .25; transition: scale var(--t-1) var(--ease-exit), opacity var(--t-1) var(--ease-exit);
  }
  .filters input[type="checkbox"]:checked::before { scale: 1; transition: scale var(--t-2) var(--ease-spring); }
  .filters input[type="checkbox"]:checked::after {
    opacity: 1; scale: 1; transition: scale var(--t-2) var(--ease-enter) 60ms, opacity var(--t-2) var(--ease-enter) 60ms;
  }
  /* the global reduced-motion rule shortens durations, not delays: the ticked box is whole at once */
  @media (prefers-reduced-motion: reduce) { .filters input[type="checkbox"]:checked::after { transition-delay: 0s; } }
  /* forced colours drop fills: the browser's own box comes back */
  @media (forced-colors: active) {
    .filters input[type="checkbox"] { appearance: auto; border: 0; }
    .filters input[type="checkbox"]::before, .filters input[type="checkbox"]::after { content: none; }
  }
  .fchip .n { color: var(--text-3); font-size: .75rem; font-variant-numeric: tabular-nums; }
  .fchip:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
  /* an option that would empty the grid */
  .fchip:has(input:disabled), .dd-menu label:has(input:disabled) { opacity: .4; cursor: default; }
  @media (hover: hover) { .fchip:has(input:disabled):hover { border-color: var(--line); } }
  @media (hover: hover) { .dd-menu label:has(input:disabled):hover { background: none; } }
  .subtabs button:disabled { opacity: .4; cursor: default; }
  @media (hover: hover) { .subtabs button:disabled:hover { background: none; color: var(--text-2); } }
  .filters .end { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: var(--fs-sm); }
  .filters select { height: 34px; border-radius: var(--r-1); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); padding: 0 10px; }
  .active-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
  .active-chips:empty { display: none; }
  .active-chips button {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 0; background: var(--blue-soft); color: var(--blue); font-size: .8rem; cursor: pointer;
  }
  .active-chips button.new { animation: chipIn .25s var(--ease-spring) both; }
  .active-chips button.clear { background: none; color: var(--text-3); text-decoration: underline; }
  .filter-btn .badge {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--blue-fill); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1;
  }
  .filter-btn .badge:empty { display: none; }
  @media (max-width: 640px) {
    /* sticky results bar: the sheet's trigger and the live count */
    .results-bar {
      position: sticky; top: var(--nav-h); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
      margin-inline: calc(var(--gutter) * -1); padding: 8px var(--gutter);
      background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line-soft);
    }
    .filter-btn { height: 40px; }
    .rcount { color: var(--text-3); font-size: var(--fs-sm); }
    .rcount b { color: var(--text); display: inline-block; }
    .active-chips { padding-top: 10px; }

    /* the sheet: rises with the emphasized curve, drops faster than it rises */
    .filters {
      position: fixed; z-index: 70; inset-inline: 0; bottom: 0; max-height: min(86vh, 720px);
      flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 0;
      background: var(--surface); border-radius: var(--r-3) var(--r-3) 0 0; box-shadow: var(--shadow-3);
      transform: translateY(100%); visibility: hidden; transition: transform .2s var(--ease-exit), visibility 0s linear .2s;
    }
    .filters.open { transform: none; visibility: visible; transition: transform .38s var(--ease-emph), visibility 0s; }
    .sheet-scrim {
      display: block; position: fixed; inset: 0; z-index: 65; background: rgba(10, 12, 16, .45); opacity: 0; visibility: hidden;
      transition: opacity .2s var(--ease-exit), visibility 0s linear .2s;
    }
    .sheet-scrim.show { opacity: 1; visibility: visible; transition: opacity .3s var(--ease-enter), visibility 0s; }
    .sheet-lock { overflow: hidden; }
    .sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 0 4px; padding-inline: 16px 8px; }
    .sheet-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
    .sheet-title { font-size: var(--fs-lg); }
    .sheet-body { display: grid; gap: 22px; padding: 8px 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
    .dd-title { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
    .dd > button, .filters .end > span { display: none; }
    .dd-menu { position: static; min-width: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; opacity: 1; visibility: inherit; transform: none; transition: none; }
    .dd-menu label { height: 46px; padding: 0 2px; border-radius: 0; border-bottom: 1px solid var(--line-soft); }
    .dd-menu label:last-child { border-bottom: 0; }
    @media (hover: hover) { .dd-menu label:hover { background: none; } }
    /* short option sets read better as chips */
    .dd.price .dd-menu, .fgroup { display: flex; flex-wrap: wrap; gap: 8px; }
    .fgroup .dd-title { flex-basis: 100%; margin-bottom: 0; }
    .dd.price .dd-title { margin-bottom: 8px; }
    .dd.price .dd-menu label, .fchip { height: 40px; padding: 0 14px; gap: 8px; border: 1px solid var(--line); border-radius: 999px; }
    .dd.price .dd-menu label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
    .dd.price .dd-menu .n { margin-inline-start: 0; }
    .filters .end { display: block; margin: 0; }
    .filters .end .dd-title { margin-bottom: 8px; }
    .filters select { width: 100%; height: 44px; }
    .sheet-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-soft); }
    .sheet-foot .btn-quiet { height: 44px; }
    .sheet-foot .btn-primary { flex: 1; }
    .sheet-foot b { display: inline-block; }
  }

  /* store cards */
  .store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-block: 16px 40px; }
  .scard {
    display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 0 20px; padding: 16px; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line-soft);
    transition: box-shadow .3s var(--ease-out), transform .3s var(--ease-out), border-color .3s var(--ease-out), opacity .3s var(--ease);
    min-width: 0;
  }
  @media (hover: hover) { .scard:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); border-color: transparent; } }
  .scard .well { position: relative; border-radius: var(--r-2); background: var(--bg-sunk); display: grid; place-items: center; aspect-ratio: 1; grid-row: span 2; }
  .scard .well img { width: 78%; filter: drop-shadow(0 12px 16px rgba(16, 24, 40, .14)); transition: transform .5s var(--ease-out); }
  @media (hover: hover) { .scard:hover .well img { transform: scale(1.05) translateY(-2px); } }
  .scard .info { display: grid; gap: 2px; align-content: start; min-width: 0; }
  .scard h3 { font-size: var(--fs-lg); line-height: 1.55; }
  .scard h3 a { color: var(--text); }
  @media (hover: hover) { .scard h3 a:hover { color: var(--blue); } }
  .scard .desc { color: var(--text-2); font-size: var(--fs-sm); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .8rem; color: var(--text-2); }
  .specs li { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .specs .icon { width: 16px; height: 16px; color: var(--text-3); }
  .buy { display: flex; align-items: end; justify-content: space-between; gap: 10px; flex-wrap: nowrap; align-self: end; margin-top: 14px; }
  /* with an offer: its tag above the price (.cost); when the row is too narrow for both, the buttons wrap under the price,
     at the inline end (LAUNCH-02) */
  .buy.has-offer { flex-wrap: wrap; }
  .buy.has-offer .acts { margin-inline-start: auto; }
  .buy .cost { display: grid; justify-items: start; gap: 4px; min-width: 0; max-width: 100%; }
  /* while the discount runs, its struck regular price takes its own line above the price; past the end it is the price */
  .buy .cost [data-offer-price]:not(.is-over) .was { display: block; inline-size: fit-content; font-size: var(--fs-sm); }
  .buy .price { min-width: 0; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; }
  .buy .price small { display: block; font-size: .72rem; color: var(--text-3); font-weight: 400; }
  .buy .acts { display: flex; gap: 6px; }
  .buy .btn { padding: 0 12px; }
  .note-empty { text-align: center; color: var(--text-3); padding: 40px 0; }
  /* help card: ends the list; on the two-column grid it only fills an odd last cell */
  .help-card { display: grid; align-content: center; justify-items: start; gap: 8px; padding: 24px; border-radius: var(--r-2); background: var(--bg-sunk); min-width: 0; }
  .help-card > .icon { width: 28px; height: 28px; color: var(--blue); }
  .help-card h3 { font-size: var(--fs-lg); }
  .help-card p { color: var(--text-2); font-size: var(--fs-sm); max-width: 30em; }
  .help-card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
  @media (min-width: 961px) { .store-grid.even .help-card { display: none; } }
  @media (max-width: 960px) { .store-grid { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 640px) {
    /* compact rows: thumbnail beside the title, price and actions across the bottom */
    .store-grid { gap: 10px; padding-block: 12px 32px; }
    .scard { grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "well info" "buy buy"; gap: 10px 12px; padding: 12px; }
    .scard .well { grid-area: well; grid-row: auto; align-self: start; }
    .scard .well img { width: 82%; }
    /* the stock tag becomes a strip along the thumbnail's bottom edge, clear of the photo */
    .scard .well .tag { top: auto; bottom: 4px; inset-inline: 4px; justify-content: center; height: 16px; font-size: .6rem; }
    .scard .info { grid-area: info; }
    .scard h3 { font-size: var(--fs-md); line-height: 1.5; }
    .scard .desc { display: none; }
    .scard .specs { display: flex; flex-wrap: wrap; gap: 0; margin-top: 4px; font-size: .75rem; color: var(--text-3); }
    .scard .specs .icon { display: none; }
    .scard .specs li + li::before { content: "·"; margin-inline: 6px; }
    .scard .specs li:nth-child(n + 4) { display: none; }
    .scard .buy { grid-area: buy; align-items: center; margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
    .buy .price { font-size: 1.05rem; }
    .help-card { padding: 18px; }
  }

  /* add-to-compare checkbox button (.cmp-btn is the ui.js hook) */
  .cmp-check { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; border-radius: var(--r-1); }
  @media (hover: hover) { .cmp-check:hover { background: var(--bg-sunk); color: var(--text); } }
  .cmp-check .box {
    width: 16px; height: 16px; border-radius: 3px; border: 1.5px solid var(--text-3); display: grid; place-items: center;
    transition: background-color var(--t-2) var(--ease-standard), border-color var(--t-2) var(--ease-standard);
  }
  .cmp-check .box svg { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.6); transition: opacity var(--t-2) var(--ease-standard), transform .3s var(--ease-spring); }
  .cmp-check[aria-pressed="true"] { color: var(--blue); }
  .cmp-check[aria-pressed="true"] .box { background: var(--blue); border-color: var(--blue); }
  .cmp-check[aria-pressed="true"] .box svg { opacity: 1; transform: none; }

  /* compare tray (enters slower than it leaves) + dialog */
  .tray {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 60; transform: translateY(110%); visibility: hidden;
    transition: transform .18s var(--ease-exit), visibility 0s linear .18s;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(16, 24, 40, .08);
  }
  .tray.show { transform: none; visibility: visible; transition: transform .32s var(--ease-enter), visibility 0s; }
  .tray .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .tray-items { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; }
  .tray-item { display: flex; align-items: center; gap: 8px; height: 48px; padding: 4px 10px 4px 4px; border-radius: var(--r-2); background: var(--bg-sunk); font-size: .8rem; white-space: nowrap; animation: chipIn .25s var(--ease-out) both; }
  .tray-item.new { animation: chipIn .3s var(--ease-spring) .5s both; }
  .tray-item img { width: 40px; height: 40px; object-fit: contain; }
  .tray-item button { border: 0; background: none; color: var(--text-3); cursor: pointer; width: 24px; height: 24px; border-radius: 50%; }
  @media (hover: hover) { .tray-item button:hover { background: var(--line); color: var(--text); } }
  .tray .hint { color: var(--text-3); font-size: .8rem; }
  /* on phones it sits on the call bar and rises from behind it (z-index under the bar's 55), not across it */
  @media (max-width: 640px) { .tray { z-index: 54; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); transform: translateY(calc(100% + 64px + env(safe-area-inset-bottom, 0px))); } .tray.show { transform: none; } }
  dialog.cmp {
    width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; padding: 0; border-radius: var(--r-3); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
  }
  dialog.cmp[open] { animation: dlgIn .3s var(--ease-out); }
  dialog.cmp::backdrop { background: rgba(10, 12, 16, .45); backdrop-filter: blur(4px); animation: fadeIn .3s ease-out; }
  @keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
  .cmp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: var(--surface); z-index: 1; }
  .cmp-head h2 { font-size: 1.1rem; }

  /* ---------- bento grids (security: 1.6 + 3; store guide: 4 equal) ---------- */
  .bento { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 16px; }
  .bento.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bento.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  @media (max-width: 1100px) { .bento, .bento.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 640px) { .bento, .bento.four, .bento.three { grid-template-columns: minmax(0, 1fr); } }

  /* ---------- 404 and 410 (server/templates/gone.html, rendered on request by the server) ---------- */
  .gone-box { padding-block: clamp(48px, 8vw, 104px); display: grid; gap: 20px; justify-items: start; max-width: 44rem; }
  .gone-box h1 { font-size: var(--fs-h1); line-height: 1.3; }
  .gone-box p { color: var(--text-2); font-size: var(--fs-lg); }
  .gone-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
  .gone-links a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-weight: 600; }
  @media (hover: hover) { .gone-links a:hover { border-color: var(--blue); color: var(--blue); } }
  .gone-actions { display: flex; flex-wrap: wrap; gap: 12px; }

  /* ---------- security: hero (real product on black) ---------- */
  .lens-hero {
    position: relative; overflow: hidden; background: #05070a; color: #fff; isolation: isolate; margin-top: calc(var(--nav-h) * -1);
    padding-top: calc(var(--nav-h) + clamp(28px, 5vw, 56px)); min-height: min(820px, 100svh);
    display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr);
  }
  .lens-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background: radial-gradient(50% 45% at 50% 82%, rgba(0, 111, 255, .28), transparent 70%), #05070a;
  }
  .lens-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(#05070a 0%, rgba(5, 7, 10, 0) 38%, rgba(5, 7, 10, 0) 80%, rgba(5, 7, 10, .5) 100%); }
  .lens-hero h1 { font-size: var(--fs-h1); text-align: center; text-shadow: 0 2px 30px rgba(0, 0, 0, .5); }
  .lens-hero .sub { text-align: center; color: rgba(255, 255, 255, .78); margin-top: 10px; font-size: var(--fs-lg); }
  .lens-hero .pills { margin-top: 22px; }
  .lens-copy { text-align: center; color: rgba(255, 255, 255, .85); margin-top: 16px; min-height: 3.6em; }
  .hero-art { position: absolute; z-index: -1; left: 50%; bottom: -25%; width: min(360px, 56vw); translate: -50% 0; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .6)) drop-shadow(0 0 40px rgba(0, 111, 255, .18)); }
  .js .hero-art { animation: rise 1.1s var(--ease-emph) .15s both; }
  @media (max-width: 640px) {
    .lens-hero { min-height: 800px; }
    .hero-art { width: 48vw; bottom: -16%; }
  }
  @media (prefers-reduced-motion: reduce) { .js .hero-art { animation: none; } }

  /* ---------- security: feature tabs ---------- */
  .features > .pills { margin-bottom: 28px; }

  /* ---------- security: lineup rail + compare slots ---------- */
  .seg-row { display: flex; justify-content: center; margin-bottom: 24px; }
  .lineup-head { margin-bottom: 8px; }
  .lineup-head .series { flex: 1; margin: 0; }
  .cta-row { display: flex; justify-content: center; margin-top: 20px; }
  .lcard {
    display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 14px 16px; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line-soft);
    transition: box-shadow .3s var(--ease-out), transform .3s var(--ease-out), border-color .3s var(--ease-out); min-width: 0;
  }
  @media (hover: hover) { .lcard:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); border-color: transparent; } }
  @media (hover: none) { .lcard:active { transform: scale(.98); } }
  .lcard img { width: 70%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(16, 24, 40, .14)); transition: transform .5s var(--ease-out); }
  @media (hover: hover) { .lcard:hover img { transform: scale(1.05); } }
  .lcard h3 { font-size: var(--fs-md); }
  .lcard p { font-size: .8rem; color: var(--text-2); min-height: 3em; }
  .lcard .btn { margin-top: 6px; }
  .cmp-zone { margin-top: 28px; }
  .cmp-zone .slots { display: grid; grid-template-columns: 220px repeat(3, minmax(0, 1fr)); background: var(--surface); border-radius: var(--r-2) var(--r-2) 0 0; margin-bottom: 2px; }
  .cmp-zone .ctable { table-layout: fixed; background: var(--surface); border-radius: var(--r-2); overflow: hidden; }
  .cmp-zone .ctable thead.compact th { padding: 0; border: 0; height: 0; }
  .cmp-zone .ctable th[scope="row"] { width: 220px; }
  .slot { display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; padding: 12px; position: relative; min-height: 210px; }
  .slot.empty { color: var(--text-3); align-content: center; font-size: .82rem; }
  .slot.empty .icon { width: 36px; height: 36px; opacity: .5; }
  .slot.filled { animation: floatIn .5s var(--ease-out) both; }
  .slot.fresh img { animation: fadeIn .2s ease-out .55s both; }
  .slot img { width: 120px; filter: drop-shadow(0 10px 14px rgba(16, 24, 40, .14)); }
  .slot h4 { color: var(--blue); font-size: var(--fs-md); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .slot .x { position: absolute; top: 6px; inset-inline-end: 10px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--bg-sunk-2); color: var(--text-2); cursor: pointer; }
  @media (max-width: 960px) { .cmp-zone .slots { grid-template-columns: 120px repeat(3, minmax(0, 1fr)); } }
  @media (max-width: 640px) {
    .cmp-zone .slots { grid-template-columns: 92px repeat(3, minmax(0, 1fr)); }
    .cmp-zone .ctable th[scope="row"] { width: 92px; white-space: normal; font-size: .75rem; }
    .cmp-zone .ctable th[scope="row"] .icon { display: none; }
    .cmp-zone .ctable td { font-size: .75rem; padding: 10px 4px; }
    .slot { min-height: 160px; padding: 6px; }
    .slot img { width: 76px; }
    .slot h4 { font-size: .78rem; }
    .slot .sku { display: none; }
  }

  /* ---------- product page ---------- */
  .pd-crumbs { padding-top: 20px; }
  .pd-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 64px); align-items: start; padding-block: 16px clamp(40px, 6vw, 72px); }
  .pd-gallery { position: sticky; top: calc(var(--nav-h) + 16px); }
  .pd-stage { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--r-3); background: var(--bg-sunk); display: grid; place-items: center; overflow: hidden; }
  .pd-stage img { width: 64%; filter: drop-shadow(0 24px 30px rgba(16, 24, 40, .18)); transition: transform .6s var(--ease-out); }
  @media (hover: hover) { .pd-stage:hover img { transform: scale(1.04); } }
  .pd-stage .tag { position: absolute; top: 16px; inset-inline-start: 16px; background: var(--surface); }
  .tag.out { color: var(--warn); }
  .pd-buy { display: grid; gap: 14px; padding-top: 8px; }
  .pd-brand { font-size: var(--fs-sm); font-weight: 600; }
  .pd-buy h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
  .pd-lede { color: var(--text-2); font-size: var(--fs-lg); max-width: 34em; }
  .pd-keys { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; font-size: var(--fs-sm); color: var(--text-2); }
  .pd-keys li { display: flex; align-items: center; gap: 8px; }
  .pd-keys .icon { color: var(--text); }
  .pd-opts { border: 0; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pd-opts legend { float: left; grid-column: 1 / -1; width: 100%; /* floated: a grid item, not the fieldset-border legend */ margin-bottom: 8px; padding: 0; font-size: var(--fs-sm); font-weight: 700; }
  .pd-opts .opt { position: relative; display: block; cursor: pointer; }
  .pd-opts .opt input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
  .pd-opts .opt span {
    display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface);
    transition: border-color var(--t-1), box-shadow var(--t-2) var(--ease-standard), background-color var(--t-1);
  }
  .pd-opts .opt b { font-size: var(--fs-md); }
  .pd-opts .opt small { color: var(--text-3); font-size: .78rem; }
  @media (hover: hover) { .pd-opts .opt:hover span { border-color: var(--text-3); } }
  .pd-opts .opt input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); background: color-mix(in srgb, var(--blue-soft) 45%, var(--surface)); }
  .pd-opts .opt input:focus-visible + span { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
  .pd-help { grid-column: 1 / -1; font-size: var(--fs-sm); justify-self: start; }
  .pd-price { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
  .pd-price .price { font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
  .pd-price .price small { font-size: var(--fs-md); font-weight: 500; color: var(--text-2); }
  .pd-price .qty-note { flex-basis: 100%; font-size: var(--fs-sm); }
  .pd-price .stock { display: inline-flex; align-items: center; gap: 8px; color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
  .pd-price .stock.in { color: var(--ok); }
  .pd-price .stock .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
  .pd-cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pd-note { color: var(--text-3); font-size: var(--fs-sm); }

  /* stock enquiry: a disclosure under the note; the boxes take the full width. Without JS the server sends the page back
     at #enquiry-sent or #enquiry-error, and only the target message shows. */
  .pd-enq { border-top: 1px solid var(--line-soft); padding-top: 12px; }
  .pd-enq summary { inline-size: fit-content; cursor: pointer; color: var(--blue); font-size: var(--fs-md); font-weight: 600; }
  .enq-form { display: grid; gap: 6px; margin-top: 12px; }
  .enq-form label { margin-top: 6px; color: var(--text-2); font-size: var(--fs-sm); }
  .enq-form input, .enq-form textarea {
    inline-size: 100%; min-inline-size: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-2);
    background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;   /* 16px: iOS zooms into smaller boxes */
  }
  .enq-form textarea { resize: vertical; }
  .enq-form [aria-invalid="true"] { border-color: var(--danger-text); }
  .enq-form .btn { justify-self: start; margin-top: 8px; }
  .enq-err { color: var(--danger-text); font-size: var(--fs-sm); }
  .enq-status { color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
  .enq-hp { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .enq-msg { display: none; }
  .enq-msg:target { display: block; padding: 10px 12px; border-radius: var(--r-2); background: var(--bg-sunk); color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
  .pd-assure { list-style: none; margin: 4px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--text-2); }
  .pd-assure li { display: flex; align-items: center; gap: 8px; }
  .pd-assure .icon { width: 18px; height: 18px; color: var(--ok); }

  /* section nav: sticky under the header; a compact buy summary slides in once the buy box has scrolled away */
  .pd-nav {
    position: sticky; top: var(--nav-h); z-index: 40; border-block: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  }
  .pd-nav-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
  .pd-links { justify-content: flex-start; border-bottom: 0; min-width: 0; }
  .utabs a { display: inline-flex; align-items: center; height: 50px; padding: 0 14px; color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; flex-shrink: 0; transition: color var(--t-1); }
  @media (hover: hover) { .utabs a:hover { color: var(--text); } }
  .utabs a[aria-current="true"] { color: var(--blue); font-weight: 600; }
  .pd-links .bar { bottom: 0; }
  .pd-mini {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0; opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s var(--ease-exit), transform .15s var(--ease-exit), visibility 0s linear .15s;
  }
  .pd-nav.show-buy .pd-mini { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease-enter), transform .3s var(--ease-enter), visibility 0s; }
  .pd-mini img { width: 40px; height: 40px; object-fit: contain; border-radius: var(--r-1); background: var(--bg-sunk); }
  .pd-mini > span { display: grid; line-height: 1.4; font-size: var(--fs-sm); }
  .pd-mini small { color: var(--text-3); font-size: .75rem; }
  /* the bar names the price only: the struck regular price shows once it is the price again (LAUNCH-05) */
  .pd-mini [data-offer-price]:not(.is-over) .was { display: none; }

  /* html already pads anchors by the header (scroll-padding-top); add only the section nav */
  .pd-sec { padding-block: clamp(48px, 7vw, 96px); scroll-margin-top: 52px; }

  /* overview tiles: the big value reads first, like ui.com's spec callouts */
  .pd-feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pd-feat { position: relative; display: grid; align-content: end; gap: 6px; min-height: 240px; padding: 24px; border-radius: var(--r-3); background: var(--bg-sunk); overflow: hidden; }
  .pd-feat .big { font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--text); margin-bottom: 10px; }
  .pd-feat h3 { font-size: var(--fs-lg); }
  .pd-feat p:not(.big) { color: var(--text-2); font-size: var(--fs-sm); max-width: 28em; }
  .pd-feat.wide { grid-column: span 2; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: end; min-height: 300px; }
  .pd-feat.wide .art { width: 100%; max-width: 300px; justify-self: center; align-self: center; filter: drop-shadow(0 22px 28px rgba(16, 24, 40, .2)); }
  .pd-feat.night { background: var(--night); color: var(--night-text); }
  .pd-feat.night .big, .pd-feat.night h3 { color: var(--night-text); }
  .pd-feat.night p:not(.big) { color: var(--night-text-2); }

  /* lens chooser: copy + segmented control beside a top-down field-of-view drawing */
  .pd-lens { background: var(--night); color: var(--night-text); }
  .pd-lens-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
  .pd-lens h2 { font-size: var(--fs-h2); }
  .pd-lens-copy > p { color: var(--night-text-2); margin: 12px 0 22px; max-width: 32em; }
  .pd-lens .seg { background: rgba(255, 255, 255, .08); }
  .pd-lens .seg button { color: var(--night-text-2); }
  .pd-lens .seg button[aria-pressed="true"] { color: var(--text); }
  .pd-lens-text { margin-top: 20px; min-height: 6.5em; }
  .pd-lens-text h3 { font-size: var(--fs-lg); }
  .pd-lens-text p { color: var(--night-text-2); margin-top: 6px; }
  .js .pd-lens-text:not([hidden]) { animation: fadeUp .45s var(--ease-enter) both; }
  .pd-lens-art { margin: 0; }
  .pd-lens-art svg { width: 100%; height: auto; display: block; }
  .pd-lens-art .ring { fill: none; stroke: rgba(158, 197, 255, .22); stroke-dasharray: 3 6; }
  .pd-lens-art .rl { fill: rgba(158, 197, 255, .75); font: 500 13px var(--font); text-anchor: middle; }
  .pd-lens-art .wallx { stroke: rgba(158, 197, 255, .55); stroke-width: 3; }
  .pd-lens-art .cam { fill: #fff; stroke: var(--blue-bright); stroke-width: 3; }
  .pd-lens-art .showcase-note { color: var(--night-text-2); }

  /* one table per spec group; the caption is the group heading */
  .pd-specs { width: 100%; max-width: 860px; border-collapse: collapse; font-size: var(--fs-md); }
  .pd-specs + .pd-specs { margin-top: 26px; }
  .pd-specs caption { text-align: start; padding: 0 4px 10px; border-bottom: 1px solid var(--line); color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
  .pd-specs th, .pd-specs td { padding: 13px 4px; border-bottom: 1px solid var(--line-soft); text-align: start; vertical-align: top; }
  .pd-specs th[scope="row"] { width: 38%; color: var(--text-2); font-weight: 500; }
  .ds { color: var(--blue); font-weight: 700; }
  .pd-foot-note { margin-top: 14px; color: var(--text-3); font-size: var(--fs-sm); }
  .pd-foot-note a { text-decoration: underline; text-underline-offset: 3px; }

  /* official datasheet: a file card beside the specs heading (under it on phones) + a quiet link in the buy box */
  .pd-doc {
    display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 14px; padding-inline-start: 10px; border-radius: var(--r-2);
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    transition: border-color var(--t-2) var(--ease), box-shadow var(--t-2) var(--ease), transform var(--t-2) var(--ease);
  }
  @media (hover: hover) { .pd-doc:hover { border-color: var(--text-3); box-shadow: var(--shadow-1); color: var(--text); } }
  @media (hover: none) { .pd-doc:active { transform: scale(.98); } }
  .pd-doc-ic { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 48px; border-radius: 6px; background: var(--bg-sunk); color: var(--text-2); }
  .pd-doc-ic .icon { width: 26px; height: 26px; margin-top: -8px; }
  .pd-doc-ic b { position: absolute; bottom: 6px; padding: 0 4px; border-radius: 3px; background: var(--red-fill); color: #fff; font-size: 9px; line-height: 14px; letter-spacing: .04em; }
  .pd-doc-txt { display: grid; min-width: 0; line-height: 1.6; }
  .pd-doc-txt small { color: var(--text-3); font-size: .8rem; }
  .pd-doc-go { flex: none; width: 20px; height: 20px; margin-inline-start: auto; color: var(--blue); }
  @media (max-width: 640px) { .pd-doc { flex: 1 1 100%; } }
  .pd-ds-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: var(--fs-sm); font-weight: 600; }
  .pd-ds-link .icon { width: 18px; height: 18px; }
  .pd-ds-link small { color: var(--text-3); font-weight: 400; }

  /* the video after the specs: the section above pads it on top */
  .pd-video { display: grid; gap: 16px; padding-block-end: clamp(48px, 7vw, 96px); scroll-margin-top: 52px; }
  .pd-video > * { max-width: 860px; }
  .pd-video h2 { font-size: var(--fs-h2); }
  .pd-video p { color: var(--text-2); max-width: 40em; }

  .pd-setup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pd-service {
    display: grid; align-content: start; gap: 10px; padding: 24px; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line-soft); color: var(--text);
    transition: box-shadow .3s var(--ease-out), transform .3s var(--ease-out), border-color .3s var(--ease-out);
  }
  @media (hover: hover) { .pd-service:hover { box-shadow: var(--shadow-2); transform: translateY(-4px); border-color: transparent; color: var(--text); } }
  @media (hover: none) { .pd-service:active { transform: scale(.98); } }
  .pd-service > .icon { width: 28px; height: 28px; color: var(--blue); }
  .pd-service h3 { font-size: var(--fs-lg); }
  .pd-service p { color: var(--text-2); font-size: var(--fs-sm); }
  .pd-service .link-arrow { margin-top: auto; color: var(--blue); }

  .pd-alt .ctable thead th { min-width: 150px; }
  .pd-alt .ctable thead img { width: 88px; }
  .pd-alt .ctable .me { background: var(--bg-sunk); }
  .pd-alt .ctable thead .me a { color: var(--text); }
  .me-tag { display: block; width: max-content; margin: 0 auto 6px; padding: 0 8px; border-radius: 999px; background: var(--blue-fill); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; }

  @media (max-width: 960px) {
    .pd-hero { grid-template-columns: minmax(0, 1fr); }
    .pd-gallery { position: static; }
    /* landscape on tablets so the buy box starts near the fold; back to 4:3 on phones */
    .pd-stage { aspect-ratio: 16 / 9; }
    .pd-stage img { width: 36%; }
    .pd-feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-lens-in { grid-template-columns: minmax(0, 1fr); }
    .pd-setup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-service { grid-column: 1 / -1; }
    .pd-mini { display: none; }
  }
  @media (max-width: 640px) {
    .pd-stage { aspect-ratio: 4 / 3; }
    .pd-stage img { width: 46%; }
    .pd-feats, .pd-setup { grid-template-columns: minmax(0, 1fr); }
    .pd-feat { min-height: 0; }
    .pd-feat.wide { grid-column: auto; grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .pd-feat.wide .art { display: none; }
    .pd-lens-art .rl { font-size: 22px; }
    .pd-links { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
    .pd-keys { grid-template-columns: minmax(0, 1fr); }
    .pd-specs th[scope="row"] { width: 44%; }
  }

  /* ---------- guide page (guide-<slug>.html): one reading column; the h1 and lede are the LCP text and never animate ---------- */
  .guide, .guide ~ .guide-sec, .guide ~ .pd-video { max-width: calc(760px + var(--gutter) * 2); }
  .guide { display: grid; gap: clamp(20px, 3vw, 32px); padding-block: 16px clamp(32px, 5vw, 56px); }
  .guide-head, .guides-head { display: grid; gap: 14px; }
  .guide-head h1, .guides-head h1 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); }
  .guide-lede { color: var(--text-2); font-size: var(--fs-lg); max-width: 40em; }
  .byline { display: flex; align-items: flex-start; gap: 14px; margin-top: 4px; padding-block: 14px; border-block: 1px solid var(--line-soft); }
  .avatar { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--bg-sunk); }
  span.avatar { display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: var(--fs-xl); font-weight: 700; line-height: 1; }
  .byline-text { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-sm); line-height: 1.8; }
  .byline-name { font-size: var(--fs-md); font-weight: 700; }
  .byline-name a { color: var(--text); }
  .byline-bio { color: var(--text-2); }
  .byline-date { color: var(--text-3); }
  .guide-cover { width: 100%; max-width: 480px; margin-inline: auto; border-radius: var(--r-3); background: var(--bg-sunk); }
  /* a library photo inside the body (markup.js image line), drawn as the cover is */
  .guide-fig { margin: 0; }
  .guide-fig img { width: 100%; max-width: 480px; margin-inline: auto; border-radius: var(--r-3); background: var(--bg-sunk); }
  .guide-body { display: grid; gap: 14px; min-width: 0; font-size: var(--fs-lg); line-height: 2.05; overflow-wrap: anywhere; }
  .guide-body h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); margin-top: 18px; }
  .guide-body h3 { font-size: var(--fs-xl); margin-top: 8px; }
  .guide-body ul, .guide-body ol { margin: 0; padding-inline-start: 1.4em; display: grid; gap: 6px; }
  .guide-body ol { list-style: persian; }
  .guide-body a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .3em; }
  .guide-sec { display: grid; gap: 20px; padding-block: clamp(32px, 5vw, 56px); }
  .guide-sec h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); }
  .guide-sec .head { text-align: start; justify-items: start; margin-bottom: 0; }
  .guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 16px; }
  .guide-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
  .guide-cats a {
    display: inline-flex; align-items: center; min-height: 40px; padding-inline: 16px; border: 1px solid var(--line); border-radius: 999px;
    color: var(--text); font-size: var(--fs-sm); font-weight: 600; transition: border-color var(--t-1) var(--ease), color var(--t-1) var(--ease);
  }
  @media (hover: hover) { .guide-cats a:hover { border-color: var(--blue); color: var(--blue); } }

  /* ---------- guides index (guides.html): the cards, then one block per author (a guide's byline links #author-<login>) ---------- */
  .guides-head { padding-block-start: 16px; }
  .authors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
  .author {
    display: flex; align-items: flex-start; gap: 14px; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--r-2);
    background: var(--surface); scroll-margin-top: calc(var(--nav-h) + 16px); transition: border-color var(--t-1) var(--ease);
  }
  .author:target { border-color: var(--blue); }
  .author > div { display: grid; gap: 4px; min-width: 0; }
  .author h3 { font-size: var(--fs-md); }
  .author p { color: var(--text-2); font-size: var(--fs-sm); }

  /* ---------- devices settle into place as they scroll in (scroll-driven, no JS) ---------- */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .monitor .bezel, .eco svg.topo, .plan-art {
        animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 38%;
        transform-origin: 50% 100%;
      }
      @keyframes settle { from { transform: perspective(1600px) rotateX(9deg) translateY(36px) scale(.95); } to { transform: none; } }   /* transform only: a faded frame drops its text under 4.5:1 while it is already on screen */
      .collage img, .bcard .art { animation: drift-y linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
      @keyframes drift-y { from { translate: 0 18px; } to { translate: 0 -18px; } }
    }
  }
}

/* =====================================================================
   UTILITIES
   ===================================================================== */
@layer utilities {
  .sprite { position: absolute; }
  .ltr { direction: ltr; unicode-bidi: isolate; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
  .hide { display: none; }
  .muted { color: var(--text-3); }
  .no-top { padding-top: 0; }
  .ruled { border-top: 1px solid var(--line-soft); }

  /* reveal on its own property (translate) via animation, so hover transforms and transitions stay intact */
  .js [data-reveal]:not(.in) { opacity: 0; }
  .js [data-reveal].in { animation: reveal .8s var(--ease-enter) var(--d, 0s) both; }
  @keyframes reveal { from { opacity: 0; translate: 0 20px; } to { opacity: 1; translate: 0 0; } }

  @media (prefers-reduced-motion: reduce) {
    .js [data-reveal]:not(.in) { opacity: 1; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  }
}
