@charset "UTF-8";
/* ============================================================
   Lottie Editor — application styles.
   Every value here resolves to a token from tokens/tokens.json
   (via css/tokens/_bridge.scss). Nothing in this file hardcodes
   a colour, a font or a radius; flipping `data-theme="board"` on
   <html> repaints the whole editor.
   ============================================================ */
/* ============================================================
   Token entry point.
   Order matters: fonts first (plain CSS @import must lead the
   output), then the generated token layers, then the bridge that
   maps them to the editor's names, then the base element
   defaults that consume them.
   ============================================================ */
/* ============================================================
   Webfonts — Ubuntu Sans + Ubuntu Sans Mono (Google Fonts).
   The variable cut carries the wdth axis (75–100%), which is
   what `--display-stretch` leans on for the condensed headline
   cut. tokens.json points `--font-sans` / `--font-mono` at the
   two variables defined below, so they must stay in sync.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Ubuntu+Sans:wdth,wght@75..100,100..800&family=Ubuntu+Sans+Mono:wght@400..700&display=swap");
:root {
  --font-ubuntu-sans: 'Ubuntu Sans', ui-sans-serif, system-ui, sans-serif;
  --font-ubuntu-sans-mono: 'Ubuntu Sans Mono', ui-monospace, 'SFMono-Regular', monospace;
}

/* Generated from tokens/tokens.json by tokens/build.mjs. Edit the JSON, then run `bun run tokens`. */
/* Primitive */
:root {
  --color-olive-50: #fdfef6;
  --color-olive-100: #f8fddf;
  --color-olive-200: #f1fcc2;
  --color-olive-300: #e1f7a2;
  --color-olive-400: #cdd0c3; /* The dot-matrix 22% ink line, flattened onto olive-50 so SVG fills stay opaque. */
  --color-olive-500: #c9d8a4;
  --color-olive-700: #44511f;
  --color-olive-750: #3e4b1c;
  --color-olive-800: #2b3712;
  --color-olive-900: #222b0d;
  --color-olive-950: #1a2108;
  --color-lime-400: #bce261;
  --color-lime-700: #486c14;
  --color-bayside-300: #74d6fd;
  --color-bayside-500: #1ba0f9;
  --color-white: #ffffff;
  --font-sans: var(--font-ubuntu-sans);
  --font-mono: var(--font-ubuntu-sans-mono);
  --weight-medium: 500;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --text-sm: 0.875rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --text-7xl: 4.5rem;
  --text-8xl: 6rem;
  --leading-tightest: 0.9;
  --leading-tighter: 0.95;
  --leading-none: 1;
  --leading-snug: 1.15;
  --leading-body: 1.5;
  --leading-relaxed: 1.625;
  --leading-prose: 1.7;
  --leading-sm: calc(1.25 / 0.875);
  --leading-lg: calc(1.75 / 1.125);
  --leading-xl: 1.4;
  --leading-2xl: calc(2 / 1.5);
  --leading-3xl: 1.2;
  --tracking-tightest: -0.03em;
  --tracking-tighter: -0.025em;
  --tracking-tight: -0.02em;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-15: 3.75rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;
  --space-32: 8rem;
  --space-40: 10rem;
  --space-1-5: 0.375rem;
  --radius-pill: 999px;
  --radius-tile: 1.75rem;
  --radius-code: 0.4em;
  --container: 1400px;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-800: 800ms;
  --duration-900: 900ms;
  --duration-stagger: 120ms; /* Delay between items in an entrance, multiplied by --i. */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-tick: cubic-bezier(0.3, 2.2, 0.5, 1); /* Overshoot of the clock's second hand. */
  --z-nav: 40;
  --z-grain: 50;
}

/* Semantic */
:root {
  --bg: var(--color-olive-50);
  --raised: var(--color-olive-100);
  --ink: var(--color-olive-900);
  --muted: var(--color-olive-700);
  --line: var(--color-olive-400);
  --accent: var(--color-lime-400); /* The fill. Use accent-ink for text. */
  --accent-ink: var(--color-lime-700); /* Text-safe accent: AA on bg and raised. */
  --on-accent: var(--color-olive-900);
  --gutter: var(--space-4);
  --gutter-md: var(--space-8);
  --section-y: var(--space-24);
  --section-y-md: var(--space-32);
  --focus-width: 2px;
  --focus-offset: 3px;
  --display-stretch: 78%;
  --display-weight: var(--weight-extrabold);
  --display-tracking: var(--tracking-tightest);
  --display-leading: 1.02;
  --display-hero: clamp(2.75rem, 6.9vw, 6rem);
  --display-article: clamp(2.75rem, 7.5vw, 6.5rem);
  --display-contact: clamp(3.25rem, 9vw, 8.5rem);
  --display-footer: clamp(2.5rem, 13.6vw, 12.25rem);
}

