/* Local Sandbox — component styles. Every value comes from tokens.css; nothing here re-declares a token. */

body { margin: 0; background: var(--bg); color: var(--label); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
.ls-icon { display: block; flex: none; }

/* ---------- Preview/demo stage: monochrome layers for the glass to refract ---------- */
.ls-stage { position: relative; min-height: 100%; box-sizing: border-box; padding: var(--space-6); display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: center; background: var(--bg); overflow: hidden; isolation: isolate; }
.ls-stage--col { flex-direction: column; }
.ls-stage--start { justify-content: flex-start; align-items: flex-start; }

/* ---------- ParticleField: the brand's particle motion, drawn behind content ---------- */
.ls-particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; color: var(--label); }
.ls-particles--fixed { position: fixed; }

/* ---------- Liquid Glass ----------
   A thin veil (glass-*) over the lens: the backdrop is refracted along the edge (--ls-lens, set per
   shape by the bundle where supported), lightly blurred and saturated, then lit by the rim. */
.ls-glass { --ls-blur: var(--blur-regular); position: relative; isolation: isolate; border-radius: var(--radius-xl); color: var(--label);
  background: var(--glass-regular);
  -webkit-backdrop-filter: blur(var(--ls-blur)) saturate(var(--saturate-glass));
  backdrop-filter: var(--ls-lens, ) blur(var(--ls-blur)) saturate(var(--saturate-glass));
  box-shadow: var(--shadow-glass-rim), 0 0 0 0.5px var(--glass-edge), var(--shadow-glass);
  transition: transform var(--duration-base) var(--ease-snap), box-shadow var(--duration-base) var(--ease-standard), filter var(--duration-base) var(--ease-standard); }
/* Specular sheen: light caught along the top edge and the upper-left shoulder. */
.ls-glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background:
    radial-gradient(120% 60% at 20% 0%, var(--glass-rim), transparent 55%),
    linear-gradient(to bottom, var(--glass-rim), transparent 30%);
  opacity: .32; }
.ls-glass--clear { --ls-blur: var(--blur-thin); background: var(--glass-clear); }
.ls-glass--thick { --ls-blur: var(--blur-thick); }
.ls-glass--capsule { border-radius: var(--radius-capsule); }
.ls-glass--ink { background: var(--glass-ink); color: var(--on-ink); }
.ls-glass--ink::before { opacity: .18; }
.ls-glass--interactive { cursor: pointer; }
.ls-glass--interactive:hover { filter: brightness(1.04); }
/* Press: the glass lifts and swells slightly, then springs back on release. */
.ls-glass--interactive:active { transform: scale(1.06); filter: brightness(1.08);
  transition-duration: var(--duration-instant); transition-timing-function: var(--ease-standard); }
.ls-glass-dim { position: absolute; inset: 0; background: var(--glass-dim); pointer-events: none; }
/* Secondary text on glass is denser than on opaque grounds. */
.ls-glass .ls-glass-secondary { color: var(--label-glass-secondary); }

/* Text set straight on the particle field gets a faint surface-coloured halo, so specks never cut through letters. */
.ls-on-field, .ls-list__header, .ls-list__footer, .ls-toolbar__title, .ls-msg__meta, .ls-msg__text, .ls-chart__head, .ls-chart__legend, .ls-chart__tick, .ls-orb__label { text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }

/* ---------- Focus ---------- */
.ls-btn:focus-visible, .ls-iconbtn:focus-visible, .ls-seg__item:focus-visible, .ls-toggle:focus-visible, .ls-row.is-action:focus-visible {
  outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.ls-glass.ls-btn:focus-visible, .ls-glass.ls-iconbtn:focus-visible { box-shadow: var(--focus-ring), var(--shadow-glass); }

/* ---------- Button ---------- */
.ls-btn { appearance: none; border: 0; margin: 0; font: inherit; font-family: var(--font-sans); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  border-radius: var(--radius-capsule); cursor: pointer; white-space: nowrap; font-weight: 600; -webkit-tap-highlight-color: transparent;
  transition: transform var(--duration-base) var(--ease-snap), background-color var(--duration-instant) var(--ease-standard), filter var(--duration-base) var(--ease-standard), opacity var(--duration-instant) linear; }
.ls-btn--sm { height: var(--size-control-sm); padding: 0 var(--space-3); font-size: 13px; line-height: 16px; }
.ls-btn--md { height: var(--size-control-md); padding: 0 var(--space-4); font-size: 15px; line-height: 20px; letter-spacing: -0.23px; }
.ls-btn--lg { height: var(--size-control-lg); padding: 0 var(--space-5); font-size: 17px; line-height: 22px; letter-spacing: -0.43px; }
.ls-btn--tinted { background: var(--fill-secondary); color: var(--label); }
.ls-btn--plain { background: transparent; color: var(--label); font-weight: 500; }
.ls-btn--plain.ls-btn--md, .ls-btn--plain.ls-btn--sm { padding: 0 var(--space-2); }
.ls-btn--tinted:hover, .ls-btn--plain:hover { background-image: linear-gradient(var(--fill-quaternary), var(--fill-quaternary)); }
.ls-btn--tinted:active, .ls-btn--plain:active { opacity: var(--opacity-pressed); }
.ls-btn--destructive.ls-btn--plain, .ls-btn--destructive.ls-btn--tinted, .ls-btn--destructive.ls-btn--glass { color: var(--red-text); }
.ls-btn--destructive.ls-btn--tinted { background: var(--fill-tertiary); }
.ls-btn:disabled, .ls-iconbtn:disabled { opacity: var(--opacity-disabled); pointer-events: none; }

/* ---------- IconButton (always round: concentric with its container) ---------- */
.ls-iconbtn { appearance: none; border: 0; margin: 0; padding: 0; display: inline-grid; place-items: center; flex: none; border-radius: var(--radius-capsule);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform var(--duration-base) var(--ease-snap), background-color var(--duration-instant) var(--ease-standard), opacity var(--duration-instant) linear; }
.ls-iconbtn--sm { width: var(--size-control-sm); height: var(--size-control-sm); }
.ls-iconbtn--md { width: var(--size-control-md); height: var(--size-control-md); }
.ls-iconbtn--lg { width: var(--size-control-lg); height: var(--size-control-lg); }
.ls-iconbtn--plain { background: transparent; color: var(--label); }
.ls-iconbtn--plain:hover { background: var(--fill-quaternary); }
.ls-iconbtn--plain:active { background: var(--fill-tertiary); transform: scale(.94); }
.ls-iconbtn--filled { background: var(--fill-tertiary); color: var(--label); }
.ls-iconbtn--filled:hover { background: var(--fill-secondary); }
.ls-iconbtn--filled:active { transform: scale(.94); }

/* ---------- SegmentedControl: a drop of glass sliding on a track ---------- */
.ls-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; box-sizing: border-box; min-width: 240px;
  height: var(--size-control-md); padding: 2px; border-radius: var(--radius-capsule); background: var(--fill-secondary); }
