:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #24262b;          /* ink, no pure black */
  --card: #faf8f4;                /* the light table field */
  --card-foreground: #24262b;
  --muted: #f1eee8;               /* hover fills, inert swatch wells */
  --muted-foreground: #5c5f66;
  --disabled: #6b6e75;            /* a control that is off on a live surface */
  --mat: #ffffff;                 /* the slide mat */
  --primary: #c2547a;             /* brand rose: rules, focus, chip borders */
  --primary-solid: #ad4468;       /* same hue one step down so white labels clear 4.5 */
  --primary-solid-hover: #96395a;
  --primary-soft: #f8ebf0;
  --primary-ink: #8e3453;
  --primary-foreground: #ffffff;
  --border: #e7e2da;              /* the table hairline */
  --border-strong: #d8d2c8;
  --ring: var(--primary);
  --checker-a: #ffffff;           /* transparent background under the result */
  --checker-b: #ebe6de;
  --hairline: 1px;                /* every border and inset rule on this surface */
  --border-width: 1px;
  --phi-3: 3px; --phi-4: 4px; --phi-5: 5px; --phi-6: 6px; --phi-8: 8px; --phi-10: 10px;
  --phi-13: 13px; --phi-17: 17px; --phi-21: 21px; --phi-27: 27px; --phi-34: 34px; --phi-43: 43px;
  --phi-55: 55px; --phi-70: 70px; --phi-89: 89px; --phi-113: 113px; --phi-144: 144px;
  --phi-183: 183px; --phi-233: 233px; --phi-296: 296px; --phi-377: 377px;
  --radius: var(--phi-13);
  --radius-sm: var(--phi-8);
  --radius-xs: var(--phi-5);
  --radius-pill: 999px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-base: var(--phi-13);
  --text-lg: var(--phi-17);
  --text-sm: var(--phi-13);
  --text-count: var(--phi-13);
  --space-1: var(--phi-3); --space-2: var(--phi-8); --space-3: var(--phi-13); --space-4: var(--phi-13); --space-6: var(--phi-21);
  --page: var(--phi-21);          /* page margin and the table's own inset */
  --clearance: var(--phi-21);     /* slides to result */
  --strip-top: var(--phi-55);
  --strip-bottom: var(--phi-55);
  --rail-h: var(--phi-43);        /* the dial rail, the table's bottom edge */
  --control-h: var(--phi-34);
  --control-inset: var(--phi-3);
  --btn-h: var(--phi-43);
  --icon: var(--phi-21);
  --icon-glyph: var(--phi-13);
  --mark: var(--phi-21);
  --mark-radius: var(--phi-5);
  --slide-w-max: 132px;
  --slide-w-min: 56px;
  --slide-w-narrow: 66px;
  --slides-reserve: 432px;        /* strips, page margin, rail and caption rows above the slide column */
  /* four 16:9 slides with their mats and captions stack at 2.25 times one slide's width */
  --slide-w: clamp(var(--slide-w-min), calc((100vh - var(--slides-reserve)) / 2.25), var(--slide-w-max));
  --mat-pad: 6px;                 /* the white mat around a slide */
  --table-min: 200px;
  --checker-size: 10px;
  --rule: 2px;                    /* the rose rule around the result */
  --lift: -6px;                   /* how far a dragged slide rises off the table */
  --tilt: -1.5deg;                /* and how far it tips, never past 2 degrees */
  /* the output numbers, drawn: 1cqw of the result frame is 24 output px at long side 2400 */
  --out-margin: 1cqw;             /* Margin 24 */
  --out-gap: 0.5cqw;              /* Gap 12 */
  --out-corners: 0.3333cqw;       /* Corners 8 */
  --out-corners-lg: 0.5cqw;       /* Corners 12 */
  --out-caption: 1cqw;            /* the caption band, 24 output px per row */
  --out-caption-text: 0.7cqw;
  --pad-chip: var(--phi-8);
  --swatch: var(--phi-34);
  --switch-w: var(--phi-55);
  --switch-h: var(--phi-34);
  --switch-knob: var(--phi-21);
  --inert: .55;                   /* one readable step down for a surface with nothing to act on */
  --duration-fast: 120ms;         /* chip fills */
  --duration-assemble: 200ms;     /* re-assembly after a drag or a dial */
  --duration-max: 300ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --target-min: var(--phi-43);
  --target-compact: var(--phi-34);
  --shadow-slide: 0 5px 12px -6px rgb(36 38 43 / .30);
  --shadow-lift: 0 14px 28px -10px rgb(36 38 43 / .45);
  --shadow-raised: 0 1px 2px rgb(36 38 43 / .12);
  --shadow-pill: 0 2px 6px -2px rgb(36 38 43 / .20);
  --shadow-primary: 0 6px 18px -8px rgb(36 38 43 / .30);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #17181b; --foreground: #e8e5e0; --card: #202124; --card-foreground: #e8e5e0;
    --muted: #2a2c30; --muted-foreground: #a6a29b; --disabled: #9b978f; --mat: #34363a;
    --primary: #e08aa8; --primary-solid: #cb5f84; --primary-solid-hover: #d97a9a; --primary-soft: #33232a;
    --primary-ink: #f0bccd; --primary-foreground: #1b1114;
    --border: #35373c; --border-strong: #44474c;
    --checker-a: #2a2c30; --checker-b: #34363a;
    --shadow-slide: 0 5px 12px -6px rgb(0 0 0 / .65);
    --shadow-lift: 0 14px 28px -10px rgb(0 0 0 / .8);
    --shadow-raised: 0 1px 2px rgb(0 0 0 / .5);
    --shadow-pill: 0 2px 6px -2px rgb(0 0 0 / .6);
    --shadow-primary: 0 6px 18px -8px rgb(0 0 0 / .7);
  }
}
/* @pair --foreground on --background */
/* @pair --foreground on --card */
/* @pair --muted-foreground on --background */
/* @pair --muted-foreground on --card */
/* @pair --disabled on --card */
/* @pair --primary-foreground on --primary-solid */
/* @pair --primary-ink on --primary-soft */


/* One frame at a time (owner rule 10.09): every focusable control draws its ring ON the border,
   never outside it; nothing falls back to the browser ring. Product rules may override. */
:where(input, select, textarea, button, [tabindex]):focus-visible {
  outline: var(--outline-width, 2px) solid var(--ring, currentColor);
  outline-offset: calc(-1 * var(--border-width, 1px));
}

:where(input, select, textarea)[aria-invalid='true']:focus-visible {
  outline-color: var(--destructive, currentColor);
}
