/* ==========================================================================
   AmiBroker data feed (/amibroker-data-feed)
   On top of the homepage bundle stylesheet (tokens, header, .btn, footer)
   + assets/css/site.css. Behaviour: assets/js/amibroker.js.
   ========================================================================== */

html:has(.ab-page) { scroll-padding-top: calc(var(--hdr-space) + 8px); }
.ab-page h1, .ab-page h2, .ab-page h3 { text-wrap: balance; }

/* Shared section heading */
.ab-sec { padding: clamp(64px, 8vw, 112px) 0 0; }
.ab-head { max-width: 760px; margin-bottom: clamp(32px, 4vw, 52px); }
.ab-k {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand);
}
.ab-k::before { content: ''; width: 18px; height: 1.5px; background: currentColor; }
.ab-k--night { color: #9cc3ff; }
.ab-head h2, .ab-sec h2 { margin-top: 12px; font-size: clamp(28px, 3.6vw, 46px); line-height: 1.06; letter-spacing: -0.035em; font-weight: 640; }
.ab-head > p:last-child { margin-top: 14px; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }

/* Live dot */
.ab-live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--up); flex: none; }
.ab-live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--up); opacity: 0; animation: ab-ping 1.8s var(--ease) infinite; }
@keyframes ab-ping { 0% { transform: scale(0.4); opacity: 0.8; } 100% { transform: scale(1.4); opacity: 0; } }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
/* One screen tall, content centred below the floating header (as on the homepage). */
.ab-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: calc(var(--hdr-h) + var(--hdr-gap) + clamp(16px, 3.6vh, 44px)) 0 clamp(28px, 5vh, 56px);
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}
.ab-hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ab-hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; opacity: 0.55;
  mask-image: radial-gradient(ellipse 85% 75% at 65% 25%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 65% 25%, #000 25%, transparent 75%);
}
.ab-hero-bg::after {
  content: ''; position: absolute; width: 760px; height: 560px; right: -180px; top: 10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(56, 165, 245, 0.3), transparent); filter: blur(60px);
}
.ab-hero-grid { display: grid; gap: clamp(36px, 5vw, 64px); align-items: center; }
.ab-hero-grid > * { min-width: 0; }
@media (min-width: 900px) { .ab-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
@media (max-width: 899px) { .ab-hero { min-height: 0; } .ab-hero-grid { gap: 28px; } }

.ab-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line); box-shadow: var(--sh-xs); font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.ab-hero h1 {
  margin-top: clamp(12px, 2.2vh, 22px); font-size: clamp(34px, min(4.8vw, 7.4vh), 60px); line-height: 1.03;
  letter-spacing: -0.045em; font-weight: 640;
}
/* Title sits on exactly two lines from 480px up: each line is kept whole and
   the size is capped by the text column's width (cqi), since the longer line
   is ~12.8em wide. Narrow phones wrap naturally. */