.ls-seg--sm { height: var(--size-control-sm); min-width: 180px; }
.ls-seg__thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--ls-seg-count)); border-radius: var(--radius-capsule);
  background: var(--glass-thumb); box-shadow: var(--shadow-glass-rim), var(--shadow-knob); transform: translateX(calc(var(--ls-seg-index) * 100%));
  transition: transform var(--duration-base) var(--ease-snap); }
.ls-seg__item { position: relative; z-index: 1; appearance: none; border: 0; background: transparent; margin: 0; padding: 0 var(--space-3); border-radius: var(--radius-capsule);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); font-family: var(--font-sans); font-size: 15px; line-height: 20px; letter-spacing: -0.23px; font-weight: 500;
  color: var(--label); cursor: pointer; white-space: nowrap; }
.ls-seg--sm .ls-seg__item { font-size: 13px; line-height: 16px; }
.ls-seg__item.is-selected { font-weight: 600; }

/* ---------- Toggle ---------- */
.ls-toggle { appearance: none; border: 0; margin: 0; padding: 0; position: relative; flex: none; width: 52px; height: 32px; border-radius: var(--radius-capsule);
  background: var(--fill); cursor: pointer; transition: background-color var(--duration-quick) var(--ease-standard); -webkit-tap-highlight-color: transparent; }
.ls-toggle.is-on { background: var(--ink); }
.ls-toggle--green.is-on { background: var(--green); }
.ls-toggle__knob { position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: var(--radius-capsule); background: var(--knob); box-shadow: var(--shadow-knob);
  transition: left var(--duration-quick) var(--ease-snap), width var(--duration-quick) var(--ease-snap), background-color var(--duration-quick) var(--ease-standard); }
.ls-toggle.is-on .ls-toggle__knob { left: calc(100% - 30px); background: var(--on-ink); }
.ls-toggle--green.is-on .ls-toggle__knob { background: var(--knob); }
/* Gel stretch while pressed (the knob turns to glass in the system control). */
.ls-toggle:active .ls-toggle__knob { width: 36px; }
.ls-toggle.is-on:active .ls-toggle__knob { left: calc(100% - 38px); }
.ls-toggle:disabled { opacity: var(--opacity-disabled); cursor: default; }
.ls-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--size-control-lg); font-size: 17px; line-height: 22px; letter-spacing: -0.43px; }
.ls-toggle-row__label { display: flex; flex-direction: column; color: var(--label); cursor: pointer; }
.ls-toggle-row__desc { font-size: 13px; line-height: 18px; letter-spacing: -0.08px; color: var(--label-glass-secondary); }
.ls-toggle-row.is-disabled .ls-toggle-row__label { color: var(--label-tertiary); }

/* ---------- TextField ---------- */
.ls-field { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.ls-field__label { font-size: 13px; line-height: 18px; letter-spacing: -0.08px; color: var(--label-glass-secondary); padding: 0 var(--space-1); }
.ls-field__well { display: flex; align-items: center; gap: var(--space-2); height: var(--size-control-lg); padding: 0 var(--space-3); box-sizing: border-box;
  border-radius: var(--radius-md); background: var(--fill-tertiary); transition: box-shadow var(--duration-instant) var(--ease-standard); }
.ls-field--sm .ls-field__well { height: var(--size-control-md); border-radius: var(--radius-sm); }
.ls-field__well:focus-within { box-shadow: var(--focus-ring); }
.ls-field__icon { color: var(--label-glass-secondary); }
.ls-field__input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0; font-family: var(--font-sans); font-size: 17px; line-height: 22px; letter-spacing: -0.43px; color: var(--label); }
.ls-field--sm .ls-field__input { font-size: 13px; line-height: 16px; letter-spacing: 0; }
.ls-field__input::placeholder { color: var(--label-tertiary); }
.ls-field__hint { display: flex; align-items: center; gap: var(--space-1); margin: 0; padding: 0 var(--space-1); font-size: 13px; line-height: 18px; letter-spacing: -0.08px; color: var(--label-glass-secondary); }
.ls-field.is-invalid .ls-field__well { box-shadow: inset 0 0 0 1px var(--red); }
.ls-field.is-invalid .ls-field__well:focus-within { box-shadow: inset 0 0 0 1px var(--red), var(--focus-ring); }
.ls-field.is-invalid .ls-field__hint { color: var(--red-text); }

