/* Shared styles for every page of spottedlabs.eu (loaded by src/layouts/Base.astro).
   Tokens match the previous site's :root (index.html on main); product
   accents are set per page/section through --p. Page-only styles are in src/styles/. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #050a18;
  --bg-mid: #0a0f24;
  --bg-panel: #0f1636;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(148, 163, 255, 0.12);
  --border-hot: rgba(91, 95, 199, 0.55);
  --text: #ffffff;
  --text-dim: #a0aec7;
  --text-mute: #8590ab;
  --accent: #4f6df5;
  --accent-2: #5b5fc7;
  --accent-3: #7c83ff;
  --green: #22d46b;
  --red: #ef4444;
  --amber: #f59e0b;
  /* Product code colours, one per family: Safety indigo, Access & parking sky, Operations teal. */
  --c-ppe: #8b93ff;
  --c-fsd: #8b93ff;
  --c-pac: #38bdf8;
  --c-pvd: #38bdf8;
  --c-dza: #8b93ff;
  --c-pfa: #2dd4bf;
  --c-fma: #2dd4bf;
  --c-ahp: #2dd4bf;
  --p: var(--accent);
  /* Colour of a product's 3-letter code; .p-xxx sets it, everything else uses the brand --p. */
  --pc: var(--accent-3);
  --ff-display: "Albert Sans", ui-sans-serif, system-ui, sans-serif;
  /* NOTE: Albert Sans has no Cyrillic, so Bulgarian pages use Manrope (same
     geometric-grotesque feel, full Cyrillic) through the :lang(bg) rule below. */
  --ff-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }
html:lang(bg) { --ff-display: "Manrope", "Albert Sans", ui-sans-serif, system-ui, sans-serif; }
body {
  font-family: var(--ff-display);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(79, 109, 245, 0.12), transparent 60%),
    radial-gradient(900px 500px at 85% 10%, rgba(91, 95, 199, 0.1), transparent 60%),
    linear-gradient(rgba(148, 163, 255, 0.035) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(148, 163, 255, 0.035) 1px, transparent 1px) 0 0 / 64px 64px;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 3px,
    rgba(255, 255, 255, 0.012) 3px, rgba(255, 255, 255, 0.012) 4px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { left: 16px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ---------- Type ---------- */
h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 900; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
p { color: var(--text-dim); }
.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 60ch; }
.accent { color: var(--accent); }
.p-accent { color: var(--p); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 0.75rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--p);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p); box-shadow: 0 0 10px var(--p); }