@media (min-width: 480px) {
  .ab-hero-copy { container-type: inline-size; }
  .ab-hero h1 { font-size: min(clamp(34px, min(4.8vw, 7.4vh), 60px), 7.6cqi); }
  .ab-h1-line { display: block; white-space: nowrap; }
}
/* Dark brand blue for contrast on the light hero (about 5.5:1 or more) */
.ab-accent { color: var(--brand); background: linear-gradient(100deg, var(--brand) 0%, #0f3f99 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ab-lede { margin-top: clamp(12px, 2.2vh, 22px); max-width: 560px; font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.ab-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(20px, 3.6vh, 32px); }
@media (max-width: 520px) { .ab-actions .btn { flex: 1 1 100%; } }
.ab-points { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: clamp(16px, 3vh, 28px); font-size: 14.5px; color: var(--ink-2); }
.ab-points li { display: inline-flex; align-items: center; gap: 8px; }
.ab-points svg { flex: none; color: var(--up); }

/* Hero chart frame (themed with the chart inside it) */
.ab-term {
  margin: 0; width: 100%; max-width: 640px; justify-self: center; border-radius: var(--r-lg); overflow: hidden;
  background: var(--cx-bg, #fff); border: 1px solid var(--cx-frame, var(--line));
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.65), var(--sh-xl);
}
.ab-term-note {
  padding: 8px 14px; font-size: 12px; color: var(--cx-muted); background: var(--cx-panel); border-top: 1px solid var(--cx-line);
  transition: background-color 0.3s, color 0.3s;
}

/* --------------------------------------------------------------------------
   Chart app (assets/js/ab-chart.js). Light by default; [data-theme="dark"]
   on the frame (.ab-term / .dv) switches every colour below. The
   canvas colours live in ab-chart.js (THEMES) and follow the same switch.
   -------------------------------------------------------------------------- */
.ab-term, .dv {
  --cx-bg: #ffffff; --cx-panel: #f7f9fc; --cx-frame: #dfe5ee; --cx-line: #e6eaf1;
  --cx-text: #344054; --cx-strong: #0a1020; --cx-muted: #667085;
  --cx-hover: #eef2f7; --cx-on-bg: #e6effd; --cx-on: #1a5fd6; --cx-on-line: rgba(26, 95, 214, 0.4);
  --cx-chip: #eef1f6; --cx-dash: #c9d1dd; --cx-pop: #ffffff; --cx-input: #ffffff; --cx-input-line: #d5dbe5;
  --cx-up: #0d9f6e; --cx-dn: #e0364a; --cx-flash-up: rgba(13, 159, 110, 0.16); --cx-flash-dn: rgba(224, 54, 74, 0.16);
  --cx-shadow: 0 24px 50px -18px rgba(16, 24, 40, 0.28);
}
.ab-term[data-theme="dark"], .dv[data-theme="dark"] {
  --cx-bg: #0b1120; --cx-panel: #0f1629; --cx-frame: #1c2640; --cx-line: rgba(255, 255, 255, 0.07);
  --cx-text: #c9d3e6; --cx-strong: #ffffff; --cx-muted: #8a96ad;
  --cx-hover: rgba(255, 255, 255, 0.07); --cx-on-bg: rgba(59, 156, 245, 0.16); --cx-on: #7cc0ff; --cx-on-line: rgba(59, 156, 245, 0.45);
  --cx-chip: rgba(255, 255, 255, 0.06); --cx-dash: rgba(255, 255, 255, 0.16); --cx-pop: #131c33; --cx-input: #0b1120; --cx-input-line: rgba(255, 255, 255, 0.14);
  --cx-up: #4fd690; --cx-dn: #ff7b86; --cx-flash-up: rgba(38, 180, 122, 0.3); --cx-flash-dn: rgba(239, 83, 97, 0.3);
  --cx-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.7);
}

.cx { position: relative; display: flex; flex-direction: column; background: var(--cx-bg); color: var(--cx-text); font-size: 13px; transition: background-color 0.3s, color 0.3s; }
.cx--hero { height: clamp(300px, min(40vw, 54vh), 420px); }

@media (max-width: 640px) { .cx--hero { height: 310px; } .ab-points { gap: 6px 16px; font-size: 13.5px; } }

.cx-static { display: flex; flex-direction: column; height: 100%; }
.cx-static .cx-plot { padding: 16px 12px 12px; }
.cx-static-tf { font-family: var(--mono); font-size: 11.5px; color: var(--cx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-fallback { display: block; width: 100%; height: 100%; }
.cx-fallback line { stroke-width: 1; vector-effect: non-scaling-stroke; }
.cx-fallback .up line { stroke: #089981; } .cx-fallback .up rect { fill: #089981; }
.cx-fallback .dn line { stroke: #f23645; } .cx-fallback .dn rect { fill: #f23645; }

.cx-top {
  flex: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px;
  background: var(--cx-panel); border-bottom: 1px solid var(--cx-line);
  overflow-x: auto; scrollbar-width: none; transition: background-color 0.3s;
}
.cx-top::-webkit-scrollbar { display: none; }
/* When the bar is too narrow the timeframes scroll; theme switch and Live stay pinned right. */
.cx-right {
  position: sticky; right: -10px; z-index: 1; margin-right: -10px; padding: 0 8px 0 14px; align-self: stretch;
  background: linear-gradient(90deg, transparent, var(--cx-panel) 12px);
}
@media (max-width: 640px) { .cx-right .cx-live { font-size: 0; gap: 0; margin-left: 4px; } }
.cx[data-cx="mobile"] .cx-right .cx-live { font-size: 0; gap: 0; margin-left: 4px; }
.cx-sym { flex: none; padding: 5px 10px; border-radius: 7px; background: var(--cx-chip); font-weight: 650; font-size: 13px; letter-spacing: 0.01em; color: var(--cx-strong); }
.cx-tfs, .cx-inds { flex: none; display: flex; align-items: center; gap: 2px; }
.cx-inds { padding-left: 10px; border-left: 1px solid var(--cx-line); }
.cx-btn, .cx-icon, .cx-tool {
  font: inherit; color: inherit; border: 0; background: transparent; cursor: pointer; border-radius: 7px;
  transition: background-color 0.15s, color 0.15s;
}
.cx-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; font-size: 12.5px; font-weight: 550; color: var(--cx-muted); white-space: nowrap; }
.cx-btn:hover, .cx-icon:hover, .cx-tool:hover { background: var(--cx-hover); color: var(--cx-strong); }
.cx-btn[aria-pressed="true"] { background: var(--cx-on-bg); color: var(--cx-on); }
.cx-btn--custom { margin-left: 4px; border: 1px dashed var(--cx-dash); }
.cx-btn--custom[aria-pressed="true"] { border-style: solid; border-color: var(--cx-on-line); }
.cx-btn--custom svg { width: 15px; height: 15px; }
.cx-btn--ind i { width: 10px; height: 3px; border-radius: 2px; background: currentColor; opacity: 0.5; }
.cx-btn--ind[aria-pressed="true"] { background: var(--cx-chip); color: var(--cx-strong); }
.cx-ind-ema20[aria-pressed="true"] i { background: #f5a524; opacity: 1; }
.cx-ind-ema50[aria-pressed="true"] i { background: #9b6cf0; opacity: 1; }
.cx-ind-vol[aria-pressed="true"] i { background: #26b47a; opacity: 1; }
.cx-ind-rsi[aria-pressed="true"] i { background: #3b9cf5; opacity: 1; }
.cx-right { flex: none; display: flex; align-items: center; gap: 2px; margin-left: auto; }
.cx-icon { display: grid; place-items: center; width: 30px; height: 30px; color: var(--cx-muted); }

/* Light / dark switch */
.cx-theme {
  position: relative; flex: none; display: inline-flex; align-items: center; width: 54px; height: 28px; margin: 0 2px 0 4px; padding: 0;
  border-radius: 999px; border: 1px solid var(--cx-line); background: var(--cx-chip); cursor: pointer; color: var(--cx-muted);
}
.cx-theme svg { position: relative; z-index: 1; width: 14px; height: 14px; margin: 0 6px; transition: color 0.25s; }
.cx-theme svg:last-of-type { margin-left: auto; }
.cx-theme::before {
  content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.25); transition: transform 0.3s var(--ease), background-color 0.3s;
}
.cx-theme[aria-checked="true"]::before { transform: translateX(26px); background: #24304d; }
.cx-theme[aria-checked="false"] .cx-sun, .cx-theme[aria-checked="true"] .cx-moon { color: #f5a524; }
.cx-theme[aria-checked="true"] .cx-moon { color: #9cc3ff; }
.cx-theme:hover { border-color: var(--cx-on-line); }

.cx-live { display: inline-flex; align-items: center; gap: 7px; margin-left: 6px; padding: 0 4px; font-family: var(--mono); font-size: 11.5px; color: var(--cx-up); }
.cx-live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #26b47a; }
.cx-live i::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #26b47a; opacity: 0; animation: ab-ping 1.8s var(--ease) infinite; }
.cx button:focus-visible, .cx input:focus-visible, .cx select:focus-visible, .cx canvas:focus-visible { outline: 2px solid #3b9cf5; outline-offset: 1px; }

.cx-body { flex: 1; min-height: 0; display: flex; }
.cx-tools {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 42px; padding: 6px 0;
  background: var(--cx-panel); border-right: 1px solid var(--cx-line); overflow-y: auto; scrollbar-width: none; transition: background-color 0.3s;
}
.cx-tool { display: grid; place-items: center; flex: none; width: 32px; height: 32px; color: var(--cx-muted); }
.cx-tool[aria-pressed="true"] { background: var(--cx-on-bg); color: var(--cx-on); }
.cx-tools-sep { flex: none; width: 20px; height: 1px; margin: 4px 0; background: var(--cx-line); }
.cx-plot { position: relative; flex: 1; min-width: 0; }
.cx-plot canvas { position: absolute; inset: 0; display: block; cursor: crosshair; touch-action: pan-y; }
.cx-plot canvas.is-grab { cursor: grabbing; }
.cx-plot.is-drawing canvas { touch-action: none; }

.cx-toast {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); max-width: calc(100% - 90px);
  padding: 7px 12px; border-radius: 8px; background: var(--cx-pop); border: 1px solid var(--cx-on-line);
  font-size: 12px; color: var(--cx-strong); text-align: center; pointer-events: none;
  box-shadow: var(--cx-shadow); transition: opacity 0.4s, transform 0.4s var(--ease);
  animation: cx-hint 2.4s var(--ease) 1.2s 2;
}
.cx-toast.is-gone { opacity: 0; transform: translate(-50%, 8px); }
@keyframes cx-hint { 50% { border-color: #3b9cf5; } }

/* Custom timeframe popover */
.cx-pop {
  position: absolute; z-index: 5; width: 250px; padding: 14px; border-radius: 12px;
  background: var(--cx-pop); border: 1px solid var(--cx-input-line); box-shadow: var(--cx-shadow);
}
.cx-pop[hidden] { display: none; }
.cx-pop-t { font-weight: 650; font-size: 13.5px; color: var(--cx-strong); }
.cx-pop-s { margin-top: 2px; font-size: 12px; color: var(--cx-muted); }
.cx-pop-row { display: flex; gap: 6px; margin-top: 10px; }
.cx-pop input, .cx-pop select {
  min-width: 0; height: 34px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--cx-input-line);
  background: var(--cx-input); color: var(--cx-strong); font: inherit; font-size: 13px;
}
.cx-pop input { width: 62px; font-family: var(--mono); }
.cx-pop select { flex: 1; }
.cx-apply { height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: #1a5fd6; color: #fff; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.cx-apply:hover { background: #2a6fe6; }
.cx-pop-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cx-pop-quick button {
  height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--cx-input-line); background: transparent;
  font: inherit; font-family: var(--mono); font-size: 12px; color: var(--cx-text); cursor: pointer;
}
.cx-pop-quick button:hover { background: var(--cx-hover); color: var(--cx-strong); }
.cx-pop-err { margin-top: 8px; font-size: 12px; color: var(--cx-dn); }

/* Watchlist (full demo) */
.cx-watch { flex: none; width: 232px; border-left: 1px solid var(--cx-line); background: var(--cx-panel); overflow-y: auto; scrollbar-width: none; transition: background-color 0.3s; }
.cx-watch::-webkit-scrollbar, .cx-watch ul::-webkit-scrollbar { display: none; }
/* Compact watchlist inside the desktop device frame: all symbols fit without scrolling */
.dv .cx-watch { width: 186px; }
.dv .cx-watch-h { padding: 8px 12px 4px; font-size: 9.5px; }
.dv .cx-row { padding: 5px 10px 5px 12px; gap: 0 6px; }
.dv .cx-row-s { font-size: 11.5px; }
.dv .cx-row-c { font-size: 10px; }
.dv .cx-row-p { font-size: 11.5px; padding: 1px 4px; }
.cx-watch-h { padding: 10px 14px 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cx-muted); }
.cx-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0 8px; width: 100%; padding: 8px 14px; border: 0; background: transparent;
  text-align: left; font: inherit; color: inherit; cursor: pointer; border-left: 2px solid transparent; transition: background-color 0.15s;
}
.cx-row:hover { background: var(--cx-hover); }
.cx-row[aria-current="true"] { background: var(--cx-on-bg); border-left-color: #3b9cf5; }
.cx-row-s { font-weight: 600; font-size: 12.5px; color: var(--cx-strong); }
.cx-row-p { grid-row: span 2; align-self: center; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--cx-strong); padding: 2px 4px; border-radius: 4px; transition: background-color 0.6s; }
.cx-row-c { font-family: var(--mono); font-size: 11px; }
.cx-row-c.is-up { color: var(--cx-up); } .cx-row-c.is-dn { color: var(--cx-dn); }
.cx-row-p.flash-up { background: var(--cx-flash-up); transition: none; }
.cx-row-p.flash-dn { background: var(--cx-flash-dn); transition: none; }
@media (max-width: 899px) {
  .cx[data-cx="full"] .cx-body { display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .cx[data-cx="full"] .cx-watch { grid-column: 1 / -1; }
  .cx-watch { width: 100%; flex: 0 0 auto; max-height: none; border-left: 0; border-top: 1px solid var(--cx-line); overflow: visible; }
  .cx-watch-h { display: none; }
  .cx-watch ul { display: flex; overflow-x: auto; scrollbar-width: none; }
  .cx-watch li { flex: none; }
  .cx-row { width: auto; min-width: 132px; border-left: 0; border-bottom: 2px solid transparent; }
  .cx-row[aria-current="true"] { border-bottom-color: #3b9cf5; }
}

/* --------------------------------------------------------------------------
   Two in one
   -------------------------------------------------------------------------- */
.ab-flow { display: grid; align-items: center; gap: 0; margin-bottom: clamp(28px, 4vw, 44px); grid-template-columns: 1fr; justify-items: center; }
@media (min-width: 900px) { .ab-flow { grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr) 72px minmax(0, 1.1fr); } }
.ab-node {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 340px; padding: 16px 18px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-sm);
  font-weight: 600; font-size: 15.5px; color: var(--ink);
}
.ab-node svg { flex: none; color: var(--brand); }
.ab-node small { display: block; margin-top: 2px; font-weight: 450; font-size: 13px; color: var(--muted); }
.ab-node--core { background: linear-gradient(160deg, #1d64e0, #1550b8); border-color: #1550b8; color: #fff; box-shadow: 0 18px 40px -18px rgba(26, 95, 214, 0.7); }
.ab-node--core svg, .ab-node--core small { color: #d6e5ff; }
.ab-node--own { border-color: var(--brand-100); background: linear-gradient(180deg, #fff, var(--brand-50)); }
.ab-outs { display: grid; gap: 12px; width: 100%; justify-items: center; }
/* animated connectors */
.ab-wire, .ab-fork { position: relative; width: 2px; height: 34px; }
.ab-wire i, .ab-fork i {
  position: absolute; inset: 0; border-radius: 2px;
  background: repeating-linear-gradient(180deg, var(--brand) 0 6px, transparent 6px 12px); background-size: 100% 24px;
  animation: ab-flow-v 0.9s linear infinite; opacity: 0.6;
}
.ab-fork i + i { display: none; }
@keyframes ab-flow-v { to { background-position: 0 24px; } }
@keyframes ab-flow-h { to { background-position: 24px 0; } }
@media (min-width: 900px) {
  .ab-wire { width: 100%; height: 2px; }
  .ab-wire i { background: repeating-linear-gradient(90deg, var(--brand) 0 6px, transparent 6px 12px); background-size: 24px 100%; animation-name: ab-flow-h; }
  .ab-fork { width: 100%; height: 96px; }
  .ab-fork i { display: block !important; inset: auto; left: 0; right: 0; height: 2px; transform-origin: left center;
    background: repeating-linear-gradient(90deg, var(--brand) 0 6px, transparent 6px 12px); background-size: 24px 100%; animation-name: ab-flow-h; }
  .ab-fork i:first-child { top: 50%; transform: rotate(-34deg); width: 120%; }
  .ab-fork i + i { top: 50%; transform: rotate(34deg); width: 120%; }
}

.ab-tabs { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-md); overflow: hidden; }
.ab-tablist { display: flex; gap: 4px; padding: 6px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.ab-tablist [role="tab"] {
  flex: 1; min-height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: transparent;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.ab-tablist [role="tab"]:hover { color: var(--ink); }
.ab-tablist [aria-selected="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--sh-sm); }
.ab-tablist [role="tab"]:focus-visible { outline: none; box-shadow: var(--ring); }
.ab-panel { padding: clamp(20px, 3vw, 32px); }
.ab-panel[hidden] { display: none; }
.ab-panel ul { display: grid; gap: 16px 32px; }
@media (min-width: 820px) { .ab-panel ul { grid-template-columns: 1fr 1fr; } }
.ab-panel li { display: flex; gap: 12px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.ab-panel li svg { flex: none; margin-top: 3px; padding: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--wa-50); color: var(--up); }
.ab-panel strong { color: var(--ink); font-weight: 600; }
.js .ab-panel:not([hidden]) { animation: ab-fade 0.4s var(--ease); }
@keyframes ab-fade { from { opacity: 0; transform: translateY(6px); } }

/* --------------------------------------------------------------------------
   Segments
   -------------------------------------------------------------------------- */
.ab-seg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.ab-seg {
  position: relative; padding: 22px 22px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-xs); overflow: hidden; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.ab-seg::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--sky)); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease);
}
.ab-seg:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--line-2); }
.ab-seg:hover::after { transform: scaleX(1); }
.ab-seg-n { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.ab-seg h3 { margin-top: 10px; font-size: 19px; font-weight: 620; letter-spacing: -0.02em; }
.ab-seg p { margin-top: 6px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.ab-seg-eg { display: inline-block; margin-top: 14px; padding: 4px 9px; border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Features
   -------------------------------------------------------------------------- */
.ab-feat-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ab-feat { padding: clamp(22px, 2.6vw, 30px); background: var(--surface); transition: background-color 0.3s; }
.ab-feat:hover { background: #fbfcfe; }
.ab-feat-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); transition: transform 0.4s var(--ease); }
.ab-feat:hover .ab-feat-ic { transform: rotate(-6deg) scale(1.06); }
.ab-feat h3 { margin-top: 16px; font-size: 17px; font-weight: 620; letter-spacing: -0.015em; }
.ab-feat p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Charting (dark band)
   -------------------------------------------------------------------------- */
.ab-charting {
  margin-top: clamp(64px, 8vw, 112px); padding-bottom: clamp(56px, 7vw, 96px);
  background: radial-gradient(900px 500px at 85% 0%, rgba(56, 165, 245, 0.16), transparent 70%), var(--night); color: var(--night-ink);
}
.ab-head--night h2 { color: #fff; }
.ab-head--night > p:last-child { color: var(--night-muted); }
.ab-cap-grid { display: grid; gap: 14px; margin-top: clamp(36px, 4.5vw, 56px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ab-cap { padding: 22px; border-radius: var(--r); background: rgba(255, 255, 255, 0.035); border: 1px solid var(--night-line); transition: background-color 0.3s, border-color 0.3s; }
.ab-cap:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.ab-cap h3 { margin-top: 14px; font-size: 17px; font-weight: 600; color: #fff; }
.ab-cap p { margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--night-muted); }
.ab-chart-grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; margin-top: clamp(40px, 5vw, 64px); }
.ab-chart-grid > * { min-width: 0; }
@media (min-width: 980px) { .ab-chart-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ab-chart-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(56, 165, 245, 0.12); border: 1px solid rgba(56, 165, 245, 0.25); color: #8fc8ff; }

.ab-builder { border-radius: var(--r-lg); background: var(--night-2); border: 1px solid #1f2a46; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7); overflow: hidden; }
.ab-builder-bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--night-line); font-size: 12.5px; color: var(--night-muted); background: #0f1730; }
.ab-builder-body { display: grid; gap: 10px; padding: 20px; }
.ab-builder-k { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.ab-rule {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--night-3); border: 1px solid var(--night-line); font-size: 13.5px;
}
.ab-rule-if { width: 44px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: #8fc8ff; }
.ab-op { color: var(--night-muted); }
.ab-chip { padding: 4px 10px; border-radius: 7px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.1); color: #fff; font-weight: 550; }
.ab-chip--n { font-family: var(--mono); }
.ab-chip--go { background: rgba(48, 194, 122, 0.16); border-color: rgba(48, 194, 122, 0.4); color: #6fe0a5; }
.ab-rule--then { border-color: rgba(48, 194, 122, 0.3); }
.ab-builder-note { padding: 0 20px 14px; font-size: 11.5px; color: var(--night-muted); }
.js .ab-builder.is-in .ab-rule { animation: ab-rule-in 0.6s var(--ease) both; }
.js .ab-builder.is-in .ab-rule:nth-child(3) { animation-delay: 0.12s; }
.js .ab-builder.is-in .ab-rule:nth-child(4) { animation-delay: 0.24s; }
.js .ab-builder.is-in .ab-rule:nth-child(5) { animation-delay: 0.42s; }
@keyframes ab-rule-in { from { opacity: 0; transform: translateX(-12px); } }

.ab-plat-p { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--night-muted); }
.ab-plat-list { display: grid; gap: 10px; margin-top: 18px; }
.ab-plat-list li { display: flex; gap: 10px; font-size: 15px; color: #dbe3f1; }
.ab-plat-list svg { flex: none; margin-top: 2px; color: #4fd690; }
.ab-plat-h { font-size: clamp(22px, 2.4vw, 28px); font-weight: 640; letter-spacing: -0.03em; color: #fff; }
.ab-plat { display: grid; gap: 12px; margin-top: 18px; }
.ab-plat li { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--night-line); transition: background-color 0.3s, border-color 0.3s; }
.ab-plat li:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16); }
.ab-plat svg { flex: none; color: #8fc8ff; }
.ab-plat h4 { font-size: 16px; font-weight: 600; color: #fff; }
.ab-plat p { margin-top: 2px; font-size: 14px; color: var(--night-muted); }

/* --------------------------------------------------------------------------
   Compare
   -------------------------------------------------------------------------- */
.ab-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); }
.ab-table-wrap:focus-visible { outline: none; box-shadow: var(--ring); }
.ab-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; }
.ab-table th, .ab-table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ab-table thead th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg); }
.ab-table thead .ab-col-ours { color: var(--brand); }
.ab-table tbody th { font-weight: 500; color: var(--ink); }
.ab-table tbody tr:last-child > * { border-bottom: 0; }
.ab-table tbody tr:hover > * { background: #fbfcfe; }
.ab-table .ab-col-ours { background: rgba(237, 243, 254, 0.55); }
.ab-table tbody tr:hover .ab-col-ours { background: var(--brand-50); }
.ab-yes, .ab-no, .ab-varies { display: inline-flex; align-items: center; gap: 8px; }
.ab-yes { font-weight: 600; color: var(--ink); }
.ab-yes svg { color: var(--up); flex: none; }
.ab-yes--muted { font-weight: 450; color: var(--ink-2); }
.ab-no { color: var(--faint); }
.ab-varies { color: var(--muted); }
.ab-fine { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Getting started + pricing
   -------------------------------------------------------------------------- */
.ab-start-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: start; }
.ab-start-grid > * { min-width: 0; }
@media (min-width: 980px) { .ab-start-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }
.ab-steps { display: grid; gap: 0; margin-top: 28px; counter-reset: step; }
.ab-steps li { position: relative; display: flex; gap: 18px; padding-bottom: 26px; }
.ab-steps li:not(:last-child)::before { content: ''; position: absolute; left: 19px; top: 44px; bottom: 6px; width: 2px; background: linear-gradient(var(--brand-100), var(--line)); }
.ab-step-n { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--brand-100); color: var(--brand); font-weight: 650; box-shadow: var(--sh-xs); }
.ab-steps h3 { margin-top: 8px; font-size: 18px; font-weight: 620; letter-spacing: -0.015em; }
.ab-steps p { margin-top: 4px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

.ab-price {
  position: relative; padding: clamp(24px, 3vw, 34px); border-radius: var(--r-xl); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-lg); overflow: hidden;
}
.ab-price::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--brand), var(--sky)); }
.ab-price-k { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ab-price-v { margin-top: 10px; font-size: clamp(44px, 5vw, 58px); font-weight: 680; letter-spacing: -0.05em; line-height: 1; color: var(--ink); }
.ab-price-v small { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.ab-price-v span { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }
.ab-price-sub { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.ab-price ul { display: grid; gap: 10px; margin: 22px 0 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.ab-price li { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.ab-price li svg { flex: none; margin-top: 2px; color: var(--up); }
.ab-price-cta { width: 100%; }
.ab-price-fine { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.ab-faq-grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: start; }
.ab-faq-grid > * { min-width: 0; }
@media (min-width: 980px) {
  .ab-faq-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); }
  .ab-faq-head { position: sticky; top: calc(var(--hdr-space) + 16px); }
}
.ab-faq-head > p:not(.ab-k) { margin-top: 14px; font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.ab-faq-head .btn { margin-top: 22px; }
.ab-faq-list { border-top: 1px solid var(--line); }
.ab-qa { border-bottom: 1px solid var(--line); }
.ab-qa summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 4px; cursor: pointer; list-style: none; border-radius: 8px; }
.ab-qa summary::-webkit-details-marker { display: none; }
.ab-qa summary:focus-visible { outline: none; box-shadow: var(--ring); }
.ab-qa summary h3 { font-size: clamp(16px, 1.3vw, 17.5px); font-weight: 600; letter-spacing: -0.015em; color: var(--ink); transition: color 0.2s; }
.ab-qa summary:hover h3 { color: var(--brand); }
.ab-qa-ic { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); transition: background-color 0.25s, border-color 0.25s, transform 0.35s var(--ease); }
.ab-qa-ic::before, .ab-qa-ic::after { content: ''; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.6px; margin: -0.8px 0 0 -5.5px; border-radius: 2px; background: var(--ink); transition: transform 0.35s var(--ease); }
.ab-qa-ic::after { transform: rotate(90deg); }
.ab-qa[open] .ab-qa-ic { background: var(--brand); border-color: var(--brand); transform: rotate(180deg); }
.ab-qa[open] .ab-qa-ic::before, .ab-qa[open] .ab-qa-ic::after { background: #fff; }
.ab-qa[open] .ab-qa-ic::after { transform: rotate(0deg); }
.ab-qa-a { padding: 0 52px 22px 4px; }
.ab-qa-a p { font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.js .ab-qa[open] .ab-qa-a { animation: ab-fade 0.35s var(--ease); }

/* --------------------------------------------------------------------------
   Closing CTA
   -------------------------------------------------------------------------- */
.ab-cta { padding-top: clamp(64px, 8vw, 112px); }
.ab-cta-card {
  position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 28px; align-items: center;
  padding: clamp(28px, 4.4vw, 56px); border-radius: var(--r-xl); background: var(--night); color: #fff;
}
.ab-cta-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(600px 300px at 90% 0%, rgba(56, 165, 245, 0.28), transparent 70%), radial-gradient(500px 300px at 0% 100%, rgba(14, 124, 62, 0.22), transparent 70%);
}
@media (min-width: 960px) { .ab-cta-card { grid-template-columns: minmax(0, 1.4fr) auto; gap: 48px; } }
.ab-cta-card h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 640; color: #fff; }
.ab-cta-card p { margin-top: 12px; max-width: 560px; font-size: 16.5px; line-height: 1.6; color: var(--night-muted); }
.ab-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 520px) { .ab-cta-actions .btn { flex: 1 1 100%; } }

/* --------------------------------------------------------------------------
   Scroll reveal (only when JS runs; content is visible without it)
   -------------------------------------------------------------------------- */
.js .ab-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .ab-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ab-page *, .ab-page *::before, .ab-page *::after { animation: none !important; transition: none !important; }
  .js .ab-reveal { opacity: 1; transform: none; }
}

@media (max-width: 640px) { .ab-qa-a { padding-right: 4px; } }

/* --------------------------------------------------------------------------
   Built-in charting: device showcase (desktop · web · Android)
   Wide screens: all three devices on one stage (a fixed 1136×520 scene
   scaled to the column by assets/js/amibroker.js via --k); the chosen one
   comes to the front and is interactive. Below 900px: the chosen device
   alone, at full width. Chart engine: assets/js/ab-chart.js.
   -------------------------------------------------------------------------- */
.dv-show { margin-top: clamp(8px, 2vw, 16px); }
.dv-switch {
  display: flex; width: max-content; max-width: 100%; margin: 0 auto clamp(18px, 2.4vw, 26px); padding: 5px; gap: 4px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--night-line);
}
.dv-switch button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px;
  background: transparent; color: var(--night-muted); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.dv-switch button:hover { color: #fff; }
.dv-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6); }
.dv-switch button[aria-pressed="true"] svg { color: var(--brand); }
.dv-switch button:focus-visible { outline: 2px solid #8fc8ff; outline-offset: 2px; }
@media (max-width: 480px) { .dv-x { display: none; } .dv-switch { width: 100%; } .dv-switch button { flex: 1; justify-content: center; padding: 0 8px; font-size: 13.5px; } }

.dv-caps { min-height: 26px; margin-top: clamp(14px, 2vw, 22px); text-align: center; font-size: 15.5px; color: var(--night-muted); }
.dv-caps strong { color: #fff; font-weight: 600; }
.dv-caps p { animation: ab-fade 0.4s var(--ease); }
.dv-note { margin-top: 6px; text-align: center; font-size: 12.5px; color: rgba(154, 164, 184, 0.75); }

/* Device frames (shared) */
.dv { position: relative; }
.dv .cx { height: 100%; }
.dv-monitor { padding: 12px 12px 26px; border-radius: 18px; background: linear-gradient(180deg, #23293a, #151a27); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.dv-screen { height: 100%; border-radius: 6px; overflow: hidden; background: var(--cx-bg); }
.dv-neck { width: 120px; height: 46px; margin: 0 auto; background: linear-gradient(90deg, #1c2130, #2b3245 50%, #1c2130); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
.dv-foot { width: 260px; height: 12px; margin: 0 auto; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #2f3649, #171b27); box-shadow: 0 18px 30px -12px rgba(0, 0, 0, 0.8); }
.dv-browser { display: flex; flex-direction: column; height: 100%; border-radius: 14px; overflow: hidden; background: var(--cx-bg); border: 1px solid var(--cx-frame); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.dv-bar { flex: none; display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 14px; background: var(--cx-panel); border-bottom: 1px solid var(--cx-line); }
.dv-url { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; max-width: 380px; height: 24px; margin: 0 auto; padding: 0 12px; border-radius: 7px; background: var(--cx-chip); font-size: 12px; color: var(--cx-muted); white-space: nowrap; overflow: hidden; }
.dv-browser .cx { flex: 1; height: auto; min-height: 0; }
.dv-phone { position: relative; display: flex; flex-direction: column; height: 100%; padding: 10px 9px 8px; border-radius: 40px; background: #12151f; box-shadow: inset 0 0 0 2px #2c3242, 0 40px 80px -24px rgba(0, 0, 0, 0.85); }
.dv-phone > * { border-radius: 0; }
.dv-status { flex: none; position: relative; display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 22px; border-radius: 30px 30px 0 0; background: var(--cx-panel); color: var(--cx-strong); font-size: 12px; font-weight: 650; }
.dv-cam { position: absolute; left: 50%; top: 9px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #05070c; box-shadow: inset 0 0 0 2px #1e2333; }
.dv-sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.dv-sig b { width: 3px; border-radius: 1px; background: currentColor; }
.dv-sig b:nth-child(1) { height: 4px; } .dv-sig b:nth-child(2) { height: 6px; } .dv-sig b:nth-child(3) { height: 8px; } .dv-sig b:nth-child(4) { height: 11px; }
.dv-phone .cx { flex: 1; height: auto; min-height: 0; }
.dv-home { flex: none; height: 20px; border-radius: 0 0 31px 31px; background: var(--cx-panel); position: relative; }
.dv-home::after { content: ''; position: absolute; left: 50%; top: 8px; width: 96px; height: 4px; margin-left: -48px; border-radius: 4px; background: var(--cx-muted); opacity: 0.5; }

/* Phone layout of the chart: drawing tools along the bottom */
.cx[data-cx="mobile"] .cx-sym { padding: 4px 8px; font-size: 12px; }
.cx[data-cx="mobile"] .cx-body { flex-direction: column-reverse; }
.cx[data-cx="mobile"] .cx-tools { flex-direction: row; width: 100%; height: 42px; padding: 0 6px; justify-content: space-between; border-right: 0; border-top: 1px solid var(--cx-line); overflow-x: auto; }
.cx[data-cx="mobile"] .cx-tools-sep { width: 1px; height: 18px; margin: 0 2px; }
.cx[data-cx="mobile"] .cx-toast { bottom: 30px; max-width: calc(100% - 24px); }
.cx[data-cx="mobile"] .cx-btn { padding: 0 7px; }

.dv-pick { display: none; }

/* ---- Wide: the three-device scene (1136×520, scaled by --k) ---- */
@media (min-width: 900px) {
  .dv-stage { --k: 1; position: relative; height: calc(520px * var(--k)); }
  .dv-in { position: absolute; left: calc((100% - 1136px * var(--k)) / 2); top: 0; width: 1136px; height: 520px; transform: scale(var(--k)); transform-origin: 0 0; }
  .dv {
    position: absolute; left: 0; top: 0; transform-origin: 0 0;
    transition: transform 0.75s var(--ease), opacity 0.5s, filter 0.5s;
  }
  .dv--desktop { width: 740px; }
  .dv--desktop .dv-monitor { height: 430px; }
  .dv--desktop .dv-neck { height: 38px; }
  .dv--web { width: 680px; height: 420px; }
  .dv--android { width: 250px; height: 500px; }
  .dv:not(.is-active) { opacity: 0.7; filter: saturate(0.7); }
  .dv:not(.is-active) .cx { pointer-events: none; }
  .dv:not(.is-active) .cx-toast { display: none; }
  .dv-pick { display: block; position: absolute; inset: 0; z-index: 5; width: 100%; border: 0; border-radius: 18px; background: transparent; cursor: pointer; }
  .dv.is-active .dv-pick { display: none; }
  .dv:not(.is-active):hover { opacity: 0.95; filter: none; }

  /* Desktop in front */
  [data-active="desktop"] .dv--desktop { transform: translate(168px, 0) scale(1); z-index: 3; }
  [data-active="desktop"] .dv--web { transform: translate(0, 130px) scale(0.55); z-index: 1; }
  [data-active="desktop"] .dv--android { transform: translate(900px, 95px) scale(0.8); z-index: 4; }
  /* Web in front */
  [data-active="web"] .dv--web { transform: translate(196px, 40px) scale(1); z-index: 3; }
  [data-active="web"] .dv--desktop { transform: translate(0, 120px) scale(0.52); z-index: 1; }
  [data-active="web"] .dv--android { transform: translate(900px, 95px) scale(0.8); z-index: 4; }
  /* Android in front */
  [data-active="android"] .dv--android { transform: translate(443px, 0) scale(1.04); z-index: 4; }
  [data-active="android"] .dv--desktop { transform: translate(30px, 110px) scale(0.58); z-index: 2; }
  [data-active="android"] .dv--web { transform: translate(680px, 140px) scale(0.6); z-index: 1; }
}

/* ---- Narrow: one device at a time ---- */
@media (max-width: 899px) {
  .dv:not(.is-active) { display: none; }
  .dv.is-active { animation: ab-fade 0.45s var(--ease); }
  .dv--desktop .dv-monitor { height: clamp(440px, 70vw, 540px); padding: 8px 8px 18px; border-radius: 14px; }
  .dv--desktop .dv-neck { width: 80px; height: 26px; }
  .dv--desktop .dv-foot { width: 170px; height: 9px; }
  .dv--web { height: clamp(440px, 66vw, 500px); }
  .dv--android { width: min(300px, 86vw); height: min(600px, 172vw); margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) { .dv { transition: none; } }

/* Phone frame: compact theme switch (one icon) to leave room for timeframes */
.cx[data-cx="mobile"] .cx-theme { width: 28px; justify-content: center; }
.cx[data-cx="mobile"] .cx-theme::before { display: none; }
.cx[data-cx="mobile"] .cx-theme svg { margin: 0; }
.cx[data-cx="mobile"] .cx-theme[aria-checked="false"] .cx-moon,
.cx[data-cx="mobile"] .cx-theme[aria-checked="true"] .cx-sun { display: none; }
.cx[data-cx="mobile"] .cx-live { display: none; }
@media (max-width: 640px) {
  .cx-right .cx-icon { display: none; }
  .cx-toast { font-size: 11.5px; padding: 6px 10px; }
}