/* ---------- Composer (radius = half its height, so it stays a capsule and its round buttons nest concentrically) ---------- */
.ls-composer { display: flex; align-items: flex-end; gap: var(--space-1); box-sizing: border-box; width: 100%; max-width: 680px; min-height: var(--size-control-xl);
  padding: var(--space-2); border-radius: calc(var(--size-control-xl) / 2); margin: 0; }
.ls-composer__input { flex: 1; min-width: 0; box-sizing: border-box; border: 0; outline: 0; resize: none; background: transparent; margin: 0; padding: 7px var(--space-1);
  font-family: var(--font-sans); font-size: 16px; line-height: 22px; letter-spacing: -0.31px; color: var(--label); max-height: 168px; }
.ls-composer__input::placeholder { color: var(--label-glass-secondary); }
.ls-composer:focus-within { box-shadow: var(--shadow-glass-rim), 0 0 0 0.5px var(--glass-edge), var(--shadow-glass), var(--focus-ring); }

/* ---------- Toolbar: separate glass capsules floating over content ---------- */
.ls-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-2); width: 100%; box-sizing: border-box; padding: var(--space-2) var(--space-4); }
.ls-toolbar__leading { display: flex; gap: var(--space-2); justify-self: start; }
.ls-toolbar__trailing { display: flex; gap: var(--space-2); justify-self: end; align-items: center; }
.ls-toolbar__title { display: flex; flex-direction: column; align-items: center; text-align: center; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.43px; color: var(--label); }
.ls-toolbar__subtitle { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: 0; color: var(--label-secondary); }
.ls-toolbar__group { display: inline-flex; align-items: center; gap: 2px; padding: 4px; }
.ls-toolbar__group > .ls-iconbtn, .ls-toolbar__group > .ls-btn { box-shadow: none; }

/* ---------- Sheet ---------- */
.ls-sheet { box-sizing: border-box; width: 100%; max-width: 420px; border-radius: var(--radius-sheet); padding: var(--space-2) var(--space-5) var(--space-5); }
.ls-sheet__grabber { width: 36px; height: 5px; margin: 0 auto var(--space-2); border-radius: var(--radius-capsule); background: var(--label-tertiary); }
.ls-sheet__header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.ls-sheet__header > div:last-child { justify-self: end; }
.ls-sheet__title { margin: 0; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.43px; color: var(--label); text-align: center; }
.ls-sheet__body { font-size: 15px; line-height: 20px; letter-spacing: -0.23px; color: var(--label); }
/* No glass on glass: groups inside a sheet use fills, and secondary text uses the glass-secondary label. */
.ls-sheet .ls-list__group { background: var(--fill-tertiary); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.ls-sheet .ls-list__group::before, .ls-sheet .ls-glass .ls-glass::before { display: none; }
.ls-sheet .ls-list__header, .ls-sheet .ls-list__footer, .ls-sheet .ls-row__subtitle, .ls-sheet .ls-row__trailing { color: var(--label-glass-secondary); }

/* ---------- List (inset grouped) ---------- */
.ls-list { display: flex; flex-direction: column; width: 100%; max-width: 480px; }
.ls-list__header { padding: 0 var(--space-4) 6px; font-size: 13px; line-height: 18px; letter-spacing: -0.08px; color: var(--label-secondary); }
.ls-list__footer { padding: 6px var(--space-4) 0; font-size: 13px; line-height: 18px; letter-spacing: -0.08px; color: var(--label-secondary); }
.ls-list__group { border-radius: var(--radius-lg); overflow: hidden; }
.ls-row-wrap { position: relative; }
.ls-row-wrap + .ls-row-wrap::before { content: ""; position: absolute; top: 0; right: 0; left: var(--space-4); height: 1px; transform: scaleY(.5); transform-origin: top; background: var(--separator); }
.ls-row-wrap.has-leading + .ls-row-wrap.has-leading::before { left: 56px; }
.ls-row { appearance: none; border: 0; margin: 0; width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: var(--space-3); min-height: var(--size-control-lg);
  padding: 11px var(--space-4); background: transparent; text-align: left; font-family: var(--font-sans); color: var(--label); }
.ls-row.is-action { cursor: pointer; transition: background-color var(--duration-instant) var(--ease-standard); }
.ls-row.is-action:hover { background: var(--fill-quaternary); }
.ls-row.is-action:active { background: var(--fill-tertiary); }
.ls-row__leading { flex: none; display: grid; place-items: center; width: 28px; height: 28px; color: var(--label); }
.ls-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ls-row__title { font-size: 17px; line-height: 22px; letter-spacing: -0.43px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-row__subtitle { font-size: 15px; line-height: 20px; letter-spacing: -0.23px; color: var(--label-glass-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-row__trailing { flex: none; font-size: 17px; line-height: 22px; letter-spacing: -0.43px; color: var(--label-glass-secondary); display: inline-flex; align-items: center; gap: var(--space-2); }
.ls-row__chevron { color: var(--gray); }
.ls-row__check { color: var(--label); }

/* ---------- Badge ---------- */
.ls-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 var(--space-2); box-sizing: border-box; border-radius: var(--radius-capsule);
  font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--fill-tertiary); color: var(--label-secondary); }
.ls-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-capsule); background: currentColor; flex: none; }
.ls-badge--strong { background: var(--ink); color: var(--on-ink); }
.ls-badge--green { color: var(--green-text); }
.ls-badge--green .ls-badge__dot { background: var(--green); }
.ls-badge--red { color: var(--red-text); }
.ls-badge--red .ls-badge__dot { background: var(--red); }

