/* ==========================================================================
   Animated product scenes (assets/demos/*.js): the shared frame and pieces.
   Synthetic simplified product UI that plays a scripted flow on scroll.
   Layout is forced LTR inside the frame (like the product); labels localize.
   Scene-specific classes live in assets/demos/<group>.css.
   ========================================================================== */
[data-demo] { min-height: 300px; }
.demo {
  position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: radial-gradient(120% 90% at 50% -10%, #102025 0%, #0a161a 45%, #091215 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
  font-size: 0.78rem; text-align: left; min-height: 300px;
  line-height: 1.45; /* the page body runs 1.7, which stretched every scene row */
}
.demo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), transparent 30%);
}
.demo-stage { max-width: 960px; margin: 0 auto; }
.demo-stage.demo-stage-wide { max-width: 1100px; }
:is(.split-visual, .flow-step) [data-demo] { width: 100%; }
:is(.split-visual, .flow-step) .demo { transition: transform 0.5s var(--ease-out), box-shadow 0.5s ease; }
:is(.split-visual, .flow-step):hover .demo { transform: translateY(-6px); box-shadow: 0 34px 96px rgba(0, 0, 0, 0.6), 0 0 60px rgba(7, 159, 191, 0.1); }

/* window bar */
.dm-bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.02);
}
.dm-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); flex: none; }
.dm-bar i:first-child { background: rgba(255, 96, 96, 0.55); }
.dm-bar i:nth-child(2) { background: rgba(255, 200, 90, 0.55); }
.dm-bar i:nth-child(3) { background: rgba(46, 178, 117, 0.55); }
.dm-bar span { color: var(--faint); font-size: 0.74rem; margin-left: 8px; letter-spacing: 0.01em; }
[dir="rtl"] .dm-bar span { margin-left: 0; margin-right: 6px; }