/* Component */
:root {
  --btn-height: var(--space-12);
  --btn-height-sm: var(--space-10);
  --btn-height-lg: var(--space-16);
  --btn-padding: var(--space-6);
  --btn-padding-sm: var(--space-5);
  --btn-padding-lg: var(--space-9);
  --btn-accent-bg: var(--accent);
  --btn-accent-fg: var(--on-accent);
  --btn-ghost-border: var(--line);
  --btn-ghost-hover-bg: var(--raised);
  --btn-contact-bg: var(--on-accent);
  --btn-contact-fg: var(--accent);
  --nav-height: var(--space-14);
  --nav-blur: 12px;
  --nav-bg: color-mix(in oklab, var(--bg) 80%, transparent);
  --ws-glow: var(--color-olive-200); /* Stars, moon and lit windows. */
  --ws-cloud: var(--color-white); /* Clouds and the glare on the glass. */
  --ws-noon-top: var(--color-bayside-500); /* Sky before the script has run. */
  --ws-noon-horizon: var(--color-bayside-300);
  --ws-far: var(--color-olive-800); /* Mixed with the sky for the far buildings. */
  --ws-near: var(--color-olive-950); /* Mixed with the sky for the near buildings. */
  --astro-code-foreground: var(--ink);
  --astro-code-background: var(--raised);
  --astro-code-token-constant: var(--accent-ink);
  --astro-code-token-string: var(--accent-ink);
  --astro-code-token-string-expression: var(--accent-ink);
  --astro-code-token-keyword: var(--accent-ink);
  --astro-code-token-link: var(--accent-ink);
  --astro-code-token-parameter: var(--ink);
  --astro-code-token-function: var(--ink);
  --astro-code-token-comment: var(--muted);
  --astro-code-token-punctuation: var(--muted);
}

/* Semantic, dark theme */
[data-theme=board] {
  --bg: var(--color-olive-950);
  --raised: var(--color-olive-900);
  --ink: var(--color-olive-300);
  --muted: var(--color-olive-500);
  --line: var(--color-olive-750);
  --accent-ink: var(--color-lime-400);
}

/* ============================================================
   Bridge — the editor's own names, resolved onto the generated
   Pendekar Kerayon tokens.

   `_generated.scss` is the source of truth and is regenerated
   from tokens/tokens.json. This file is the only place that
   translates it into the surface / text / border / motion names
   app.scss uses, and the only place allowed to invent a value
   the token set does not ship (control heights, the dot-grid
   texture, the three sub-`sm` type steps).

   Everything theme-dependent is mixed from the *semantic*
   tokens (--bg, --raised, --ink, --muted, --line, --accent),
   never from a primitive step, so `[data-theme="board"]` —
   which overrides only the semantic layer — repaints the whole
   editor without a second set of rules here.
   ============================================================ */