/* ---------- ActivityIndicator: Apple's eight-spoke spinner, turned in steps ---------- */
.ls-activity { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--label-secondary); font-size: 15px; line-height: 20px; letter-spacing: -0.23px; }
.ls-spinner { display: block; animation: ls-spin 960ms steps(8, end) infinite; }
@keyframes ls-spin { to { transform: rotate(360deg); } }

/* ---------- AgentOrb: a clear glass bead with an ink drop inside ---------- */
.ls-orb-wrap { display: inline-flex; align-items: center; gap: var(--space-3); vertical-align: middle; }
.ls-orb { --ls-core: var(--ink); position: relative; display: inline-block; flex: none; width: var(--ls-orb-size, 48px); height: var(--ls-orb-size, 48px); }
.ls-orb__body, .ls-orb__halo, .ls-orb__ring { position: absolute; inset: 0; border-radius: var(--radius-capsule); }
.ls-orb__body { overflow: hidden; isolation: isolate; background: var(--glass-clear);
  -webkit-backdrop-filter: blur(var(--blur-thin)) saturate(var(--saturate-glass));
  backdrop-filter: var(--ls-lens, ) blur(var(--blur-thin)) saturate(var(--saturate-glass));
  box-shadow: inset 0 1px 1px var(--glass-rim), inset 0 -3px 8px var(--glass-edge), inset 0 0 0 0.5px var(--glass-edge), 0 4px 14px var(--glass-edge); }
/* Specular highlight (upper left) and caustic (lower edge). */
.ls-orb__body::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 30% 24%, var(--glass-rim), transparent 34%), radial-gradient(circle at 50% 108%, var(--glass-rim), transparent 46%); }
.ls-orb__core { position: absolute; inset: 31%; border-radius: inherit; background: var(--ls-core); opacity: .9;
  box-shadow: 0 0 calc(var(--ls-orb-size, 48px) * .18) var(--ls-core);
  transition: background-color var(--duration-gentle) var(--ease-standard), transform var(--duration-gentle) var(--ease-standard), opacity var(--duration-gentle) var(--ease-standard); }
.ls-orb__sheen { position: absolute; inset: -20%; border-radius: inherit; opacity: 0; z-index: 1;
  background: conic-gradient(from 0deg, transparent 0deg, var(--glass-rim) 60deg, transparent 140deg, transparent 360deg); }
.ls-orb__halo { background: var(--ls-core); opacity: 0; }
.ls-orb__ring { inset: -5px; border: 1.5px solid transparent; opacity: 0; }
.ls-orb__label { display: flex; flex-direction: column; font-family: var(--font-rounded); font-size: 15px; line-height: 20px; font-weight: 600; color: var(--label); }
.ls-orb__name { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 400; color: var(--label-secondary); }

.ls-orb[data-state="idle"] .ls-orb__core { animation: ls-breathe var(--duration-breathe) var(--ease-breathe) infinite; }
.ls-orb[data-state="listening"] .ls-orb__ring { opacity: 1; border-color: var(--ink); animation: ls-ripple var(--duration-pulse) var(--ease-enter) infinite; }
.ls-orb[data-state="listening"] .ls-orb__halo { animation: ls-ripple var(--duration-pulse) var(--ease-enter) infinite; animation-delay: calc(var(--duration-pulse) / -2); }
.ls-orb[data-state="listening"] .ls-orb__core { transform: scale(.8); }
.ls-orb[data-state="thinking"] .ls-orb__sheen { opacity: 1; animation: ls-orbit var(--duration-think) linear infinite; }
.ls-orb[data-state="thinking"] .ls-orb__core { animation: ls-breathe calc(var(--duration-breathe) / 2) var(--ease-breathe) infinite; }
.ls-orb[data-state="working"] .ls-orb__ring { opacity: 1; border-width: 2px; border-top-color: var(--ink); border-right-color: var(--ink); animation: ls-orbit calc(var(--duration-think) / 2) linear infinite; }
.ls-orb[data-state="waiting"] .ls-orb__core { animation: ls-wait var(--duration-pulse) var(--ease-breathe) infinite alternate; }
.ls-orb[data-state="waiting"] .ls-orb__halo { animation: ls-glow var(--duration-pulse) var(--ease-breathe) infinite alternate; }
.ls-orb[data-state="error"] { --ls-core: var(--red); }
.ls-orb[data-state="error"] .ls-orb__body { animation: ls-shake var(--duration-gentle) var(--ease-standard) 1; }
.ls-orb[data-state="disconnected"] .ls-orb__core { background: transparent; box-shadow: inset 0 0 0 1.5px var(--gray); opacity: 1; }
.ls-orb[data-state="disconnected"] .ls-orb__body { opacity: .7; }
.ls-orb[data-state="disconnected"] .ls-orb__ring { opacity: 1; inset: -4px; border: 1.5px dashed var(--gray); }

@keyframes ls-breathe { 0%, 100% { transform: scale(.86); } 50% { transform: scale(1); } }
@keyframes ls-ripple { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes ls-orbit { to { transform: rotate(360deg); } }
@keyframes ls-wait { from { transform: scale(.7); opacity: .55; } to { transform: scale(1.05); opacity: .95; } }
@keyframes ls-glow { from { transform: scale(1.05); opacity: 0; } to { transform: scale(1.3); opacity: .14; } }
@keyframes ls-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); } }