.section { padding: 112px 0; position: relative; }
.section.tight { padding: 72px 0; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { margin: 14px 0 16px; }
.section-head.center .lead { margin: 0 auto; }
@media (max-width: 768px) { .section { padding: 72px 0; } .section-head { margin-bottom: 36px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 30px rgba(79, 109, 245, 0.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(79, 109, 245, 0.5); }
.btn-ghost { background: rgba(255, 255, 255, 0.03); border-color: var(--border); color: #fff; }
.btn-ghost:hover { border-color: var(--border-hot); background: rgba(255, 255, 255, 0.06); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(5, 10, 24, 0.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.nav-logo { flex: none; } /* never squeeze the logo when the row is full */
.nav-logo img { height: 28px; width: auto; }
.nav-inner > nav { flex: 1; display: flex; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links > li > a, .nav-links > li > button {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 10px;
  font: 500 0.92rem var(--ff-display); color: var(--text-dim); background: none; border: 0; cursor: pointer;
}
.nav-links > li > a:hover, .nav-links > li > button:hover, .nav-links > li > button[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.04); }
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links .chev { width: 14px; height: 14px; transition: transform 0.2s; }
.nav-links button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font: 600 0.75rem var(--ff-mono); }
.lang a { padding: 8px 10px; color: var(--text-mute); min-width: 40px; text-align: center; }
.lang a[aria-current="true"] { background: rgba(79, 109, 245, 0.18); color: #fff; }
.nav-cta { min-height: 40px; padding: 0 16px; font-size: 0.85rem; }
.mobile-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 10px; background: none; border: 1px solid var(--border); color: #fff; cursor: pointer; }
.mobile-toggle svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Products mega menu — anchored to the nav bar (not the button) so it never runs off-screen. */
.nav-inner { position: relative; }
.has-mega { position: static; }
.mega {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translate(-50%, 6px);
  width: min(880px, 92vw); padding: 22px; border-radius: 18px;
  background: rgba(10, 15, 36, 0.98); border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 22px;
  opacity: 0; visibility: hidden; transition: opacity 0.18s, transform 0.18s var(--ease), visibility 0.18s;
}
.has-mega.open .mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.mega .menu-label { font: 600 0.7rem var(--ff-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); margin: 4px 10px 8px; }
.mega a { display: flex; gap: 12px; padding: 10px; border-radius: 12px; }
.mega a:hover { background: rgba(255, 255, 255, 0.04); }
.mega .code { flex: none; font: 700 0.68rem var(--ff-mono); color: var(--pc); border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); background: color-mix(in srgb, var(--pc) 10%, transparent); border-radius: 8px; padding: 6px 7px; height: fit-content; }
/* color-mix() fallbacks. Safari before 16.2, Chrome before 111 and Firefox before 113 (inside the
   targets in astro.config.mjs) do not know color-mix(). A plain fallback line in front of it does
   not work here: a value containing var() is only checked after the cascade, so those browsers
   treat the property as unset (no border, no background, a black SVG fill) and the earlier
   line is already lost. So each rule that shows a state, a mark or a frame is followed by
   an @supports block that only those browsers apply, with the same colour as a fixed rgba:
   --p is the brand #4f6df5 = rgb(79, 109, 245) in every rule below. --pc differs per product and
   cannot be mixed there, so code badges get a plain var(--pc) border. Hover tints and glows have
   no fallback (their loss changes nothing a visitor needs). */
@supports not (color: color-mix(in srgb, red, blue)) { .mega .code { border: 1px solid var(--pc); } }
.mega strong { display: block; font-size: 0.92rem; }
.mega span.d { display: block; font-size: 0.8rem; color: var(--text-mute); line-height: 1.4; }

.mobile-menu { display: none; }
@media (max-width: 1024px) {
  /* The desktop nav itself is hidden too, not only its list: otherwise it stays in the
     accessibility tree as a second, empty "Main" navigation next to the mobile menu's. */
  .nav-inner > nav, .nav-links, .nav-right .nav-cta, .nav-right .lang { display: none; }
  .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-menu.open { display: block; position: fixed; inset: 72px 0 0; background: var(--bg-deep); overflow-y: auto; padding: 20px 16px 40px; z-index: 99; }
  .mobile-menu .menu-label { font: 600 0.7rem var(--ff-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); margin: 20px 0 6px; }
  .mobile-menu a { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--border); font-weight: 600; }
  .mobile-menu .code { font: 700 0.65rem var(--ff-mono); color: var(--pc); min-width: 36px; }
  .mobile-menu .btn { width: 100%; margin-top: 18px; border-bottom: 0; }
  .mobile-menu .lang { display: inline-flex; margin-top: 20px; }
}
/* Bulgarian header: the labels and the CTA are longer. With the tighter spacing below, the
   desktop row needs ~1120px, which fits the 1152px container from 1200px up; narrower Bulgarian
   pages use the mobile menu (English fits down to 1025px). The range block repeats the 1024px
   rules above for html:lang(bg) only. */
html:lang(bg) .nav-inner { gap: 16px; }
html:lang(bg) .nav-links > li > a, html:lang(bg) .nav-links > li > button { padding: 10px; }
@media (min-width: 1025px) and (max-width: 1199px) {
  html:lang(bg) .nav-inner > nav, html:lang(bg) .nav-links, html:lang(bg) .nav-right .nav-cta, html:lang(bg) .nav-right .lang { display: none; }
  html:lang(bg) .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
  html:lang(bg) .mobile-menu.open { display: block; position: fixed; inset: 72px 0 0; background: var(--bg-deep); overflow-y: auto; padding: 20px 16px 40px; z-index: 99; }
  html:lang(bg) .mobile-menu .menu-label { font: 600 0.7rem var(--ff-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); margin: 20px 0 6px; }
  html:lang(bg) .mobile-menu a { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--border); font-weight: 600; }
  html:lang(bg) .mobile-menu .code { font: 700 0.65rem var(--ff-mono); color: var(--pc); min-width: 36px; }
  html:lang(bg) .mobile-menu .btn { width: 100%; margin-top: 18px; border-bottom: 0; }
  html:lang(bg) .mobile-menu .lang { display: inline-flex; margin-top: 20px; }
}

/* Product code colour scopes (only the 3-letter code is coloured) */
.p-ppe { --pc: var(--c-ppe); } .p-fsd { --pc: var(--c-fsd); } .p-pac { --pc: var(--c-pac); }
.p-pvd { --pc: var(--c-pvd); } .p-dza { --pc: var(--c-dza); } .p-pfa { --pc: var(--c-pfa); } .p-fma { --pc: var(--c-fma); } .p-ahp { --pc: var(--c-ahp); }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  font: 600 0.72rem var(--ff-mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid rgba(148, 163, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}
/* Neutral chip; only the product code (<b>) and the dot carry the family colour. */
.chip b { color: var(--pc); font-weight: 700; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px color-mix(in srgb, var(--pc) 60%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 88px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { margin: 20px 0 22px; }
.hero h1 .accent { background: linear-gradient(90deg, var(--accent-3), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero.product h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
.hero.product h1 .accent { background: none; color: var(--p); }
.hero .lead { margin-bottom: 30px; }
.proof { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px; margin-top: 36px; border-top: 1px solid var(--border); padding-top: 24px; }
.proof div { padding-left: 14px; border-left: 2px solid color-mix(in srgb, var(--p) 55%, transparent); }
@supports not (color: color-mix(in srgb, red, blue)) { .proof div { border-left: 2px solid rgba(79, 109, 245, 0.55); } }
.proof strong { display: block; font: 700 0.98rem var(--ff-display); }
.proof span { font-size: 0.85rem; color: var(--text-mute); }
@media (max-width: 1024px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 600px) {
  .hero { padding: 36px 0 56px; }
  .proof { gap: 14px 16px; }
}

.breadcrumb { font: 500 0.75rem var(--ff-mono); letter-spacing: 0.08em; color: var(--text-mute); display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { color: #fff; }

/* Camera mock frame */
.cam {
  position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border);
  background: #0b1020; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.02);
  aspect-ratio: 4 / 3;
}
.cam > img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) brightness(0.8); }
.cam-top { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; justify-content: space-between; font: 500 0.7rem var(--ff-mono); letter-spacing: 0.08em; }
.cam-top .rec { display: inline-flex; align-items: center; gap: 8px; background: rgba(5, 10, 24, 0.7); padding: 5px 9px; border-radius: 6px; }
.cam-top .rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: blink 1.4s infinite; }
/* Status badge (e.g. EDGE · ONLINE): the same blinking dot in green. */
.cam-top .rec.ok::before { background: var(--green); }
.det { position: absolute; border: 2px solid var(--p); border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 18px color-mix(in srgb, var(--p) 45%, transparent); }
.det b { position: absolute; left: -2px; bottom: 100%; margin-bottom: 4px; white-space: nowrap; font: 700 0.66rem var(--ff-mono); letter-spacing: 0.06em; padding: 3px 7px; border-radius: 4px; background: var(--p); color: #04101a; }
.det.bad { --p: var(--red); }
/* .det.at: box placed with --y/--h (% of the 4:3 photo), e.g. a licence plate. */
.det.at { top: var(--y); height: var(--h); }
.det.warn { --p: var(--amber); }
.det.ok { --p: var(--green); }
/* Decision panel in the top-right corner, for photos whose subject sits low in the frame. */
.cam-panel.top { top: 46px; bottom: auto; }
/* A zone drawn on the camera picture: SVG polygon in % of the photo (viewBox 0 0 100 100). */
.cam-zone { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-zone polygon { fill: rgba(239, 68, 68, 0.14); stroke: var(--red); stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }
/* Counting zones (PFA): same overlay in the product colour instead of red. */
.cam-zone.info polygon { fill: color-mix(in srgb, var(--p) 12%, transparent); stroke: var(--p); }
.zone-tag.info { background: color-mix(in srgb, var(--p) 90%, transparent); color: #04101a; }
@supports not (color: color-mix(in srgb, red, blue)) {
  .cam-zone.info polygon { fill: rgba(79, 109, 245, 0.12); }
  .zone-tag.info { background: rgba(79, 109, 245, 0.9); }
}
.zone-tag { position: absolute; left: var(--x); top: var(--y); font: 700 0.62rem var(--ff-mono); letter-spacing: 0.08em; padding: 3px 7px; border-radius: 4px; background: rgba(239, 68, 68, 0.88); color: #fff; white-space: nowrap; }
.cam-panel {
  position: absolute; right: 12px; bottom: 12px; width: min(300px, 70%);
  background: rgba(5, 10, 24, 0.86); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font: 500 0.72rem var(--ff-mono); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cam-panel .row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--text-dim); }
.cam-panel .row b { color: #fff; font-weight: 600; }
.cam-panel .ok { color: var(--green); } .cam-panel .warn { color: var(--amber); } .cam-panel .no { color: var(--red); }
.cam-panel .title { color: var(--text-mute); letter-spacing: 0.14em; margin-bottom: 6px; display: flex; justify-content: space-between; }
@keyframes blink { 50% { opacity: 0.25; } }
/* Phones: the decision panel moves under the image so it never hides the detections. */
@media (max-width: 600px) {
  .cam { aspect-ratio: auto; }
  .cam > img { height: auto; aspect-ratio: 4 / 3; }
  .cam-panel { position: static; width: auto; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
  /* The frame now also holds the panel, so % of its height no longer matches the photo.
     Margin/padding % follow the width instead: on a 4:3 photo 1% of height = 0.75% of width. */
  .det.at { top: 0; height: 0; margin-top: calc(var(--y) * 0.75); padding-top: calc(var(--h) * 0.75); }
  /* Two plate labels side by side overlap at this width: the second one goes under its box. */
  .det.at + .det.at b { bottom: auto; top: 100%; margin: 4px 0 0; }
  .cam-zone { height: auto; aspect-ratio: 4 / 3; }
  .zone-tag { top: 0; margin-top: calc(var(--y) * 0.75); left: auto; right: 6px; }
  /* Too many labels for a phone-width frame: keep the boxes, label only the problems. */
  .det.at.ok b { display: none; }
  .zone-tag.info { display: none; } /* the panel lists the zones */
}
/* Narrow desktops (1025–1199px): the hero camera is 533px wide from 1200px up, the size its
   labels and decision panel are placed for, but only 447px at 1025px. With pixel sizes the
   panel then covered the detection boxes and the labels ran into each other and into the
   panel. Here the panel and the labels are sized in cqw (1% of the frame's width; the 1200px
   frame is 532.6px, so 1cqw = 5.326px there) and shrink with the frame, keeping the 1200px
   layout. Browsers without container units keep the pixel sizes. The fire page's portrait
   frame (.fsd-cam) is never 533px wide, and its single label fits, so it is left as it is. */
@media (min-width: 1025px) and (max-width: 1199px) {
  .hero .cam:not(.fsd-cam) { container-type: inline-size; }
  .hero .cam:not(.fsd-cam) .cam-panel { width: 56.33cqw; right: 2.25cqw; bottom: 2.25cqw; padding: 2.25cqw 2.63cqw; font-size: 2.16cqw; }
  .hero .cam:not(.fsd-cam) .cam-panel.top { bottom: auto; }
  .hero .cam:not(.fsd-cam) .cam-panel .row { gap: 1.88cqw; padding: 0.75cqw 0; }
  .hero .cam:not(.fsd-cam) .cam-panel .title { margin-bottom: 1.13cqw; }
  .hero .cam:not(.fsd-cam) .det b { font-size: 1.98cqw; padding: 0.56cqw 1.31cqw; }
  .hero .cam:not(.fsd-cam) .zone-tag { font-size: 1.86cqw; padding: 0.56cqw 1.31cqw; }
}

/* ---------- Cards ---------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: border-color 0.2s, transform 0.25s var(--ease), background 0.2s; }
.card:hover { border-color: color-mix(in srgb, var(--p) 45%, transparent); }
.card p { font-size: 0.95rem; margin-top: 10px; }
.ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--p); background: color-mix(in srgb, var(--p) 12%, transparent); border: 1px solid color-mix(in srgb, var(--p) 30%, transparent); margin-bottom: 18px; }
@supports not (color: color-mix(in srgb, red, blue)) { .ico { background: rgba(79, 109, 245, 0.12); border: 1px solid rgba(79, 109, 245, 0.3); } }
.ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1024px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Need-based product chooser (home) */
.need { margin-top: 48px; }
.need:first-of-type { margin-top: 0; }
.need-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.need-head h3 { font-size: 1.35rem; }
.need-head p { font-size: 0.95rem; }
.pcard { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.pcard:hover { transform: translateY(-4px); }
.pcard .media { position: relative; aspect-ratio: 16 / 8; overflow: hidden; border-bottom: 1px solid var(--border); }
.pcard .media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.8) brightness(0.7); transition: transform 0.5s var(--ease); }
.pcard:hover .media img { transform: scale(1.04); }
.pcard .media .chip { position: absolute; top: 14px; left: 14px; background: rgba(5, 10, 24, 0.75); }
.pcard .body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.pcard .outcome { color: #fff; font-size: 1.02rem; font-weight: 600; line-height: 1.45; }
.pcard ul { list-style: none; display: grid; gap: 8px; }
.pcard li { display: flex; gap: 10px; font-size: 0.9rem; color: var(--text-dim); }
.pcard li::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: color-mix(in srgb, var(--p) 18%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; }
/* The whole background shorthand is dropped there, tick image included, so the fallback repeats it. */
@supports not (color: color-mix(in srgb, red, blue)) { .pcard li::before { background: rgba(79, 109, 245, 0.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; } }
.pcard .more { margin-top: auto; padding-top: 8px; font: 600 0.75rem var(--ff-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--p); display: inline-flex; gap: 8px; }

/* ---------- Flow diagram ----------
   HTML diagram: columns on desktop, stacked on mobile. Connectors are
   animated dashed lines (transform-free, disabled for reduced motion). */
.flow-wrap { border: 1px solid var(--border); border-radius: 22px; padding: 28px; background: linear-gradient(180deg, rgba(15, 22, 54, 0.6), rgba(5, 10, 24, 0.4)); }
.zone { position: relative; border: 1.5px dashed color-mix(in srgb, var(--p) 45%, transparent); border-radius: 18px; padding: 40px 22px 22px; }
@supports not (color: color-mix(in srgb, red, blue)) { .zone { border: 1.5px dashed rgba(79, 109, 245, 0.45); } }
.zone-label { position: absolute; top: -12px; left: 18px; padding: 2px 10px; background: var(--bg-mid); font: 600 0.7rem var(--ff-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--p); border-radius: 6px; }
.flow { display: grid; grid-template-columns: minmax(0, 0.9fr) 56px minmax(0, 1.5fr) 56px minmax(0, 1fr); align-items: center; }
/* Hosted products (PPE, DZA, PFA, FMA): only camera → recorder sit on the site; the analysis is in
   the cloud row below. Desktop only, so the stacked layout under 900px stays as it is. */
@media (min-width: 901px) { .flow-2 { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); } }
.node { background: rgba(10, 15, 36, 0.92); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.node .k { font: 600 0.66rem var(--ff-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-mute); }
/* Node titles are h3 (they sit under the section's h2); line-height 1.1 keeps the h1–h4 value, not h3's 1.3. */
.node h3 { font-size: 1rem; font-weight: 700; line-height: 1.1; margin: 6px 0 4px; letter-spacing: -0.01em; }
.node p { font-size: 0.85rem; line-height: 1.45; }
.node .ni { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--p); background: color-mix(in srgb, var(--p) 12%, transparent); margin-bottom: 10px; }
@supports not (color: color-mix(in srgb, red, blue)) { .node .ni { background: rgba(79, 109, 245, 0.12); } }
.node .ni svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.node.edge { border-color: color-mix(in srgb, var(--p) 55%, transparent); box-shadow: 0 0 40px color-mix(in srgb, var(--p) 14%, transparent); padding: 18px; }
@supports not (color: color-mix(in srgb, red, blue)) { .node.edge { border-color: rgba(79, 109, 245, 0.55); } }
.outs { display: grid; gap: 12px; }
.node.out.ok { border-color: rgba(34, 212, 107, 0.4); }
.node.out.sms { border-color: rgba(245, 158, 11, 0.4); }
.link { position: relative; height: 2px; margin: 0 6px; background: repeating-linear-gradient(90deg, var(--p) 0 8px, transparent 8px 14px); background-size: 28px 2px; animation: flowx 1.2s linear infinite; }
.link::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 8px solid var(--p); border-right: 0; }
@keyframes flowx { to { background-position: 28px 0; } }
.vlink { display: flex; justify-content: center; gap: 40px; padding: 14px 0; font: 600 0.72rem var(--ff-mono); letter-spacing: 0.08em; color: var(--text-mute); }
.vlink span { display: inline-flex; align-items: center; gap: 8px; }
.vlink span::before { content: ""; width: 2px; height: 34px; background: repeating-linear-gradient(180deg, var(--accent-3) 0 6px, transparent 6px 11px); background-size: 2px 22px; animation: flowy 1.2s linear infinite; }
@keyframes flowy { to { background-position: 0 22px; } }
.cloud-row { border: 1.5px dashed rgba(124, 131, 255, 0.45); border-radius: 18px; padding: 36px 22px 22px; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cloud-row .zone-label { color: var(--accent-3); }
.power { margin-top: 14px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(34, 212, 107, 0.06); border: 1px solid rgba(34, 212, 107, 0.25); font-size: 0.86rem; color: var(--text-dim); }
.power svg { flex: none; width: 20px; height: 20px; stroke: var(--green); fill: none; stroke-width: 2; }
.power b { color: #fff; }
.flow-note { margin-top: 14px; font: 500 0.75rem var(--ff-mono); letter-spacing: 0.06em; color: var(--text-mute); text-align: center; }
@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; }
  .link { width: 2px; height: 36px; margin: 6px auto; background: repeating-linear-gradient(180deg, var(--p) 0 8px, transparent 8px 14px); background-size: 2px 28px; animation-name: flowy2; }
  .link::after { right: auto; left: -5px; top: auto; bottom: -4px; border: 6px solid transparent; border-top: 8px solid var(--p); border-bottom: 0; }
  .cloud-row { grid-template-columns: 1fr 1fr; }
  .flow-wrap { padding: 16px; }
  .zone { padding: 34px 14px 14px; }
}
@keyframes flowy2 { to { background-position: 0 28px; } }

/* ---------- Segmented control / tabs ---------- */
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); gap: 4px; flex-wrap: wrap; }
.seg button { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: none; color: var(--text-dim); font: 600 0.9rem var(--ff-display); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background 0.2s, color 0.2s; }
.seg button[aria-selected="true"] { background: color-mix(in srgb, var(--p) 18%, transparent); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--p) 50%, transparent); }
@supports not (color: color-mix(in srgb, red, blue)) { .seg button[aria-selected="true"] { background: rgba(79, 109, 245, 0.18); box-shadow: inset 0 0 0 1px rgba(79, 109, 245, 0.5); } }
.seg button .sw { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
[role="tabpanel"][hidden] { display: none; }

/* Mode / scenario matrix */
.modes { display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: start; }
.mode-panel { margin-top: 22px; }
.mode-panel h3 { font-size: 1.5rem; margin-bottom: 10px; }
.mode-panel .when { margin-top: 16px; font-size: 0.92rem; }
.mode-panel .when b { color: #fff; }
.matrix { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.matrix-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--border); }
.matrix-row:first-child { border-top: 0; background: rgba(255, 255, 255, 0.03); font: 600 0.7rem var(--ff-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); }
.matrix-row .veh { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.plate { font: 700 0.78rem var(--ff-mono); padding: 4px 8px; border-radius: 5px; background: #f3f4f6; color: #0b1020; border-left: 6px solid #1d4ed8; letter-spacing: 0.04em; white-space: nowrap; }
.res { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; }
.res::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.res.open { color: var(--green); } .res.closed { color: var(--red); } .res.notify { color: var(--amber); }
.res small { display: block; font-weight: 500; color: var(--text-mute); font-size: 0.8rem; }
@media (max-width: 900px) { .modes { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .matrix-row { grid-template-columns: 1fr; gap: 6px; } }

/* Resilience scenarios */
.resil { display: grid; grid-template-columns: 1fr 1.2fr; gap: 36px; align-items: center; }
.status-list { list-style: none; display: grid; gap: 10px; margin-top: 22px; }
.status-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); font-size: 0.95rem; }
.st { font: 700 0.7rem var(--ff-mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
.st.on { color: var(--green); background: rgba(34, 212, 107, 0.1); }
.st.later { color: var(--amber); background: rgba(245, 158, 11, 0.1); }
.st.off { color: var(--red); background: rgba(239, 68, 68, 0.1); }
@media (max-width: 900px) { .resil { grid-template-columns: 1fr; } }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: st; }
.step { counter-increment: st; }
.step::before { content: counter(st, decimal-leading-zero); display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--p) 55%, transparent); color: var(--p); font: 700 0.95rem var(--ff-mono); box-shadow: 0 0 24px color-mix(in srgb, var(--p) 25%, transparent); }
@supports not (color: color-mix(in srgb, red, blue)) { .step::before { border: 1px solid rgba(79, 109, 245, 0.55); } }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* Dashboard mock */
.dash { border: 1px solid var(--border); border-radius: 18px; background: rgba(10, 15, 36, 0.85); overflow: hidden; }
.dash-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font: 500 0.75rem var(--ff-mono); color: var(--text-mute); }
.dash-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3150; }
.dash-body { padding: 20px; display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: rgba(255, 255, 255, 0.02); }
.kpi span { font: 600 0.66rem var(--ff-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); }
.kpi strong { display: block; font-size: 1.6rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--text-mute); font-size: 0.78rem; }
.log { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.log th { text-align: left; font: 600 0.66rem var(--ff-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-mute); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.log td { padding: 12px; border-bottom: 1px solid rgba(148, 163, 255, 0.07); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.log td:first-child { font-family: var(--ff-mono); font-size: 0.8rem; }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 600 0.7rem var(--ff-mono); padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.tag.g { color: var(--green); background: rgba(34, 212, 107, 0.1); }
.tag.r { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.tag.a { color: var(--amber); background: rgba(245, 158, 11, 0.1); }
.table-scroll { overflow-x: auto; }
@media (max-width: 768px) { .kpis { grid-template-columns: 1fr 1fr; } .log .hide-sm { display: none; } }

/* Timeline (FSD) */
.timeline { list-style: none; position: relative; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 0 0 26px; }
.timeline li::before { content: ""; position: absolute; left: 117px; top: 8px; bottom: -8px; width: 2px; background: linear-gradient(var(--p), transparent); opacity: 0.4; }
.timeline li:last-child::before { display: none; }
.timeline .t { font: 700 0.8rem var(--ff-mono); color: var(--p); text-align: right; padding-top: 2px; }
.timeline .e { position: relative; padding-left: 22px; }
.timeline .e::before { content: ""; position: absolute; left: -9px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg-deep); border: 2px solid var(--p); }
.timeline .e strong { display: block; }
.timeline .e p { font-size: 0.9rem; margin-top: 4px; }

/* Callout / disclaimer */
.note { display: flex; gap: 14px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.025); font-size: 0.9rem; color: var(--text-dim); }
.note svg { flex: none; width: 20px; height: 20px; stroke: var(--amber); fill: none; stroke-width: 2; margin-top: 2px; }
.note b { color: #fff; }

/* Use cases */
.uc { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; border: 1px solid var(--border); }
.uc img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.8) brightness(0.6); }
.uc div { position: absolute; inset: auto 0 0; padding: 20px; background: linear-gradient(transparent, rgba(5, 10, 24, 0.95)); }
.uc span { font: 600 0.68rem var(--ff-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--p); }
.uc h3 { margin-top: 6px; font-size: 1.05rem; }
.uc p { font-size: 0.85rem; margin-top: 4px; }

/* FAQ */
.faq { max-width: 840px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 22px; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 56px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.4rem var(--ff-mono); color: var(--accent-3); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; font-size: 0.95rem; max-width: 70ch; }
/* "Show all questions" (Faq.astro): phones only, shown by the phone rules below. */
.faq-more { display: none; }

/* Related + CTA + footer */
.related a { display: flex; gap: 14px; align-items: center; }
.cta-band { border: 1px solid var(--border-hot); border-radius: 26px; padding: 64px 32px; text-align: center; background: radial-gradient(600px 240px at 50% 0%, rgba(79, 109, 245, 0.22), transparent 70%), rgba(15, 22, 54, 0.55); }
.cta-band h2 { margin-bottom: 14px; }
.cta-band .lead { margin: 0 auto 28px; }
.cta-band .btn-row { justify-content: center; }
footer.site { border-top: 1px solid var(--border); padding: 64px 0 32px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.foot-grid .foot-label { font: 600 0.7rem var(--ff-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 14px; }
.foot-grid ul { list-style: none; display: grid; gap: 10px; font-size: 0.9rem; color: var(--text-dim); }
.foot-grid a:hover { color: #fff; }
/* Free consultation: dialog shell + three-step wizard (both built by site.js).
   margin: auto brings back the browser's centring of a modal dialog, which the * reset above removes. */
/* Each 100dvh comes after a 100vh line for browsers without dvh units (Chrome before 108,
   Firefox before 101, Safari before 15.4), which drop the dvh line. */
.consult { margin: auto; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--border-hot); border-radius: 20px; background: var(--bg-panel); color: var(--text); font-family: var(--ff-display); }
.consult::backdrop { background: rgba(3, 6, 16, 0.74); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.consult-box { position: relative; padding: 30px 32px; max-height: calc(100vh - 34px); max-height: calc(100dvh - 34px); overflow-y: auto; }
.consult h2 { margin: 10px 0 6px; font-size: 1.55rem; padding-right: 48px; }
.consult-sub { color: var(--text-dim); margin-bottom: 18px; }
.consult-x { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.consult-x:hover { border-color: var(--border-hot); }
.cw { display: grid; gap: 16px; }
/* The wizard shows/hides steps, buttons and the thank-you block with the hidden attribute;
   their own display: grid/flex rules would otherwise override it. */
.cw [hidden] { display: none !important; }
.cw-head { display: grid; gap: 8px; }
.cw-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cw-progress span { height: 4px; border-radius: 4px; background: var(--border); transition: background 0.3s var(--ease); }
.cw-progress span.on { background: var(--accent); }
.cw-count { font: 600 0.7rem var(--ff-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mute); }
.cw-step { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 14px; animation: cw-in 0.25s var(--ease); }
@keyframes cw-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cw-title { font-size: 1.2rem; outline: none; }
.cw-hint { margin-top: -6px; font-size: 0.88rem; color: var(--text-mute); }
.cw-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cw-card, .cw-chip { position: relative; }
.cw-card input, .cw-chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.cw-card span { position: relative; display: grid; gap: 2px; height: 100%; padding: 12px 34px 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); transition: border-color 0.2s, background 0.2s; }
.cw-card b { font: 600 0.62rem var(--ff-mono); letter-spacing: 0.1em; color: var(--pc); }
.cw-card strong { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.cw-card small { font-size: 0.78rem; color: var(--text-mute); }
.cw-card:hover span { border-color: color-mix(in srgb, var(--p) 50%, transparent); }
.cw-card input:checked + span { border-color: var(--p); background: color-mix(in srgb, var(--p) 12%, transparent); }
.cw-card input:checked + span::after { content: "✓"; position: absolute; top: 10px; right: 12px; color: var(--p); font-weight: 700; }
.cw-card.cw-unsure { --p: var(--text-dim); }
/* The "Not sure yet" card mixes --text-dim (#a0aec7) instead of the brand colour. */
@supports not (color: color-mix(in srgb, red, blue)) {
  .cw-card input:checked + span { background: rgba(79, 109, 245, 0.12); }
  .cw-card.cw-unsure input:checked + span { background: rgba(160, 174, 199, 0.12); }
}
.cw-card input:focus-visible + span, .cw-chip input:focus-visible + span { outline: 2px solid var(--accent-3); outline-offset: 2px; }
.cw-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.cw-label { margin-bottom: 8px; font-size: 0.85rem; color: var(--text-dim); }
.cw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-chip span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.86rem; color: var(--text-dim); transition: border-color 0.2s, background 0.2s; }
.cw-chip:hover span { border-color: var(--border-hot); }
.cw-chip input:checked + span { border-color: var(--accent); background: rgba(79, 109, 245, 0.16); color: var(--text); }
.cw-field, .cw-row > label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--text-dim); }
.cw-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cw input[type="text"], .cw input[type="email"], .cw input[type="tel"], .cw textarea {
  min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03);
  color: var(--text); font: inherit; font-size: 16px; }
.cw textarea { resize: vertical; min-height: 84px; }
.cw input:user-invalid, .cw textarea:user-invalid { border-color: var(--red); }
.cw-consent { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; font-size: 0.85rem; color: var(--text-dim); }
.cw-consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.cw-consent a { color: var(--accent-3); text-decoration: underline; }
.cw-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cw-nav { display: flex; gap: 10px; }
.cw-nav .cw-next, .cw-nav .cw-send { margin-left: auto; }
.cw-done { display: grid; justify-items: center; gap: 10px; padding: 28px 0 8px; text-align: center; outline: none; }
.cw-done p { color: var(--text-dim); max-width: 40ch; }
.cw-check { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(34, 212, 107, 0.14); color: var(--green); font-size: 1.6rem; }
.consult-status { min-height: 1.3em; font-size: 0.92rem; }
.consult-status.err { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .cw-step { animation: none; } }
@media (max-width: 600px) { .cw-cards, .cw-row { grid-template-columns: 1fr; } .consult-box { padding: 24px 18px; } }
/* Keep nav labels on one line (Bulgarian labels and CTA are longer). Top-level items only:
   the mega menu links sit inside .nav-links too and must wrap, or the long Bulgarian names
   push the third column out of the panel and past the screen edge. */
.nav-links > li > a, .nav-links > li > button, .nav-cta { white-space: nowrap; }
/* Long Bulgarian words must not push cloud-row boxes past the screen on small phones. */
.cloud-row .node { min-width: 0; overflow-wrap: anywhere; }
/* In two narrow columns those words still broke mid-word; one box per row on small phones. */
@media (max-width: 480px) { html:lang(bg) .cloud-row { grid-template-columns: 1fr; } }
/* Links inside FAQ answers must be visible (the base `a` rule inherits colour, no underline). */
.faq p a { color: var(--accent-3); text-decoration: underline; }
/* Design-preview marker for facts or numbers the owner still has to confirm. */
.tbc { background: none; color: inherit; border-bottom: 1.5px dashed var(--amber); padding: 0 1px; }
.tbc::after { content: "to confirm"; margin-left: 6px; font: 600 0.58rem var(--ff-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); vertical-align: middle; }
.foot-legal { display: flex; gap: 14px; flex-wrap: wrap; }
.foot-legal a:hover, .foot-base a:hover { color: #fff; }
.foot-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); font: 500 0.75rem var(--ff-mono); color: var(--text-mute); }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* ==========================================================================
   Phones, folds and tablets: shorter pages, swipe rows, touch targets.
   Every rule below sits in a media query with max-width 1024px or less, so desktop
   (1025px and wider) is untouched. Breakpoints: ≤600px phones and fold cover screens,
   601–899px unfolded phones and portrait tablets, ≤1024px everything with a touch screen.
   ========================================================================== */

/* ---------- Touch targets: at least 44 x 44px ---------- */
@media (max-width: 1024px) {
  /* The logo link becomes as tall as the menu button; the 28px image stays centred in the bar. */
  .nav-logo { display: inline-flex; align-items: center; min-height: 44px; }
  .mobile-toggle { flex: none; } /* never squeezed below 44px by the header row */
  .mobile-menu .lang a { min-width: 48px; }
  /* Breadcrumb links: a larger invisible hit area around the small text, so the row keeps its height. */
  .breadcrumb a { position: relative; }
  .breadcrumb a::after { content: ""; position: absolute; inset: -14px -6px; }
  /* Product code chips that are links (industry cards on the home page). */
  a.chip { min-height: 44px; min-width: 44px; justify-content: center; }
  /* Standalone "more" links under a paragraph. */
  .home-more .more, .how-more, .pfa-more, .mua-more { display: inline-flex; min-height: 44px; align-items: center; }
  /* Footer links: one 44px row each; the list gap moves into the rows. */
  .foot-grid ul { gap: 0; }
  .foot-grid li > a, .foot-base a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .foot-legal { column-gap: 18px; }

  /* Body text of 14px or more (these were 13.6–13.8px). */
  .proof span, .node p, .uc p, .power, .cw-card small { font-size: 0.875rem; }
}

/* ---------- Short landscape screens (open folds, small tablets): a lower sticky header ---------- */
@media (max-width: 1024px) and (max-height: 720px) and (orientation: landscape) {
  .nav-inner { height: 60px; }
  .mobile-menu.open { inset: 60px 0 0; }
}

/* ---------- Unfolded phones and tablets (601–1024px) ---------- */
/* The hero camera view, under the text here, at about its desktop size (535px there) instead of the
   full width: a full-width view filled a landscape fold's whole screen. Beside the text it would be
   under 470px wide, and its panel would cover the detection labels. */
@media (min-width: 601px) and (max-width: 1024px) {
  .hero-grid > .cam, .hero:not(.product) .hero-grid > div:last-child { width: 100%; max-width: 600px; justify-self: center; }
}
/* The flow diagram, when stacked: a centred column instead of full-width boxes, the results side by side. */
@media (min-width: 601px) and (max-width: 900px) {
  .flow { justify-items: center; }
  .flow > .node { width: min(100%, 480px); }
  .outs { width: 100%; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (min-width: 768px) and (max-width: 900px) { .cloud-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Three cards in a row from 900px, as on desktop (two columns left the third card alone on a row). */
@media (min-width: 900px) and (max-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Swipe rows ----------
   Card rows that would stack into one long column scroll sideways instead, with the next card
   peeking in: one card at a time on phones (≤600px), two at a time for three-card rows on
   unfolded phones and portrait tablets (601–899px). Native scrolling with snap points: no
   JavaScript carousel, no autoplay. A row with nothing focusable inside is made a focusable,
   labelled region by /assets/site.js while it scrolls, so keyboard users can scroll it too.
   The row reaches the screen edges (negative margin = the container's side padding). */
@media (max-width: 600px) {
  .grid-3, .grid-4, .need .grid-2, #teams .grid-2, .how-cards, .home-stack, .sec-stack, .pfa-points, .mua-points, .proof, .dash-body > .pfa-two, .dash-body > .mua-two {
    display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(84%, 340px);
    gap: 12px; margin-inline: -16px; padding: 2px 16px 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    scrollbar-width: thin; scrollbar-color: var(--border-hot) transparent;
  }
  /* Outcome cards: the row is the page container itself, already full width. */
  .container.grid-3 { margin-inline: auto; }
  :is(.grid-3, .grid-4, .need .grid-2, #teams .grid-2, .how-cards, .home-stack, .sec-stack, .pfa-points, .mua-points, .proof, .dash-body > .pfa-two, .dash-body > .mua-two) > * { min-width: 0; scroll-snap-align: start; }
  :is(.grid-3, .grid-4, .need .grid-2, #teams .grid-2, .how-cards, .home-stack, .sec-stack, .pfa-points, .mua-points, .proof, .dash-body > .pfa-two, .dash-body > .mua-two):focus-visible { outline-offset: -2px; border-radius: 12px; }
  /* Hero proof points: a line or two each, so narrower columns show more than one at a time.
     (The phone rules below keep their 20px top padding under the border.) */
  .proof { grid-auto-columns: min(62%, 240px); }
  /* PFA and FMA dashboard charts: the row sits in the dashboard body, whose side padding is 14px
     on phones, so it reaches the dashboard's edges instead of the screen's. */
  .dash-body > .pfa-two, .dash-body > .mua-two { margin-inline: -14px; padding-inline: 14px; scroll-padding-inline: 14px; }
  /* Cards that put an icon beside the text: icon above it, so long (Bulgarian) words fit a narrow card. */
  .related a, .home-mini, .sec-mini, .pfa-point, .mua-point { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* Grid items may shrink below their content (a wide table then scrolls inside its own box). */
  .hero-grid > *, .resil > *, .modes > *, [class*="-split"] > *, .grid-2 > * { min-width: 0; }
}
@media (min-width: 601px) and (max-width: 899px) {
  .grid-3 {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 2.15);
    gap: 16px; margin-inline: -24px; padding: 2px 24px 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 24px;
    scrollbar-width: thin; scrollbar-color: var(--border-hot) transparent;
  }
  .container.grid-3 { margin-inline: auto; }
  .grid-3 > * { min-width: 0; scroll-snap-align: start; }
  .grid-3:focus-visible { outline-offset: -2px; border-radius: 12px; }
}

/* ---------- Phones (≤600px): tighter rhythm, compact blocks ---------- */
@media (max-width: 600px) {
  .section { padding: 40px 0; }
  .section.tight { padding: 28px 0; }
  .section-head { margin-bottom: 20px; }
  .section-head h2 { margin: 10px 0 12px; }
  h2 { font-size: 1.75rem; }
  .lead { font-size: 1.05rem; }
  /* Slimmer buttons: two short ones (e.g. the English hero pair) fit side by side from 375px. */
  .btn { padding: 0 16px; }
  .btn-row { gap: 10px; }
  .hero { padding: 24px 0 40px; }
  .hero h1 { margin: 14px 0; }
  .hero .lead { margin-bottom: 22px; }
  .proof { margin-top: 26px; padding-top: 20px; }
  .card { padding: 22px; }
  .pcard { padding: 0; }
  .pcard .body { padding: 20px; gap: 10px; }
  .need { margin-top: 32px; }
  .need-head { margin-bottom: 12px; }

  /* Flow diagram: icon beside the text, shorter connectors. */
  .flow-wrap { padding: 12px; border-radius: 18px; }
  .zone { padding: 30px 12px 12px; }
  .node, .node.edge { padding: 12px 14px; }
  .flow > .node, .outs > .node { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-content: start; }
  .flow > .node > .ni, .outs > .node > .ni { grid-row: span 3; margin: 0; }
  .flow > .node > :not(.ni), .outs > .node > :not(.ni) { grid-column: 2; }
  .link { height: 22px; margin: 4px auto; }
  .vlink { padding: 8px 0; }
  .vlink span::before { height: 22px; }
  .cloud-row { padding: 30px 12px 12px; gap: 8px; }

  /* Steps: number beside the text instead of above it. */
  .steps { gap: 14px; }
  .step { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
  .step::before { grid-row: 1 / span 2; width: 40px; height: 40px; margin: 0; font-size: 0.85rem; }
  .step > * { grid-column: 2; }
  .step p { margin-top: 2px; }

  .timeline li { padding-bottom: 20px; }
  .status-list { gap: 8px; margin-top: 18px; }
  .status-list li { padding: 11px 14px; }
  .matrix-row { padding: 12px 14px; }
  .note { padding: 16px; }
  .dash-body { padding: 14px; gap: 12px; }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 1.4rem; }
  .log th { padding: 8px; }
  .log td { padding: 10px 8px; }
  .faq summary { padding: 16px 18px; min-height: 52px; }
  .faq details p { padding: 0 18px 16px; }
  /* FAQ: the first three questions until "Show all questions" expands the list (site.js sets
     and removes data-collapsed; without JavaScript it is never set, so every question shows). */
  .faq[data-collapsed] > details:nth-of-type(n+4) { display: none; }
  .faq[data-collapsed] + .faq-more:not([hidden]) { display: flex; width: 100%; max-width: 840px; margin: 10px auto 0; }
  .cta-band { padding: 40px 20px; border-radius: 20px; }
  .cta-band .lead { margin-bottom: 22px; }
  footer.site { padding: 44px 0 28px; margin-top: 16px; }
  .foot-base { margin-top: 28px; }
  /* Footer: the product links repeat the menu, so phones leave them out. */
  .foot-products { display: none; }

  /* Dashboard mock-ups: only the KPI tiles. The log tables after them (on the PFA and FMA pages,
     the panel holding the table) are left out; their charts stay. */
  .kpis ~ .table-scroll, .kpis ~ .pfa-panel, .kpis ~ .mua-panel { display: none; }
  /* Flow diagrams: the one-line summary under the diagram is for screen readers only (the
     diagram points at it with aria-describedby); the stacked diagram shows the same steps. */
  .flow-note { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

  /* Camera views: labels kept inside the photo. On the home view the two labels on the right
     half run from their box's right edge to the left, not past the frame. */
  .home-overlay .det.bad b, .home-overlay .det.p-fma b { left: auto; right: -2px; }
  /* That puts the no-go label right above the "hi-vis" label; a little more room keeps them apart. */
  .home-overlay .det.bad b { margin-bottom: 8px; }
  /* PPE and DZA: a label drawn under its box would run past the bottom of the photo onto the
     panel below it, so it sits inside the box, at its foot.
     NOTE: !important only because the desktop placement is an inline style on the label. */
  .cam .det.at.bad b[style*="top:100%"] { top: auto !important; bottom: 3px !important; left: 3px; margin: 0 !important; }
  /* PVD: the one label shown on phones is centred on its plate, so it fits the narrowest frames. */
  .p-pvd .cam .det.at.bad b { left: 50%; transform: translateX(-50%); }
}
@media (max-width: 768px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Small phones (≤400px) and the narrowest fold cover screens (≤360px) ---------- */
@media (max-width: 400px) {
  h1 { font-size: 2.15rem; }
  .hero.product h1 { font-size: 1.95rem; }
}
@media (max-width: 360px) {
  h1 { font-size: 1.95rem; }
  .hero.product h1 { font-size: 1.75rem; }
  h2 { font-size: 1.6rem; }
  /* Long (Bulgarian) words break instead of pushing the page wider than the screen. */
  h1, h2, h3, h4, .lead, .faq summary, .kpi span, .kpi small { overflow-wrap: anywhere; }
  .matrix-row .veh, .status-list li { flex-wrap: wrap; }
  /* Header row: logo + menu button need 174px plus the gaps; 28px gaps did not fit a 280px screen. */
  .nav-inner { gap: 12px; }
  .cam-top { left: 10px; right: 10px; font-size: 0.62rem; }
}
@media (max-width: 340px) {
  /* Old fold cover screens (280px): a tighter hero brings the main button closer to the first screen. */
  .hero { padding-top: 16px; }
  h1 { font-size: 1.8rem; }
  .hero.product h1 { font-size: 1.6rem; }
  .hero .lead { font-size: 1rem; margin-bottom: 18px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  /* KPI tiles one per row: two side by side are too narrow for word values such as "Затворен". */
  .kpis { grid-template-columns: minmax(0, 1fr); }
  /* Camera views: smaller labels, so the crowded home view keeps its labels apart. */
  .det b, .zone-tag { font-size: 0.56rem; padding: 2px 5px; }
  .cam-top .rec { padding: 3px 6px; gap: 5px; }
  /* Keeps the home badge "CAM_01 · WAREHOUSE A" on one line at 280px. */
  .cam-top { letter-spacing: 0.02em; }
  .home-overlay .det.bad b { margin-bottom: 4px; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
/* Printing: blocks the visitor never scrolled to are still hidden (opacity 0); print them all. */
@media print { .reveal { opacity: 1; transform: none; } }