:root {
  /* ---- Surfaces --------------------------------------------- */
  --surface-page: var(--bg);
  --surface-card: var(--raised);
  --surface-raised: var(--raised);
  --surface-sunken: color-mix(in oklab, var(--raised) 88%, var(--ink));
  --surface-inverse: var(--ink);
  --surface-brand: var(--accent);
  /* ---- Text ------------------------------------------------- */
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: color-mix(in oklab, var(--muted) 72%, var(--bg));
  --text-inverse: var(--bg);
  --text-on-brand: var(--on-accent);
  --text-link: var(--accent-ink);
  /* ---- Borders ---------------------------------------------- */
  --border-subtle: color-mix(in oklab, var(--line) 55%, var(--raised));
  --border-default: var(--line);
  --border-strong: var(--muted);
  --border-inverse: var(--muted);
  /* ---- Brand ------------------------------------------------ */
  /* --brand-hover is a fill, so it stays in the lime; use
     --brand-ink / --accent-ink wherever the accent is text. */
  --brand: var(--accent);
  --brand-hover: color-mix(in oklab, var(--accent) 78%, var(--accent-ink));
  --brand-press: var(--accent-ink);
  --brand-subtle: color-mix(in oklab, var(--accent) 24%, var(--bg));
  --brand-ink: var(--accent-ink);
  /* ---- Status ----------------------------------------------- */
  /* The token set ships one accent and one neutral family, so
     the editor's only status colour — delete — is the accent at
     full strength rather than a red it has no token for. */
  --danger: var(--accent-ink);
  /* ---- Type: the steps below `sm`, which the scale omits ---- */
  --text-2xs: 0.6875rem; /* 11px */
  --text-xs: 0.75rem; /* 12px */
  --text-md: 1rem; /* 16px — base */
  --font-body: var(--font-sans);
  --font-heading: var(--font-sans);
  --font-display: var(--font-sans);
  --font-label: var(--font-mono);
  --font-numeric: var(--font-mono);
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-heading: var(--display-weight);
  --leading-tight: var(--leading-snug);
  --leading-normal: var(--leading-body);
  --tracking-normal: 0;
  --tracking-display: var(--display-tracking);
  --tracking-wider: 0.08em; /* uppercase mono labels need the air */
  /* ---- Control sizing --------------------------------------- */
  --grid: 4px;
  --control-sm: var(--space-8);
  --control-md: var(--btn-height-sm);
  --control-lg: var(--btn-height);
  /* ---- Radii ------------------------------------------------ */
  /* The token set is explicit: interactive elements are pills,
     tiles and media are --radius-tile (28px). The scale below
     fills the gap for inputs and small chrome. */
  --radius-none: 0;
  --radius-xs: 0.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: var(--radius-tile);
  --radius-dot: 50%;
  /* ---- Borders ---------------------------------------------- */
  --border-hair: 1px;
  --border-thick: 2px;
  --border-heavy: 3px;
  /* ---- Elevation -------------------------------------------- */
  /* Flat surfaces with crisp lines; only the two floating
     elements (menu, toast) cast anything. */
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 6px 18px color-mix(in oklab, var(--ink) 16%, transparent);
  --shadow-lg: 0 14px 36px color-mix(in oklab, var(--ink) 20%, transparent);
  /* ---- Phosphor glow — the accent blooming ------------------ */
  --glow-sm: 0 0 8px color-mix(in oklab, var(--accent) 55%, transparent);
  --glow-md: 0 0 20px color-mix(in oklab, var(--accent) 60%, transparent);
  --glow-lg: 0 0 32px color-mix(in oklab, var(--accent) 65%, transparent);
  /* ---- Motion ----------------------------------------------- */
  --ease-flip: var(--ease-std);
  --ease-out: var(--ease-expo);
  --ease-in-out: var(--ease-std);
  --ease-overshoot: var(--ease-tick);
  --dur-instant: 100ms;
  --dur-fast: var(--duration-150);
  --dur-base: var(--duration-300);
  --dur-slow: var(--duration-500);
  /* ---- Repeating dot-grid texture --------------------------- */
  --dot-grid-ink: var(--line);
  --dot-grid: radial-gradient(
      circle at center,
      var(--dot-grid-ink) 1.5px,
      transparent 1.6px
    );
  --dot-grid-size: 14px 14px;
}

/* ============================================================
   Base element defaults
   Light, opt-in resets + typographic defaults wired to the
   tokens. Scoped to not be too aggressive on host pages.
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The headline cut: Ubuntu Sans squeezed to --display-stretch on
   its width axis, extra-bold, set tight. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: var(--display-weight);
  line-height: var(--display-leading);
  letter-spacing: var(--display-tracking);
  margin: 0;
  color: var(--text-primary);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Eyebrow / kicker label — mono, uppercase, wide. */
.dm-kicker {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* A real outline, not a box-shadow: outline-offset paints the gap in
   whatever is actually behind the control, and it never collides with a
   component's own shadow. */
:focus-visible {
  outline: var(--focus-width) solid var(--accent-ink);
  outline-offset: var(--focus-offset);
}

:root {
  /* App-level sizing, derived from the token scales. */
  --rail-left: 17.5rem; /* layers panel  — 280px */
  --rail-right: 19rem; /* inspector     — 304px */
  --topbar-h: 4rem; /* 64px — 16 dot-cells */
  --row-h: 2.125rem; /* compact control height for inspector rows */
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

svg.ico,
svg.ico-fill {
  width: 17px;
  height: 17px;
  flex: none;
}

svg.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.ico-fill {
  fill: currentColor;
}

/* ---------- top bar ---------- */
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  border-bottom: var(--border-hair) solid var(--border-subtle);
  background: var(--surface-card);
}

.brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-display);
  margin: 0;
}

.topbar-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-md);
  padding: 0 var(--btn-padding-sm);
  border: var(--border-hair) solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-flip), border-color var(--dur-fast) var(--ease-flip), box-shadow var(--dur-fast) var(--ease-flip), opacity var(--dur-fast) var(--ease-flip);
}