/* ---------- Message ---------- */
.ls-msg { display: flex; flex-direction: column; gap: var(--space-1); width: 100%; max-width: 680px; animation: ls-arrive var(--duration-gentle) var(--ease-enter) both; }
@keyframes ls-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ls-msg__meta { font-size: 12px; line-height: 16px; color: var(--label-secondary); }
.ls-msg__author { font-weight: 600; }
.ls-msg--assistant { flex-direction: row; gap: var(--space-3); align-items: flex-start; }
.ls-msg__avatar { flex: none; padding-top: 2px; }
.ls-msg__content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.ls-msg__text { font-family: var(--font-serif); font-size: 17px; line-height: 27px; color: var(--label); max-width: 68ch; }
.ls-msg__text p { margin: 0 0 var(--space-3); }
.ls-msg__text p:last-child { margin-bottom: 0; }
.ls-msg__text code { font-family: var(--font-mono); font-size: 14px; padding: 1px 5px; border-radius: var(--radius-xs); background: var(--fill-tertiary); }
.ls-msg__text a { color: var(--label); text-decoration: underline; text-decoration-color: var(--label-tertiary); text-underline-offset: 3px; }
.ls-msg--user { align-items: flex-end; }
.ls-msg__bubble { max-width: 80%; padding: 10px var(--space-4); border-radius: var(--radius-lg); color: var(--label);
  font-size: 17px; line-height: 22px; letter-spacing: -0.43px; }
