/* ==========================================================================
   3 · SWARM OS — interactive product demo            prefix: os-
   Builds on css/base.css tokens and components; never redefines them.
   - One ARIA tablist, restyled: sidebar (> 900px) / swipeable strip (≤ 900px).
   - Panel internals reflow on the panel's own width (container "os-panels"),
     so the mock stays crisp at 1100px and stacks cleanly at 375px.
   - Intro animations only run when js/sections/os.js adds .os-anim
     (never under prefers-reduced-motion); without JS everything renders final.
   ========================================================================== */

.os {
  --os-side: clamp(200px, 22vw, 240px);
  --os-line: #E5E7EB;
  --os-line-2: #EEF0F3;
  --os-soft: #F4F6FB;
  --os-hover: #F8F9FC;
  --os-canvas: #F8F9FB;
  --os-head: #FAFBFC;
  --os-t2: #4B5563;
  --os-t3: #636A77;           /* ≥ 4.9:1 on every light surface used here */
  --os-icon: #8A93A3;
  --os-green: #047857;
  --os-green-bg: #E3F5EE;
  --os-blue: #1D4ED8;
  --os-blue-bg: #EAF1FE;
  --os-amber: #92400E;
  --os-amber-bg: #FEF3C7;
  --os-slate: #374151;
  --os-slate-bg: #EEF0F3;
  --os-pale-navy: #C9D6E8;
}

/* Yellow focus rings vanish on white: use the blue light source here instead */
.os :focus-visible { outline-color: var(--glow-blue); }

.os-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Drafting-table grid that only shows around the product, fading to white */
.os-grid {
  -webkit-mask-image: radial-gradient(ellipse 64% 46% at 50% 58%, #000 0%, rgba(0, 0, 0, .5) 46%, transparent 78%);
          mask-image: radial-gradient(ellipse 64% 46% at 50% 58%, #000 0%, rgba(0, 0, 0, .5) 46%, transparent 78%);
}

/* Shared outline icon (sprite symbols are stroked from here) */
.os-ico {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Section head ---------- */
.os-head { max-width: 860px; }
.os-title { font-weight: 400; text-wrap: balance; }
.os-lede { max-width: 640px; }

/* ---------- Stage + hint ---------- */
.os-stage { position: relative; margin-top: 40px; padding-top: 62px; }
.os-stage::before {                       /* soft light pooling under the window */
  content: ''; position: absolute; left: 4%; right: 4%; bottom: -56px; height: 64%;
  background: radial-gradient(ellipse 50% 58% at 50% 72%, rgba(37, 99, 235, .10), transparent 72%);
  pointer-events: none;
}

.os-hint {
  position: absolute; top: 0; left: 20px; z-index: 3;
  display: none; align-items: center; gap: 8px;
  padding: 10px 17px 10px 14px; border-radius: 99px;
  background: var(--yellow); color: var(--ink);
  font: 700 13px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 12px 26px -12px rgba(184, 140, 0, .75);
  animation: os-bob 2.4s var(--ease-in-out) infinite;
  transition: opacity .35s var(--ease-out), visibility 0s linear 0s;
}
.os-hint::after {                          /* pointer triangle */
  content: ''; position: absolute; left: 24px; bottom: -5px;
  width: 12px; height: 12px; border-radius: 2px; background: var(--yellow); transform: rotate(45deg);
}
.os-hint__emoji { font-size: 15px; line-height: 1; letter-spacing: 0; }
.os-hint__tap { display: none; }
.os-ready .os-hint { display: inline-flex; }
.os-explored .os-hint { opacity: 0; visibility: hidden; transition: opacity .35s var(--ease-out), visibility 0s linear .35s; }
@media (hover: none) and (pointer: coarse) {
  .os-hint__click { display: none; }
  .os-hint__tap { display: inline; }
}
@keyframes os-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Window ---------- */
.os-window {
  position: relative;
  display: grid;
  grid-template-columns: var(--os-side) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "brand bar"
    "nav   panels"
    "foot  panels";
  min-height: 540px;
  background: var(--white);
  border: 1px solid var(--os-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 64px -30px rgba(15, 23, 42, .35);
  overflow: hidden;
  color: var(--text);
  text-align: left;
}

/* Sidebar header */
.os-brand {
  grid-area: brand; display: flex; align-items: center; gap: 12px; min-width: 0;
  min-height: 64px; padding: 0 18px 0 20px;
  border-right: 1px solid var(--os-line); border-bottom: 1px solid var(--os-line);
}
.os-brand__tile {
  display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px;
  border-radius: 9px; background: var(--yellow); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(11, 14, 26, .06), 0 6px 14px -6px rgba(217, 174, 0, .8);
}
.os-brand__glyph { width: 24px; height: 24px; }
.os-brand__text { display: flex; flex-direction: column; min-width: 0; }
.os-brand__name { font: 400 21px/1 var(--f-display-2); letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.os-brand__sub { margin-top: 4px; font: 600 11px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--os-t3); white-space: nowrap; }

/* Title bar */
.os-bar {
  grid-area: bar; display: flex; align-items: center; gap: 14px; min-width: 0;
  min-height: 64px; padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--os-line); background: var(--white);
}
.os-bar__dots { display: flex; gap: 7px; flex-shrink: 0; }
.os-bar__dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .14); }
.os-bar__dots i:nth-child(2) { background: #FEBC2E; }
.os-bar__dots i:nth-child(3) { background: #28C840; }
.os-bar__title {
  flex: 1 1 auto; min-width: 0; white-space: nowrap;
  font: 600 13px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--os-t3);
}
.os-bar__search {
  display: none; align-items: center; gap: 8px; flex-shrink: 0; width: 232px; height: 34px; padding: 0 7px 0 11px;
  border: 1px solid var(--os-line); border-radius: 8px; background: var(--os-canvas);
  font-size: 13px; color: var(--os-t3);
}
.os-bar__search .os-ico { width: 15px; height: 15px; color: var(--os-icon); }
.os-bar__search span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-bar__search kbd {
  padding: 3px 6px; border: 1px solid var(--os-line); border-radius: 4px; background: var(--white);
  font: 600 11px/1 var(--f-body); color: var(--os-t3);
}
@media (min-width: 1000px) { .os-bar__search { display: flex; } }
/* "● Live" pill doubles as the demo's pause control (WCAG 2.2.2); os.js toggles aria-pressed + .os-paused */
.os-live {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; min-height: 26px;
  padding: 0 11px 0 9px; border-radius: 99px; background: var(--os-green-bg); color: var(--os-green);
  font: 700 11px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s;
}
.os-live:hover { box-shadow: inset 0 0 0 1px rgba(4, 120, 87, .35); }
.os-live__dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #10B981; animation: dotPulse 2s ease infinite; }
.os-live__off { display: none; }
@media (hover: hover) {   /* hovering the running pill previews the pause glyph */
  .os-live[aria-pressed="false"]:hover .os-live__dot {
    border-radius: 1px; animation: none;
    background: linear-gradient(90deg, currentColor 0 2.5px, transparent 2.5px 4.5px, currentColor 4.5px 7px);
  }
}
.os-live[aria-pressed="false"]:focus-visible .os-live__dot {
  border-radius: 1px; animation: none;
  background: linear-gradient(90deg, currentColor 0 2.5px, transparent 2.5px 4.5px, currentColor 4.5px 7px);
}
.os-live[aria-pressed="true"] { background: var(--os-slate-bg); color: var(--os-slate); }
.os-live[aria-pressed="true"]:hover { box-shadow: inset 0 0 0 1px rgba(55, 65, 81, .3); }
.os-live[aria-pressed="true"] .os-live__on { display: none; }
.os-live[aria-pressed="true"] .os-live__off { display: inline; }
.os-live[aria-pressed="true"] .os-live__dot {   /* play triangle = "click to resume" */
  width: 0; height: 0; border-radius: 0; background: none; animation: none;
  border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent currentColor;
}

/* Modules nav (the tablist) */
.os-nav { grid-area: nav; min-width: 0; padding: 20px 0 16px; border-right: 1px solid var(--os-line); background: var(--white); }
.os-nav__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px 10px; }
.os-nav__label { font: 700 11px/1 var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--os-t3); }
.os-nav__swipe { display: none; font: 600 11px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--os-t3); white-space: nowrap; }
.os-tabs { position: relative; display: flex; flex-direction: column; gap: 2px; }
.os-tab {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px;
  padding: 0 16px 0 17px; border-left: 3px solid transparent;
  font: 500 14px/1.2 var(--f-body); color: var(--os-t2); text-align: left;
  transition: background-color .2s, color .2s, border-color .2s;
}
.os-tab .os-ico { color: var(--os-icon); transition: color .2s; }
.os-tab:hover { background: var(--os-hover); color: var(--ink); }
.os-tab:hover .os-ico { color: var(--navy); }
.os-tab[aria-selected="true"] { border-left-color: var(--yellow); background: var(--os-soft); color: var(--ink); font-weight: 600; }
.os-tab[aria-selected="true"] .os-ico { color: var(--navy); }
.os-tab:focus-visible { outline-offset: -3px; }
.os-tab__label { flex: 1 1 auto; min-width: 0; }
.os-tab__badge {
  min-width: 22px; padding: 4px 6px; border-radius: 99px; background: var(--yellow); color: var(--ink);
  font: 700 11px/1 var(--f-label); letter-spacing: .04em; text-align: center;
}
.os-tab__live { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }

/* Invitation pulse on one tab until the first interaction (os.js adds/removes .os-invite) */
.os-invite .os-tab[data-invite][aria-selected="false"] { animation: os-invite 2.6s var(--ease-in-out) infinite; }
@keyframes os-invite {
  0%, 100% { background-color: rgba(247, 198, 0, 0); border-color: transparent; }
  50% { background-color: rgba(247, 198, 0, .13); border-color: rgba(247, 198, 0, .6); }
}

/* Sidebar footer */
.os-foot {
  grid-area: foot; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 14px 16px 14px 20px; border-top: 1px solid var(--os-line); border-right: 1px solid var(--os-line);
}
.os-foot__av {
  display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: var(--white); font: 700 12px/1 var(--f-label); letter-spacing: .06em;
}
.os-foot__text { display: flex; flex-direction: column; min-width: 0; }
.os-foot__name { font-size: 13.5px; font-weight: 600; line-height: 1.25; color: var(--ink); white-space: nowrap; }
.os-foot__plan { font-size: 12px; line-height: 1.3; color: var(--os-t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-foot__gear { width: 17px; height: 17px; margin-left: auto; color: var(--os-icon); }

/* ---------- Panels ---------- */
.os-panels {
  grid-area: panels; display: flex; flex-direction: column; min-width: 0;
  background: var(--os-canvas);
  container: os-panels / inline-size;
}
@media (min-width: 901px) { .os-panels { min-height: 620px; } }
.os-panel {
  flex: 1 0 auto; display: flex; flex-direction: column; gap: 18px; min-width: 0;
  padding: 24px 26px 22px;
  animation: os-panel-in .45s var(--ease-out);
}
.os-panel[hidden] { display: none; }
.os-panel:focus-visible { outline: 2px solid var(--glow-blue); outline-offset: -4px; }
@keyframes os-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Panel head */
.os-ph { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.os-ph__text { flex: 1 1 260px; min-width: 0; }
.os-ph__title { font: 400 24px/1 var(--f-display-2); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.os-ph__sub { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--os-t2); }
.os-range {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 7px 11px; border: 1px solid var(--os-line); border-radius: 8px; background: var(--white);
  font: 600 12px/1 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--os-t2);
}
.os-range .os-ico { width: 14px; height: 14px; color: var(--os-icon); }

/* Panel foot + contextual CTA */
.os-pf {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--os-line);
}
.os-pf__note { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; min-width: 0; font-size: 13px; line-height: 1.45; color: var(--os-t2); }
.os-pf__note .os-ico { width: 16px; height: 16px; color: var(--os-green); stroke-width: 2.2; }
.os-pf__cta { flex-shrink: 0; }

/* Cards */
.os-card {
  min-width: 0; padding: 16px 18px;
  background: var(--white); border: 1px solid var(--os-line); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.os-card--flush { padding: 0; overflow: hidden; }
.os-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 14px; }
.os-card__title { font: 700 12px/1.2 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.os-card__meta { font-size: 12.5px; line-height: 1.35; color: var(--os-t3); }

/* KPI tiles */
.os-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.os-kpi {
  position: relative; min-width: 0; padding: 14px 16px 13px;
  background: var(--white); border: 1px solid var(--os-line); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  transition: border-color .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.os-kpi__label { font: 700 11px/1.25 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--os-t3); }
.os-kpi__value { margin-top: 8px; font: 400 34px/1 var(--f-display-2); letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-kpi__meta { margin-top: 6px; font-size: 12.5px; line-height: 1.35; color: var(--os-t3); }
.os-kpi__viz { position: absolute; top: 40px; right: 16px; width: 76px; height: 26px; overflow: visible; }
.os-kpi.is-tick { border-color: rgba(247, 198, 0, .8); box-shadow: 0 0 0 3px rgba(247, 198, 0, .16); }
.os-kpi--row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "meta value";
  align-items: center; column-gap: 12px; padding: 12px 14px;
}
.os-kpi--row .os-kpi__label { grid-area: label; }
.os-kpi--row .os-kpi__meta { grid-area: meta; margin-top: 4px; }
.os-kpi--row .os-kpi__value { grid-area: value; margin-top: 0; font-size: 30px; }
.os-kpis--stack { grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }

/* Drawn lines use pathLength="1": dash 1 + gap 2 means offset 1.02 hides the whole stroke (no stray round cap) */
.os-viz-line { fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.os-viz-dot { fill: var(--yellow); stroke: var(--navy); stroke-width: 1.4; }
.os-viz-bar { fill: var(--os-pale-navy); }
.os-viz-bar--hi { fill: var(--navy); }
.os-viz-track { fill: var(--os-line-2); }
.os-viz-fill { fill: var(--os-green); }
.os-viz-tick { fill: none; stroke: var(--os-t3); stroke-width: 1.4; stroke-linecap: round; }

.os-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--os-green); }
.os-delta .os-ico { width: 14px; height: 14px; stroke-width: 2.2; }

/* People, tags, sources, statuses */
.os-av {
  display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  font: 700 12px/1 var(--f-label); letter-spacing: .06em;
}
.os-av--1 { background: #E7EEF7; color: #1E3A5F; }
.os-av--2 { background: #FDECE1; color: #7C2D12; }
.os-av--3 { background: #E3F5EE; color: #065F46; }
.os-av--4 { background: #EEF0F3; color: #374151; }
.os-av--5 { background: #FDF3C8; color: #5C4A00; }
.os-who { display: flex; flex-direction: column; min-width: 0; }
.os-who__name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-who__sub { font-size: 12.5px; line-height: 1.35; color: var(--os-t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.os-tag {
  display: inline-block; max-width: 100%; vertical-align: middle;
  padding: 4px 9px 4px 8px; border-radius: 6px;
  font: 600 12px/1.25 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.os-tag::before {
  content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; vertical-align: middle;
  border-radius: 50%; background: currentColor; opacity: .75;
}
.os-tag--termite { background: #FDECE1; color: #7C2D12; }
.os-tag--mosquito { background: #FDF3C8; color: #5C4A00; }
.os-tag--mosquito::before { background: #D9AE00; opacity: 1; }
.os-tag--ant { background: #E7EEF7; color: #1E3A5F; }
.os-tag--rodent { background: #EEF0F3; color: #374151; }

.os-src {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  padding: 3px 8px 3px 6px; border: 1px solid var(--os-line); border-radius: 6px; background: var(--white);
  font-size: 12.5px; line-height: 1.3; color: var(--os-t2);
}
.os-src .os-ico { width: 14px; height: 14px; color: var(--os-icon); }
.os-src > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.os-status {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px;
  font: 700 11px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.os-status::before { content: ''; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.os-status--new { background: var(--os-blue-bg); color: var(--os-blue); }
.os-status--booked { background: var(--os-green-bg); color: var(--os-green); }
.os-status--follow { background: var(--os-amber-bg); color: var(--os-amber); }
.os-status--quote { background: var(--os-blue-bg); color: var(--os-blue); }
.os-status--handoff { background: var(--os-slate-bg); color: var(--os-slate); }

/* ---------- Tables (ARIA table on a CSS grid; stack into cards on narrow panels) ---------- */
.os-tr { display: grid; align-items: center; column-gap: 12px; padding: 0 16px; }
.os-thead .os-tr {
  min-height: 36px; background: var(--os-head); border-bottom: 1px solid var(--os-line);
  font: 700 11px/1 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--os-t3);
}
.os-tbody .os-tr { padding-top: 11px; padding-bottom: 11px; border-top: 1px solid var(--os-line-2); overflow: hidden; }
.os-tbody .os-tr:first-child { border-top: 0; }

.os-lead { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.25fr) minmax(0, 1fr) 92px 64px; }
.os-lead > :last-child { justify-self: end; text-align: right; }
.os-lead__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.os-lead__svc, .os-lead__src { min-width: 0; }
.os-lead__time { font-size: 12.5px; color: var(--os-t3); white-space: nowrap; }

/* Live feed: a new lead slides in, the oldest one folds away (driven by os.js) */
.os-lead--new { animation: os-row-in .55s var(--ease-out) backwards, os-row-glow 2.8s ease-out; }
.os-lead--new .os-lead__time { color: var(--ink); font-weight: 700; }
.os-lead--out { animation: os-row-out .5s var(--ease-in-out) forwards; pointer-events: none; }
.os-lead--flip .os-status { animation: os-flip .55s var(--ease-out); }
@keyframes os-row-in {
  from { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
  to { max-height: var(--os-row-h, 64px); opacity: 1; }
}
@keyframes os-row-out {
  from { max-height: var(--os-row-h, 64px); opacity: 1; }
  to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; }
}
@keyframes os-row-glow { 0%, 30% { background-color: rgba(247, 198, 0, .16); } 100% { background-color: rgba(247, 198, 0, 0); } }
@keyframes os-flip { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

.os-trk { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 96px; }
.os-trk > :last-child { justify-self: end; text-align: right; }
.os-trk__who, .os-trk__src { min-width: 0; }
.os-trk__out { display: flex; align-items: center; gap: 8px; min-width: 0; }
.os-trk__val { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.os-trk__val--muted { font-weight: 600; color: var(--os-t3); }
.os-arrow { display: none; color: var(--os-t3); font-size: 14px; line-height: 1; }

/* ---------- 2 · Swarm Voice ---------- */
.os-voice { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }

.os-call {
  position: relative; isolation: isolate; min-width: 0; overflow: hidden;
  padding: 18px 18px 16px; border-radius: 14px;
  background: var(--ink); color: var(--on-dark);
  box-shadow: 0 20px 44px -26px rgba(11, 14, 26, .7);
}
.os-call::before {                         /* blueprint grid inside the live card */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 22px 22px;
}
.os-call::after {
  content: ''; position: absolute; z-index: -1; top: -70px; right: -70px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(247, 198, 0, .14), transparent 65%);
}
.os-call__top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.os-call__live {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px;
  background: rgba(16, 185, 129, .16); color: #6EE7B7;
  font: 700 10.5px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase;
}
.os-call__dot { width: 6px; height: 6px; border-radius: 50%; background: #34D399; animation: dotPulse 1.6s ease infinite; }
.os-call__title { flex: 1 1 auto; min-width: 0; font: 600 13px/1.3 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-2); }
.os-call__timer { margin-left: auto; font: 600 13px/1 var(--f-body); color: var(--yellow); font-variant-numeric: tabular-nums; }
.os-call__who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; font-size: 13px; color: var(--on-dark-3); }
.os-call__who .os-ico { width: 15px; height: 15px; color: var(--yellow); }
.os-call__who strong { color: var(--on-dark); font-weight: 600; font-variant-numeric: tabular-nums; }

.os-wave { display: flex; align-items: center; justify-content: space-between; gap: 2px; height: 46px; margin: 14px 0; }
.os-wave span {
  flex: 0 1 4px; width: 4px; min-width: 2px; height: calc(var(--h, .5) * 100%);
  border-radius: 2px; background: linear-gradient(180deg, #FFDF63, var(--yellow) 60%, #D9AE00);
  transform-origin: 50% 50%;
  animation: os-wave 1.15s var(--ease-in-out) infinite;
}
.os-wave span:nth-child(2n) { animation-duration: .95s; animation-delay: -.35s; }
.os-wave span:nth-child(3n) { animation-duration: 1.35s; animation-delay: -.6s; }
.os-wave span:nth-child(5n) { animation-duration: 1.6s; animation-delay: -.2s; }
.os-wave span:nth-child(7n) { animation-duration: .85s; animation-delay: -.75s; }
@keyframes os-wave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.32); } }

.os-transcript { display: grid; gap: 8px; }
.os-msg { max-width: 92%; padding: 9px 12px 10px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.os-msg__who { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font: 700 10.5px/1.2 var(--f-label); letter-spacing: .14em; text-transform: uppercase; }
.os-msg__who .os-ico { width: 14px; height: 14px; }
.os-msg--caller {
  justify-self: start; border-bottom-left-radius: 3px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: var(--on-dark-2);
}
.os-msg--caller .os-msg__who { color: var(--on-dark-3); }
.os-msg--ai {
  justify-self: end; border-bottom-right-radius: 3px;
  background: rgba(247, 198, 0, .10); border: 1px solid rgba(247, 198, 0, .28); color: var(--on-dark);
}
.os-msg--ai .os-msg__who { color: var(--yellow); }

.os-call__out {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08);
}
.os-outcome {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px;
  max-width: 100%; background: var(--yellow); color: var(--ink);
  font: 700 12.5px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase;
}
.os-outcome .os-ico { width: 15px; height: 15px; stroke-width: 2.4; }
.os-call__saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--on-dark-3); }
.os-call__saved .os-ico { width: 14px; height: 14px; }

.os-log__list { display: grid; }
.os-log__row {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--os-line-2);
}
.os-log__row:first-child { padding-top: 2px; border-top: 0; }
.os-log__row:last-child { padding-bottom: 2px; }
.os-log__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--os-soft); color: var(--navy); }
.os-log__icon .os-ico { width: 15px; height: 15px; }
.os-log__who { display: flex; flex-direction: column; min-width: 0; }
.os-log__name { font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.os-log__sub { font-size: 12px; line-height: 1.35; color: var(--os-t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-log__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.os-log__time { font-size: 11.5px; color: var(--os-t3); white-space: nowrap; }

/* ---------- 3 · Local SEO ---------- */
.os-seo { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.os-geo {
  position: relative; aspect-ratio: 1 / 1; min-width: 0; overflow: hidden;
  border: 1px solid var(--os-line); border-radius: 12px; background: #EEF1F5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  container: os-geo / inline-size;
}
.os-geo::after {                           /* one-time scan sweep on first view */
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 30%; opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0), rgba(37, 99, 235, .08) 75%, rgba(37, 99, 235, .4) 100%);
}
.os-geo__map { position: absolute; inset: 0; width: 100%; height: 100%; }
.os-geo__grid {
  position: absolute; inset: 6.5%;
  display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); place-items: center;
}
.os-pt {
  display: grid; place-items: center; aspect-ratio: 1 / 1; border-radius: 50%;
  width: 26px; width: min(30px, 9.2cqi);
  font-family: var(--f-body); font-weight: 700; line-height: 1;
  font-size: 11px; font-size: min(12px, 3.6cqi);
  color: var(--white); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 2px 6px rgba(15, 23, 42, .18);
}
.os-pt--g { background: var(--os-green); }
.os-pt--a { background: #F59E0B; color: var(--ink); }
.os-pt--r { background: #C53030; }
.os-pt--home { position: relative; box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--navy), 0 4px 10px rgba(15, 23, 42, .28); }
.os-pt--home::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--navy); opacity: 0;
  animation: os-ping 2.8s var(--ease-out) infinite;
}
@keyframes os-ping { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.9); opacity: 0; } }
/* rows cascade top → bottom during the intro */
.os-pt:nth-child(n+8)  { --r: 1; }
.os-pt:nth-child(n+15) { --r: 2; }
.os-pt:nth-child(n+22) { --r: 3; }
.os-pt:nth-child(n+29) { --r: 4; }
.os-pt:nth-child(n+36) { --r: 5; }
.os-pt:nth-child(n+43) { --r: 6; }

.os-seo__side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.os-field__label { display: block; margin-bottom: 6px; font: 700 11px/1 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--os-t3); }
.os-select {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--os-line); border-radius: 8px; background: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.os-select .os-ico { width: 15px; height: 15px; color: var(--os-icon); }
.os-select > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-select__chev { color: var(--os-t3); }

.os-bigstat { padding: 14px 16px; background: var(--white); border: 1px solid var(--os-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .03); }
.os-bigstat__label { font: 700 11px/1.2 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--os-t3); }
.os-bigstat__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 6px; }
.os-bigstat__value { font: 400 52px/1 var(--f-display-2); letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.os-bigstat__meta { font-size: 12.5px; color: var(--os-t3); }
.os-dist { display: flex; gap: 2px; height: 8px; margin-top: 12px; border-radius: 4px; overflow: hidden; transform-origin: 0 50%; }
.os-dist span { flex-basis: 0; min-width: 4px; }
.os-dist__g { background: var(--os-green); }
.os-dist__a { background: #F59E0B; }
.os-dist__r { background: #C53030; }
.os-dist__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--os-t2); }
.os-dist__legend li { display: inline-flex; align-items: center; gap: 6px; }
.os-dist__legend b { font-weight: 700; color: var(--ink); }
.os-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; }
.os-dot--g { background: var(--os-green); }
.os-dot--a { background: #F59E0B; }
.os-dot--r { background: #C53030; }

.os-kw { padding: 14px 16px 6px; }
.os-kw .os-card__head { margin-bottom: 4px; }
.os-kw__list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 48px; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--os-line-2); font-size: 13px;
}
.os-kw__list li:first-child { border-top: 0; }
.os-kw__q { min-width: 0; color: var(--os-t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-kw__r { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.os-kw__d { font-size: 12px; font-weight: 700; color: var(--os-green); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.os-seo__note { font: 600 11px/1.4 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--os-t3); }

/* ---------- 4 · Call tracking ---------- */
.os-track { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.os-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--os-t2); }
.os-legend li { display: inline-flex; align-items: center; gap: 6px; }
.os-sw { width: 10px; height: 10px; flex-shrink: 0; border-radius: 3px; }
.os-sw--calls { background: var(--os-pale-navy); }
.os-sw--booked, .os-sw--termite { background: var(--navy); }
.os-sw--mosquito { background: var(--yellow); }
.os-sw--ant { background: #7FA3C9; }
.os-sw--rodent { background: #C9D1DC; }

.os-hbars { display: grid; gap: 13px; }
.os-hbar { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; grid-template-areas: "label track val"; align-items: center; gap: 12px; }
.os-hbar__label { grid-area: label; display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.os-hbar__label .os-ico { width: 15px; height: 15px; color: var(--os-icon); }
.os-hbar__track { grid-area: track; position: relative; height: 12px; border-radius: 6px; background: #F1F3F7; overflow: hidden; }
.os-hbar__calls { position: absolute; top: 0; bottom: 0; left: 0; width: var(--calls); border-radius: 6px; background: var(--os-pale-navy); transform-origin: 0 50%; }
.os-hbar__booked { position: absolute; top: 0; bottom: 0; left: 0; width: var(--booked); border-radius: 6px; background: var(--navy); }
.os-hbar__val { grid-area: val; font-size: 12px; color: var(--os-t3); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.os-hbar__val b { font-weight: 700; color: var(--ink); }

/* ---------- 5 · Data & revenue ---------- */
.os-data { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }

.os-chart { display: grid; grid-template-columns: 36px minmax(0, 1fr); grid-template-rows: 168px auto; gap: 8px; }
.os-chart__y {
  grid-row: 1; grid-column: 1; display: flex; flex-direction: column; justify-content: space-between;
  margin: -6px 0; font-size: 10.5px; line-height: 12px; color: var(--os-t3); text-align: right; font-variant-numeric: tabular-nums;
}
.os-chart__plot {
  grid-row: 1; grid-column: 2; position: relative;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr);
  align-items: end; justify-items: center;
  border-bottom: 1px solid #CBD2DC;
  background: linear-gradient(var(--os-line-2) 1px, transparent 1px) 0 0 / 100% 25%;
}
.os-col { display: flex; flex-direction: column-reverse; width: min(34px, 62%); height: 100%; transform-origin: 50% 100%; }
.os-seg { display: block; height: calc(var(--v) * 1.25%); border-top: 2px solid var(--white); }
.os-seg:first-child { border-radius: 0 0 2px 2px; }
.os-seg:last-child { border-radius: 4px 4px 0 0; }
.os-seg--termite { background: var(--navy); }
.os-seg--mosquito { background: var(--yellow); }
.os-seg--ant { background: #7FA3C9; }
.os-seg--rodent { background: #C9D1DC; }
.os-chart__x {
  grid-row: 2; grid-column: 2; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  font: 600 11px/1 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--os-t3); text-align: center;
}

.os-trendcard { display: flex; flex-direction: column; }
.os-trendcard .os-card__head { margin-bottom: 6px; }
.os-trendcard__total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.os-trendcard__num { font: 400 34px/1 var(--f-display-2); letter-spacing: .01em; color: var(--ink); }
.os-trendcard__sub { font-size: 12.5px; color: var(--os-t3); }
.os-area { width: 100%; height: auto; margin-top: auto; padding-top: 14px; overflow: visible; }
.os-area__grid { fill: none; stroke: var(--os-line-2); stroke-width: 1; }
.os-area__fill { fill: url(#os-area-grad); }
.os-area__line { fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 2; stroke-dashoffset: 0; }
.os-area__peak { fill: none; stroke: var(--os-t3); stroke-width: 1; stroke-dasharray: 3 3; opacity: .45; }
.os-area__dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 2.2; }
.os-months {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-top: 6px;
  font: 600 10.5px/1 var(--f-label); letter-spacing: .06em; color: var(--os-t3); text-align: center;
}

/* ---------- 6 · Season Pass ---------- */
.os-pass { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 14px; align-items: stretch; }

.os-goal { display: flex; align-items: center; gap: 20px; }
.os-ring { position: relative; flex-shrink: 0; width: 136px; height: 136px; }
.os-ring svg { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.os-ring__track { fill: none; stroke: var(--os-line-2); stroke-width: 12; }
/* r = 54 → circumference 339.29; 186 / 250 = 74.4% → offset 86.86. The 400 gap lets offset 341 hide it fully. */
.os-ring__bar { fill: none; stroke: var(--yellow); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 339.29 400; stroke-dashoffset: 86.86; }
.os-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.os-ring__num { font: 400 40px/1 var(--f-display-2); letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.os-ring__of { margin-top: 4px; font: 700 10.5px/1.2 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--os-t3); }
.os-goal__stats { flex: 1 1 auto; min-width: 0; }
.os-goal__label { font: 700 11px/1.2 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--os-t3); }
.os-goal__pct { margin-top: 5px; font: 400 26px/1 var(--f-display-2); letter-spacing: .02em; color: var(--ink); }
.os-goal__dl { display: grid; margin-top: 12px; }
.os-goal__dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--os-line-2); font-size: 12.5px; }
.os-goal__dl dt { min-width: 0; color: var(--os-t2); }
.os-goal__dl dd { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }

.os-renew__list { display: grid; }
.os-renew__row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--os-line-2);
}
.os-renew__row:first-child { padding-top: 0; border-top: 0; }
.os-renew__row:last-child { padding-bottom: 0; }
.os-renew__row .os-av { width: 28px; height: 28px; font-size: 11px; }
.os-renew__row .os-who__name { font-size: 13.5px; }
.os-renew__row .os-who__sub { font-size: 12px; }
.os-renew__end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.os-renew__amt { font-size: 13.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.os-renew__date { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--os-green); white-space: nowrap; }
.os-renew__date .os-ico { width: 12px; height: 12px; stroke-width: 2.2; }

.os-funnel { grid-column: 1 / -1; }
.os-funnel .os-card__head { margin-bottom: 12px; }
.os-funnel__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.os-step {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 12px 28px 12px 18px; background: var(--os-soft);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}
.os-step + .os-step {
  margin-left: -11px; padding-left: 30px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}
.os-step--win { background: var(--yellow); }
.os-step__label { min-width: 0; font: 700 11px/1.2 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--os-t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-step__num { font: 400 30px/1 var(--f-display-2); letter-spacing: .01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.os-step__sub { font-size: 12px; color: var(--os-t2); }
.os-step--win .os-step__label, .os-step--win .os-step__sub { color: rgba(11, 14, 26, .78); }
.os-step__bar { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(30, 58, 95, .12); overflow: hidden; }
.os-step__bar i { display: block; width: var(--p); height: 100%; border-radius: 2px; background: var(--navy); transform-origin: 0 50%; }
.os-step--win .os-step__bar { background: rgba(11, 14, 26, .14); }
.os-step--win .os-step__bar i { background: var(--ink); }

/* ---------- Value props under the window ---------- */
.os-props {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 72px;
  border-top: 1px solid var(--line-light); border-bottom: 1px solid var(--line-light);
}
.os-prop { min-width: 0; padding: 28px 24px; }
.os-prop + .os-prop { border-left: 1px solid var(--line-light); }
.os-prop:first-child { padding-left: 0; }
.os-prop:last-child { padding-right: 0; }
.os-prop__icon {
  display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px;
  background: var(--os-soft); border: 1px solid rgba(30, 58, 95, .14); color: var(--navy);
  box-shadow: inset 0 -2px 0 var(--yellow);
}
.os-prop__icon .os-ico { width: 20px; height: 20px; }
.os-prop__title { font: 700 17px/1.2 var(--f-label); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.os-prop__text { margin-top: 8px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }

/* ==========================================================================
   First-view intros — only while os.js has set .os-anim (motion allowed).
   .is-seen starts them, .is-done (added after they finish) drops them so
   switching tabs later never replays them.
   ========================================================================== */
.os-anim .os-panel:not(.is-seen) .os-kpi__viz,
.os-anim .os-panel:not(.is-seen) .os-msg,
.os-anim .os-panel:not(.is-seen) .os-call__out,
.os-anim .os-panel:not(.is-seen) .os-pt,
.os-anim .os-panel:not(.is-seen) .os-area__fill,
.os-anim .os-panel:not(.is-seen) .os-area__dot { opacity: 0; }
.os-anim .os-panel:not(.is-seen) .os-hbar__calls,
.os-anim .os-panel:not(.is-seen) .os-dist,
.os-anim .os-panel:not(.is-seen) .os-step__bar i { transform: scaleX(0); }
.os-anim .os-panel:not(.is-seen) .os-col { transform: scaleY(0); }
.os-anim .os-panel:not(.is-seen) .os-viz-line,
.os-anim .os-panel:not(.is-seen) .os-area__line { stroke-dashoffset: 1.02; }
.os-anim .os-panel:not(.is-seen) .os-ring__bar { stroke-dashoffset: 341; }

.os-anim .os-panel.is-seen:not(.is-done) .os-kpi__viz { animation: os-fade .6s ease-out .3s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-viz-line { animation: os-draw 1.1s var(--ease-out) .35s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-hbar__calls { animation: os-grow-x .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms + 150ms); }
.os-anim .os-panel.is-seen:not(.is-done) .os-col { animation: os-grow-y .8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms + 100ms); }
.os-anim .os-panel.is-seen:not(.is-done) .os-area__line { animation: os-draw 1.6s var(--ease-out) .2s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-area__fill { animation: os-fade .8s ease-out .9s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-area__dot { animation: os-fade .4s ease-out 1.6s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-ring__bar { animation: os-ring 1.4s var(--ease-out) .15s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-step__bar i { animation: os-grow-x 1s var(--ease-out) .3s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-step:nth-child(2) .os-step__bar i { animation-delay: .45s; }
.os-anim .os-panel.is-seen:not(.is-done) .os-step:nth-child(3) .os-step__bar i { animation-delay: .6s; }
.os-anim .os-panel.is-seen:not(.is-done) .os-dist { animation: os-grow-x .9s var(--ease-out) .5s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-pt { animation: os-pop .42s var(--ease-out) both; animation-delay: calc(var(--r, 0) * 75ms + 150ms); }
.os-anim .os-panel.is-seen:not(.is-done) .os-geo::after { animation: os-scan 1s var(--ease-in-out) .05s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-msg { animation: os-msg-in .5s var(--ease-out) .2s both; }
.os-anim .os-panel.is-seen:not(.is-done) .os-msg:nth-child(2) { animation-delay: .8s; }
.os-anim .os-panel.is-seen:not(.is-done) .os-msg:nth-child(3) { animation-delay: 1.6s; }
.os-anim .os-panel.is-seen:not(.is-done) .os-call__out { animation: os-msg-in .5s var(--ease-out) 2.2s both; }

@keyframes os-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes os-draw { from { stroke-dashoffset: 1.02; } to { stroke-dashoffset: 0; } }
@keyframes os-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes os-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes os-ring { from { stroke-dashoffset: 341; } to { stroke-dashoffset: 86.86; } }
@keyframes os-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes os-scan { 0% { opacity: 1; transform: translateY(-100%); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(340%); } }
@keyframes os-msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Loops rest while the window is off-screen (os.js toggles .os-off on the section)
   or while the visitor has paused the demo with the Live pill (.os-paused) */
.os-off .os-hint,
.os-off .os-live__dot,
.os-off .os-call__dot,
.os-off .os-wave span,
.os-off .os-pt--home::after,
.os-off .os-tab[data-invite],
.os-paused .os-hint,
.os-paused .os-live__dot,
.os-paused .os-call__dot,
.os-paused .os-wave span,
.os-paused .os-pt--home::after,
.os-paused .os-tab[data-invite] { animation-play-state: paused; }

/* ==========================================================================
   Panel internals: container queries on the panel area's own width
   ========================================================================== */
@container os-panels (max-width: 760px) {
  .os-track { grid-template-columns: minmax(0, 1fr); }
  .os-kpis--stack { order: -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .os-kpis--stack .os-kpi--row { display: block; padding: 14px 16px 13px; }
  .os-kpis--stack .os-kpi--row .os-kpi__value { margin-top: 8px; font-size: 34px; }
  .os-kpis--stack .os-kpi--row .os-kpi__meta { margin-top: 6px; }
}

@container os-panels (max-width: 699px) {
  .os-voice, .os-data, .os-pass { grid-template-columns: minmax(0, 1fr); }
}

@container os-panels (max-width: 660px) {
  /* Tables become stacked rows; the header row stays for screen readers only */
  .os-thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .os-tbody .os-tr { padding: 12px 14px; }

  .os-lead {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-areas:
      "who who status"
      ".   svc svc"
      ".   src time";
    column-gap: 10px; row-gap: 7px;
  }
  .os-tbody .os-lead { --os-row-h: 140px; }
  .os-lead__who { grid-area: who; }
  .os-lead__status { grid-area: status; }
  .os-lead__svc { grid-area: svc; }
  .os-lead__src { grid-area: src; }
  .os-lead__time { grid-area: time; }
  .os-lead .os-av { width: 30px; height: 30px; font-size: 11px; }
  .os-lead .os-who { flex-direction: row; align-items: baseline; gap: 8px; }
  .os-lead .os-who__name { flex: 0 1 auto; }
  .os-lead .os-who__sub { flex: 0 1 auto; min-width: 0; }

  .os-trk {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "who who val"
      "src out out";
    column-gap: 10px; row-gap: 8px;
  }
  .os-trk__who { grid-area: who; }
  .os-trk__src { grid-area: src; }
  .os-trk__out { grid-area: out; }
  .os-trk__val { grid-area: val; align-self: start; }
  .os-arrow { display: inline; }
}

@container os-panels (max-width: 600px) {
  .os-kpi__viz { display: none; }
  .os-seo { grid-template-columns: minmax(0, 1fr); }
  .os-geo { justify-self: center; width: 100%; max-width: 440px; }
}

@container os-panels (max-width: 520px) {
  .os-funnel__steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .os-step, .os-step + .os-step { margin-left: 0; padding: 12px 16px; clip-path: none; border-radius: 8px; }
}

@container os-panels (max-width: 460px) {
  .os-panel { padding: 18px 14px 16px; gap: 14px; }
  .os-ph__title { font-size: 22px; }
  .os-card { padding: 14px; }
  .os-card--flush { padding: 0; }
  .os-kw { padding: 12px 14px 4px; }

  /* every KPI becomes a compact label / value row */
  .os-kpis, .os-kpis--stack { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .os-kpis .os-kpi,
  .os-kpis--stack .os-kpi--row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "meta value";
    align-items: center; column-gap: 12px; padding: 11px 14px;
  }
  .os-kpis .os-kpi .os-kpi__label { grid-area: label; }
  .os-kpis .os-kpi .os-kpi__meta { grid-area: meta; margin-top: 3px; }
  .os-kpis .os-kpi .os-kpi__value,
  .os-kpis--stack .os-kpi--row .os-kpi__value { grid-area: value; margin-top: 0; font-size: 30px; }

  .os-hbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label val" "track track"; row-gap: 7px; }

  .os-call { padding: 16px 14px 14px; }
  .os-msg { max-width: 100%; }
  .os-wave { height: 40px; }

  .os-bigstat__value { font-size: 46px; }
  .os-goal { gap: 16px; }
  .os-ring { width: 112px; height: 112px; }
  .os-ring__num { font-size: 32px; }

  .os-pf__cta { flex: 1 1 100%; }
}

@container os-panels (max-width: 360px) {
  .os-goal { flex-direction: column; align-items: stretch; }
  .os-ring { align-self: center; }
  .os-chart { grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: 150px auto; }
}

/* Fallback for the rare browser without container queries: stack by viewport instead */
@supports not (container-type: inline-size) {
  @media (max-width: 700px) {
    .os-voice, .os-data, .os-pass, .os-seo, .os-track { grid-template-columns: minmax(0, 1fr); }
    .os-funnel__steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .os-step, .os-step + .os-step { margin-left: 0; clip-path: none; border-radius: 8px; }
    .os-kpi__viz { display: none; }
  }
}

/* ==========================================================================
   Viewport breakpoints (900 / 600, matching base.css)
   ========================================================================== */
@media (max-width: 1100px) {
  .os-hint { left: 16px; }
}

@media (max-width: 900px) {
  .os-stage { margin-top: 28px; padding-top: 56px; }
  .os-hint { left: 12px; }

  /* Window: title bar → module strip → panel */
  .os-window {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "bar" "nav" "panels";
    min-height: 0; border-radius: 14px;
  }
  .os-brand, .os-foot { display: none; }
  .os-bar { min-height: 52px; padding: 0 14px; gap: 12px; }

  /* Same tab elements, restyled as a horizontal swipe strip */
  .os-nav { padding: 12px 0 0; border-right: 0; border-bottom: 1px solid var(--os-line); }
  .os-nav__head { padding: 0 16px 8px; }
  .os-nav--overflow:not(.is-swiped) .os-nav__swipe { display: block; }
  .os-nav.has-left { --os-fl: 28px; }
  .os-nav.has-right { --os-fr: 44px; }
  .os-tabs {
    flex-direction: row; gap: 2px; padding: 0 10px;
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scroll-padding: 0 10px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--os-fl, 0px), #000 calc(100% - var(--os-fr, 0px)), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 var(--os-fl, 0px), #000 calc(100% - var(--os-fr, 0px)), transparent 100%);
  }
  .os-tabs::-webkit-scrollbar { display: none; }
  .os-tab {
    flex: 0 0 auto; width: auto; min-height: 46px; gap: 8px; padding: 0 14px;
    border-left: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0;
    white-space: nowrap; scroll-snap-align: start;
  }
  .os-tab[aria-selected="true"] { border-bottom-color: var(--yellow); }
  .os-tab .os-ico { width: 17px; height: 17px; }

  .os-props { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 52px; }
  .os-prop { padding: 26px 20px; }
  .os-prop + .os-prop { border-left: 0; }
  .os-prop:nth-child(odd) { padding-left: 0; }
  .os-prop:nth-child(even) { padding-right: 0; border-left: 1px solid var(--line-light); }
  .os-prop:nth-child(n+3) { border-top: 1px solid var(--line-light); }
}

@media (max-width: 600px) {
  .os-stage { margin-top: 24px; padding-top: 54px; }
  .os-hint { font-size: 12px; padding: 9px 15px 9px 12px; }
  .os-window { border-radius: 12px; }
  .os-tab { font-size: 13.5px; padding: 0 12px; }
}

@media (max-width: 520px) {
  .os-props { grid-template-columns: minmax(0, 1fr); margin-top: 44px; }
  .os-prop, .os-prop:nth-child(odd), .os-prop:nth-child(even) {
    display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-areas: "icon title" "icon text";
    column-gap: 16px; align-items: start; padding: 22px 0; border-left: 0;
  }
  .os-prop + .os-prop { border-top: 1px solid var(--line-light); }
  .os-prop__icon { grid-area: icon; margin: 0; }
  .os-prop__title { grid-area: title; align-self: center; font-size: 16px; }
  .os-prop__text { grid-area: text; margin-top: 4px; font-size: 14px; }
}

@media (max-width: 400px) {
  .os-bar__dots { display: none; }
  .os-bar__title { font-size: 12px; letter-spacing: .08em; }
}