.btn:hover:not(:disabled) {
  background: var(--surface-sunken);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text-on-brand);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  box-shadow: var(--glow-sm);
}

.btn-primary:active:not(:disabled) {
  background: var(--brand-press);
  border-color: var(--brand-press);
}

/* icon-only chrome button — theme switch lives here */
.btn-icon {
  width: var(--control-md);
  padding: 0;
  justify-content: center;
}

/* ---------- shell ---------- */
.shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rail-left) 1fr var(--rail-right);
}

.shell.is-empty {
  visibility: hidden;
}

.panel {
  overflow-y: auto;
  padding: var(--space-6) var(--space-5);
  background: var(--surface-card);
}

.panel-left {
  border-right: var(--border-hair) solid var(--border-subtle);
}

.panel-right {
  border-left: var(--border-hair) solid var(--border-subtle);
}

.panel-title,
.section-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-heading);
  letter-spacing: var(--tracking-display);
  margin: 0 0 var(--space-4);
}

/* ---------- layer list ---------- */
.layer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.layer-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.layer-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: var(--border-hair) solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast) var(--ease-flip), background var(--dur-fast) var(--ease-flip);
}

.layer-btn:hover {
  background: var(--surface-sunken);
}

.layer-btn.is-selected {
  border-color: var(--brand-hover);
  background: var(--brand-subtle);
  color: var(--brand-ink);
}

.layer-btn.is-hidden {
  opacity: 0.45;
}

.layer-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-badge {
  margin-left: auto;
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
  border: var(--border-hair) solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0 var(--space-1);
}

.icon-btn {
  flex: none;
  width: var(--space-8);
  height: var(--space-8);
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-flip), color var(--dur-fast) var(--ease-flip);
}

.icon-btn:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.icon-btn.danger:hover {
  color: var(--danger);
}

.empty-note {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ---------- stage ---------- */
.stage-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* The matrix backdrop — the artwork sits on the board. */
.stage-area {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: var(--space-8);
  background-color: var(--surface-page);
  background-image: var(--dot-grid);
  background-size: var(--dot-grid-size);
}

.stage {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1/1;
  width: min(560px, 100%);
  display: grid;
  place-items: center;
  border-radius: var(--radius-tile);
  box-shadow: var(--shadow-sm);
}

.stage svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.transport {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8) var(--space-6);
  justify-content: center;
  background: var(--surface-card);
  border-top: var(--border-hair) solid var(--border-subtle);
}

.tbtn {
  width: var(--control-sm);
  height: var(--control-sm);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-flip), color var(--dur-fast) var(--ease-flip);
}

.tbtn:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
}

.tbtn-toggle.is-on {
  color: var(--brand-ink);
}

.scrub {
  flex: 1;
  max-width: 740px;
  -webkit-appearance: none;
  appearance: none;
  height: var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--border-default);
  outline: none;
}

.scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--space-4);
  height: var(--space-4);
  border-radius: var(--radius-dot);
  background: var(--brand);
  border: var(--border-thick) solid var(--brand-press);
  cursor: pointer;
}

.scrub::-moz-range-thumb {
  width: var(--space-4);
  height: var(--space-4);
  border-radius: var(--radius-dot);
  background: var(--brand);
  border: var(--border-thick) solid var(--brand-press);
  cursor: pointer;
}

.scrub:active::-webkit-slider-thumb {
  box-shadow: var(--glow-sm);
}

.scrub:active::-moz-range-thumb {
  box-shadow: var(--glow-sm);
}

.frame-num {
  width: 4rem;
  height: var(--control-sm);
  text-align: center;
  border: var(--border-hair) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ---------- inspector ---------- */
.section + .section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: var(--border-hair) solid var(--border-subtle);
}

.section-sub {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  margin: var(--space-4) 0 var(--space-2);
}

.field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.field > label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex: none;
  min-width: 4.625rem;
}

.input {
  flex: 1;
  min-width: 0;
  height: var(--row-h);
  padding: 0 var(--space-2);
  border: var(--border-hair) solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--surface-card);
}

.input:focus {
  border-color: var(--brand-hover);
  outline: var(--focus-width) solid var(--accent-ink);
  outline-offset: var(--focus-offset);
}

.input:disabled {
  background: var(--surface-sunken);
  color: var(--text-muted);
}

.range {
  flex: 1;
  accent-color: var(--brand-hover);
}

.range-val {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  width: 3rem;
  text-align: right;
}