.ls-msg--tool { padding-left: 40px; box-sizing: border-box; }
.ls-msg__card { border-radius: var(--radius-md); overflow: hidden; }
.ls-msg__toolhead { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); color: var(--label-glass-secondary); font-size: 13px; line-height: 18px; }
.ls-msg__toolname { flex: 1; min-width: 0; font-family: var(--font-mono); color: var(--label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-msg__output { margin: 0; padding: var(--space-3); border-top: 1px solid var(--separator); font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--label); white-space: pre-wrap; overflow-x: auto; }

/* ---------- AreaChart ---------- */
.ls-chart { margin: 0; width: 100%; font-family: var(--font-sans); color: var(--label); }
.ls-chart__head { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-3); }
.ls-chart__title { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.43px; }
.ls-chart__total { font-size: 48px; line-height: 52px; font-weight: 600; letter-spacing: -0.02em; }
.ls-chart__plot { position: relative; width: 100%; }
.ls-chart__svg { display: block; overflow: visible; outline: none; border-radius: var(--radius-xs); touch-action: pan-y; }
.ls-chart__svg:focus-visible { box-shadow: var(--focus-ring); }
.ls-chart__grid { stroke: var(--separator); stroke-width: 1; shape-rendering: crispEdges; }
.ls-chart__tick { font-size: 12px; fill: var(--label-secondary); font-variant-numeric: tabular-nums; }
.ls-chart__direct { font-size: 12px; fill: var(--label-secondary); }
.ls-chart__band { transition: opacity var(--duration-quick) var(--ease-standard); }
.ls-chart__band.is-dim { opacity: .82; }
.ls-chart__gap { fill: none; stroke: var(--bg); stroke-width: 2; stroke-linejoin: round; }
.ls-chart__cross { stroke: var(--label-tertiary); stroke-width: 1; }
.ls-chart__dot { stroke: var(--bg); stroke-width: 2; }
.ls-chart__tip { position: absolute; z-index: 2; width: 220px; box-sizing: border-box; padding: var(--space-3); border-radius: var(--radius-lg); pointer-events: none; }
.ls-chart__tiphead { display: flex; justify-content: space-between; gap: var(--space-2); margin-bottom: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--label); }
.ls-chart__tiphead span { font-variant-numeric: tabular-nums; }
.ls-chart__tiprow { display: grid; grid-template-columns: 12px auto 1fr; align-items: center; gap: 6px; font-size: 13px; line-height: 20px; }
.ls-chart__tiprow strong { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--label); }
.ls-chart__tipname { color: var(--label-glass-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-chart__key { width: 12px; height: 2px; border-radius: 1px; }
.ls-chart__legend { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px var(--space-4); font-size: 13px; line-height: 18px; color: var(--label-secondary); }
.ls-chart__legend li { display: inline-flex; align-items: center; gap: 6px; }
.ls-chart__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ls-chart__foot { margin-top: var(--space-2); margin-left: calc(var(--space-2) * -1); }
.ls-chart__tablewrap { margin-top: var(--space-2); overflow-x: auto; border-radius: var(--radius-md); }
.ls-chart__table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.ls-chart__table caption { text-align: left; padding: var(--space-2) var(--space-3); color: var(--label-glass-secondary); }
.ls-chart__table th, .ls-chart__table td { padding: 6px var(--space-3); text-align: right; border-top: 1px solid var(--separator); white-space: nowrap; }
.ls-chart__table th:first-child { text-align: left; }
.ls-chart__table thead th { font-weight: 600; color: var(--label-glass-secondary); }

/* ---------- Builder (wireframe canvas) ---------- */
.abm { --abm-glass-rgb: 255 255 255; position: relative; width: 100%; height: 100%; min-height: 560px; overflow: hidden; isolation: isolate; background: var(--bg); color: var(--label); font-family: var(--font-sans); user-select: none; -webkit-user-select: none; }
[data-theme="dark"] .abm, .abm[data-theme="dark"] { --abm-glass-rgb: 42 42 44; }
.abm input, .abm textarea, .abm select { user-select: text; -webkit-user-select: text; }
.abm-canvas { position: absolute; inset: 0; overflow: hidden; cursor: default; touch-action: none; }
.abm-canvas.is-connect { cursor: crosshair; }
.abm-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.abm-links { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.abm-link { pointer-events: auto; cursor: pointer; }
.abm-link__hit { fill: none; stroke: transparent; stroke-width: 18; }
.abm-link__line { fill: none; stroke: var(--label); stroke-width: 2; opacity: .55; }
.abm-link__line.is-draft { opacity: .9; stroke-dasharray: 6 6; }
.abm-link__flow { fill: none; stroke: var(--label); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1 26; opacity: .95; animation: abm-flow 1.2s linear infinite; }
.abm-link.is-selected .abm-link__line { opacity: 1; stroke-width: 3; }
.abm-arrowhead { fill: var(--label); opacity: .8; }
@keyframes abm-flow { to { stroke-dashoffset: -27; } }
.abm-pagewrap { position: absolute; }
.abm-pagehead { position: absolute; left: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; color: var(--label); cursor: grab; text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.abm-pagehead__route { font-weight: 400; color: var(--label-secondary); font-family: var(--font-mono); font-size: .85em; }
.abm-page { position: absolute; inset: 0; border-radius: 44px; overflow: hidden; background: rgb(var(--abm-glass-rgb) / .14); --ls-blur: 1px; box-shadow: var(--shadow-glass-rim), 0 0 0 calc(1px / var(--abm-z, 1)) var(--label-tertiary), var(--shadow-glass) !important; }
.abm-page--popup { border-radius: var(--radius-xl); background: var(--glass-regular); --ls-blur: var(--blur-thick); }
.abm-page.is-selected { box-shadow: var(--shadow-glass-rim), 0 0 0 calc(2px / var(--abm-z, 1)) var(--label), var(--shadow-glass) !important; }
.abm-node { position: absolute; box-sizing: border-box; cursor: move; }
.abm-node.is-locked { cursor: default; }
.abm-node__content { width: 100%; height: 100%; pointer-events: none; display: flex; align-items: center; }
.abm-node__content > * { flex: 1 1 auto; min-width: 0; }
.abm-node .ls-glass { background: rgb(var(--abm-glass-rgb) / var(--abm-veil, .7)); --ls-blur: var(--abm-blur, 6px); }
.abm-node .ls-glass--ink { background: var(--glass-ink); }
.abm-node .ls-glass--clear { background: rgb(var(--abm-glass-rgb) / calc(var(--abm-veil, .7) * .3)); }
.abm-node__badge { position: absolute; right: -6px; top: -6px; width: 16px; height: 16px; border-radius: var(--radius-capsule); display: grid; place-items: center; background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 2px var(--bg); }
.abm-heading { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--label); text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.abm-text { margin: 0; font-size: 17px; line-height: 22px; letter-spacing: -0.43px; color: var(--label); text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.abm-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; height: 100%; box-sizing: border-box; border-radius: var(--abm-radius, var(--radius-lg)); font-size: 15px; line-height: 20px; align-self: stretch; }
.abm-card strong { font-size: 17px; line-height: 22px; }
.abm-card .ls-btn { margin-top: auto; }
.abm-card .ls-field { min-width: 0; }
.abm-media { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: var(--abm-radius, var(--radius-lg)); align-self: stretch; }
.abm-menuitem { width: 100%; height: 100%; justify-content: flex-start; gap: 12px; color: var(--label); font-weight: 500; }
.abm-fill { width: 100%; min-width: 0 !important; max-width: none; }
.abm-fillh { height: 100%; align-self: stretch; }
.abm-toolbar { padding: 0; }
.abm-node .ls-btn, .abm-node .ls-iconbtn { border-radius: var(--abm-radius, var(--radius-capsule)); }
.abm-halo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--label); }
.abm-overlay { position: absolute; inset: 0; pointer-events: none; }
.abm-overlay > * { pointer-events: auto; }
.abm-selbox { position: absolute; box-sizing: border-box; pointer-events: none !important; box-shadow: 0 0 0 1px var(--label); }
.abm-handle { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: var(--radius-capsule); background: var(--glass-regular); box-shadow: var(--shadow-glass-rim), 0 0 0 1.5px var(--label), var(--shadow-knob); -webkit-backdrop-filter: blur(var(--blur-regular)); backdrop-filter: blur(var(--blur-regular)); }
.abm-connector { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: var(--radius-capsule); display: grid; place-items: center; background: var(--glass-ink); color: var(--on-ink); cursor: crosshair; box-shadow: var(--shadow-glass-rim), var(--shadow-glass); transform: rotate(90deg); }
.abm-connector:hover { transform: rotate(90deg) scale(1.12); }
.abm-minibar { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 14px; white-space: nowrap; }
.abm-minibar__label { font-size: 12px; font-weight: 600; color: var(--label-glass-secondary); }
.abm-minibar .is-on { background: var(--fill-secondary); }
.abm-range { width: 110px; accent-color: var(--ink); }
.abm-rail { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 6; }
.abm-rail__inner { display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.abm-panel, .abm-inspector { position: absolute; z-index: 5; top: 76px; bottom: 12px; display: flex; flex-direction: column; border-radius: var(--radius-xl); overflow: hidden; }
.abm-panel { left: 72px; width: 268px; animation: abm-in var(--duration-gentle) var(--ease-glass) both; }
.abm-inspector { right: 12px; width: 296px; }
@keyframes abm-in { from { opacity: 0; transform: translateX(-12px) scale(.98); } to { opacity: 1; transform: none; } }
.abm-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 8px 18px; font-size: 15px; }
.abm-panel__body { flex: 1; overflow: auto; padding: 0 12px 16px; }
.abm-libgroup { margin: 14px 6px 6px; font-size: 12px; font-weight: 600; color: var(--label-glass-secondary); }
.abm-libgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.abm-libitem { appearance: none; border: 0; margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: var(--radius-md); background: var(--fill-tertiary); color: var(--label); font: inherit; font-size: 13px; line-height: 16px; text-align: left; cursor: grab; touch-action: none; }
.abm-libitem:hover { background: var(--fill-secondary); }
.abm-libitem:active { cursor: grabbing; }
.abm-libitem__icon { width: 28px; height: 28px; border-radius: var(--radius-capsule); display: grid; place-items: center; background: var(--glass-regular); box-shadow: var(--shadow-glass-rim); }
.abm-libitem__thumb { width: 22px; height: 36px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--label); }
.abm-libitem__thumb--tablet { width: 30px; height: 38px; }
.abm-libitem__thumb--desktop { width: 44px; height: 28px; }
.abm-libitem__thumb--popup { width: 30px; height: 30px; border-radius: 10px; }
.abm-libitem__meta { font-size: 11px; color: var(--label-glass-secondary); font-variant-numeric: tabular-nums; }
.abm-hint { margin: 12px 6px 0; font-size: 12px; line-height: 16px; color: var(--label-glass-secondary); }
.abm-layers { display: flex; flex-direction: column; gap: 10px; }
.abm-layer { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); }
.abm-layer.is-selected, .abm-layer--page.is-selected { background: var(--fill-secondary); }
.abm-layer.is-hidden .abm-layer__name { opacity: .45; }
.abm-layer--page, .abm-layer__main { appearance: none; border: 0; background: transparent; color: var(--label); font: inherit; font-size: 13px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; flex: 1; min-width: 0; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.abm-layer--page { font-weight: 600; width: 100%; }
.abm-layer__main { padding-left: 22px; }
.abm-layer__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abm-layer__meta { font-size: 11px; color: var(--label-glass-secondary); }
.abm-layer__btn { appearance: none; border: 0; background: transparent; color: var(--label); width: 26px; height: 26px; border-radius: var(--radius-capsule); display: grid; place-items: center; cursor: pointer; }
.abm-layer__btn:hover { background: var(--fill-quaternary); }
.abm-dim { opacity: .35; }
.abm-layerbar { display: flex; gap: 4px; margin-top: 8px; }
.abm-section { padding: 10px 6px; border-top: 0.5px solid var(--separator); }
.abm-section:first-child { border-top: 0; }
.abm-section__title { margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--label-glass-secondary); }
.abm-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 13px; }
.abm-row__label { font-size: 12px; color: var(--label-glass-secondary); }
.abm-input { box-sizing: border-box; width: 100%; min-height: 32px; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: var(--fill-tertiary); color: var(--label); font: inherit; font-size: 13px; line-height: 18px; outline: none; }
.abm-input:focus { box-shadow: var(--focus-ring); }
.abm-input--num { font-variant-numeric: tabular-nums; }
.abm-input--code { font-family: var(--font-mono); font-size: 12px; }
select.abm-input { appearance: auto; }
.abm-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.abm-mini { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--label-glass-secondary); }
.abm-mini .abm-input { padding: 6px; }
.abm-action { padding: 10px; margin-bottom: 8px; border-radius: var(--radius-md); background: var(--fill-tertiary); }
.abm-action.is-selected { box-shadow: 0 0 0 1.5px var(--label); }
.abm-action__head { display: flex; gap: 4px; align-items: center; margin-bottom: 8px; }
.abm-topbar { position: absolute; z-index: 7; left: 12px; right: 12px; top: 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; pointer-events: none; }
.abm-topbar > * { pointer-events: auto; }
.abm-topbar__group { display: flex; align-items: center; gap: 8px; }
.abm-topbar__group:last-child { justify-self: end; }
.abm-topbar__title { display: flex; flex-direction: column; align-items: center; font-weight: 600; font-size: 15px; text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }
.abm-topbar__sub { font-weight: 400; font-size: 12px; color: var(--label-secondary); }
.abm-tools { min-width: 160px; }
.abm-flip svg { transform: scaleX(-1); }
.abm-zoom { appearance: none; border: 0; background: transparent; color: var(--label); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 46px; height: 36px; border-radius: var(--radius-capsule); cursor: pointer; }
.abm-zoom:hover { background: var(--fill-quaternary); }
.abm-exportwrap { position: relative; }
.abm-menu { position: absolute; right: 0; top: 46px; width: 300px; padding: 6px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 2px; animation: abm-pop var(--duration-base) var(--ease-glass) both; transform-origin: top right; }
@keyframes abm-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.abm-menu__item { appearance: none; border: 0; background: transparent; color: var(--label); text-align: left; font: inherit; padding: 10px 12px; border-radius: var(--radius-md); display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.abm-menu__item:hover { background: var(--fill-quaternary); }
.abm-menu__item strong { font-size: 14px; }
.abm-menu__item span { font-size: 12px; line-height: 16px; color: var(--label-glass-secondary); }
.abm-ghost { position: fixed; z-index: 50; transform: translate(-50%, -50%) scale(1.04); padding: 10px 16px; font-size: 13px; font-weight: 600; pointer-events: none; }
.abm-toast { position: absolute; z-index: 9; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 18px; font-size: 14px; animation: abm-pop var(--duration-base) var(--ease-glass) both; }
.abm-preview { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--scrim); -webkit-backdrop-filter: blur(var(--blur-thick)); backdrop-filter: blur(var(--blur-thick)); }
.abm-preview__bar { display: flex; align-items: center; justify-content: space-between; color: var(--label); }
.abm-preview__frame { flex: 1; width: 100%; border: 0; border-radius: var(--radius-xl); }
@media (max-width: 860px) { .abm-inspector { width: 240px; } .abm-panel { width: 220px; } .abm-tools { display: none; } }