/* body, panels, grids */
.dm-body { position: relative; padding: 20px; }
.dm-grid2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.dm-grid1 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dm-panel {
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
  border-radius: 16px; padding: 14px 16px; min-width: 0;
}
.dm-ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dm-ph span { color: var(--faint); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; }
.dm-faint { text-transform: none !important; letter-spacing: 0 !important; font-weight: 400 !important; }
.dm-btn {
  background: var(--brand-grad-btn, linear-gradient(120deg, #4DDAFF, #079FBF)); color: var(--on-brand, #03141b); border: 0; border-radius: 9px; padding: 6px 14px;
  font: inherit; font-size: 0.76rem; font-weight: 650; pointer-events: none;
  box-shadow: 0 4px 14px rgba(7, 159, 191, 0.35); transition: transform 0.15s ease, box-shadow 0.2s;
}
.dm-btn.pressed { transform: scale(0.94); box-shadow: 0 2px 8px rgba(7, 159, 191, 0.5); }
.dm-btn.ghost { background: rgba(255, 255, 255, 0.06); color: var(--ink); box-shadow: none; border: 1px solid var(--line-soft); }

/* KPI tiles */
.dm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.dm-kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.dm-kpis.k3 { grid-template-columns: repeat(3, 1fr); }
.dm-kpi {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02) 70%);
  border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 16px; padding: 14px 16px 13px; min-width: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  opacity: 0; transform: translateY(12px) scale(0.985);
  transition: opacity 0.6s ease, transform 0.7s var(--ease-spring), box-shadow 0.9s ease;
}
.dm-kpi.in { opacity: 1; transform: none; }
.dm-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent); opacity: 0; transition: opacity 0.8s ease; }
.dm-kpi.in::before { opacity: 1; }
.dm-kpi span { display: block; color: var(--faint); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-kpi b { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dm-kpi b.amber { color: var(--warn); }
.dm-kpi u { display: block; text-decoration: none; color: var(--faint); font-size: 0.64rem; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* rows (lists and tables) */
.dm-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px;
  border: 1px solid transparent; margin-bottom: 4px; background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.3s, background 0.3s, transform 0.55s var(--ease-spring), opacity 0.45s ease, box-shadow 0.6s ease;
}
.dm-row.rise { opacity: 0; transform: translateY(10px) scale(0.99); }
.dm-row.rise.in { opacity: 1; transform: none; }
.dm-row b { color: var(--ink); font-weight: 500; font-size: 0.8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.005em; }
.dm-row small { display: block; color: var(--faint); font-size: 0.64rem; font-weight: 400; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row u { text-decoration: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.76rem; white-space: nowrap; flex: none; }
.dm-row .num { min-width: 66px; text-align: right; }
.dm-row.hl { border-color: rgba(7, 159, 191, 0.4); background: rgba(7, 159, 191, 0.08); box-shadow: 0 0 24px rgba(7, 159, 191, 0.12); }
.dm-row.hl u { color: var(--ink); font-weight: 650; }
.dm-row.win { border-color: rgba(61, 220, 151, 0.4); background: rgba(61, 220, 151, 0.07); }
.dm-thead { display: flex; gap: 8px; padding: 4px 9px 6px; color: var(--faint); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.dm-thead b { flex: 1; font-weight: 600; color: inherit; }
.dm-thead u { text-decoration: none; flex: none; }
.dm-mark {
  position: relative; width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center;
  font-style: normal; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em;
}
.dm-mark .dm-mark-img { width: 100%; height: 100%; border-radius: inherit; overflow: hidden; display: grid; place-items: center; }
.dm-mark.dm-logo { background: #f4f6f5; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 2px 6px rgba(0, 0, 0, 0.35); }
.dm-mark.dm-logo .dm-mark-img { padding: 2px; box-sizing: border-box; }
.dm-mark.dm-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* country badge at the mark's corner: the flag carries the market */
.dm-cc { position: absolute; right: -5px; bottom: -5px; width: 13px; height: 13px; border-radius: 50%; background: #0a161a; display: grid; place-items: center; box-shadow: 0 0 0 1.5px #0a161a; }
.dm-cc .dm-flag { width: 11px; height: 11px; border-radius: 50%; display: block; }
[dir="rtl"] .dm-cc { right: auto; left: -5px; }
.dm-avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-style: normal; font-size: 0.62rem; font-weight: 700; color: #fff; overflow: hidden; box-shadow: 0 0 0 2px rgba(7, 21, 25, 0.9), 0 0 0 3px rgba(255, 255, 255, 0.12); }
.dm-avatar.dm-photo { background: #18292e; }
.dm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* tags, badges, chips */
.dm-tag {
  font-style: normal; border-radius: 999px; padding: 2px 9px; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.01em;
  white-space: nowrap; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.t-open { background: rgba(59, 130, 246, 0.16); color: #8fbaff; }
.t-eval { background: rgba(139, 127, 240, 0.18); color: #b9b2ff; }
.t-awarded { background: rgba(61, 220, 151, 0.13); color: var(--good); }
.t-won { background: rgba(61, 220, 151, 0.16); color: var(--good); }
.t-lost { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.t-warn { background: rgba(255, 197, 85, 0.14); color: var(--warn); }
.t-reason { background: rgba(7, 159, 191, 0.13); color: #8de0f7; }
.t-grey { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.t-mag { background: rgba(224, 31, 181, 0.14); color: #ff8ae2; }
.t-violet { background: rgba(139, 127, 240, 0.16); color: #b9b2ff; }
.dm-tag.pop, .dm-badge.pop { animation: dm-pop 0.45s var(--ease-spring); }
@keyframes dm-pop { 0% { transform: scale(0.6); } 70% { transform: scale(1.12); } }
.dm-badge {
  font-style: normal; border-radius: 6px; padding: 1px 7px; font-size: 0.62rem; font-weight: 700;
  background: rgba(7, 159, 191, 0.16); color: #8de0f7; white-space: nowrap; flex: none;
}
.dm-badge.amber { background: rgba(255, 197, 85, 0.14); color: var(--warn); }
.dm-badge.blue { background: rgba(59, 130, 246, 0.16); color: #8fbaff; }
.dm-badge.grey { background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.dm-chip {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 5px 12px; color: var(--faint); font-size: 0.7rem;
  opacity: 0.45; transition: opacity 0.35s, border-color 0.35s, color 0.35s; max-width: 100%;
}
.dm-chip.on { opacity: 1; border-color: rgba(61, 220, 151, 0.35); color: var(--good); }
.dm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dm-chips .dm-chip { opacity: 1; padding: 3px 10px; font-size: 0.66rem; color: var(--muted); }
.dm-chips .dm-chip.sel { border-color: rgba(7, 159, 191, 0.5); background: rgba(7, 159, 191, 0.1); color: var(--ink); }

/* tabs and filters */
.dm-tabbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.dm-tab {
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 11px;
  color: var(--faint); font-size: 0.68rem; font-weight: 600; transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.dm-tab.on { color: var(--ink); border-color: rgba(7, 159, 191, 0.5); background: rgba(7, 159, 191, 0.1); }
.dm-toggle { display: inline-flex; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.dm-toggle span { padding: 3px 9px; font-size: 0.66rem; font-weight: 700; color: var(--faint); transition: background 0.25s, color 0.25s; }
.dm-toggle span.on { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.dm-rail { display: flex; flex-direction: column; gap: 10px; }
.dm-rail h6 { margin: 0; color: var(--faint); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.dm-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-soft); border-radius: 9px; padding: 6px 10px; color: var(--faint); font-size: 0.72rem; background: rgba(255, 255, 255, 0.02); }
.dm-search b { color: var(--ink); font-weight: 500; min-height: 1em; }

/* steps and stepper */
.dm-step {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line-soft); margin-bottom: 6px; background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.25s, background 0.25s;
}
.dm-step i {
  font-style: normal; width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.68rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.06); color: var(--faint);
  transition: background 0.25s, color 0.25s;
}
.dm-step > div { flex: 1; min-width: 0; }
.dm-step b { display: block; color: var(--ink); font-size: 0.76rem; font-weight: 600; }
.dm-step span { display: block; color: var(--faint); font-size: 0.68rem; }
.dm-step u { flex: none; color: var(--good); opacity: 0; transform: scale(0.5); transition: opacity 0.3s, transform 0.35s var(--ease-spring); }
.dm-step.on { border-color: rgba(7, 159, 191, 0.45); background: rgba(7, 159, 191, 0.08); }
.dm-step.on i { background: var(--brand-grad-btn, linear-gradient(120deg, #4DDAFF, #079FBF)); color: var(--on-brand, #03141b); }
.dm-step.done u { opacity: 1; transform: scale(1); }
.dm-step.done { border-color: rgba(61, 220, 151, 0.25); background: rgba(61, 220, 151, 0.045); }
.dm-stepper { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding-top: 6px; }
.dm-stepper .dm-tlline { left: 10%; right: 10%; }

/* meters, bars, timeline rail */
.dm-meterrow { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.dm-meterrow > span { color: var(--faint); font-size: 0.7rem; flex: none; }
.dm-meterrow b { color: var(--ink); font-size: 0.76rem; font-variant-numeric: tabular-nums; flex: none; min-width: 42px; text-align: right; }
.dm-meter { flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.dm-meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #079FBF, #00829C); transition: width 0.2s linear; width: 0; }
.dm-meter i.amber { background: linear-gradient(90deg, #ffc555, #e0a030); }
[dir="rtl"] .dm-meter i { background: linear-gradient(270deg, #079FBF, #00829C); }
[dir="rtl"] .dm-meter i.amber { background: linear-gradient(270deg, #ffc555, #e0a030); }
.dm-hbar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); margin: 5px 0 3px; overflow: hidden; }
.dm-hbar i { display: block; height: 100%; border-radius: 999px; width: 0; background: #079FBF; }
.dm-mbars { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding: 2px 2px 0; }
.dm-mbars i { flex: 1; border-radius: 4px 4px 2px 2px; min-height: 3px; height: 0;
  background: linear-gradient(180deg, rgba(7, 159, 191, 0.9), rgba(7, 159, 191, 0.35));
  transition: height 0.35s var(--ease-out), opacity 0.3s, background 0.3s; }
.dm-mbars i.hl { background: linear-gradient(180deg, #3ddc97, rgba(61, 220, 151, 0.4)); box-shadow: 0 0 14px rgba(61, 220, 151, 0.25); }
.dm-mbars i.rest { background: rgba(255, 255, 255, 0.16); }
.dm-mlbls { display: flex; gap: 6px; padding: 4px 2px 0; }
.dm-mlbls span { flex: 1; text-align: center; color: var(--faint); font-size: 0.58rem; white-space: nowrap; overflow: hidden; }
.dm-tl { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 6px; }
.dm-tlline { position: absolute; top: 13px; left: 12.5%; right: 12.5%; height: 2px; background: rgba(255, 255, 255, 0.07); border-radius: 999px; }
.dm-tlline i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #079FBF, #00829C 55%, #3ddc97); }
[dir="rtl"] .dm-tlline i { background: linear-gradient(270deg, #079FBF, #00829C 55%, #3ddc97); }
.dm-tlnode { text-align: center; min-width: 0; }
.dm-tlnode i {
  display: block; width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 7px;
  background: rgba(255, 255, 255, 0.08); border: 2px solid rgba(255, 255, 255, 0.14);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s; position: relative; z-index: 1;
}
.dm-tlnode.on i { background: #079FBF; border-color: rgba(141, 224, 247, 0.55); box-shadow: 0 0 12px rgba(7, 159, 191, 0.4); }
.dm-tlnode.soft.on i { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.3); box-shadow: none; }
.dm-tlnode b { display: block; color: var(--ink); font-size: 0.7rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-tlnode span { display: block; color: var(--faint); font-size: 0.62rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* donut (part-to-whole) */
.dm-owngrid { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.dm-donutwrap { position: relative; width: 150px; height: 150px; }
.dm-donuttxt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dm-donuttxt span { color: var(--faint); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.dm-donuttxt b { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.dm-donuttxt.dm-rise { opacity: 0; transform: translateY(5px); transition: opacity 0.5s ease, transform 0.55s var(--ease-out); }
.dm-donuttxt.dm-rise.in { opacity: 1; transform: none; }
.dm-hrows { min-width: 0; }
.dm-hrow { padding: 5px 0; opacity: 0; transform: translateY(9px); transition: opacity 0.5s ease, transform 0.55s var(--ease-out); }
.dm-hrow.in { opacity: 1; transform: none; }
.dm-hmeta { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dm-hmeta i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dm-hmeta b { color: var(--ink); font-weight: 550; font-size: 0.78rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-hmeta u { text-decoration: none; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; font-size: 0.78rem; margin-left: auto; flex: none; }
[dir="rtl"] .dm-hmeta u { margin-left: 0; margin-right: auto; }

/* toast, cursor, typing caret, score */
.dm-toast {
  grid-column: 1 / -1; justify-self: end;
  display: flex; align-items: center; gap: 8px;
  background: #0d1c21; border: 1px solid rgba(61, 220, 151, 0.35); border-radius: 12px;
  padding: 9px 14px; font-size: 0.76rem; color: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  box-sizing: border-box; max-width: 100%;
  opacity: 0; transform: translateY(10px); transition: opacity 0.35s ease, transform 0.4s var(--ease-spring);
}
.dm-toast i { color: var(--good); display: grid; place-items: center; }
.dm-toast span { min-width: 0; }
.dm-toast.on { opacity: 1; transform: translateY(0); }
.dm-cursor {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  transform: translate(40px, 40px); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.dm-cursor .dm-ripple {
  position: absolute; left: -7px; top: -7px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75); opacity: 0; transform: scale(0.3);
}
.dm-cursor.click .dm-ripple { animation: dm-ripple 0.38s ease-out; }
@keyframes dm-ripple { 0% { opacity: 0.9; transform: scale(0.3); } 100% { opacity: 0; transform: scale(1.15); } }
.dm-field { display: flex; align-items: baseline; gap: 10px; padding: 4px 2px; }
.dm-field span { color: var(--faint); font-size: 0.7rem; min-width: 88px; flex: none; }
.dm-field b { color: var(--ink); font-size: 0.76rem; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.dm-field b:not(:empty)::after { content: ""; display: inline-block; width: 1px; height: 0.9em; background: var(--accent); margin-left: 2px; vertical-align: -1px; animation: dm-caret 0.8s steps(1) infinite; }
@keyframes dm-caret { 50% { opacity: 0; } }
.dm-score { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 8px; }
.dm-score b { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--ink); }
.dm-score b i { font-style: normal; font-size: 1rem; color: var(--faint); font-weight: 600; }
.dm-score span { color: var(--faint); font-size: 0.74rem; }
.dm-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--line-soft); margin-top: 8px; padding: 9px 2px 1px;
}
.dm-total span { color: var(--faint); font-size: 0.7rem; }
.dm-total b { color: var(--ink); font-family: var(--font-display); font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; transition: opacity 0.4s ease; }
.dm-note { color: var(--faint); font-size: 0.68rem; margin-top: 8px; }
.dm-scan { background: rgba(255, 255, 255, 0.06); color: var(--faint); animation: dm-pulse 1.1s ease-in-out infinite; }
@keyframes dm-pulse { 50% { opacity: 0.45; } }

/* RTL: the frame keeps physical LTR order for window dots; text anchors to the reading edge */
[dir="rtl"] .demo { text-align: right; }
[dir="rtl"] .dm-bar { direction: ltr; }
[dir="rtl"] .dm-bar span { direction: rtl; }
[dir="rtl"] .dm-row .num { text-align: left; }
[dir="rtl"] .dm-toast { justify-self: start; }

/* responsive and reduced motion */
@media (max-width: 860px) {
  .dm-grid2 { grid-template-columns: 1fr; }
  .dm-cursor { display: none; }
  .dm-kpis, .dm-kpis.k5, .dm-kpis.k3 { grid-template-columns: repeat(2, 1fr); }
  .dm-owngrid { grid-template-columns: 1fr; justify-items: center; }
  .dm-tl, .dm-stepper { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .dm-tlline { display: none; }
}
:is(.split-visual, .flow-step) .dm-kpis { grid-template-columns: repeat(2, 1fr); }
/* five tiles in a split column go three then two on a six-track grid (2/2/2/3/3),
   never two, two and a lone tile on its own row; phones keep their own layout */
@media (min-width: 861px) {
  .split-visual .dm-kpis.k5 { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .split-visual .dm-kpis.k5 > .dm-kpi { grid-column: span 2; }
  .split-visual .dm-kpis.k5 > .dm-kpi:nth-child(4), :is(.split-visual, .flow-step) .dm-kpis.k5 > .dm-kpi:nth-child(5) { grid-column: span 3; }
  .split-visual .dm-kpis.k5 > .dm-kpi b { font-size: 1.1rem; }
}
:is(.split-visual, .flow-step) .dm-grid2 { grid-template-columns: 1fr; }
:is(.split-visual, .flow-step) .dm-owngrid { grid-template-columns: 1fr; justify-items: center; }
@media (prefers-reduced-motion: reduce) {
  .dm-cursor, .dm-toast { transition: none; }
  .dm-cursor { display: none; }
  .dm-scan { animation: none; }
  .dm-field b:not(:empty)::after { display: none; }
  .dm-row.rise, .dm-hrow, .dm-kpi, .dm-donuttxt.dm-rise { opacity: 1; transform: none; transition: none; }
}


/* ambient: CSS-only idle motion once a hero scene has finished, so it never
   reads as a still. Subtle by design; off under reduced motion. */
.ambient:not(.live) .dm-panel .dm-row.rise.in:first-of-type { animation: dm-breathe 7s ease-in-out 2s infinite; }
@keyframes dm-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(7, 159, 191, 0); border-color: transparent; }
  8% { box-shadow: 0 0 22px rgba(7, 159, 191, 0.16); border-color: rgba(7, 159, 191, 0.35); }
  22% { box-shadow: 0 0 0 0 rgba(7, 159, 191, 0); border-color: transparent; }
}
.ambient .dm-tlline i { background-size: 200% 100%; animation: dm-shimmer 5s linear 1.5s infinite; }
@keyframes dm-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.ambient .dm-tlline i { background-image: linear-gradient(90deg, #079FBF 0%, #00829C 35%, #4DDAFF 50%, #00829C 65%, #079FBF 100%); }
@media (prefers-reduced-motion: reduce) {
  .ambient:not(.live) .dm-panel .dm-row.rise.in:first-of-type, .ambient .dm-panel .dm-row.rise.in:first-of-type, .ambient .dm-tlline i { animation: none; }
}

/* KPI sparkline: five to eight hairline bars at the tile's edge, grown in
   after the tile lands. Decorative trend, never a labelled series. */
.dm-spark { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: flex-end; gap: 3px; height: 26px; width: 44px; }
[dir="rtl"] .dm-spark { right: auto; left: 14px; }
.dm-spark u { flex: 1; height: var(--h); border-radius: 2px 2px 1px 1px; background: linear-gradient(180deg, rgba(7, 159, 191, 0.85), rgba(7, 159, 191, 0.3)); transform: scaleY(0); transform-origin: bottom; transition: transform 0.6s var(--ease-spring); transition-delay: calc(var(--d) + 250ms); }
.dm-spark u:last-child { background: linear-gradient(180deg, #3ddc97, rgba(61, 220, 151, 0.4)); }
.dm-kpi.in .dm-spark u { transform: scaleY(1); }
/* a horizontal lockup gets a wide tile so the mark stays legible */
.dm-mark.dm-logo.wide { width: 40px; border-radius: 6px; }

/* pause/play control for scenes with a live phase (WCAG 2.2.2): faint in the
   window bar, full strength on hover and keyboard focus */
.dm-pause {
  appearance: none; -webkit-appearance: none; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04);
  color: var(--faint); width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; padding: 0; margin: 0 0 0 10px;
  cursor: pointer; transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease; flex: none;
}
.demo:hover .dm-pause, .dm-pause:focus-visible { color: var(--muted); }
.dm-pause:hover { background: rgba(255, 255, 255, 0.09); color: var(--ink); border-color: rgba(255, 255, 255, 0.18); }
.dm-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo.paused .dm-pause { color: var(--good); border-color: rgba(61, 220, 151, 0.4); }
.dm-pause { order: 9; margin-left: auto; }

/* runtime text changes: two layers stacked in one grid cell; the old eases
   out upward, the new eases in from below; nothing reflows */
.dm-swap { display: inline-grid; vertical-align: bottom; max-width: 100%; }
.dm-swap > span { grid-area: 1 / 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.dm-swap > span.pre { opacity: 0; transform: translateY(5px); }
.dm-swap > span.out { opacity: 0; transform: translateY(-5px); transition: opacity 0.25s var(--ease-in), transform 0.25s var(--ease-in); pointer-events: none; }
.dm-tag.dm-swap, .dm-badge.dm-swap { vertical-align: middle; }
.dm-tag, .dm-badge { transition: background 0.4s ease, color 0.4s ease; }
.t-new { background: rgba(61, 220, 151, 0.16); color: var(--good); }
/* a badge that will pop later keeps its slot, so the pop never reflows the row */
.dm-badge.pending { visibility: hidden; }
/* a small "+1" beside a figure that just ticked */
.dm-whisper { display: inline-block; margin-left: 8px; vertical-align: middle; font-style: normal; font-size: 0.66rem; font-weight: 700; color: var(--good); letter-spacing: 0; animation: dm-whisper 1.1s var(--ease-out) forwards; }
[dir="rtl"] .dm-whisper { margin-left: 0; margin-right: 8px; }
@keyframes dm-whisper { 0% { opacity: 0; transform: translateY(6px); } 25% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-7px); } }
/* the newest sparkline bar registers a tick */
.dm-spark u.nudge { animation: dm-nudge 0.45s var(--ease-out); }
@keyframes dm-nudge { 50% { transform: scaleY(1.18); } }
/* a no-transition frame for DOM commits */
.noanim, .noanim * { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .dm-swap > span, .dm-swap > span.pre, .dm-swap > span.out { transition: none; }
  .dm-whisper, .dm-pause { display: none; }
  .dm-spark u.nudge { animation: none; }
}
/* a swap inside a KPI sub line keeps the sub line's type, not the label's */
.dm-kpi u .dm-swap, .dm-kpi u .dm-swap > span { display: block; margin: 0; font-size: inherit; letter-spacing: inherit; text-transform: none; color: inherit; font-weight: inherit; }
.dm-kpi u .dm-swap { display: inline-grid; vertical-align: top; max-width: 100%; }