/* color rows */
.color-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.swatch {
  flex: none;
  width: var(--row-h);
  height: var(--row-h);
  padding: 0;
  border: var(--border-hair) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.swatch::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.swatch::-webkit-color-swatch {
  border: 0;
  border-radius: var(--radius-xs);
}

.swatch::-moz-color-swatch {
  border: 0;
  border-radius: var(--radius-xs);
}

.hex {
  width: 5.75rem;
  height: var(--row-h);
  padding: 0 var(--space-2);
  border: var(--border-hair) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
}

.hex:focus {
  border-color: var(--brand-hover);
  outline: var(--focus-width) solid var(--accent-ink);
  outline-offset: var(--focus-offset);
}

.color-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-normal);
  margin: var(--space-2) 0 0;
}

/* number groups + transform rows */
.num-group {
  display: flex;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.input.num {
  width: 100%;
  min-width: 0;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}

.animated-note {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

.btn-slim {
  height: var(--row-h);
  padding: 0 var(--space-4);
  font-size: var(--text-xs);
}

/* keyframe groups */
.kf-group {
  border: var(--border-hair) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-1);
  overflow: hidden;
}

.kf-group[open] {
  background: var(--surface-sunken);
}

.kf-group summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  list-style: none;
  color: var(--text-primary);
}

.kf-group summary::-webkit-details-marker {
  display: none;
}

.kf-group summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid var(--text-muted);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform var(--dur-fast) var(--ease-flip);
}

.kf-group[open] summary::before {
  transform: rotate(90deg);
}

.kf-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kf-count {
  flex: none;
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  color: var(--text-muted);
  background: var(--surface-page);
  border: var(--border-hair) solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0 var(--space-2);
}

.kf-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-6);
  border-top: var(--border-hair) solid var(--border-subtle);
}

.kf-row .input,
.kf-row .hex,
.kf-row .swatch {
  height: var(--control-sm);
}

.kf-row .num-group {
  flex: 1 1 76px;
}

/* both need to out-rank `.input.num { width: 100% }` */
.kf-row .kf-t {
  width: 3rem;
  flex: none;
  text-align: center;
  font-family: var(--font-mono);
}

.kf-row .kf-ease {
  width: 5.5rem;
  flex: none;
  padding: 0 var(--space-1);
  font-size: var(--text-2xs);
}

.kf-row .color-row {
  margin: 0;
  flex: 1;
}

.kf-row .hex {
  width: 4.75rem;
}

.kf-row .swatch {
  width: var(--control-sm);
}

/* download menu */
.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 13rem;
  background: var(--surface-raised);
  border: var(--border-hair) solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1);
  z-index: 30;
}

.menu[hidden] {
  display: none;
}

.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.menu button:hover {
  background: var(--surface-sunken);
}

.menu-ext {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.caret {
  width: 14px;
  height: 14px;
  margin-left: -2px;
  opacity: 0.75;
}

/* ---------- dropzone ---------- */
.dropzone {
  position: fixed;
  inset: var(--topbar-h) 0 0;
  display: grid;
  place-items: center;
  background-color: var(--surface-page);
  background-image: var(--dot-grid);
  background-size: var(--dot-grid-size);
  z-index: 20;
}

.dropzone[hidden] {
  display: none;
}

.dropzone.is-over .dropzone-inner {
  border-color: var(--brand-hover);
  background: var(--brand-subtle);
  box-shadow: var(--glow-md);
}

.dropzone-inner {
  width: min(520px, 86vw);
  padding: var(--space-12) var(--space-8);
  border: var(--border-thick) dashed var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  text-align: center;
  transition: background var(--dur-fast) var(--ease-flip), border-color var(--dur-fast) var(--ease-flip), box-shadow var(--dur-fast) var(--ease-flip);
}

.dropzone-inner h2 {
  font-size: var(--text-xl);
  margin: var(--space-3) 0 var(--space-2);
}

.dropzone-inner p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-5);
}

.dropzone-inner code {
  font-family: var(--font-mono);
  background: var(--surface-sunken);
  padding: 0 var(--space-1);
  border-radius: var(--radius-xs);
}

.drop-ico {
  width: var(--space-10);
  height: var(--space-10);
  stroke: var(--text-muted);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.samples {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.chip {
  border: var(--border-hair) solid var(--border-default);
  background: var(--surface-card);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-flip);
}

.chip:hover {
  background: var(--surface-sunken);
}

/* ---------- toast ---------- */
/* Phosphor readout — lime text on the dark board. */
.toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-inverse);
  color: var(--text-inverse);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 40;
}

.toast[hidden] {
  display: none;
}