/* ---------- Accessibility settings ---------- */
@media (prefers-reduced-motion: reduce) {
  .abm-link__flow { animation: none; }
  .ls-orb__core, .ls-orb__body, .ls-orb__halo, .ls-orb__ring, .ls-orb__sheen, .ls-msg { animation: none !important; }
  .ls-orb[data-state="thinking"] .ls-orb__sheen { transform: rotate(40deg); }
  .ls-orb[data-state="listening"] .ls-orb__ring { transform: scale(1.2); opacity: .5; }
  .ls-orb[data-state="waiting"] .ls-orb__halo { opacity: .12; transform: scale(1.25); }
  .ls-spinner { animation-duration: 1920ms; }
  .ls-glass, .ls-btn, .ls-iconbtn, .ls-seg__thumb, .ls-toggle__knob { transition-duration: 1ms !important; }
  .ls-glass--interactive:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .ls-glass { background: var(--bg-tertiary); -webkit-backdrop-filter: none; backdrop-filter: none !important; }
  .ls-glass--ink { background: var(--ink); }
  .ls-glass::before { display: none; }
  .ls-orb__body { background: var(--bg-tertiary); -webkit-backdrop-filter: none; backdrop-filter: none !important; }
  .ls-seg__thumb { background: var(--bg-tertiary); }
}
@media (prefers-contrast: more) {
  .ls-glass { background: var(--bg-tertiary); -webkit-backdrop-filter: none; backdrop-filter: none !important; box-shadow: 0 0 0 1px var(--label), var(--shadow-glass); }
  .ls-glass--ink { background: var(--ink); }
  .ls-seg__thumb { background: var(--bg-tertiary); box-shadow: 0 0 0 1px var(--label); }
  .ls-toggle::after { content: ""; position: absolute; top: 11px; left: 37px; width: 8px; height: 8px; border: 1.5px solid var(--label-secondary); border-radius: var(--radius-capsule); box-sizing: border-box; }
  .ls-toggle.is-on::after { left: 14px; width: 1.5px; height: 10px; border: 0; background: var(--on-ink); border-radius: 1px; }
  .ls-toggle--green.is-on::after { background: var(--knob); }
}

/* ---------- Component effects: glass tint, glow, motion ----------
   Set per block (Builder → Effects, stored as node.fx) or per component type by a design system
   (generated CSS scoped to [data-abm-type="…"]). Values arrive as custom properties only. */
@property --abm-fx-glow-a { syntax: '<number>'; inherits: true; initial-value: 0; }
[data-abm-fx] { --abm-fx-hue: 220; --abm-fx-tint: 0; --abm-fx-glow: 0px; --abm-fx-glow-a: 0; --abm-fx-dur: 4s; }
[data-abm-fx] .ls-glass, [data-abm-fx].ls-glass {
  background-image: linear-gradient(hsl(var(--abm-fx-hue) 90% 56% / var(--abm-fx-tint)), hsl(var(--abm-fx-hue) 90% 56% / var(--abm-fx-tint)));
  box-shadow: var(--shadow-glass-rim), 0 0 0 0.5px var(--glass-edge), 0 0 var(--abm-fx-glow) calc(var(--abm-fx-glow) / 6) hsl(var(--abm-fx-hue) 95% 62% / var(--abm-fx-glow-a)), var(--shadow-glass);
}
[data-abm-fx]:is([data-abm-type="heading"], [data-abm-type="text"]) .abm-node__content > *,
[data-abm-fx]:is([data-abm-type="heading"], [data-abm-type="text"]) > :is(h1, h2, h3, p) {
  text-shadow: 0 0 calc(var(--abm-fx-glow) / 2) hsl(var(--abm-fx-hue) 95% 62% / var(--abm-fx-glow-a));
}
[data-abm-anim] > * { animation-duration: var(--abm-fx-dur, 4s); animation-iteration-count: infinite; animation-timing-function: var(--ease-standard, ease-in-out); transform-origin: 50% 50%; }
[data-abm-anim="float"] > * { animation-name: abm-fx-float; }
[data-abm-anim="pulse"] > * { animation-name: abm-fx-pulse; }
[data-abm-anim="breathe"] > * { animation-name: abm-fx-breathe; }
[data-abm-anim="tilt"] > * { animation-name: abm-fx-tilt; }
[data-abm-anim="glow"] { animation: abm-fx-glow var(--abm-fx-dur, 4s) ease-in-out infinite; }
@keyframes abm-fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes abm-fx-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes abm-fx-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.82; } }
@keyframes abm-fx-tilt { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes abm-fx-glow { 0%, 100% { --abm-fx-glow-a: 0.15; } 50% { --abm-fx-glow-a: 0.9; } }
@media (prefers-reduced-motion: reduce) { [data-abm-anim], [data-abm-anim] > * { animation: none !important; } }

/* Focus mode: one component, large, on the particle field, with its effect controls. */
.abm-focus { position: absolute; inset: 0; z-index: 40; display: grid; grid-template-columns: 1fr minmax(280px, 340px); background: var(--scrim); -webkit-backdrop-filter: blur(var(--blur-regular)); backdrop-filter: blur(var(--blur-regular)); }
.abm-focus__stage { position: relative; display: grid; place-items: center; overflow: hidden; }
.abm-focus__node { position: relative; box-sizing: border-box; }
.abm-focus__panel { margin: 16px 16px 16px 0; border-radius: var(--radius-xl); display: flex; flex-direction: column; min-height: 0; color: var(--label); }
.abm-focus__panel .abm-panel__head { display: flex; align-items: center; justify-content: space-between; }
@media (max-width: 760px) { .abm-focus { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .abm-focus__panel { margin: 0 12px 12px; max-height: 55vh; } }
.abm-row--buttons { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.abm-range--hue { background: linear-gradient(90deg, hsl(0 80% 55%), hsl(60 80% 55%), hsl(120 80% 45%), hsl(180 80% 45%), hsl(240 80% 60%), hsl(300 80% 55%), hsl(360 80% 55%)); border-radius: 999px; height: 6px; }
.abm-history { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.abm-history li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--fill-quaternary); font-size: 13px; }
