/* Engram — shared interface system. Extend here before adding a page-specific primitive. */
@font-face { font-family: Inter; src: url('/vendor/InterVariable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  /* Core palette. New work uses only these: canvas, one surface, text, muted
     text, one accent (with its text), the control boundary and functional states. */
  --ds-paper: #111313;
  --ds-surface: #181b1a;
  --ds-ink: #ededed;
  --ds-muted: #a1aaa6;
  --ds-accent: #77d9ad;
  --ds-accent-ink: #10261b;
  --ds-input-border: #65716b;
  --ds-success: #83dcb0;
  --ds-warning: #edc686;
  --ds-danger: #f0aaa5;
  /* Interaction states: a soft tint and a slightly stronger edge, never an
     underline or a bright outline. Text links in prose keep their underline. */
  --ds-hover-bg: rgb(237 237 237 / .06);
  --ds-press-bg: rgb(237 237 237 / .1);
  --ds-selected-bg: rgb(237 237 237 / .08);
  --ds-hover-border: #85918b;
  --ds-accent-press: #6bc89e;
  --ds-danger-hover-bg: rgb(240 170 165 / .1);
  /* Deprecated compatibility tokens. They resolve to the core palette (or keep
     their value for email/static exports) and must not be used in new work. */
  --ds-surface-soft: var(--ds-surface);
  --ds-accent-hover: #8fe3bd;
  --ds-accent-muted: #1b3529;
  --ds-inverse: #ededed;
  --ds-inverse-ink: #111313;
  --ds-line: #2c3230;
  --ds-line-strong: #424b47;
  --ds-lime: #1b3529;
  --ds-lilac: #252d35;
  --ds-apricot: #332c24;
  --ds-info: var(--ds-muted);
  --ds-success-bg: var(--ds-surface);
  --ds-warning-bg: var(--ds-surface);
  --ds-danger-bg: var(--ds-surface);
  --ds-info-bg: var(--ds-surface);
  /* Data and identity illustrations (app only): contribution levels and fallback avatars. */
  --ds-chart-0: #202423;
  --ds-chart-1: #254333;
  --ds-chart-2: #34694d;
  --ds-chart-3: #4e9b73;
  --ds-chart-4: #77d9ad;
  --ds-avatar-1: #77d9ad;
  --ds-avatar-2: #9fc7e8;
  --ds-avatar-3: #dec39e;
  --ds-avatar-4: #c3b4df;
  --ds-avatar-5: #e3b5c9;
  --ds-avatar-face: #10261b;
  --ds-profile-avatar-sm: 56px;
  --ds-profile-avatar-md: 80px;
  --ds-profile-avatar-lg: 112px;
  --ds-font-sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ds-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ds-font-editorial: var(--ds-font-sans); /* Legacy alias; expressive text uses Inter. */
  --ds-text-xs: .75rem;
  --ds-text-sm: .8125rem;
  --ds-text-base: .875rem;
  --ds-text-lg: 1.0625rem;
  --ds-text-xl: 1.375rem;
  --ds-text-2xl: 2rem;
  --ds-text-input: 1rem;
  --ds-text-display: clamp(2.75rem, 6vw, 5rem);
  --ds-spinner-size: 16px;
  --ds-spinner-stroke: 1.6px;
  --ds-spinner-duration: 720ms;
  --ds-shimmer-duration: 1400ms;
  --ds-status-shimmer-duration: 3200ms;
  --ds-status-shine-ink: var(--ds-accent);
  --ds-progress-duration: 1200ms;
  --ds-progress-height: 4px;
  --ds-choice-preview-min-height: 132px;
  --ds-highlight-art-ratio: 24 / 11;
  --ds-week-bar-height: 72px;
  --ds-button-height: 32px;
  --ds-button-padding-block: 5px;
  --ds-button-padding-inline: 10px;
  --ds-button-font-weight: 450;
  --ds-space-1: 4px; --ds-space-2: 8px; --ds-space-3: 12px;
  --ds-space-4: 16px; --ds-space-5: 20px; --ds-space-6: 24px;
  --ds-space-8: 32px; --ds-space-10: 40px; --ds-space-12: 48px;
  --ds-space-16: 64px; --ds-space-20: 80px; --ds-space-24: 96px;
  --ds-gap-label-title: var(--ds-space-3);
  --ds-gap-title-body: var(--ds-space-3);
  --ds-gap-heading-actions: var(--ds-space-5);
  --ds-email-width: 600px;
  --ds-email-padding: var(--ds-space-6);
  --ds-email-font-sans: Inter, Arial, Helvetica, sans-serif;
  --ds-email-font-editorial: Inter, Arial, Helvetica, sans-serif;
  --ds-email-font-mono: Consolas, 'Courier New', monospace;
  --ds-email-heading-size: var(--ds-text-2xl);
  --ds-email-body-size: var(--ds-text-input);
  --ds-radius-control: 6px;
  --ds-radius-card: 8px;
  --ds-radius-panel: 12px;
  --ds-radius-pill: 999px;
  --ds-shadow-press: none;
  --ds-shadow-card: none;
  --ds-shadow-sticker: none;
  --ds-shadow-dialog: 0 16px 48px #000; /* Overlays only: dialogs, menus, toasts. */
  --ds-duration-fast: 120ms;
  --ds-duration-base: 180ms;
  --ds-duration-slow: 220ms;
  --ds-duration-illustration: 220ms;
  --ds-ease-out: cubic-bezier(.23, 1, .32, 1);
  --ds-ease-in-out: cubic-bezier(.77, 0, .175, 1);
  /* One entrance recipe for overlays and fresh content: a short rise, a 2px
     blur clearing and a slight scale. Exits run about 40% faster. */
  --ds-ease-spring: cubic-bezier(.34, 1.36, .64, 1);
  --ds-duration-overlay: 250ms;
  --ds-duration-exit: 150ms;
  --ds-enter-rise: 8px;
  --ds-enter-blur: 2px;
  --ds-enter-scale: .97;
  --ds-focus-ring: 0 0 0 2px var(--ds-paper), 0 0 0 4px var(--ds-accent);
  --muted: var(--ds-muted); --line: var(--ds-line); --soft: var(--ds-surface-soft);
  --radius-control: var(--ds-radius-control); --radius-card: var(--ds-radius-card); --radius-panel: var(--ds-radius-panel);
  --ease-out: var(--ds-ease-out); --font-mono: var(--ds-font-mono);
  font-family: var(--ds-font-sans);
  color: var(--ds-ink); background: var(--ds-paper);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--ds-text-base); line-height: 1.6; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
/* Inline links read as links: a quiet underline that firms up on hover. Links
   styled as buttons (.button, .button-link, .ds-button) never underline. */
a:where(:not(.button, .button-link, .ds-button)) { text-decoration-color: color-mix(in srgb, currentColor 38%, transparent); transition: text-decoration-color var(--ds-duration-fast) var(--ds-ease-out), color var(--ds-duration-fast) var(--ds-ease-out); }
@media (hover: hover) and (pointer: fine) { a:where(:not(.button, .button-link, .ds-button)):hover { text-decoration-color: currentColor; } }
::selection { color: var(--ds-accent-ink); background: var(--ds-accent); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.14; text-wrap: balance; }
h1 { font-size: var(--ds-text-2xl); font-weight: 560; letter-spacing: 0; }
h2 { font-size: var(--ds-text-xl); font-weight: 550; letter-spacing: 0; }
h3 { font-size: var(--ds-text-lg); font-weight: 550; letter-spacing: 0; }
code, pre, kbd, .mono { font-family: var(--ds-font-mono); }
code, pre { overflow-wrap: anywhere; }
pre { padding: var(--ds-space-4); background: var(--ds-surface); border: 0; border-radius: var(--ds-radius-control); font-size: var(--ds-text-sm); white-space: pre-wrap; line-height: 1.7; }
.ds-code-scroll { display: block; min-width: 0; max-width: 100%; min-height: 44px; padding-block: var(--ds-space-3); overflow-x: auto; overflow-y: hidden; white-space: nowrap; overflow-wrap: normal; word-break: normal; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--ds-input-border) transparent; border-radius: var(--ds-radius-control); line-height: 1.6; }
/* A command or value with an adjacent Copy action. The value scrolls; the action stays put and stacks below on narrow screens. */
.ds-command { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--ds-space-2); min-width: 0; }
.ds-command > .ds-code-scroll { padding-inline: var(--ds-space-3); border: 0; background: var(--ds-surface); color: var(--ds-ink); font-size: var(--ds-text-sm); }
@media (max-width: 420px) { .ds-command { grid-template-columns: minmax(0, 1fr); } .ds-command > :not(.ds-code-scroll) { width: 100%; } }
/* A short code a person compares against another screen before acting. */
.ds-confirm-code { display: grid; gap: var(--ds-space-2); justify-items: start; min-width: 0; padding: var(--ds-space-4); border: 0; border-radius: var(--ds-radius-control); background: var(--ds-surface); }
.ds-confirm-code-label { margin: 0; color: var(--ds-ink); font-size: var(--ds-text-sm); line-height: 1.5; }
.ds-confirm-code-value { color: var(--ds-ink); font-family: var(--ds-font-mono); font-size: var(--ds-text-2xl); font-weight: 600; letter-spacing: .12em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 360px) { .ds-confirm-code-value { font-size: var(--ds-text-xl); } }
@media (forced-colors: active) { .ds-confirm-code { border-color: CanvasText; } }
/* Deprecated: no kickers or highlighted words. Both render as plain text until callers are removed. */
.ds-eyebrow { font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); line-height: 1.5; letter-spacing: normal; text-transform: none; font-weight: 400; color: var(--ds-muted); }
.ds-editorial { color: inherit; font-family: inherit; font-style: normal; font-weight: inherit; letter-spacing: inherit; }
.ds-muted { color: var(--ds-muted); }
.ds-tabular { font-variant-numeric: tabular-nums; }
.ds-agent-avatar { display: block; flex-shrink: 0; border-radius: 50%; overflow: hidden; }
.ds-profile-avatar { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: var(--ds-profile-avatar-md); height: var(--ds-profile-avatar-md); overflow: hidden; border: 0; border-radius: 50%; background: var(--ds-paper); vertical-align: middle; }
.ds-profile-avatar[data-size='sm'] { width: var(--ds-profile-avatar-sm); height: var(--ds-profile-avatar-sm); }
.ds-profile-avatar[data-size='lg'] { width: var(--ds-profile-avatar-lg); height: var(--ds-profile-avatar-lg); }
.ds-profile-avatar-fallback { display: block; width: 100%; height: 100%; }
.ds-profile-avatar-halo { fill: none; stroke: var(--ds-line); stroke-width: 1; }
.ds-profile-avatar-core { fill: var(--ds-accent-muted); }
.ds-profile-avatar-orbit { fill: none; stroke: var(--ds-accent); stroke-width: 1.15; opacity: .7; }
.ds-profile-avatar-seed { fill: var(--ds-accent); }
.ds-profile-avatar-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--ds-duration-fast) var(--ds-ease-out); }
.ds-profile-avatar[data-state='ready'] .ds-profile-avatar-image { opacity: 1; }
[data-input='keyboard'] .ds-profile-avatar-image, [data-motion='reduced'] .ds-profile-avatar-image { transition: none; }
@media (prefers-reduced-motion: reduce) { .ds-profile-avatar-image { transition: none; } }
@media (forced-colors: active) { .ds-profile-avatar { border-color: CanvasText; } .ds-profile-avatar-halo, .ds-profile-avatar-orbit { stroke: CanvasText; } .ds-profile-avatar-core { fill: Canvas; } .ds-profile-avatar-seed { fill: CanvasText; } }
.ds-product-logo { display: block; flex-shrink: 0; width: 24px; height: 24px; object-fit: contain; }
.ds-product-logo[data-size='28'] { width: 28px; height: 28px; }
.ds-product-logo[data-tone='mono'] { filter: invert(1); } /* A one-color black mark, shown light on the dark canvas. */
/* Deprecated backplate: kept for app callers. New work shows the mark itself, with data-tone='mono' where needed. */
.ds-product-logo-frame[data-tone='inverse'], html[data-design-system] .ds-logo-backplate { background: var(--ds-inverse); color: var(--ds-inverse-ink); box-shadow: none; }
.ds-product-logo-frame { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; background: var(--ds-inverse); border: 0; border-radius: var(--ds-radius-control); }
.ds-sr-only, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ds-stack { display: grid; gap: var(--ds-space-4); }
.ds-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-3); }
.ds-touch-target { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.ds-attribution { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-3); max-width: 100%; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.5; }
.ds-attribution-label { white-space: nowrap; }
.ds-attribution-links { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-3); }
.ds-attribution .ds-attribution-link { gap: var(--ds-space-2); min-height: 36px; color: var(--ds-ink); font-weight: 550; text-decoration: none; border-radius: var(--ds-radius-control); }
.ds-attribution-link:is(:hover, :focus-visible) { color: var(--ds-ink); }
.ds-attribution-avatar { display: block; flex-shrink: 0; width: var(--ds-space-6); height: var(--ds-space-6); border-radius: 50%; object-fit: cover; background: var(--ds-surface-soft); }
.ds-results { padding-block-start: var(--ds-space-6); }
.ds-benefit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--ds-space-6); }
.ds-benefit-count { color: var(--ds-ink); font-size: var(--ds-text-xl); font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.ds-benefit-description { font-size: var(--ds-text-sm); line-height: 1.7; }
.ds-benefit > .ds-button { max-width: 100%; white-space: normal; }
@media (max-width: 600px) {
  .ds-benefit { grid-template-columns: minmax(0, 1fr); }
  .ds-benefit > .ds-button { justify-self: start; }
}
.ds-option { display: flex; align-items: flex-start; gap: var(--ds-space-3); padding: var(--ds-space-4); border: 0; border-radius: var(--ds-radius-card); background: var(--ds-surface); cursor: pointer; }
.ds-option > span { min-width: 0; }
.ds-option strong { display: block; color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 550; line-height: 1.5; }
.ds-option small { display: block; margin-top: var(--ds-space-2); color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.7; }
html[data-design-system] .ds-option input[type='checkbox'] { flex: 0 0 auto; width: 18px; height: 18px; min-height: 18px; margin: var(--ds-space-1) 0 0; padding: 0; accent-color: var(--ds-accent); }
.ds-option:has(input:disabled) { cursor: default; }
.ds-heading-group { display: flex; flex-direction: column; align-items: flex-start; }
.ds-heading-group > h2 { font-size: var(--ds-text-xl); font-weight: 550; line-height: 1.14; letter-spacing: 0; }
.ds-heading-group > h3 { font-size: var(--ds-text-lg); font-weight: 550; line-height: 1.14; letter-spacing: 0; }
.ds-heading-label { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-4); width: 100%; }
.ds-heading-group > :where(h1, h2, h3, p, .ds-eyebrow, .ds-badge, .ds-sticker, .ds-heading-label, .ds-attribution) { margin: 0; }
.ds-heading-group > :is(.ds-eyebrow, .ds-badge, .ds-sticker, .ds-heading-label, .ds-attribution) + :is(h1, h2, h3),
.ds-dialog > :is(.ds-eyebrow, .ds-badge, .ds-sticker) + :is(h1, h2, h3),
.ds-card > :is(.ds-eyebrow, .ds-badge, .ds-sticker) + :is(h1, h2, h3) { margin-top: var(--ds-gap-label-title); }
.ds-heading-group > :is(h1, h2, h3) + p, .ds-dialog > :is(h1, h2, h3) + p, .ds-card > :is(h1, h2, h3) + p { margin-top: var(--ds-gap-title-body); }
.ds-heading-group > .ds-row, .ds-heading-group > .ds-heading-actions { margin-top: var(--ds-gap-heading-actions); }
.ds-mail-preference { min-height: 100dvh; padding: var(--ds-space-12) var(--ds-space-5); display: grid; place-items: center; background: var(--ds-paper); }
.ds-mail-preference-shell { width: min(560px, 100%); }
.ds-mail-preference-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-4); margin-bottom: var(--ds-space-8); }
.ds-mail-preference-header a { display: inline-flex; align-items: center; gap: var(--ds-space-3); color: var(--ds-ink); font-size: 25px; font-weight: 650; letter-spacing: 0; text-decoration: none; }
.ds-mail-preference-header img { width: 34px; height: 34px; object-fit: contain; }
.ds-mail-preference-card { padding: var(--ds-space-8); }
.ds-mail-preference-card h1 { font-size: clamp(28px, 6vw, 36px); }
.ds-mail-preference-card p { max-width: 45ch; color: var(--ds-muted); font-size: var(--ds-text-base); line-height: 1.8; }
.ds-mail-preference-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-3); margin-top: var(--ds-space-6); }
.ds-mail-preference-note { margin-top: var(--ds-space-5); padding: var(--ds-space-4); border-radius: var(--ds-radius-control); background: var(--ds-paper); }
.ds-mail-preference-card .ds-mail-preference-hint { margin-top: var(--ds-space-5); font-size: var(--ds-text-sm); }
.ds-mail-preference-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-4); margin-top: var(--ds-space-6); font-size: var(--ds-text-sm); color: var(--ds-muted); line-height: 1.8; }
.ds-mail-preference-footer nav { display: flex; flex-wrap: wrap; gap: var(--ds-space-4); }
.ds-mail-preference-footer a { display: inline-block; min-height: 36px; }
.ds-mail-preference-preview { margin-bottom: var(--ds-space-6); }
@media (max-width: 600px) {
  .ds-mail-preference { padding: var(--ds-space-6) var(--ds-space-4); }
  .ds-mail-preference-card { padding: var(--ds-space-6); }
}

button, .button, .button-link, .ds-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-2);
  min-width: 0; max-width: 100%; overflow-wrap: anywhere;
  min-height: var(--ds-button-height); padding: var(--ds-button-padding-block) var(--ds-button-padding-inline); border: 1px solid var(--ds-input-border); border-radius: var(--ds-radius-control);
  color: var(--ds-ink); background: transparent; cursor: pointer; text-decoration: none;
  font-size: var(--ds-text-xs); font-weight: var(--ds-button-font-weight); line-height: 1.4; text-align: center;
  transition: transform var(--ds-duration-fast) var(--ds-ease-out), background-color var(--ds-duration-fast) var(--ds-ease-out), border-color var(--ds-duration-fast) var(--ds-ease-out), color var(--ds-duration-fast) var(--ds-ease-out), opacity var(--ds-duration-fast) var(--ds-ease-out);
}
:is(button, .button, .button-link, .ds-button).primary,
.ds-button[data-variant='primary'] { background: var(--ds-accent); color: var(--ds-accent-ink); border-color: var(--ds-accent); box-shadow: var(--ds-shadow-press); }
.ds-button[data-variant='lime'], .ds-button[data-variant='accent'] { background: transparent; color: var(--ds-accent); border-color: var(--ds-accent); box-shadow: none; }
:is(button, .button, .button-link, .ds-button).text,
.ds-button[data-variant='text'] { color: var(--ds-ink); background: transparent; border-color: transparent; box-shadow: none; }
.ds-button[data-variant='danger'] { color: var(--ds-danger); border-color: var(--ds-danger); background: transparent; }
:is(button, .button, .button-link, .ds-button):is(.small, .large) { min-height: var(--ds-button-height); padding: var(--ds-button-padding-block) var(--ds-button-padding-inline); font-size: var(--ds-text-xs); }
html[data-design-system] :is(.ds-icon-button, .icon-button) { width: var(--ds-button-height); height: var(--ds-button-height); min-width: var(--ds-button-height); min-height: var(--ds-button-height); flex-shrink: 0; padding: 0; }
.ds-skip-link { position: fixed; z-index: 100; top: max(var(--ds-space-3), env(safe-area-inset-top)); left: max(var(--ds-space-3), env(safe-area-inset-left)); }
.ds-skip-link:not(:focus) { clip-path: inset(50%); pointer-events: none; }
:is(button, .button, .button-link, .ds-button):disabled,
:is(button, .button, .button-link, .ds-button)[aria-disabled='true'] { cursor: default; opacity: .46; box-shadow: none; }
:is(button, .button, .button-link, .ds-button):active:not(:disabled):not([aria-disabled='true']):not(:focus-visible) { transform: scale(.985); }
/* Hover and press: tint the surface, firm up the edge, keep text undecorated.
   Borderless buttons (text variant, rows, tabs) only gain the tint. */
@media (hover: hover) and (pointer: fine) {
  :is(button, .button, .button-link, .ds-button):hover:not(:disabled):not([aria-disabled='true']) { transform: none; background-color: var(--ds-hover-bg); border-color: var(--ds-hover-border); text-decoration: none; }
  :is(button, .button, .button-link, .ds-button):is(.text, [data-variant='text']):hover:not(:disabled):not([aria-disabled='true']) { color: var(--ds-ink); border-color: transparent; }
  :is(button, .button, .button-link, .ds-button):is(.primary, [data-variant='primary']):hover:not(:disabled):not([aria-disabled='true']) { color: var(--ds-accent-ink); background-color: var(--ds-accent-hover); border-color: var(--ds-accent-hover); }
  .ds-button[data-variant='danger']:hover:not(:disabled):not([aria-disabled='true']) { color: var(--ds-danger); background-color: var(--ds-danger-hover-bg); border-color: var(--ds-danger); }
  .ds-button:is([data-variant='lime'], [data-variant='accent']):hover:not(:disabled):not([aria-disabled='true']) { background-color: var(--ds-glow-soft); border-color: var(--ds-accent); }
}
:is(button, .button, .button-link, .ds-button):active:not(:disabled):not([aria-disabled='true']):not(.primary):not([data-variant='primary']) { background-color: var(--ds-press-bg); }
:is(button, .button, .button-link, .ds-button):is(.primary, [data-variant='primary']):active:not(:disabled):not([aria-disabled='true']) { background-color: var(--ds-accent-press); border-color: var(--ds-accent-press); }
input, select, textarea {
  min-width: 0; max-width: 100%; min-height: 36px; padding: 7px 11px; border: 1px solid var(--ds-input-border);
  border-radius: var(--ds-radius-control); background: var(--ds-surface); color: var(--ds-ink); line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: var(--ds-muted); opacity: 1; }
input[type='checkbox'], input[type='radio'] { min-height: 18px; width: 18px; height: 18px; accent-color: var(--ds-accent); padding: 0; }
input:disabled, select:disabled, textarea:disabled { background: var(--ds-surface-soft); color: var(--ds-muted); cursor: not-allowed; }
input[readonly], textarea[readonly] { background: var(--ds-surface-soft); }
input[aria-invalid='true'], textarea[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--ds-danger); }
textarea { width: 100%; min-height: 110px; resize: vertical; }
select { cursor: pointer; }
.ds-select { position: relative; display: inline-grid; vertical-align: middle; min-width: 0; max-width: 100%; }
.ds-select[hidden] { display: none; }
/* Product logo list: every mark beside its visible name, static and wrapping. */
.ds-logo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--ds-space-5) var(--ds-space-6); padding: 0; margin: 0; list-style: none; }
.ds-logo-list > li { display: flex; align-items: center; gap: var(--ds-space-3); min-width: 0; color: var(--ds-ink); font-size: var(--ds-text-base); line-height: 1.4; }
html[data-design-system] .ds-select > select.ds-select-native { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; min-width: 0; min-height: 0; max-height: 1px; padding: 0; margin: 0; border: 0; opacity: 0; clip-path: inset(50%); pointer-events: none; }
html[data-design-system] .ds-select > .ds-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); width: 100%; min-width: 0; min-height: 36px; padding: 8px var(--ds-space-3); border: 1px solid var(--ds-input-border); border-radius: var(--ds-radius-control); background: var(--ds-surface); color: var(--ds-ink); font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); font-weight: 400; line-height: 1.45; text-align: left; box-shadow: var(--ds-shadow-card); cursor: pointer; }
.ds-select-value { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.ds-select-indicator { display: inline-flex; flex-shrink: 0; color: var(--ds-muted); }
html[data-design-system] .ds-select > .ds-select-trigger[aria-expanded='true'] { border-color: var(--ds-accent); }
.ds-select-trigger[aria-expanded='true'] .ds-select-indicator { color: var(--ds-accent); transform: rotate(180deg); }
html[data-design-system] .ds-select > .ds-select-trigger[aria-invalid='true'] { border-color: var(--ds-danger); }
html[data-design-system] .ds-select > .ds-select-trigger:disabled { color: var(--ds-muted); background: var(--ds-surface-soft); opacity: .65; cursor: not-allowed; }
html[data-design-system] .ds-select[data-select-variant='embedded'] > .ds-select-trigger { border-color: transparent; background: transparent; box-shadow: none; }
.ds-field > .ds-select, .field > .ds-select { width: 100%; }
.ds-select-error { margin-top: var(--ds-space-2); }
.ds-select-popup { z-index: 1000; position: fixed; inset: auto; box-sizing: border-box; margin: 0; padding: var(--ds-space-1); max-width: calc(100vw - 16px); max-height: min(320px, calc(100dvh - 16px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border: 1px solid var(--ds-input-border); border-radius: var(--ds-radius-card); background: var(--ds-surface); color: var(--ds-ink); font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); line-height: 1.5; text-align: left; box-shadow: var(--ds-shadow-dialog); opacity: 1; transition: opacity var(--ds-duration-fast) var(--ds-ease-out); }
.ds-select-popup[hidden] { display: none; }
.ds-select-option { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); min-height: 36px; padding: var(--ds-space-2) var(--ds-space-3); border: 1px solid transparent; border-radius: 4px; color: var(--ds-ink); cursor: pointer; }
.ds-select-option-label { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.ds-select-option > svg { flex-shrink: 0; color: var(--ds-accent); opacity: 0; }
.ds-select-option[aria-selected='true'] > svg { opacity: 1; }
.ds-select-option[data-active] { border-color: var(--ds-input-border); }
.ds-select-option[aria-selected='true'] { color: var(--ds-accent); }
.ds-select-option[aria-disabled='true'] { color: var(--ds-muted); opacity: .55; cursor: not-allowed; }
.ds-select-group + .ds-select-group { margin-top: var(--ds-space-2); }
.ds-select-group-label { padding: var(--ds-space-2) var(--ds-space-3) var(--ds-space-1); color: var(--ds-muted); font-size: var(--ds-text-xs); font-weight: 500; }
.ds-select-empty { margin: 0; padding: var(--ds-space-3); color: var(--ds-muted); }
@starting-style { .ds-select-popup { opacity: 0; } }
[data-input='keyboard'] .ds-select-popup, [data-motion='reduced'] .ds-select-popup { transition: none; }
@media (pointer: coarse), (max-width: 600px) {
  html[data-design-system] .ds-select > .ds-select-trigger { min-height: 44px; font-size: var(--ds-text-input); }
  .ds-select-option { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .ds-select-popup { transition: none; } }
@media (forced-colors: active) {
  html[data-design-system] .ds-select > .ds-select-trigger, .ds-select-popup { border-color: ButtonText; }
  .ds-select-option[data-active] { border-color: Highlight; }
  .ds-select-option[aria-selected='true'] > svg { color: Highlight; }
}
.ds-field, .field { display: grid; gap: var(--ds-space-2); font-size: var(--ds-text-sm); font-weight: 550; }
.ds-field input, .ds-field textarea, .ds-field select { width: 100%; font-weight: 400; }
.ds-hint { color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.65; }
.ds-field-error { color: var(--ds-danger); font-size: var(--ds-text-sm); font-weight: 500; }
:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 4px; }
:is(input, select, textarea):focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* A flat surface used only when grouping is essential. No border, no shadow. */
.ds-card { min-width: 0; padding: var(--ds-space-6); border: 0; border-radius: var(--ds-radius-card); background: var(--ds-surface); box-shadow: none; }
html[data-design-system] .ds-card-caption { margin-block: var(--ds-space-4) 0; padding-inline: var(--ds-card-content-padding, var(--ds-space-6)); }
/* Deprecated tones: every card uses the one surface; "ink" sits on the canvas. */
.ds-card[data-tone='ink'] { background: var(--ds-paper); }
/* Deprecated: no tags. A badge or sticker renders as plain inline text (no border,
   no fill). Functional states keep their text color; other tones use muted text. */
.ds-badge, .ds-sticker { --ds-badge-ink: var(--ds-muted); display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ds-badge-ink); font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); line-height: 1.5; letter-spacing: normal; font-weight: 400; white-space: normal; }
.ds-badge > :is(svg, img), .ds-sticker > :is(svg, img) { flex-shrink: 0; }
html[data-design-system] .ds-resource-chip {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: var(--ds-space-2);
  min-width: 0; max-width: 100%; min-height: 30px; padding: var(--ds-space-1) var(--ds-space-3);
  border: 0; border-radius: var(--ds-radius-control); box-shadow: none;
  color: var(--ds-ink); background: none; font-family: var(--ds-font-sans);
  font-size: var(--ds-text-sm); font-weight: 500; line-height: 1.5; text-align: left; text-decoration: none;
}
html[data-design-system] button.ds-resource-chip { min-height: var(--ds-button-height); padding-block: var(--ds-button-padding-block); font-size: var(--ds-text-xs); cursor: pointer; }
.ds-resource-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-resource-chip-mark { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 16px; width: 16px; height: 16px; }
.ds-resource-chip-mark:has(img) { background: var(--ds-inverse); border-radius: 3px; }
.ds-resource-chip-mark > img { padding: 2px; }
.ds-resource-chip-mark > :is(img, svg) { width: 16px; height: 16px; object-fit: contain; }
.ds-resource-chip > :is(img, svg) { flex-shrink: 0; }
html[data-design-system] .ds-resource-chip:is(:hover, :active) { transform: none; }
@media (hover: hover) and (pointer: fine) {
  html[data-design-system] button.ds-resource-chip:hover:not(:disabled) { text-decoration: none; background-color: var(--ds-hover-bg); }
}
@media (pointer: coarse), (max-width: 600px) { html[data-design-system] button.ds-resource-chip { min-height: 44px; } }
.ds-sticker { box-shadow: none; text-transform: none; }
.ds-sticker--left, .ds-sticker--right { transform: none; }

:is(.ds-badge, .ds-sticker)[data-tone='success'] { --ds-badge-ink: var(--ds-success); }
:is(.ds-badge, .ds-sticker)[data-tone='warning'] { --ds-badge-ink: var(--ds-warning); }
:is(.ds-badge, .ds-sticker)[data-tone='danger'] { --ds-badge-ink: var(--ds-danger); }
/* A notice is one flat surface; its state is carried by the text color and the words. */
.ds-notice { padding: var(--ds-space-4); border: 0; border-radius: var(--ds-radius-control); background: var(--ds-surface); font-size: var(--ds-text-sm); }
.ds-notice[data-tone='danger'] { color: var(--ds-danger); }
.ds-notice[data-tone='success'] { color: var(--ds-success); }
.ds-notice[data-tone='warning'] { color: var(--ds-warning); }

/* The actual text remains solid. A clipped duplicate moves its narrow window
   while counter-translating its letters, so only transform and opacity animate. */
.ds-status-text { position: relative; display: inline-block; max-width: 100%; overflow: hidden; vertical-align: top; }
.ds-status-copy { display: block; }
.ds-status-sheen { position: absolute; top: 0; left: 0; width: 25%; height: 100%; overflow: hidden; pointer-events: none; opacity: 0; transform: translateX(-100%); mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent); }
.ds-status-shine { position: absolute; top: 0; left: 0; width: 400%; height: 100%; color: var(--ds-status-shine-ink); transform: translateX(25%); }
.ds-status-shine::before { content: attr(data-text); }
.ds-status-text[data-active='true'] > .ds-status-sheen { animation: ds-status-sweep var(--ds-status-shimmer-duration) linear infinite paused; }
.ds-status-text[data-active='true'] .ds-status-shine { animation: ds-status-counter var(--ds-status-shimmer-duration) linear infinite paused; }
.ds-status-text[data-active='true'][data-motion-paused='false'] > .ds-status-sheen,
.ds-status-text[data-active='true'][data-motion-paused='false'] .ds-status-shine { animation-play-state: running; }
@keyframes ds-status-sweep { 0%, 24% { transform: translateX(-100%); opacity: 0; } 33%, 63% { opacity: .72; } 74%, 100% { transform: translateX(400%); opacity: 0; } }
@keyframes ds-status-counter { 0%, 24% { transform: translateX(25%); } 74%, 100% { transform: translateX(-100%); } }
[data-input='keyboard'] .ds-status-text :is(.ds-status-sheen, .ds-status-shine),
[data-motion='reduced'] .ds-status-text :is(.ds-status-sheen, .ds-status-shine),
.ds-status-text[data-motion='reduced'] :is(.ds-status-sheen, .ds-status-shine) { animation: none !important; opacity: 0; }
@media (prefers-reduced-motion: reduce), (forced-colors: active) { .ds-status-text :is(.ds-status-sheen, .ds-status-shine) { animation: none !important; opacity: 0; } }

/* Pending motion exists only for an operation in flight. Its owner removes or
   settles the state; observeLoadingMotion pauses it outside the visible page. */
.ds-spinner { display: inline-block; flex-shrink: 0; width: var(--ds-spinner-size); height: var(--ds-spinner-size); border: var(--ds-spinner-stroke) solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ds-spin var(--ds-spinner-duration) linear infinite; }
.ds-skeleton { position: relative; isolation: isolate; display: block; height: 12px; overflow: hidden; background: var(--ds-surface); border-radius: 4px; }
.ds-skeleton::after { position: absolute; content: ''; inset: 0; background: linear-gradient(90deg, transparent, var(--ds-paper), transparent); transform: translateX(-100%); opacity: 0; }
.ds-skeleton[data-size='heading'] { height: 25px; width: 62%; }
.ds-skeleton[data-size='short'] { width: 73%; }
[aria-busy='true'] .ds-skeleton::after { opacity: 1; animation: ds-shimmer var(--ds-shimmer-duration) var(--ds-ease-in-out) infinite; }
.ds-progress { display: block; position: relative; width: 100%; height: var(--ds-progress-height); overflow: hidden; border-radius: var(--ds-radius-pill); background: var(--ds-surface); }
.ds-progress-fill { display: block; width: 100%; height: 100%; background: var(--ds-accent); transform: scaleX(0); transform-origin: left center; transition: transform var(--ds-duration-base) var(--ds-ease-out); }
.ds-progress[data-indeterminate='true'] .ds-progress-fill { width: 40%; transform: translateX(-110%); animation: ds-progress-travel var(--ds-progress-duration) var(--ds-ease-in-out) infinite; }
.ds-loading { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--ds-space-3); min-width: 0; padding: var(--ds-space-5); border: 0; border-radius: var(--ds-radius-card); background: var(--ds-surface); }
.ds-loading > .ds-spinner { margin-top: 2px; color: var(--ds-accent); }
.ds-loading-body { display: grid; gap: var(--ds-space-2); min-width: 0; }
.ds-loading-label { color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.ds-loading-description { color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.65; overflow-wrap: anywhere; }
.ds-loading > .ds-progress, .ds-loading > .ds-loading-lines { grid-column: 1 / -1; }
.ds-loading-lines { display: grid; gap: var(--ds-space-3); padding-top: var(--ds-space-2); }
.ds-loading-lines .ds-skeleton:last-child { width: 70%; }
.ds-loading[data-compact='true'] { display: flex; align-items: center; gap: var(--ds-space-2); padding: 0; border: 0; background: transparent; }
.ds-loading[data-compact='true'] > .ds-spinner { margin-top: 0; }
html[data-design-system] :is(button, .ds-button)[data-feedback='success'] { color: var(--ds-success); background: transparent; border-color: var(--ds-success); }
html[data-design-system] :is(button, .ds-button)[data-feedback='error'] { color: var(--ds-danger); background: transparent; border-color: var(--ds-danger); }
.ds-feedback-icon { animation: ds-feedback-arrive var(--ds-duration-base) var(--ds-ease-out) 1; }
[data-motion-paused='true'].ds-spinner, [data-motion-paused='true'].ds-skeleton::after, [data-motion-paused='true'].ds-progress > .ds-progress-fill { animation-play-state: paused; }
[data-motion-paused='true'] .ds-spinner, [data-motion-paused='true'] .ds-skeleton::after, [data-motion-paused='true'] .ds-progress-fill { animation-play-state: paused; }
@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes ds-progress-travel { from { transform: translateX(-110%); } to { transform: translateX(360%); } }
@keyframes ds-feedback-arrive { from { transform: scale(.9); opacity: .35; } to { transform: scale(1); opacity: 1; } }
[data-input='keyboard'] :is(.ds-spinner, .ds-feedback-icon), [data-input='keyboard'] .ds-skeleton::after, [data-input='keyboard'] .ds-progress-fill { animation: none !important; transition: none; }
[data-input='keyboard'] .ds-skeleton::after { opacity: 0; }
[data-input='keyboard'] .ds-progress[data-indeterminate='true'] .ds-progress-fill { transform: translateX(75%); }
[data-motion='reduced'] :is(.ds-spinner, .ds-feedback-icon), [data-motion='reduced'] .ds-skeleton::after, [data-motion='reduced'] .ds-progress-fill { animation: none !important; transition: none; }
[data-motion='reduced'] .ds-skeleton::after { opacity: 0; }
[data-motion='reduced'] .ds-progress[data-indeterminate='true'] .ds-progress-fill { transform: translateX(75%); }
.ds-dialog, dialog { color: var(--ds-ink); background: var(--ds-surface); border: 0; border-radius: var(--ds-radius-panel); box-shadow: var(--ds-shadow-dialog); overscroll-behavior: contain; }
.ds-dialog { width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: var(--ds-space-8); }
dialog::backdrop { background: rgb(0 0 0 / .62); }
.ds-dialog[open] { opacity: 1; transform: translateY(0) scale(1); filter: none; transition: opacity var(--ds-duration-overlay) var(--ds-ease-out), transform var(--ds-duration-overlay) var(--ds-ease-out), filter var(--ds-duration-overlay) var(--ds-ease-out); }
@starting-style { .ds-dialog[open] { opacity: 0; transform: translateY(var(--ds-enter-rise)) scale(.96); filter: blur(var(--ds-enter-blur)); } }
.ds-dialog h2 { font-size: var(--ds-text-xl); letter-spacing: 0; }
.ds-dialog p { margin-top: var(--ds-gap-title-body); color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-dialog form { margin-top: var(--ds-space-6); }
.ds-toast, .toast { color: var(--ds-ink); background: var(--ds-surface); border: 0; border-radius: var(--ds-radius-control); box-shadow: var(--ds-shadow-dialog); }
html[data-design-system] :is(.ds-toast, .toast) { bottom: max(var(--ds-space-6), env(safe-area-inset-bottom)); }
.ds-toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 13px 18px; font-size: var(--ds-text-sm); opacity: 1; transition: opacity var(--ds-duration-base) var(--ds-ease-out); }
@starting-style { .ds-toast { opacity: 0; } }
.ds-motif-line { fill: none; stroke: var(--ds-line-strong); stroke-width: 1.25; }
.ds-motif-track { fill: none; stroke: var(--ds-line-strong); stroke-width: 1; stroke-dasharray: 3 7; opacity: .7; }
.ds-motif-paper { fill: var(--ds-surface); stroke: var(--ds-line-strong); stroke-width: 1; }
.ds-motif-lime { fill: var(--ds-lime); stroke: var(--ds-line-strong); stroke-width: 1; }
.ds-motif-lilac { fill: var(--ds-lilac); stroke: var(--ds-line-strong); stroke-width: 1; }
.ds-motif-apricot { fill: var(--ds-apricot); stroke: var(--ds-line-strong); stroke-width: 1; }
.ds-motif-text { fill: var(--ds-ink); font-family: var(--ds-font-sans); font-size: 15px; letter-spacing: 0; }
.ds-motif-agent .ds-motif-text { font-size: var(--ds-text-lg); font-weight: 550; }
.ds-motif-mono { fill: var(--ds-muted); font-family: var(--ds-font-sans); font-size: 11px; letter-spacing: 0; }
.ds-motif-core .ds-motif-editorial:last-child { fill: var(--ds-accent); }
.ds-motif-editorial { fill: var(--ds-ink); font-family: var(--ds-font-sans); font-size: 27px; font-weight: 500; letter-spacing: 0; }
.ds-motif-rings, .ds-motif-core { transform-box: fill-box; transform-origin: center; }
.ds-motif-intro .ds-motif-rings { animation: ds-orbit-arrive var(--ds-duration-illustration) var(--ds-ease-out) 1 both; }
.ds-motif-intro .ds-motif-core { animation: ds-core-arrive var(--ds-duration-base) var(--ds-ease-out) 1 both; }
.ds-motif-intro .ds-motif-node { animation: ds-node-arrive var(--ds-duration-fast) var(--ds-ease-out) 1 both; }
.ds-motif-intro .ds-motif-node[data-order='1'] { animation-delay: 30ms; }
.ds-motif-intro .ds-motif-node[data-order='2'] { animation-delay: 60ms; }
@keyframes ds-orbit-arrive { from { transform: translateY(4px) scale(.99); opacity: .25; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes ds-core-arrive { from { transform: scale(.975); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes ds-node-arrive { from { transform: translateY(7px); opacity: .3; } to { transform: translateY(0); opacity: 1; } }
[data-input='keyboard'] .ds-motif-intro :is(.ds-motif-rings, .ds-motif-core, .ds-motif-node) { animation: none; }
[data-input='keyboard'] :is(button, .button, .button-link, .ds-button, .ds-dialog, .ds-toast) { transition: none; transform: none; }
[data-input='keyboard'] .ds-toast { transform: translateX(-50%); }
:is(button, .button, .button-link, .ds-button):focus-visible { transition: none; transform: none; }

/* Opt in on the document root. Shared action sizing and visuals outrank legacy
   generic controls; surfaces retain content-row and card-grid composition. */
html[data-design-system] { color: var(--ds-ink); background: var(--ds-paper); font-family: var(--ds-font-sans); --muted: var(--ds-muted); --line: var(--ds-line); --soft: var(--ds-surface-soft); --radius-control: var(--ds-radius-control); --radius-card: var(--ds-radius-card); --radius-panel: var(--ds-radius-panel); }
html[data-design-system] body { color: var(--ds-ink); background: var(--ds-paper); font-family: var(--ds-font-sans); font-size: var(--ds-text-base); line-height: 1.6; }
html[data-design-system] h1 { font-weight: 560; letter-spacing: 0; }
html[data-design-system] :where(button, .button, .button-link) { color: var(--ds-ink); background: transparent; border-color: var(--ds-input-border); border-radius: var(--ds-radius-control); font-family: var(--ds-font-sans); transition: transform var(--ds-duration-fast) var(--ds-ease-out), opacity var(--ds-duration-fast) var(--ds-ease-out); }
:where(html[data-design-system]) :is(button, .button, .button-link, .ds-button) { min-height: var(--ds-button-height); padding: var(--ds-button-padding-block) var(--ds-button-padding-inline); font-size: var(--ds-text-xs); font-weight: var(--ds-button-font-weight); line-height: 1.4; }
html[data-design-system] :where(button, .button, .button-link).primary { color: var(--ds-accent-ink); background: var(--ds-accent); border-color: var(--ds-accent); }
html[data-design-system] :where(button, .button, .button-link).text { color: var(--ds-muted); background: transparent; border-color: transparent; box-shadow: none; }
html[data-design-system] :where(input, select, textarea) { color: var(--ds-ink); background: var(--ds-surface); border-color: var(--ds-input-border); border-radius: var(--ds-radius-control); font-family: var(--ds-font-sans); }
html[data-design-system] :is(input, textarea)::placeholder { color: var(--ds-muted); opacity: 1; }
html[data-design-system] :where(input, select, textarea)[aria-invalid='true'] { border-color: var(--ds-danger); }
html[data-design-system] :where(input, select, textarea):disabled, html[data-design-system] :where(input, textarea)[readonly] { background: var(--ds-paper); }
html[data-design-system] :focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 3px; box-shadow: none; }
html[data-design-system] :where(button, .button, .button-link, input, select, textarea):focus-visible { transition: none; transform: none; }
/* Text fields show one ring: the accent border, never an outline around it. */
html[data-design-system] :where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], .ds-switch), select, textarea):focus-visible { outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 1px var(--ds-accent); }
html[data-design-system][data-input='keyboard'] :where(button, .button, .button-link, dialog, .toast) { transition: none; }
html[data-design-system][data-input='keyboard'] :where(button, .button, .button-link, .ds-button), html[data-design-system] :where(button, .button, .button-link, .ds-button):focus-visible { transition: none !important; transform: none !important; }
@media (hover: hover) and (pointer: fine) {
  html[data-design-system] :where(button, .button, .button-link):hover:not(:disabled):not([aria-disabled='true']) { transform: none; }
  html[data-design-system] .ds-button[data-variant='primary']:hover:not(:disabled),
  html[data-design-system] :where(button, .button, .button-link).primary:hover:not(:disabled) { color: var(--ds-accent-ink); background: var(--ds-accent-hover); border-color: var(--ds-accent-hover); }
}
@media (pointer: coarse), (max-width: 600px) { :root { --ds-button-height: 44px; } :is(button, .button, .button-link, .ds-button), :is(button, .button, .button-link, .ds-button).small, input:not([type='checkbox']):not([type='radio']), select { min-height: 44px; } }

/* Shared workspace grammar. Surface files only arrange these primitives. */
/* A flat surface used only when grouping is essential. No border, no header/footer rules. */
.ds-panel { min-width: 0; overflow: clip; border: 0; border-radius: var(--ds-radius-card); background: var(--ds-surface); box-shadow: none; }
.ds-panel-header, .ds-panel-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-3); padding: var(--ds-space-5); }
.ds-panel-header :is(h2, h3) { font-size: var(--ds-text-base); font-weight: 550; letter-spacing: 0; }
.ds-panel-body { min-width: 0; padding: var(--ds-space-5); }
.ds-panel-footer { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-3); }
/* Deprecated: no dividers. Renders as space only until callers are removed. */
.ds-divider { width: 100%; height: 0; margin: var(--ds-space-8) 0; border: 0; background: none; }
.ds-tabs { display: flex; align-items: center; gap: var(--ds-space-5); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ds-tabs::-webkit-scrollbar { display: none; }
html[data-design-system] .ds-tab { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-2); min-height: var(--ds-button-height); padding: var(--ds-button-padding-block) 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ds-muted); background: transparent; box-shadow: none; font-size: var(--ds-text-xs); font-weight: 500; line-height: 1.5; text-decoration: none; white-space: nowrap; transform: none; }
html[data-design-system] .ds-tab:hover:not(:disabled) { color: var(--ds-ink); background: transparent; border-color: transparent; }
html[data-design-system] .ds-tabs .ds-tab:is([aria-selected='true'], [aria-current='page']) { color: var(--ds-ink); border-bottom-color: var(--ds-accent); }
html[data-design-system] .ds-tab:focus-visible { outline-offset: -3px; }
/* Data display: column chart, bar list and table (design-system.js). Static; real counts only. */
.ds-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--ds-space-3); }
.ds-column-chart { margin: 0; min-width: 0; }
.ds-column-chart-columns { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(2px, 1fr); align-items: end; gap: 2px; height: 160px; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--ds-hairline); }
.ds-column { position: relative; display: flex; align-items: flex-end; height: 100%; min-width: 0; }
.ds-column-fill { display: block; width: 100%; height: 100%; border-radius: 2px 2px 0 0; background: var(--ds-chart-3); transform: scaleY(var(--ds-column-ratio, 0)); transform-origin: center bottom; }
.ds-column:not([data-filled]) .ds-column-fill { transform: none; height: 2px; background: var(--ds-chart-0); }
.ds-column:hover .ds-column-fill { background: var(--ds-chart-4); }
.ds-column-chart-axis { display: flex; justify-content: space-between; gap: var(--ds-space-3); margin-top: var(--ds-space-2); color: var(--ds-muted); font-size: var(--ds-text-xs); font-variant-numeric: tabular-nums; }
.ds-bar-list { display: grid; gap: var(--ds-space-2); margin: 0; padding: 0; list-style: none; }
.ds-bar-row { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr) minmax(3rem, auto); align-items: center; gap: var(--ds-space-3); min-height: 28px; font-size: var(--ds-text-sm); }
.ds-bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ds-ink); }
.ds-bar-track { position: relative; display: block; height: 8px; overflow: hidden; border-radius: 4px; background: var(--ds-chart-0); }
.ds-bar-fill { position: absolute; inset: 0; display: block; background: var(--ds-chart-3); transform: scaleX(var(--ds-bar-ratio, 0)); transform-origin: left center; }
.ds-bar-value { color: var(--ds-ink); text-align: right; font-variant-numeric: tabular-nums; }
.ds-bar-note { grid-column: 1 / -1; color: var(--ds-muted); font-size: var(--ds-text-xs); }
.ds-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; border-radius: var(--ds-radius-control); }
.ds-table-wrap:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--ds-text-sm); }
.ds-table th { padding: var(--ds-space-2) var(--ds-space-3); border-bottom: 1px solid var(--ds-hairline); color: var(--ds-muted); font-size: var(--ds-text-xs); font-weight: 450; text-align: left; white-space: nowrap; }
.ds-table td { padding: var(--ds-space-3); border-bottom: 1px solid var(--ds-hairline); color: var(--ds-ink); vertical-align: top; overflow-wrap: anywhere; }
.ds-table tbody tr:hover { background: var(--ds-hover-bg); }
.ds-table [data-numeric] { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) { .ds-bar-row { grid-template-columns: minmax(0, 1fr) minmax(3rem, auto); } .ds-bar-track { grid-column: 1 / -1; grid-row: 2; } .ds-column-chart-columns { height: 120px; } }
@media (forced-colors: active) { .ds-column-fill, .ds-bar-fill { background: Highlight; } .ds-bar-track { border: 1px solid CanvasText; background: Canvas; } }
.ds-metric { min-width: 0; padding: var(--ds-space-5); border: 0; border-radius: var(--ds-radius-card); background: var(--ds-surface); box-shadow: none; }
.ds-metric-label { display: block; color: var(--ds-muted); font-size: var(--ds-text-xs); font-weight: 450; }
.ds-metric-value { display: block; margin-top: var(--ds-space-3); color: var(--ds-ink); font-size: var(--ds-text-2xl); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ds-metric-note { display: block; margin-top: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.6; }
.ds-evidence-list { margin: 0; min-width: 0; }
.ds-evidence-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--ds-space-4); padding-block: var(--ds-space-2); font-size: var(--ds-text-sm); line-height: 1.6; }
.ds-evidence-row dt { color: var(--ds-muted); min-width: 0; }
.ds-evidence-row dd { margin: 0; min-width: 0; color: var(--ds-ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ds-evidence-row dd small { display: block; color: var(--ds-muted); font-size: var(--ds-text-xs); }

/* Task record: a saved, agent-reported continuation record. Text only. */
.ds-task-record { display: grid; gap: var(--ds-space-5); width: 100%; min-width: 0; }
.ds-task-record-lead { display: grid; gap: var(--ds-space-1); min-width: 0; }
.ds-task-record-lead p { margin: 0; color: var(--ds-ink); font-size: var(--ds-text-sm); line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.ds-task-record-lead.is-next { padding: var(--ds-space-3) var(--ds-space-4); background: var(--ds-surface); border-radius: var(--ds-radius-control); }
.ds-task-record-label, .ds-task-record-section > :is(h2, h3, h4, h5, h6) { margin: 0; color: var(--ds-muted); font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); font-weight: 450; letter-spacing: normal; line-height: 1.5; }
.ds-task-record-section { display: grid; gap: var(--ds-space-2); min-width: 0; }
.ds-task-plan, .ds-task-record-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.ds-task-plan-step { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-3); padding-block: var(--ds-space-2); font-size: var(--ds-text-sm); line-height: 1.6; }
.ds-task-plan-text { min-width: 0; overflow-wrap: anywhere; }
.ds-task-plan-step[data-status="done"] .ds-task-plan-text, .ds-task-plan-step[data-status="dropped"] .ds-task-plan-text { color: var(--ds-muted); }
.ds-task-plan-step[data-status="dropped"] .ds-task-plan-text { text-decoration: line-through; }
.ds-task-plan-step > .ds-badge { flex: none; }
.ds-task-record-list > li { padding-block: var(--ds-space-2); color: var(--ds-ink); font-size: var(--ds-text-sm); line-height: 1.6; overflow-wrap: anywhere; }
.ds-task-record-list > li small { display: block; margin-top: var(--ds-space-1); color: var(--ds-muted); font-size: var(--ds-text-xs); }
@media (max-width: 600px) { .ds-task-plan-step { flex-direction: column; gap: var(--ds-space-1); } }

/* Release log: dated changelog entries, newest first. Static, text only. */
.ds-release-log { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; min-width: 0; }
.ds-release-entry { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: var(--ds-space-6); padding-block: var(--ds-space-5); scroll-margin-top: var(--ds-space-8); }
.ds-release-time { display: grid; align-content: start; gap: 0; color: var(--ds-muted); font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); line-height: 1.6; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-release-content { display: grid; justify-items: start; gap: var(--ds-space-2); min-width: 0; }
.ds-release-kind { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.6; }
.ds-release-entry .ds-release-title { margin: 0; color: var(--ds-ink); font-size: var(--ds-text-base); font-weight: 550; line-height: 1.45; letter-spacing: 0; overflow-wrap: anywhere; }
.ds-release-entry .ds-release-summary { margin: 0; max-width: 68ch; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.75; overflow-wrap: anywhere; }
.ds-release-refs { display: flex; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-4); margin: 0; font-size: var(--ds-text-sm); line-height: 1.6; font-variant-numeric: tabular-nums; }
.ds-release-refs a { color: var(--ds-muted); }
@media (hover: hover) { .ds-release-refs a:hover { color: var(--ds-ink); } }
@media (max-width: 600px) {
  .ds-release-entry { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-3); padding-block: var(--ds-space-5); }
  .ds-release-time { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
  .ds-release-refs a { display: inline-flex; align-items: center; min-height: 44px; }
}
.ds-disclosure-indicator { display: inline-flex; flex-shrink: 0; transition: transform var(--ds-duration-fast) var(--ds-ease-out); }
.ds-disclosure-toggle[aria-expanded='true'] .ds-disclosure-indicator { transform: rotate(180deg); }
[data-input='keyboard'] .ds-disclosure-indicator { transition: none; }
.ds-status-dot { display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@media (max-width: 600px) { .ds-panel-header, .ds-panel-body, .ds-panel-footer, .ds-metric { padding: var(--ds-space-4); } }

/* Visual selection keeps native radio behavior and one label-sized target. */
.ds-choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.ds-choice-group > legend { max-width: 100%; padding: 0; margin-bottom: var(--ds-space-3); color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 550; }
.ds-choice-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: var(--ds-space-3); }
.ds-choice-card { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: visible; border: 1px solid var(--ds-input-border); border-radius: var(--ds-radius-card); background: var(--ds-surface); cursor: pointer; }
html[data-design-system] .ds-choice-card > input[type='radio'] { position: absolute; z-index: 1; top: var(--ds-space-4); right: var(--ds-space-4); width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--ds-accent); }
.ds-choice-visual { display: grid; place-items: center; min-height: var(--ds-choice-preview-min-height); padding: var(--ds-space-3); overflow: hidden; border-radius: calc(var(--ds-radius-card) - 1px) calc(var(--ds-radius-card) - 1px) 0 0; background: var(--ds-paper); }
.ds-choice-copy { display: grid; gap: var(--ds-space-2); min-width: 0; padding: var(--ds-space-4); }
.ds-choice-title { color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 550; line-height: 1.5; }
.ds-choice-description { color: var(--ds-muted); font-size: var(--ds-text-xs); font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
.ds-choice-card:has(input:checked) { border-color: var(--ds-accent); box-shadow: inset 0 0 0 1px var(--ds-accent); }
.ds-choice-card:has(input:focus-visible) { outline: 2px solid var(--ds-accent); outline-offset: 3px; }
.ds-choice-card:has(input:disabled), .ds-choice-group:disabled .ds-choice-card { opacity: .55; cursor: not-allowed; }
.ds-layout-preview { display: block; width: 100%; height: auto; max-height: 150px; }
@media (hover: hover) and (pointer: fine) { .ds-choice-card:hover:not(:has(input:disabled)) { border-color: var(--ds-ink); } }

/* Public notes and work summaries consume the same neutral card vocabulary. */
.ds-highlight-card { display: flex; flex-direction: column; min-width: 0; padding: 0; overflow: clip; }
.ds-highlight-visual { display: grid; place-items: center; min-width: 0; aspect-ratio: var(--ds-highlight-art-ratio); overflow: hidden; background: var(--ds-paper); }
.ds-highlight-art { display: block; width: 100%; height: 100%; }
.ds-highlight-content { display: grid; gap: var(--ds-space-3); min-width: 0; padding: var(--ds-space-6); }
.ds-highlight-title { color: var(--ds-ink); font-size: var(--ds-text-xl); font-weight: 500; letter-spacing: 0; line-height: 1.35; overflow-wrap: anywhere; }
.ds-highlight-description { color: var(--ds-muted); font-size: var(--ds-text-base); line-height: 1.8; overflow-wrap: anywhere; }
.ds-highlight-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-xs); }
.ds-highlight-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-3); margin-top: var(--ds-space-2); }
.ds-highlight-disclosure { min-width: 0; padding-top: var(--ds-space-3); }
.ds-highlight-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); min-height: 44px; color: var(--ds-muted); font-size: var(--ds-text-sm); cursor: pointer; list-style: none; }
.ds-highlight-disclosure > summary::-webkit-details-marker { display: none; }
.ds-highlight-disclosure > summary .ds-disclosure-indicator { margin-left: auto; }
.ds-highlight-disclosure[open] > summary .ds-disclosure-indicator { transform: rotate(180deg); }
.ds-highlight-disclosure > p { margin-top: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.8; }
.ds-focus-row { display: flex; align-items: flex-start; gap: var(--ds-space-3); min-width: 0; padding: var(--ds-space-5); border: 0; border-radius: var(--ds-radius-card); background: var(--ds-surface); }
.ds-focus-mark { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border: 0; border-radius: var(--ds-radius-control); background: var(--ds-paper); }
.ds-focus-mark.ds-product-logo-frame { color: var(--ds-inverse-ink); background: var(--ds-inverse); }
.ds-focus-content { flex: 1; min-width: 0; display: grid; gap: var(--ds-space-2); }
.ds-focus-label { color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.5; }
.ds-focus-title { color: var(--ds-ink); font-size: var(--ds-text-base); font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; }
.ds-focus-description { color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.65; overflow-wrap: anywhere; }
.ds-focus-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-xs); }
.ds-week-pulse { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); gap: var(--ds-space-1); min-width: 0; margin: 0; padding: var(--ds-space-1); list-style: none; overflow-x: auto; scrollbar-width: thin; }
.ds-week-day { min-width: 0; }
html[data-design-system] .ds-week-button { display: grid; grid-template-rows: var(--ds-week-bar-height) auto auto; align-items: end; gap: var(--ds-space-1); width: 100%; min-width: 44px; min-height: 118px; padding: var(--ds-space-2); border: 1px solid transparent; border-radius: var(--ds-radius-control); color: var(--ds-ink); background: transparent; box-shadow: none; text-align: center; line-height: 1.4; transform: none; transition: none; }
.ds-week-bar { position: relative; display: block; width: 100%; height: var(--ds-week-bar-height); overflow: hidden; border-radius: 3px; background: var(--ds-surface-soft); }
.ds-week-bar-fill { position: absolute; inset: 0; display: block; background: var(--ds-chart-3); transform: scaleY(var(--ds-pulse-ratio, 0)); transform-origin: center bottom; }
.ds-week-label { color: var(--ds-muted); font-size: var(--ds-text-xs); }
.ds-week-count { color: var(--ds-ink); font-size: var(--ds-text-xs); font-variant-numeric: tabular-nums; }
html[data-design-system] .ds-week-button:hover:not(:disabled) { background: var(--ds-surface-soft); border-color: transparent; transform: none; }
html[data-design-system] .ds-week-pulse .ds-week-button[aria-pressed='true'] { border-color: var(--ds-accent); background: var(--ds-surface); }
html[data-design-system] .ds-week-button:focus-visible { outline-offset: -2px; }
@media (max-width: 600px) { .ds-highlight-content { padding: var(--ds-space-4); } }
@media (forced-colors: active) {
  .ds-choice-card, .ds-focus-row { border-color: CanvasText; }
  .ds-choice-card:has(input:checked) { outline: 2px solid Highlight; }
  .ds-week-bar { border: 1px solid CanvasText; background: Canvas; }
  .ds-week-bar-fill { background: Highlight; }
}

/* The gallery is an isolated review surface, not an application layout contract. */
.ds-gallery { background: var(--ds-paper); }
.ds-gallery-shell { width: min(1120px, calc(100% - 80px)); margin: auto; }
.ds-gallery-header { min-height: 80px; display: flex; justify-content: space-between; align-items: center; gap: var(--ds-space-6); }
.ds-gallery-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 22px; font-weight: 600; }
.ds-gallery-brand img { width: 28px; height: 28px; }
.ds-gallery-header nav { display: flex; flex-wrap: wrap; gap: var(--ds-space-6); font-size: var(--ds-text-sm); color: var(--ds-muted); }
.ds-gallery-header nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.ds-gallery-header nav a:hover { color: var(--ds-ink); }
.ds-gallery-hero { padding: var(--ds-space-20) 0 var(--ds-space-12); }
.ds-gallery-hero .ds-heading-group { --ds-gap-title-body: var(--ds-space-5); max-width: 680px; }
.ds-gallery-hero h1 { font-size: clamp(36px, 4.6vw, 52px); line-height: 1.12; font-weight: 600; }
.ds-gallery-hero p { color: var(--ds-muted); font-size: var(--ds-text-lg); line-height: 1.7; }
.ds-gallery-hero .ds-row { margin-top: var(--ds-space-8); }
.ds-gallery-rules-title { margin-top: var(--ds-space-12); }
.ds-gallery-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-2) var(--ds-space-10); margin: var(--ds-space-6) 0 0; padding-left: var(--ds-space-5); color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.7; }
.ds-gallery-section { padding: var(--ds-space-16) 0; scroll-margin-top: var(--ds-space-6); }
.ds-gallery-section-heading { display: grid; gap: var(--ds-space-3); max-width: 680px; margin-bottom: var(--ds-space-8); }
.ds-gallery-section-heading h2 { font-size: 28px; font-weight: 600; line-height: 1.2; }
.ds-gallery-section-heading > p { font-size: var(--ds-text-base); line-height: 1.7; color: var(--ds-muted); }
.ds-gallery-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: var(--ds-space-6); }
.ds-gallery-swatch { display: grid; gap: var(--ds-space-1); font-size: var(--ds-text-sm); }
.ds-gallery-swatch::before { content: ''; display: block; height: 72px; margin-bottom: var(--ds-space-2); border-radius: var(--ds-radius-card); background: var(--ds-swatch); }
.ds-gallery-swatch strong { font-weight: 500; }
.ds-gallery-swatch code { color: var(--ds-muted); font-size: var(--ds-text-xs); }
.ds-gallery-swatch[data-color='paper'] { --ds-swatch: var(--ds-paper); }
.ds-gallery-swatch[data-color='paper']::before { box-shadow: inset 0 0 0 1px var(--ds-input-border); }
.ds-gallery-swatch[data-color='surface'] { --ds-swatch: var(--ds-surface); }
.ds-gallery-swatch[data-color='ink'] { --ds-swatch: var(--ds-ink); }
.ds-gallery-swatch[data-color='muted'] { --ds-swatch: var(--ds-muted); }
.ds-gallery-swatch[data-color='accent'] { --ds-swatch: var(--ds-accent); }
.ds-gallery-swatch[data-color='input'] { --ds-swatch: var(--ds-input-border); }
.ds-gallery-swatch[data-color='success'] { --ds-swatch: var(--ds-success); }
.ds-gallery-swatch[data-color='warning'] { --ds-swatch: var(--ds-warning); }
.ds-gallery-swatch[data-color='danger'] { --ds-swatch: var(--ds-danger); }
.ds-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-6); }
.ds-gallery-card-title { font-size: var(--ds-text-lg); font-weight: 550; }
.ds-gallery-card-copy { color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.8; margin-top: var(--ds-space-3); }
.ds-gallery-card-example { min-height: 120px; margin-top: var(--ds-space-6); display: flex; align-items: flex-start; flex-direction: column; justify-content: center; gap: var(--ds-space-4); }
.ds-gallery-constrained { width: min(100%, 220px); }
.ds-gallery-profile-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--ds-space-3); }
.ds-gallery-type-sample { font-size: clamp(28px, 3.2vw, 40px); font-weight: 600; line-height: 1.18; }
.ds-gallery-type-grid { margin-top: var(--ds-space-12); }
.ds-gallery-products { margin-top: var(--ds-space-12); }
.ds-gallery-products .ds-heading-group { max-width: 630px; }
.ds-gallery-avatar-examples { display: flex; flex-wrap: wrap; gap: var(--ds-space-6); margin-top: var(--ds-space-6); }
.ds-gallery-avatar-example { display: flex; align-items: center; gap: var(--ds-space-3); font-size: var(--ds-text-sm); }
.ds-gallery-avatar-copy { margin-top: var(--ds-space-12); }
.ds-gallery-mono-sample { font-family: var(--ds-font-mono); font-size: clamp(18px, 2.2vw, 24px); line-height: 1.5; }
.ds-gallery-form { display: grid; gap: var(--ds-space-4); margin-top: var(--ds-space-6); }
.ds-gallery-loading { display: grid; gap: var(--ds-space-4); width: 100%; min-height: 112px; }
.ds-gallery-footer { padding: var(--ds-space-8) 0 var(--ds-space-12); font-size: var(--ds-text-sm); color: var(--ds-muted); }
.ds-gallery-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-6); margin-bottom: var(--ds-space-6); }
.ds-gallery-chart { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); margin-top: var(--ds-space-6); color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-gallery-chart-swatch { width: 28px; height: 28px; border-radius: 4px; }
.ds-gallery-chart-swatch[data-level="0"] { background: var(--ds-chart-0); }
.ds-gallery-chart-swatch[data-level="1"] { background: var(--ds-chart-1); }
.ds-gallery-chart-swatch[data-level="2"] { background: var(--ds-chart-2); }
.ds-gallery-chart-swatch[data-level="3"] { background: var(--ds-chart-3); }
.ds-gallery-chart-swatch[data-level="4"] { background: var(--ds-chart-4); }
.ds-gallery-highlight-slot { min-width: 0; min-height: 420px; }
.ds-gallery-week-example { margin-top: var(--ds-space-6); }
.ds-gallery-week-example .ds-hint { margin-top: var(--ds-space-4); }
.ds-gallery-preview-stage { display: flex; flex-direction: column; justify-content: center; min-height: 230px; }
.ds-gallery-disclosure { display: grid; justify-items: start; gap: var(--ds-space-3); margin-top: var(--ds-space-6); }
.ds-gallery-disclosure-panel { display: flex; flex-wrap: wrap; gap: var(--ds-space-4); padding: var(--ds-space-4) 0; }
.ds-gallery-disclosure-panel a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-gallery-workspace { margin-top: var(--ds-space-6); }
.ds-gallery-workspace .ds-tabs { padding-inline: var(--ds-space-5); }
.ds-gallery-workspace-row { display: flex; justify-content: space-between; align-items: center; gap: var(--ds-space-4); padding-block: var(--ds-space-3); }
.ds-gallery-workspace-row > div { min-width: 0; }
.ds-gallery-workspace-row p { margin-top: var(--ds-space-1); color: var(--ds-muted); font-size: var(--ds-text-sm); }
@media (max-width: 760px) {
  .ds-gallery-shell { width: calc(100% - 32px); }
  .ds-gallery-header { align-items: flex-start; justify-content: center; flex-direction: column; gap: var(--ds-space-2); padding: var(--ds-space-5) 0; }
  .ds-gallery-header nav { gap: var(--ds-space-5); }
  .ds-gallery-hero { padding: var(--ds-space-12) 0 var(--ds-space-8); }
  .ds-gallery-rules { grid-template-columns: 1fr; }
  .ds-gallery-section { padding: var(--ds-space-10) 0; }
  .ds-gallery-grid { grid-template-columns: 1fr; gap: var(--ds-space-4); }
  .ds-gallery-section-heading h2 { font-size: 24px; }
  .ds-gallery-metrics { grid-template-columns: 1fr; }
  .ds-gallery-workspace-row { flex-wrap: wrap; align-items: flex-start; }
}
@media (pointer: coarse), (max-width: 600px) {
  /* Marked-root specificity preserves touch targets over compact surface rules. */
  html[data-design-system] body :is(button, [role='tab'], summary, .button, .button-link, .ds-button, .ds-touch-target) { min-height: 44px; min-width: 44px; }
}
@media (max-width: 600px) {
  html[data-design-system] :is(input, select, textarea):not([type='checkbox']):not([type='radio']) { font-size: var(--ds-text-input); }
  html[data-design-system] :is(input, select):not([type='checkbox']):not([type='radio']) { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --ds-duration-fast: 0ms; --ds-duration-base: 0ms; --ds-duration-slow: 0ms; }
  :is(button, .button, .button-link, .ds-button, .ds-dialog, .ds-toast) { transition: none; }
  :is(button, .button, .button-link, .ds-button):hover, :is(button, .button, .button-link, .ds-button):active { transform: none !important; }
  .ds-spinner, .spin, .ds-skeleton, .ds-skeleton::after, .ds-progress-fill, .ds-feedback-icon, .ds-disclosure-indicator { animation: none !important; transition: none; }
  .ds-skeleton::after { opacity: 0; }
  .ds-progress[data-indeterminate='true'] .ds-progress-fill { transform: translateX(75%); }
  html[data-design-system] .spin, html[data-design-system] .skeleton-line { animation: none; }
  .ds-spinner { border-style: dashed; }
  .ds-dialog[open] { transform: none; }
  .ds-motif-intro :is(.ds-motif-rings, .ds-motif-core, .ds-motif-node) { animation: none; transform: none; opacity: 1; }
  html[data-design-system] :where(button, .button, .button-link):hover, html[data-design-system] :where(button, .button, .button-link):active { transform: none !important; }
  .ds-sticker--left, .ds-sticker--right { transform: none; }
}
@media (forced-colors: active) {
  .ds-badge, .ds-sticker, .ds-card, input, select, textarea { border-color: CanvasText; }
  .ds-sticker, .ds-card, .ds-dialog { box-shadow: none; }
  .ds-skeleton { background: GrayText; }
  .ds-skeleton::after { display: none; }
  .ds-progress { border: 1px solid CanvasText; background: Canvas; }
  .ds-progress-fill { background: Highlight; }
}

/* ── Marketing kit ─────────────────────────────────────────────────────────
   Public-page components modeled on developer-platform sites: hairline
   containers, cursor spotlight, terminal windows, stats and a dot-grid glow.
   The app keeps the plain grammar above; these primitives are for public pages
   and the gallery. Layout belongs in marketing.css. */
:root {
  --ds-hairline: #222826;
  --ds-hairline-strong: #343c39;
  --ds-surface-raised: #151918;
  --ds-glow: rgb(119 217 173 / .16);
  --ds-glow-soft: rgb(119 217 173 / .06);
  --ds-dot: rgb(237 237 237 / .07);
  --ds-reveal-distance: 14px;
  --ds-duration-reveal: 640ms;
}

/* Icon from a local Lucide SVG, tinted with currentColor: <span class="ds-icon" data-icon="brain">. No inline styles, so it works under a strict style-src. */
/* lucide:css:start */
.ds-icon[data-icon='activity'] { --icon: url('/vendor/lucide/activity.svg'); }
.ds-icon[data-icon='archive'] { --icon: url('/vendor/lucide/archive.svg'); }
.ds-icon[data-icon='arrow-down'] { --icon: url('/vendor/lucide/arrow-down.svg'); }
.ds-icon[data-icon='arrow-down-up'] { --icon: url('/vendor/lucide/arrow-down-up.svg'); }
.ds-icon[data-icon='arrow-left'] { --icon: url('/vendor/lucide/arrow-left.svg'); }
.ds-icon[data-icon='arrow-right'] { --icon: url('/vendor/lucide/arrow-right.svg'); }
.ds-icon[data-icon='arrow-up'] { --icon: url('/vendor/lucide/arrow-up.svg'); }
.ds-icon[data-icon='arrow-up-right'] { --icon: url('/vendor/lucide/arrow-up-right.svg'); }
.ds-icon[data-icon='badge-check'] { --icon: url('/vendor/lucide/badge-check.svg'); }
.ds-icon[data-icon='bell'] { --icon: url('/vendor/lucide/bell.svg'); }
.ds-icon[data-icon='book-open'] { --icon: url('/vendor/lucide/book-open.svg'); }
.ds-icon[data-icon='bookmark'] { --icon: url('/vendor/lucide/bookmark.svg'); }
.ds-icon[data-icon='bot'] { --icon: url('/vendor/lucide/bot.svg'); }
.ds-icon[data-icon='brain'] { --icon: url('/vendor/lucide/brain.svg'); }
.ds-icon[data-icon='calendar'] { --icon: url('/vendor/lucide/calendar.svg'); }
.ds-icon[data-icon='check'] { --icon: url('/vendor/lucide/check.svg'); }
.ds-icon[data-icon='check-check'] { --icon: url('/vendor/lucide/check-check.svg'); }
.ds-icon[data-icon='chevron-down'] { --icon: url('/vendor/lucide/chevron-down.svg'); }
.ds-icon[data-icon='chevron-left'] { --icon: url('/vendor/lucide/chevron-left.svg'); }
.ds-icon[data-icon='chevron-right'] { --icon: url('/vendor/lucide/chevron-right.svg'); }
.ds-icon[data-icon='chevron-up'] { --icon: url('/vendor/lucide/chevron-up.svg'); }
.ds-icon[data-icon='chevrons-up-down'] { --icon: url('/vendor/lucide/chevrons-up-down.svg'); }
.ds-icon[data-icon='circle-alert'] { --icon: url('/vendor/lucide/circle-alert.svg'); }
.ds-icon[data-icon='circle-check'] { --icon: url('/vendor/lucide/circle-check.svg'); }
.ds-icon[data-icon='circle-dashed'] { --icon: url('/vendor/lucide/circle-dashed.svg'); }
.ds-icon[data-icon='circle-dot'] { --icon: url('/vendor/lucide/circle-dot.svg'); }
.ds-icon[data-icon='circle-help'] { --icon: url('/vendor/lucide/circle-help.svg'); }
.ds-icon[data-icon='circle-play'] { --icon: url('/vendor/lucide/circle-play.svg'); }
.ds-icon[data-icon='circle-user'] { --icon: url('/vendor/lucide/circle-user.svg'); }
.ds-icon[data-icon='circle-x'] { --icon: url('/vendor/lucide/circle-x.svg'); }
.ds-icon[data-icon='clock'] { --icon: url('/vendor/lucide/clock.svg'); }
.ds-icon[data-icon='cloud'] { --icon: url('/vendor/lucide/cloud.svg'); }
.ds-icon[data-icon='code'] { --icon: url('/vendor/lucide/code.svg'); }
.ds-icon[data-icon='command'] { --icon: url('/vendor/lucide/command.svg'); }
.ds-icon[data-icon='copy'] { --icon: url('/vendor/lucide/copy.svg'); }
.ds-icon[data-icon='corner-down-left'] { --icon: url('/vendor/lucide/corner-down-left.svg'); }
.ds-icon[data-icon='credit-card'] { --icon: url('/vendor/lucide/credit-card.svg'); }
.ds-icon[data-icon='database'] { --icon: url('/vendor/lucide/database.svg'); }
.ds-icon[data-icon='download'] { --icon: url('/vendor/lucide/download.svg'); }
.ds-icon[data-icon='ellipsis'] { --icon: url('/vendor/lucide/ellipsis.svg'); }
.ds-icon[data-icon='external-link'] { --icon: url('/vendor/lucide/external-link.svg'); }
.ds-icon[data-icon='eye'] { --icon: url('/vendor/lucide/eye.svg'); }
.ds-icon[data-icon='eye-off'] { --icon: url('/vendor/lucide/eye-off.svg'); }
.ds-icon[data-icon='file-text'] { --icon: url('/vendor/lucide/file-text.svg'); }
.ds-icon[data-icon='files'] { --icon: url('/vendor/lucide/files.svg'); }
.ds-icon[data-icon='filter'] { --icon: url('/vendor/lucide/filter.svg'); }
.ds-icon[data-icon='flame'] { --icon: url('/vendor/lucide/flame.svg'); }
.ds-icon[data-icon='folder'] { --icon: url('/vendor/lucide/folder.svg'); }
.ds-icon[data-icon='git-branch'] { --icon: url('/vendor/lucide/git-branch.svg'); }
.ds-icon[data-icon='git-commit-horizontal'] { --icon: url('/vendor/lucide/git-commit-horizontal.svg'); }
.ds-icon[data-icon='git-pull-request'] { --icon: url('/vendor/lucide/git-pull-request.svg'); }
.ds-icon[data-icon='globe'] { --icon: url('/vendor/lucide/globe.svg'); }
.ds-icon[data-icon='hash'] { --icon: url('/vendor/lucide/hash.svg'); }
.ds-icon[data-icon='history'] { --icon: url('/vendor/lucide/history.svg'); }
.ds-icon[data-icon='house'] { --icon: url('/vendor/lucide/house.svg'); }
.ds-icon[data-icon='inbox'] { --icon: url('/vendor/lucide/inbox.svg'); }
.ds-icon[data-icon='info'] { --icon: url('/vendor/lucide/info.svg'); }
.ds-icon[data-icon='key-round'] { --icon: url('/vendor/lucide/key-round.svg'); }
.ds-icon[data-icon='keyboard'] { --icon: url('/vendor/lucide/keyboard.svg'); }
.ds-icon[data-icon='layers'] { --icon: url('/vendor/lucide/layers.svg'); }
.ds-icon[data-icon='layout-grid'] { --icon: url('/vendor/lucide/layout-grid.svg'); }
.ds-icon[data-icon='life-buoy'] { --icon: url('/vendor/lucide/life-buoy.svg'); }
.ds-icon[data-icon='link'] { --icon: url('/vendor/lucide/link.svg'); }
.ds-icon[data-icon='list'] { --icon: url('/vendor/lucide/list.svg'); }
.ds-icon[data-icon='loader-circle'] { --icon: url('/vendor/lucide/loader-circle.svg'); }
.ds-icon[data-icon='lock'] { --icon: url('/vendor/lucide/lock.svg'); }
.ds-icon[data-icon='log-in'] { --icon: url('/vendor/lucide/log-in.svg'); }
.ds-icon[data-icon='log-out'] { --icon: url('/vendor/lucide/log-out.svg'); }
.ds-icon[data-icon='mail'] { --icon: url('/vendor/lucide/mail.svg'); }
.ds-icon[data-icon='megaphone'] { --icon: url('/vendor/lucide/megaphone.svg'); }
.ds-icon[data-icon='menu'] { --icon: url('/vendor/lucide/menu.svg'); }
.ds-icon[data-icon='message-square'] { --icon: url('/vendor/lucide/message-square.svg'); }
.ds-icon[data-icon='minus'] { --icon: url('/vendor/lucide/minus.svg'); }
.ds-icon[data-icon='moon'] { --icon: url('/vendor/lucide/moon.svg'); }
.ds-icon[data-icon='more-horizontal'] { --icon: url('/vendor/lucide/more-horizontal.svg'); }
.ds-icon[data-icon='notebook-pen'] { --icon: url('/vendor/lucide/notebook-pen.svg'); }
.ds-icon[data-icon='panel-left'] { --icon: url('/vendor/lucide/panel-left.svg'); }
.ds-icon[data-icon='pause'] { --icon: url('/vendor/lucide/pause.svg'); }
.ds-icon[data-icon='pencil'] { --icon: url('/vendor/lucide/pencil.svg'); }
.ds-icon[data-icon='play'] { --icon: url('/vendor/lucide/play.svg'); }
.ds-icon[data-icon='plug'] { --icon: url('/vendor/lucide/plug.svg'); }
.ds-icon[data-icon='plug-zap'] { --icon: url('/vendor/lucide/plug-zap.svg'); }
.ds-icon[data-icon='plus'] { --icon: url('/vendor/lucide/plus.svg'); }
.ds-icon[data-icon='radio'] { --icon: url('/vendor/lucide/radio.svg'); }
.ds-icon[data-icon='refresh-cw'] { --icon: url('/vendor/lucide/refresh-cw.svg'); }
.ds-icon[data-icon='rotate-ccw'] { --icon: url('/vendor/lucide/rotate-ccw.svg'); }
.ds-icon[data-icon='route'] { --icon: url('/vendor/lucide/route.svg'); }
.ds-icon[data-icon='search'] { --icon: url('/vendor/lucide/search.svg'); }
.ds-icon[data-icon='settings-2'] { --icon: url('/vendor/lucide/settings-2.svg'); }
.ds-icon[data-icon='share-2'] { --icon: url('/vendor/lucide/share-2.svg'); }
.ds-icon[data-icon='shield-check'] { --icon: url('/vendor/lucide/shield-check.svg'); }
.ds-icon[data-icon='sliders-horizontal'] { --icon: url('/vendor/lucide/sliders-horizontal.svg'); }
.ds-icon[data-icon='sparkles'] { --icon: url('/vendor/lucide/sparkles.svg'); }
.ds-icon[data-icon='sun'] { --icon: url('/vendor/lucide/sun.svg'); }
.ds-icon[data-icon='tag'] { --icon: url('/vendor/lucide/tag.svg'); }
.ds-icon[data-icon='terminal'] { --icon: url('/vendor/lucide/terminal.svg'); }
.ds-icon[data-icon='trash-2'] { --icon: url('/vendor/lucide/trash-2.svg'); }
.ds-icon[data-icon='triangle-alert'] { --icon: url('/vendor/lucide/triangle-alert.svg'); }
.ds-icon[data-icon='trophy'] { --icon: url('/vendor/lucide/trophy.svg'); }
.ds-icon[data-icon='unlock'] { --icon: url('/vendor/lucide/unlock.svg'); }
.ds-icon[data-icon='upload'] { --icon: url('/vendor/lucide/upload.svg'); }
.ds-icon[data-icon='user'] { --icon: url('/vendor/lucide/user.svg'); }
.ds-icon[data-icon='user-plus'] { --icon: url('/vendor/lucide/user-plus.svg'); }
.ds-icon[data-icon='users'] { --icon: url('/vendor/lucide/users.svg'); }
.ds-icon[data-icon='wifi-off'] { --icon: url('/vendor/lucide/wifi-off.svg'); }
.ds-icon[data-icon='workflow'] { --icon: url('/vendor/lucide/workflow.svg'); }
.ds-icon[data-icon='x'] { --icon: url('/vendor/lucide/x.svg'); }
.ds-icon[data-icon='zap'] { --icon: url('/vendor/lucide/zap.svg'); }
/* lucide:css:end */
.ds-icon { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ds-icon-tile { display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); font-size: 16px; }
.ds-icon-tile[data-tone='accent'] { color: var(--ds-accent); }

/* Icon + label above a heading. */
.ds-kicker { display: inline-flex; align-items: center; gap: var(--ds-space-2); color: var(--ds-muted); font-size: var(--ds-text-sm); font-weight: 500; line-height: 1.4; }
.ds-kicker > .ds-icon { color: var(--ds-accent); font-size: 15px; }

/* Announcement pill: a quiet link to the latest release. */
.ds-announce { display: inline-flex; align-items: center; gap: var(--ds-space-2); max-width: 100%; min-height: 32px; padding: 4px 12px 4px 4px; color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-pill); font-size: var(--ds-text-sm); line-height: 1.3; text-decoration: none; transition: border-color var(--ds-duration-base) var(--ds-ease-out), background-color var(--ds-duration-base) var(--ds-ease-out); }
.ds-announce-label { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; color: var(--ds-accent-ink); background: var(--ds-accent); border-radius: var(--ds-radius-pill); font-size: var(--ds-text-xs); font-weight: 600; white-space: nowrap; }
.ds-announce-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-announce > .ds-icon { color: var(--ds-muted); transition: transform var(--ds-duration-base) var(--ds-ease-out); }
@media (hover: hover) { .ds-announce:hover { border-color: var(--ds-accent); } .ds-announce:hover > .ds-icon { transform: translateX(3px); color: var(--ds-ink); } }

/* Hairline card with a cursor-following glow (marketing-site.js sets --mx/--my). */
.ds-spotlight { position: relative; isolation: isolate; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline); border-radius: var(--ds-radius-panel); transition: border-color var(--ds-duration-slow) var(--ds-ease-out); }
.ds-spotlight::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--ds-glow), transparent 62%); transition: opacity var(--ds-duration-slow) var(--ds-ease-out); pointer-events: none; }
@media (hover: hover) { .ds-spotlight:hover { border-color: var(--ds-hairline-strong); } .ds-spotlight:hover::before { opacity: 1; } }
a.ds-spotlight { color: inherit; text-decoration: none; }
a.ds-spotlight:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* Terminal / code window with optional tabs and copy action. */
.ds-window { min-width: 0; overflow: hidden; background: #0c0e0d; border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-panel); box-shadow: 0 24px 64px rgb(0 0 0 / .45); }
.ds-window-bar { display: flex; align-items: center; gap: var(--ds-space-3); min-height: 40px; padding: 0 var(--ds-space-3) 0 var(--ds-space-4); border-bottom: 1px solid var(--ds-hairline); color: var(--ds-muted); font-size: var(--ds-text-xs); }
.ds-window-dots { display: inline-flex; gap: 6px; } .ds-window-dots > span { width: 10px; height: 10px; border-radius: 50%; background: var(--ds-hairline-strong); }
.ds-window-title { display: inline-flex; align-items: center; gap: var(--ds-space-2); min-width: 0; overflow: hidden; color: var(--ds-ink); white-space: nowrap; text-overflow: ellipsis; }
.ds-window-title > img { width: 16px; height: 16px; }
.ds-window-bar > :last-child:not(:first-child) { margin-left: auto; }
.ds-window-body { margin: 0; padding: var(--ds-space-5); overflow-x: auto; color: var(--ds-ink); background: transparent; border-radius: 0; font-family: var(--ds-font-mono); font-size: var(--ds-text-sm); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.ds-window-tabs { display: flex; gap: 2px; min-width: 0; padding: 0 var(--ds-space-2); overflow-x: auto; border-bottom: 1px solid var(--ds-hairline); scrollbar-width: none; }
.ds-window-tabs [role='tab'] { position: relative; flex-shrink: 0; min-height: 40px; padding: 0 var(--ds-space-3); color: var(--ds-muted); background: none; border: 0; border-radius: 0; font-size: var(--ds-text-xs); font-weight: 500; }
.ds-window-tabs [role='tab']::after { content: ''; position: absolute; inset: auto var(--ds-space-3) -1px; height: 1px; background: var(--ds-accent); transform: scaleX(0); transition: transform var(--ds-duration-base) var(--ds-ease-out); }
.ds-window-tabs [role='tab'][aria-selected='true'] { color: var(--ds-ink); }
.ds-window-tabs [role='tab'][aria-selected='true']::after { transform: scaleX(1); }
.ds-window-tabs [role='tab']:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: -2px; }
.ds-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px; color: var(--ds-muted); background: transparent; border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); font-size: var(--ds-text-xs); }
.ds-copy[data-copied='true'] { color: var(--ds-accent); border-color: var(--ds-accent); }
@media (hover: hover) { .ds-copy:hover { color: var(--ds-ink); border-color: var(--ds-input-border); } }
.ds-term-prompt { color: var(--ds-accent); user-select: none; }
.ds-term-muted { color: var(--ds-muted); }
.ds-term-ok { color: var(--ds-success); }
.ds-caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: var(--ds-accent); animation: ds-caret 1s steps(1) infinite; }
@keyframes ds-caret { 50% { opacity: 0; } }

/* Stat with an accent rule above it. */
.ds-stat { display: grid; align-content: start; gap: var(--ds-space-2); padding-top: var(--ds-space-5); border-top: 1px solid var(--ds-hairline-strong); position: relative; }
.ds-stat::before { content: ''; position: absolute; top: -1px; left: 0; width: 48px; height: 1px; background: var(--ds-accent); }
.ds-stat-value { color: var(--ds-ink); font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ds-stat-label { color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.5; }

/* Hairline accordion for questions. */
.ds-accordion { border-top: 1px solid var(--ds-hairline); }
.ds-accordion > details { border-bottom: 1px solid var(--ds-hairline); }
.ds-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-4); min-height: 56px; padding-block: var(--ds-space-4); color: var(--ds-ink); font-size: var(--ds-text-base); font-weight: 500; cursor: pointer; list-style: none; }
.ds-accordion summary::-webkit-details-marker { display: none; }
.ds-accordion summary::after { content: ''; flex-shrink: 0; width: 16px; height: 16px; background: var(--ds-muted); -webkit-mask: url('/vendor/lucide/plus.svg') center / contain no-repeat; mask: url('/vendor/lucide/plus.svg') center / contain no-repeat; transition: transform var(--ds-duration-base) var(--ds-ease-out); }
.ds-accordion details[open] summary::after { transform: rotate(45deg); background: var(--ds-accent); }
.ds-accordion summary:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-accordion details > :not(summary) { max-width: 70ch; margin: 0 0 var(--ds-space-5); color: var(--ds-muted); line-height: 1.8; }

/* Dot grid with a soft accent glow, for a hero or closing call to action. */
.ds-dotgrid { position: relative; isolation: isolate; }
.ds-dotgrid::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(var(--ds-dot) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); pointer-events: none; }
.ds-dotgrid::after { content: ''; position: absolute; inset: -10% 10% auto; height: 70%; z-index: -1; background: radial-gradient(ellipse at 50% 0%, var(--ds-glow), transparent 65%); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%); mask-image: linear-gradient(to bottom, transparent, #000 40%); pointer-events: none; }

/* Line grid variant: a fine grid that fades out from the center. The glow
   drifts in from above once, then holds still. */
.ds-dotgrid[data-variant='grid']::before { background-image: linear-gradient(var(--ds-dot) 1px, transparent 1px), linear-gradient(90deg, var(--ds-dot) 1px, transparent 1px); background-size: 32px 32px; background-position: center top; }
.ds-dotgrid[data-spotlight]::after { animation: ds-spotlight-in 1800ms var(--ds-ease-out) both; }
@keyframes ds-spotlight-in { from { opacity: 0; transform: translateY(-12%) scale(.92); } }

/* Bento grid: mixed card spans. Each card has a visual area (a labeled example
   of real UI) above a title and one line. Layout lives here because the spans
   are part of the pattern; page spacing stays in marketing.css. */
.ds-bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ds-space-4); }
.ds-bento > [data-span='wide'] { grid-column: span 2; }
.ds-bento > [data-span='tall'] { grid-row: span 2; }
.ds-bento-card { position: relative; display: grid; grid-template-rows: 1fr auto; gap: var(--ds-space-5); min-width: 0; padding: var(--ds-space-6); overflow: hidden; background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline); border-radius: var(--ds-radius-panel); box-shadow: inset 0 1px 0 rgb(255 255 255 / .03); }
.ds-bento-visual { display: grid; place-items: center; min-height: 140px; transition: transform var(--ds-duration-slow) var(--ds-ease-out); }
.ds-bento-card h3 { margin: 0; font-size: var(--ds-text-lg); font-weight: 500; }
.ds-bento-card p { margin: var(--ds-space-2) 0 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.65; }
@media (hover: hover) { .ds-bento-card:hover .ds-bento-visual { transform: translateY(-3px); } }
@media (max-width: 900px) { .ds-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ds-bento > [data-span='tall'] { grid-row: auto; } }
@media (max-width: 600px) { .ds-bento { grid-template-columns: minmax(0, 1fr); } .ds-bento > [data-span='wide'] { grid-column: auto; } }

/* Glowing border: a short mint arc on the card edge that turns toward the
   pointer. marketing-site.js sets --ds-glow-angle and data-glow. */
@property --ds-glow-angle { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
.ds-glow-border { position: relative; }
.ds-glow-border::after { content: ''; position: absolute; inset: 0; z-index: 2; padding: 1px; border-radius: inherit; background: conic-gradient(from calc(var(--ds-glow-angle) - 40deg), transparent 0deg, var(--ds-accent) 40deg, transparent 80deg); -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); opacity: 0; transition: opacity var(--ds-duration-slow) var(--ds-ease-out), --ds-glow-angle 160ms linear; pointer-events: none; }
.ds-glow-border[data-glow='true']::after { opacity: .9; }

/* Word reveal for a hero headline: marketing-site.js wraps each word of
   [data-words] once, and each fades in as its blur clears. */
html.ds-js [data-words] .ds-word { display: inline-block; animation: ds-word-in 700ms var(--ds-ease-out) both; animation-delay: calc(var(--ds-i, 0) * 70ms); }
@keyframes ds-word-in { from { opacity: 0; transform: translateY(6px); filter: blur(8px); } }

/* Logo marquee: a duplicated, aria-hidden list scrolls; it pauses on hover and stops for reduced motion. */
.ds-marquee { --ds-marquee-gap: var(--ds-space-10); display: flex; gap: var(--ds-marquee-gap); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ds-marquee > ul { display: flex; flex-shrink: 0; align-items: center; gap: var(--ds-marquee-gap); min-width: 100%; margin: 0; padding: 0; list-style: none; animation: ds-marquee 48s linear infinite; }
.ds-marquee:hover > ul, .ds-marquee:focus-within > ul { animation-play-state: paused; }
.ds-marquee li { display: inline-flex; align-items: center; gap: var(--ds-space-2); color: var(--ds-muted); font-size: var(--ds-text-sm); white-space: nowrap; transition: color var(--ds-duration-base) var(--ds-ease-out); }
.ds-marquee li img { filter: grayscale(1) brightness(1.4); opacity: .72; transition: filter var(--ds-duration-base) var(--ds-ease-out), opacity var(--ds-duration-base) var(--ds-ease-out); }
.ds-marquee li img[data-tone='mono'] { filter: invert(1) grayscale(1); }
@media (hover: hover) { .ds-marquee li:hover { color: var(--ds-ink); } .ds-marquee li:hover img { filter: none; opacity: 1; } .ds-marquee li:hover img[data-tone='mono'] { filter: invert(1); } }
@keyframes ds-marquee { to { transform: translateX(calc(-100% - var(--ds-marquee-gap))); } }

/* Scroll reveal. Hidden only after marketing-site.js marks the root, so content shows without JavaScript. */
html.ds-js [data-reveal] { opacity: 0; transform: translateY(var(--ds-reveal-distance)); transition: opacity var(--ds-duration-reveal) var(--ds-ease-out), transform var(--ds-duration-reveal) var(--ds-ease-out); transition-delay: var(--ds-reveal-delay, 0ms); }
html.ds-js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Navigation menu panel (header dropdowns). */
.ds-menu { position: absolute; top: calc(100% + 8px); left: -8px; z-index: 40; display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: var(--ds-space-1); width: max-content; max-width: min(560px, calc(100vw - 32px)); padding: var(--ds-space-2); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-panel); box-shadow: var(--ds-shadow-dialog); opacity: 0; transform: translateY(-4px) scale(.99); filter: blur(var(--ds-enter-blur)); transform-origin: top left; visibility: hidden; transition: opacity var(--ds-duration-exit) var(--ds-ease-out), transform var(--ds-duration-exit) var(--ds-ease-out), filter var(--ds-duration-exit) var(--ds-ease-out), visibility 0s linear var(--ds-duration-exit); }
.ds-menu[data-open='true'] { opacity: 1; transform: none; filter: none; visibility: visible; transition-duration: var(--ds-duration-overlay); transition-delay: 0s; }
@starting-style { .ds-menu[data-open='true'] { transform: translateY(-4px) scale(var(--ds-enter-scale)); } }
.ds-menu a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 2px var(--ds-space-3); align-items: start; padding: var(--ds-space-3); color: var(--ds-ink); border-radius: var(--ds-radius-card); text-decoration: none; }
.ds-menu a > .ds-icon-tile { grid-row: span 2; }
.ds-menu a > strong { font-size: var(--ds-text-sm); font-weight: 500; line-height: 1.4; }
.ds-menu a > span:last-child { color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.5; }
.ds-menu a:is(:hover, :focus-visible) { background: var(--ds-surface); outline: none; }
.ds-menu a:is(:hover, :focus-visible) > .ds-icon-tile { color: var(--ds-accent); border-color: var(--ds-accent); }

@media (prefers-reduced-motion: reduce) {
  .ds-marquee { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; }
  .ds-marquee > ul { flex-wrap: wrap; min-width: 0; animation: none; }
  .ds-marquee > ul[aria-hidden='true'] { display: none; }
  html.ds-js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .ds-caret { animation: none; }
  .ds-menu, .ds-announce > .ds-icon, .ds-spotlight, .ds-spotlight::before { transition: none; }
  .ds-dotgrid[data-spotlight]::after, html.ds-js [data-words] .ds-word { animation: none; }
  .ds-bento-visual, .ds-glow-border::after { transition: none; }
}
@media (forced-colors: active) { .ds-spotlight, .ds-window, .ds-announce, .ds-menu { border-color: CanvasText; } .ds-icon { background: CanvasText; } }

/* Gallery layout for the marketing kit examples. */
.ds-gallery-kit { display: grid; gap: var(--ds-space-8); }
.ds-gallery-kit > .ds-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-5); }
.ds-gallery-kit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--ds-space-4); }
.ds-gallery-kit-card { gap: var(--ds-space-3); padding: var(--ds-space-6); }
.ds-gallery-kit-card > span:last-child { color: var(--ds-muted); }
.ds-gallery-kit-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-8); }
.ds-gallery-kit-words { max-width: 30ch; margin: 0; padding: var(--ds-space-8); font-size: var(--ds-text-xl); font-weight: 500; text-align: center; }
.ds-gallery-slide-examples { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-8); }
.ds-gallery-segmented { display: inline-flex; padding: 2px; background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); }
html[data-design-system] .ds-gallery-segmented > button { min-height: 28px; padding: 0 10px; color: var(--ds-muted); background: transparent; border: 0; border-radius: 4px; box-shadow: none; font-size: var(--ds-text-sm); }
html[data-design-system] .ds-gallery-segmented > button[aria-pressed='true'] { color: var(--ds-ink); }
.ds-gallery-segmented > .ds-slide-indicator { background: var(--ds-paper); border-radius: 4px; box-shadow: 0 0 0 1px var(--ds-hairline-strong); }
.ds-gallery-kit-glow { display: grid; place-items: center; min-height: 160px; color: var(--ds-muted); border: 1px solid var(--ds-hairline); border-radius: var(--ds-radius-panel); overflow: hidden; }
@media (max-width: 700px) { .ds-gallery-kit-grid, .ds-gallery-kit-stats { grid-template-columns: 1fr; } }

/* ── Identity and motion (app and public) ──────────────────────────────────
   Product marks in tiles, connection presence, status icons, row entrance and
   live-update flash, empty-state art. Motion is functional: it marks arrival,
   live state or pending work, and stops for reduced motion. */
:root {
  --ds-mark-xs: 18px; --ds-mark-sm: 22px; --ds-mark-md: 28px; --ds-mark-lg: 40px; --ds-mark-xl: 56px;
  --ds-duration-enter: 420ms;
  --ds-stagger-step: 28ms;
  --ds-duration-flash: 1800ms;
  --ds-pulse-duration: 2000ms;
}
.ds-mark { --size: var(--ds-mark-md); position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--size); height: var(--size); color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: calc(var(--size) * .28); line-height: 1; vertical-align: middle; transition: border-color var(--ds-duration-base) var(--ds-ease-out), transform var(--ds-duration-base) var(--ds-ease-out); }
.ds-mark[data-size='xs'] { --size: var(--ds-mark-xs); }
.ds-mark[data-size='sm'] { --size: var(--ds-mark-sm); }
.ds-mark[data-size='lg'] { --size: var(--ds-mark-lg); }
.ds-mark[data-size='xl'] { --size: var(--ds-mark-xl); }
.ds-mark > :is(svg, img) { display: block; width: 64%; height: 64%; object-fit: contain; }
.ds-mark > .ds-agent-avatar { width: 100%; height: 100%; border-radius: inherit; }
/* A self-described or owner-chosen logo fills the tile, like the generated face. */
.ds-mark > img.agent-logo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ds-mark > svg.icon:not(.brand-icon) { width: 58%; height: 58%; color: var(--ds-muted); }
/* One-color marks are fill="currentColor" SVG files; as <img> they render black, so lighten them. */
img.brand-icon[data-tone='mono'], .ds-product-logo[data-tone='mono'] { filter: invert(1) brightness(.93); }
.ds-mark[data-presence]::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: max(8px, calc(var(--size) * .3)); height: max(8px, calc(var(--size) * .3)); background: var(--ds-muted); border: 2px solid var(--ds-paper); border-radius: 50%; box-sizing: border-box; }
.ds-mark[data-presence='recent']::after, .ds-mark[data-presence='working']::after { background: var(--ds-success); }
.ds-mark[data-presence='reconnect']::after { background: var(--ds-danger); }
.ds-mark[data-presence='quiet']::after { background: var(--ds-hairline-strong); }
.ds-mark[data-presence='working']::before { content: ''; position: absolute; right: -3px; bottom: -3px; width: max(8px, calc(var(--size) * .3)); height: max(8px, calc(var(--size) * .3)); border-radius: 50%; background: var(--ds-success); animation: ds-presence-pulse var(--ds-pulse-duration) var(--ds-ease-out) infinite; }
.ds-mark[data-presence='working'] { border-color: rgb(131 220 176 / .55); box-shadow: 0 0 0 3px rgb(131 220 176 / .08); }
@keyframes ds-presence-pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
.ds-mark-stack { display: inline-flex; align-items: center; }
.ds-mark-stack > .ds-mark { box-shadow: 0 0 0 2px var(--ds-paper); }
.ds-mark-stack > .ds-mark + .ds-mark { margin-left: calc(var(--ds-mark-sm) * -.3); }
.ds-mark-stack > .ds-mark { transition: transform 320ms var(--ds-ease-spring), border-color var(--ds-duration-base) var(--ds-ease-out); }
@media (hover: hover) {
  .ds-mark-stack > .ds-mark:hover { z-index: 1; transform: translateY(-4px) scale(1.05); }
  .ds-mark-stack > .ds-mark:hover + .ds-mark, .ds-mark-stack > .ds-mark:has(+ .ds-mark:hover) { transform: translateY(-2px); }
}
.ds-mark-more { color: var(--ds-muted); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Status with an icon: running spins, the rest stay still. */
.ds-status-icon { display: inline-flex; align-items: center; gap: 6px; }
.ds-status-icon > .icon { flex-shrink: 0; }
.ds-status-icon[data-state='running'] > .icon { color: var(--ds-accent); animation: ds-spin 1.1s linear infinite; }
.ds-status-icon[data-state='completed'] > .icon { color: var(--ds-success); }
.ds-status-icon[data-state='failed'] > .icon { color: var(--ds-danger); }
.ds-status-icon[data-state='stale'] > .icon, .ds-status-icon[data-state='unknown'] > .icon { color: var(--ds-warning); }
@keyframes ds-spin { to { transform: rotate(360deg); } }
.ds-spin { animation: ds-spin 900ms linear infinite; }

/* Entrance and live updates. */
.ds-stagger > * { animation: ds-enter var(--ds-duration-enter) var(--ds-ease-out) both; animation-delay: calc(var(--ds-i, 0) * var(--ds-stagger-step)); }
@keyframes ds-enter { from { opacity: 0; transform: translateY(6px) scale(.99); filter: blur(var(--ds-enter-blur)); } }
.ds-flash { animation: ds-flash var(--ds-duration-flash) var(--ds-ease-out); }
@keyframes ds-flash { 0% { background-color: rgb(119 217 173 / .14); box-shadow: inset 2px 0 0 var(--ds-accent); } 100% { background-color: transparent; box-shadow: inset 2px 0 0 transparent; } }
.ds-row-hover { border-radius: var(--ds-radius-card); transition: background-color var(--ds-duration-fast) var(--ds-ease-out); }
@media (hover: hover) { .ds-row-hover:hover { background: var(--ds-hover-bg); } }

/* Pressed-tab underline for button tab sets (aria-pressed or aria-selected). */
.ds-tab-underline { position: relative; }
.ds-tab-underline::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--ds-accent); transform: scaleX(0); transform-origin: left; transition: transform var(--ds-duration-slow) var(--ds-ease-out); }
.ds-tab-underline:is([aria-pressed='true'], [aria-selected='true'])::after { transform: scaleX(1); }

/* Sliding indicator: slidingIndicator(container) adds one pill or underline that
   glides to the selected tab or segment. Each item's own underline is hidden. */
.ds-slide-host { position: relative; isolation: isolate; }
.ds-slide-indicator { position: absolute; z-index: -1; left: 0; top: 0; width: var(--ds-slide-w, 0); height: var(--ds-slide-h, 0); transform: translate(var(--ds-slide-x, 0), var(--ds-slide-y, 0)); border-radius: var(--ds-radius-control); background: var(--ds-selected-bg); opacity: 0; transition: transform var(--ds-duration-overlay) var(--ds-ease-out), width var(--ds-duration-overlay) var(--ds-ease-out), height var(--ds-duration-overlay) var(--ds-ease-out), opacity var(--ds-duration-fast) var(--ds-ease-out); pointer-events: none; }
.ds-slide-indicator[data-ready] { opacity: 1; }
.ds-slide-indicator[data-variant='underline'] { z-index: 1; border-radius: 2px; background: var(--ds-accent); }
.ds-slide-host[data-slide='underline'] .ds-tab-underline::after { display: none; }
html[data-design-system] .ds-slide-host[data-slide='underline'] > .ds-tab { border-bottom-color: transparent; }
.ds-slide-host[data-slide='pill'] > :is([aria-pressed='true'], [aria-selected='true'], [aria-current='page'], [data-active='true']) { background: transparent; }
.ds-slide-indicator:not([data-ready]) { transition: none; }

/* Text or icon swap: swapContent() replays a 150ms rise and blur on change. */
.ds-swap { display: inline-block; animation: ds-swap 150ms var(--ds-ease-out); }

/* Content replacing a skeleton fades in as the blur clears. */
.ds-reveal-content { animation: ds-reveal-content 400ms var(--ds-ease-out) both; }
@keyframes ds-reveal-content { from { opacity: 0; filter: blur(var(--ds-enter-blur)); } }

/* Empty state art. */
.ds-empty { display: grid; justify-items: center; gap: var(--ds-space-3); padding: var(--ds-space-12) var(--ds-space-6); text-align: center; }
.ds-empty-art { position: relative; display: grid; place-items: center; width: 112px; height: 112px; margin-bottom: var(--ds-space-2); }
.ds-empty-art::before { content: ''; position: absolute; inset: 8px; border: 1px dashed var(--ds-hairline-strong); border-radius: 50%; }
.ds-empty-art::after { content: ''; position: absolute; inset: 20%; background: radial-gradient(circle, var(--ds-glow), transparent 70%); }
.ds-empty-tile { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; color: var(--ds-accent); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 14px; }
.ds-empty-tile > .icon { width: 22px; height: 22px; }
.ds-empty-orbit { position: absolute; inset: 8px; border-radius: 50%; animation: ds-spin 14s linear infinite; }
.ds-empty-orbit::before { content: ''; position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--ds-accent); opacity: .8; }
.ds-empty-orbit:nth-child(2) { animation-duration: 20s; animation-direction: reverse; } .ds-empty-orbit:nth-child(2)::before { background: var(--ds-muted); opacity: .6; width: 4px; height: 4px; }
.ds-empty-orbit:nth-child(3) { inset: 26px; animation-duration: 9s; } .ds-empty-orbit:nth-child(3)::before { width: 4px; height: 4px; }
.ds-empty-title { margin: 0; font-size: var(--ds-text-lg); font-weight: 500; }
.ds-empty-description { max-width: 46ch; margin: 0; color: var(--ds-muted); line-height: 1.65; }

@media (prefers-reduced-motion: reduce) {
  .ds-mark[data-presence]::before, .ds-status-icon > .icon, .ds-spin, .ds-empty-orbit, .ds-stagger > *, .ds-flash, .ds-swap, .ds-reveal-content { animation: none !important; }
  .ds-tab-underline::after, .ds-mark, .ds-row-hover, .ds-slide-indicator, .ds-mark-stack > .ds-mark { transition: none; }
  .ds-mark-stack > .ds-mark:hover, .ds-mark-stack > .ds-mark:hover + .ds-mark, .ds-mark-stack > .ds-mark:has(+ .ds-mark:hover) { transform: none; }
}
@media (forced-colors: active) { .ds-mark { border-color: CanvasText; } .ds-mark[data-presence]::after { background: CanvasText; } }

/* Gallery layout for identity, icons and motion. */
.ds-gallery-identity { display: grid; gap: var(--ds-space-5); }
.ds-gallery-identity > h3 { margin: var(--ds-space-4) 0 0; }
.ds-gallery-presence-row, .ds-gallery-identity-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-6); }
.ds-gallery-presence { display: inline-flex; align-items: center; gap: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-gallery-rows { display: grid; gap: 2px; max-width: 520px; }
.ds-topbar.ds-gallery-topbar { position: relative; z-index: auto; flex-wrap: wrap; height: auto; min-height: var(--ds-topbar-height); padding-block: var(--ds-space-2); border: 1px solid var(--ds-hairline); border-radius: var(--ds-radius-card); }
.ds-gallery-topbar-actions { flex-wrap: wrap; margin-left: auto; gap: var(--ds-space-2); }
.ds-gallery-row { padding: var(--ds-space-3); color: var(--ds-ink); font-size: var(--ds-text-sm); }
.ds-gallery-brand-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--ds-space-3) var(--ds-space-4); margin: 0; padding: 0; list-style: none; }
.ds-gallery-brand-wall > li { display: flex; align-items: center; gap: var(--ds-space-2); min-width: 0; color: var(--ds-ink); font-size: var(--ds-text-sm); }
.ds-gallery-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: var(--ds-space-2); margin: 0; padding: 0; list-style: none; }
.ds-gallery-icon-grid > li { display: grid; justify-items: center; gap: 6px; padding: var(--ds-space-3) var(--ds-space-2); color: var(--ds-muted); border-radius: var(--ds-radius-card); font-size: 11px; text-align: center; overflow-wrap: anywhere; }
.ds-gallery-icon-grid > li > .icon { color: var(--ds-ink); }
@media (hover: hover) { .ds-gallery-icon-grid > li:hover { background: var(--ds-surface-raised); color: var(--ds-ink); } }

/* ── App shell (dashboard grammar) ─────────────────────────────────────────
   Top bar with slash breadcrumbs and switchers, an icon rail that expands on
   hover, bordered list panels with mono headers, pills, top-right toasts, a route
   progress bar, banners, switches and a ⌘K palette. */
:root { --ds-topbar-height: 48px; --ds-rail-width: 56px; --ds-rail-expanded: 220px; --ds-panel-head: 36px; --ds-mono-label: 11px; }
kbd, .ds-kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; color: var(--ds-muted); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-bottom-width: 2px; border-radius: 5px; font-family: var(--ds-font-sans); font-size: 11px; font-weight: 500; line-height: 1; }
.ds-mono-label { color: var(--ds-muted); font-family: var(--ds-font-mono); font-size: var(--ds-mono-label); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }

.ds-pill { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; color: var(--ds-muted); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 5px; font-family: var(--ds-font-mono); font-size: 10px; font-weight: 500; letter-spacing: .04em; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.ds-pill[data-tone='accent'], .ds-pill[data-tone='success'] { color: var(--ds-accent); background: rgb(119 217 173 / .08); border-color: rgb(119 217 173 / .35); }
.ds-pill[data-tone='warning'] { color: var(--ds-warning); background: rgb(237 198 134 / .08); border-color: rgb(237 198 134 / .35); }
.ds-pill[data-tone='danger'] { color: var(--ds-danger); background: rgb(240 170 165 / .08); border-color: rgb(240 170 165 / .35); }

/* Top bar */
.ds-topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--ds-space-3); height: var(--ds-topbar-height); padding: 0 var(--ds-space-4); background: var(--ds-paper); border-bottom: 1px solid var(--ds-hairline); }
.ds-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: var(--ds-text-sm); }
.ds-crumb-sep { padding: 0 6px; color: var(--ds-hairline-strong); font-size: 18px; font-weight: 300; user-select: none; }
.ds-crumb { display: inline-flex; align-items: center; gap: var(--ds-space-2); min-width: 0; min-height: 30px; padding: 0 8px; color: var(--ds-ink); background: none; border: 0; border-radius: var(--ds-radius-control); font: inherit; font-weight: 500; white-space: nowrap; }
.ds-crumb > .icon.icon-chevrons-up-down { color: var(--ds-muted); }
button.ds-crumb:hover, a.ds-crumb:hover { background: var(--ds-surface-raised); }
.ds-search-trigger { display: inline-flex; align-items: center; gap: var(--ds-space-2); width: 200px; height: 30px; padding: 0 6px 0 10px; color: var(--ds-muted); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); font: inherit; font-size: var(--ds-text-sm); text-align: left; cursor: pointer; transition: border-color var(--ds-duration-fast) var(--ds-ease-out); }
.ds-search-trigger > span { flex: 1; }
.ds-search-trigger:hover { border-color: var(--ds-input-border); color: var(--ds-ink); }
.ds-topbar-button { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--ds-muted); background: transparent; border: 1px solid var(--ds-hairline-strong); border-radius: 50%; cursor: pointer; text-decoration: none; transition: color var(--ds-duration-fast) var(--ds-ease-out), background-color var(--ds-duration-fast) var(--ds-ease-out), border-color var(--ds-duration-fast) var(--ds-ease-out); }
.ds-topbar-button:hover { color: var(--ds-ink); background-color: var(--ds-hover-bg); border-color: var(--ds-hover-border); }
/* Text actions in the top bar (Share, Feedback) share the icon buttons' height and border. */
.ds-topbar-action, .ds-topbar .ds-topbar-action { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; height: 30px; padding: 0 10px; color: var(--ds-muted); background: transparent; border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); box-shadow: none; font: inherit; font-size: var(--ds-text-xs); font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer; transition: color var(--ds-duration-fast) var(--ds-ease-out), background-color var(--ds-duration-fast) var(--ds-ease-out), border-color var(--ds-duration-fast) var(--ds-ease-out); }
.ds-topbar-action:hover, .ds-topbar .ds-topbar-action:hover { color: var(--ds-ink); background-color: var(--ds-hover-bg); border-color: var(--ds-hover-border); }
/* Every top bar control is one height; general button rules must not stretch search. */
.ds-topbar .ds-search-trigger { min-height: 30px; height: 30px; border-color: var(--ds-hairline-strong); }
.ds-topbar .ds-search-trigger:hover { border-color: var(--ds-input-border); }
@media (pointer: coarse), (max-width: 600px) { .ds-topbar-action, .ds-topbar .ds-topbar-action { min-height: 44px; height: 44px; } .ds-topbar-button { width: 44px; height: 44px; } }

/* Icon rail: 56px; labels slide in on hover or keyboard focus. */
.ds-rail { position: fixed; top: var(--ds-topbar-height); bottom: 0; left: 0; z-index: 25; display: flex; flex-direction: column; gap: 2px; width: var(--ds-rail-width); padding: var(--ds-space-2); overflow: hidden; background: var(--ds-paper); border-right: 1px solid var(--ds-hairline); transition: width var(--ds-duration-slow) var(--ds-ease-out), box-shadow var(--ds-duration-slow) var(--ds-ease-out); }
.ds-rail:is(:hover, :focus-within) { width: var(--ds-rail-expanded); box-shadow: 12px 0 32px rgb(0 0 0 / .35); }
.ds-rail a, .ds-rail button { display: flex; align-items: center; gap: var(--ds-space-3); flex-shrink: 0; height: 38px; padding: 0 10px; color: var(--ds-muted); background: none; border: 0; border-radius: var(--ds-radius-control); font: inherit; font-size: var(--ds-text-sm); text-decoration: none; white-space: nowrap; cursor: pointer; }
.ds-rail a > .icon, .ds-rail button > .icon { flex-shrink: 0; width: 18px; height: 18px; }
.ds-rail a > span, .ds-rail button > span { opacity: 0; transition: opacity var(--ds-duration-base) var(--ds-ease-out); }
.ds-rail:is(:hover, :focus-within) a > span, .ds-rail:is(:hover, :focus-within) button > span { opacity: 1; }
.ds-rail a:hover, .ds-rail button:hover { color: var(--ds-ink); background: var(--ds-surface-raised); }
.ds-rail a[aria-current='page'] { color: var(--ds-ink); background: var(--ds-surface-raised); box-shadow: inset 2px 0 0 var(--ds-accent); }
.ds-rail a[aria-current='page'] > .icon { color: var(--ds-accent); }
.ds-rail-sep { flex-shrink: 0; height: 1px; margin: var(--ds-space-2) 6px; background: var(--ds-hairline); }
.ds-rail-bottom { margin-top: auto; display: grid; gap: 2px; }

/* Bordered list panel with a mono header row and footer bar. */
.ds-panel-list { overflow: hidden; background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.ds-panel-head { display: flex; align-items: center; gap: var(--ds-space-4); min-height: var(--ds-panel-head); padding: 0 var(--ds-space-4); background: var(--ds-surface-raised); border-bottom: 1px solid var(--ds-hairline-strong); color: var(--ds-muted); font-family: var(--ds-font-mono); font-size: var(--ds-mono-label); letter-spacing: .04em; text-transform: uppercase; }
.ds-panel-list > :not(.ds-panel-head, .ds-panel-foot) + :not(.ds-panel-head, .ds-panel-foot) { border-top: 1px solid var(--ds-hairline); }
.ds-panel-foot { display: flex; align-items: center; gap: var(--ds-space-3); min-height: 40px; padding: 0 var(--ds-space-4); color: var(--ds-muted); background: var(--ds-surface-raised); border-top: 1px solid var(--ds-hairline-strong); font-size: var(--ds-text-xs); }

/* Dashed empty box. */
.ds-empty[data-variant='dashed'] { border: 1px dashed var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }

/* Skeleton rows that shimmer while a list loads. */
.ds-skeleton-row { display: grid; grid-template-columns: 28px 1fr 120px 80px; align-items: center; gap: var(--ds-space-4); padding: var(--ds-space-4); }
.ds-skeleton-row > span { height: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--ds-surface-raised) 0%, #232926 40%, var(--ds-surface-raised) 80%); background-size: 300% 100%; animation: ds-shimmer 1.4s ease-in-out infinite; }
.ds-skeleton-row > span:first-child { height: 28px; border-radius: 8px; }
.ds-skeleton-row > span:nth-child(2) { width: 70%; }
@keyframes ds-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Route progress. */
.ds-route-progress { position: fixed; top: 0; left: 0; z-index: 100; height: 2px; width: 0; background: var(--ds-accent); box-shadow: 0 0 8px var(--ds-accent); opacity: 0; pointer-events: none; }
.ds-route-progress[data-active] { opacity: 1; width: 80%; transition: width 4s cubic-bezier(.1, .7, .2, 1), opacity 120ms; }
.ds-route-progress[data-done] { width: 100%; opacity: 0; transition: width 200ms var(--ds-ease-out), opacity 300ms 160ms; }

/* Toasts: top-right, stacked, with a countdown hairline. */
.ds-toast-region { position: fixed; top: calc(var(--ds-topbar-height) + 8px); right: 16px; z-index: 200; display: grid; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
/* Toasts share one grid cell. Older ones peek 12px below, smaller and dimmer;
   hovering the stack fans them out using offsets measured by showToast(). */
.ds-toast-region > .ds-toast-item { grid-area: 1 / 1; transform: translateY(calc(var(--ds-toast-depth, 0) * 12px)) scale(calc(1 - var(--ds-toast-depth, 0) * .06)); transform-origin: top center; transition: transform var(--ds-duration-overlay) var(--ds-ease-out), opacity var(--ds-duration-overlay) var(--ds-ease-out), filter var(--ds-duration-overlay) var(--ds-ease-out); }
.ds-toast-region > .ds-toast-item:nth-child(2) { --ds-toast-depth: 1; opacity: .7; z-index: -1; }
.ds-toast-region > .ds-toast-item:nth-child(3) { --ds-toast-depth: 2; opacity: .4; z-index: -2; filter: blur(1px); }
.ds-toast-region:is(:hover, :focus-within) > .ds-toast-item { transform: translateY(var(--ds-toast-offset, 0)); opacity: 1; filter: none; }
.ds-toast-item { position: relative; display: flex; align-items: center; gap: var(--ds-space-3); padding: 10px 10px 10px 12px; overflow: hidden; color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); box-shadow: var(--ds-shadow-dialog); font-size: var(--ds-text-sm); pointer-events: auto; animation: ds-toast-in 350ms var(--ds-ease-out); }
.ds-toast-item[data-leaving] { animation: ds-toast-out 200ms var(--ds-ease-out) forwards; }
.ds-toast-icon { display: inline-grid; flex-shrink: 0; color: var(--ds-success); }
.ds-toast-icon[hidden] { display: none; }
.ds-toast-item[data-tone='danger'] .ds-toast-icon { color: var(--ds-danger); }
.ds-toast-item[data-tone='info'] .ds-toast-icon { color: var(--ds-muted); }
.ds-toast-text { flex: 1; min-width: 0; }
.ds-toast-item[data-tone='pending'] .ds-toast-icon { color: var(--ds-accent); }
.ds-toast-item[data-tone='pending'] .ds-toast-timer { display: none; }
/* A toast that changes state in place swaps its icon and words with a short blur. */
.ds-toast-item[data-swapped] :is(.ds-toast-icon, .ds-toast-text) { animation: ds-swap var(--ds-duration-overlay) var(--ds-ease-out); }
.ds-toast-action { min-height: 26px; padding: 0 8px; color: var(--ds-ink); background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); font-size: var(--ds-text-xs); }
.ds-toast-close { display: inline-grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; color: var(--ds-muted); background: none; border: 0; font-size: 16px; }
.ds-toast-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--ds-accent); opacity: .5; transform-origin: left; animation: ds-toast-timer var(--ds-toast-duration, 4200ms) linear forwards; }
.ds-toast-item[data-tone='danger'] .ds-toast-timer { background: var(--ds-danger); }
.ds-toast-item[data-paused] .ds-toast-timer { animation-play-state: paused; }
@keyframes ds-toast-in { from { opacity: 0; translate: 0 -16px; scale: var(--ds-enter-scale); filter: blur(var(--ds-enter-blur)); } }
@keyframes ds-toast-out { to { opacity: 0; translate: 16px 0; filter: blur(var(--ds-enter-blur)); } }
@keyframes ds-toast-timer { to { transform: scaleX(0); } }

/* Banner. */
.ds-banner { display: flex; align-items: center; gap: var(--ds-space-4); padding: var(--ds-space-4); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.ds-banner-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; color: var(--ds-accent); background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: 9px; }
.ds-banner[data-tone='warning'] .ds-banner-icon { color: var(--ds-warning); }
.ds-banner[data-tone='danger'] .ds-banner-icon { color: var(--ds-danger); }
.ds-banner-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
.ds-banner-copy > strong { font-size: var(--ds-text-sm); font-weight: 500; }
.ds-banner-copy > span { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-banner-close { display: inline-grid; place-items: center; width: 28px; height: 28px; min-height: 0; padding: 0; color: var(--ds-muted); background: none; border: 0; font-size: 18px; }

/* Switch: <input type="checkbox" class="ds-switch">. */
input.ds-switch { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 34px; height: 20px; min-height: 0; margin: 0; padding: 0; background: var(--ds-hairline-strong); border: 0; border-radius: 999px; cursor: pointer; transition: background-color var(--ds-duration-base) var(--ds-ease-out); }
input.ds-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--ds-ink); border-radius: 50%; transition: transform 350ms var(--ds-ease-spring); }
input.ds-switch:checked { background: var(--ds-accent); }
input.ds-switch:checked::after { transform: translateX(14px); background: var(--ds-accent-ink); }
input.ds-switch:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
input.ds-switch:disabled { opacity: .5; cursor: not-allowed; }

/* ⌘K palette. */
.ds-palette { width: min(560px, calc(100vw - 32px)); max-height: min(480px, 70vh); margin: 12vh auto auto; padding: 0; overflow: hidden; color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-panel); box-shadow: var(--ds-shadow-dialog); }
.ds-palette[open] { display: flex; flex-direction: column; animation: ds-palette-in var(--ds-duration-overlay) var(--ds-ease-out); }
.ds-palette::backdrop { background: rgb(0 0 0 / .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: ds-fade-in 200ms var(--ds-ease-out); }
.ds-palette-search { display: flex; align-items: center; gap: var(--ds-space-3); padding: 0 var(--ds-space-4); border-bottom: 1px solid var(--ds-hairline-strong); }
.ds-palette-search input { flex: 1; min-height: 48px; padding: 0; color: var(--ds-ink); background: transparent; border: 0; outline: none; font-size: var(--ds-text-base); }
.ds-palette-list { position: relative; flex: 1; overflow-y: auto; padding: var(--ds-space-2); }
/* One highlight glides to the active option instead of each option lighting up. */
.ds-palette-highlight { position: absolute; left: var(--ds-space-2); right: var(--ds-space-2); top: 0; height: var(--ds-palette-h, 38px); background: var(--ds-paper); border-radius: var(--ds-radius-control); transform: translateY(var(--ds-palette-y, 0)); transition: transform 160ms var(--ds-ease-out), height 160ms var(--ds-ease-out); pointer-events: none; }
.ds-palette-highlight[hidden] { display: none; }
.ds-palette-option { position: relative; }
.ds-palette-group { padding: var(--ds-space-3) var(--ds-space-2) var(--ds-space-1); color: var(--ds-muted); font-family: var(--ds-font-mono); font-size: var(--ds-mono-label); letter-spacing: .04em; text-transform: uppercase; }
.ds-palette-option { display: flex; align-items: center; gap: var(--ds-space-3); min-height: 38px; padding: 0 var(--ds-space-2); border-radius: var(--ds-radius-control); font-size: var(--ds-text-sm); cursor: pointer; }
.ds-palette-option > span:not(.ds-palette-icon) { flex: 1; }
.ds-palette-option[aria-selected='true'] { background: var(--ds-paper); }
.ds-palette-list:has(> .ds-palette-highlight:not([hidden])) .ds-palette-option[aria-selected='true'] { background: transparent; }
.ds-palette-option[aria-selected='true'] .ds-palette-icon { color: var(--ds-accent); }
.ds-palette-icon { display: inline-grid; color: var(--ds-muted); }
.ds-palette-empty { margin: 0; padding: var(--ds-space-8) var(--ds-space-4); color: var(--ds-muted); text-align: center; }
.ds-palette-footer { padding: var(--ds-space-2) var(--ds-space-4); color: var(--ds-muted); border-top: 1px solid var(--ds-hairline-strong); font-size: var(--ds-text-xs); }
@keyframes ds-palette-in { from { opacity: 0; transform: translateY(var(--ds-enter-rise)) scale(.98); filter: blur(var(--ds-enter-blur)); } }
@keyframes ds-swap { from { opacity: 0; transform: translateY(4px); filter: blur(var(--ds-enter-blur)); } }
@keyframes ds-fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ds-toast-item, .ds-toast-item[data-leaving], .ds-palette[open], .ds-palette::backdrop, .ds-skeleton-row > span, .ds-toast-item[data-swapped] :is(.ds-toast-icon, .ds-toast-text) { animation: none !important; }
  .ds-toast-region > .ds-toast-item, .ds-palette-highlight { transition: none !important; }
  .ds-toast-timer { display: none; }
  .ds-rail, .ds-rail a > span, .ds-route-progress, input.ds-switch, input.ds-switch::after { transition: none !important; }
}
@media (forced-colors: active) { .ds-pill, .ds-panel-list, .ds-banner, .ds-palette, .ds-toast-item { border-color: CanvasText; } }
html[data-design-system] .ds-palette-search input { min-height: 48px; padding: 0; background: transparent; border: 0; box-shadow: none; outline: none; }

/* ── Settings cards, plan cards and preview panel (dashboard grammar) ───────
   A bordered settings card: header (title + one-line description), two-column
   rows (label + muted help left, control right) and a footer bar with
   right-aligned Cancel / Save changes. data-tone="danger" is the red-tinted
   Danger zone. Plan cards ring the current plan in mint. */
.ds-settings { display: grid; gap: var(--ds-space-6); min-width: 0; }
.ds-settings-card { min-width: 0; overflow: hidden; background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.ds-settings-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-2) var(--ds-space-4); padding: var(--ds-space-4) var(--ds-space-5); border-bottom: 1px solid var(--ds-hairline-strong); }
.ds-settings-head > div { display: grid; gap: 2px; min-width: 0; }
.ds-settings-head :is(h2, h3) { display: flex; align-items: center; gap: var(--ds-space-2); margin: 0; font-size: var(--ds-text-base); font-weight: 550; line-height: 1.4; letter-spacing: normal; }
.ds-settings-head p { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.5; }
.ds-settings-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--ds-space-3) var(--ds-space-8); align-items: start; padding: var(--ds-space-5); }
.ds-settings-row + .ds-settings-row, .ds-settings-card > .ds-settings-row-full + .ds-settings-row, .ds-settings-row + .ds-settings-row-full { border-top: 1px solid var(--ds-hairline); }
.ds-settings-row-full { padding: var(--ds-space-5); min-width: 0; }
.ds-settings-label { display: grid; gap: var(--ds-space-1); min-width: 0; }
.ds-settings-label > :is(label, strong, span:first-child) { color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 500; line-height: 1.5; }
.ds-settings-help { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.6; }
.ds-settings-help[role='alert'] { color: var(--ds-danger); }
.ds-settings-control { display: grid; gap: var(--ds-space-2); justify-items: start; min-width: 0; overflow-wrap: anywhere; }
.ds-settings-control > :is(input:not([type='checkbox']):not([type='radio']), select, textarea, .ds-command, .ds-progress) { justify-self: stretch; width: 100%; }
.ds-settings-value { color: var(--ds-ink); font-size: var(--ds-text-sm); line-height: 1.6; font-variant-numeric: tabular-nums; }
.ds-settings-switch { display: inline-flex; align-items: center; gap: var(--ds-space-3); min-height: 32px; color: var(--ds-ink); font-size: var(--ds-text-sm); cursor: pointer; }
.ds-settings-switch:has(input:disabled) { color: var(--ds-muted); cursor: not-allowed; }
.ds-settings-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--ds-space-2); min-height: 52px; padding: var(--ds-space-2) var(--ds-space-5); background: var(--ds-surface-raised); border-top: 1px solid var(--ds-hairline-strong); }
.ds-settings-foot > .ds-settings-note { margin: 0 auto 0 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.5; }
.ds-settings-foot > .ds-settings-note:empty { display: none; }
.ds-settings-foot:has(> .ds-settings-note:only-child:empty) { display: none; }
.ds-settings-foot > .ds-settings-note[role='alert'] { color: var(--ds-danger); }
.ds-settings-card[data-tone='danger'] { border-color: rgb(240 170 165 / .4); }
.ds-settings-card[data-tone='danger'] > .ds-settings-head { background: rgb(240 170 165 / .06); border-bottom-color: rgb(240 170 165 / .3); }
.ds-settings-card[data-tone='danger'] > .ds-settings-head :is(h2, h3) { color: var(--ds-danger); }
.ds-settings-card[data-tone='danger'] > .ds-settings-row + .ds-settings-row { border-top-color: rgb(240 170 165 / .18); }
/* Settings skeleton: label and control blocks that shimmer while a settings card loads. */
.ds-skeleton-row[data-variant='settings'] { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); padding: var(--ds-space-5); }
.ds-skeleton-row[data-variant='settings'] > span:first-child { height: 10px; width: 50%; border-radius: 4px; }
.ds-skeleton-row[data-variant='settings'] > span:nth-child(2) { width: 100%; height: 32px; border-radius: var(--ds-radius-control); }
.ds-skeleton-row[data-variant='settings'] + .ds-skeleton-row { border-top: 1px solid var(--ds-hairline); }

/* Plan cards. data-current rings the plan this workspace is on. */
.ds-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--ds-space-4); }
.ds-plan-card { display: flex; flex-direction: column; gap: var(--ds-space-4); min-width: 0; padding: var(--ds-space-5); background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.ds-plan-card[data-current] { background: var(--ds-surface-raised); border-color: var(--ds-accent); box-shadow: 0 0 0 1px var(--ds-accent), 0 0 24px rgb(119 217 173 / .08); }
.ds-plan-name { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-2); margin: 0; font-size: var(--ds-text-base); font-weight: 550; }
.ds-plan-name > .icon { color: var(--ds-muted); }
.ds-plan-card[data-current] .ds-plan-name > .icon { color: var(--ds-accent); }
.ds-plan-name > .ds-pill { margin-left: auto; }
.ds-plan-description { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.6; }
.ds-plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--ds-space-2); margin: 0; }
.ds-plan-price > strong { font-size: var(--ds-text-2xl); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ds-plan-price > span { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-plan-features { display: grid; gap: var(--ds-space-2); flex: 1; margin: 0; padding: var(--ds-space-4) 0 0; list-style: none; border-top: 1px solid var(--ds-hairline); }
.ds-plan-features > li { display: flex; align-items: flex-start; gap: var(--ds-space-2); font-size: var(--ds-text-sm); line-height: 1.5; }
.ds-plan-features > li > .icon { flex-shrink: 0; margin-top: 2px; color: var(--ds-accent); }
.ds-plan-card > :is(a, button) { justify-content: center; width: 100%; }
.ds-plan-note { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.6; }

/* Usage meter: a label, its measured value and a determinate bar. */
.ds-usage { display: grid; gap: var(--ds-space-2); width: 100%; min-width: 0; }
.ds-usage-line { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-3); font-size: var(--ds-text-sm); }
.ds-usage-line > span:last-child { color: var(--ds-muted); font-variant-numeric: tabular-nums; }
.ds-usage .ds-progress { background: var(--ds-surface-raised); }

/* Preview panel: a bordered panel with a mono header holding a live preview. */
.ds-preview-panel { min-width: 0; overflow: hidden; background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.ds-preview-panel > .ds-panel-head { justify-content: space-between; }
.ds-preview-body { min-width: 0; padding: var(--ds-space-5); }

@media (max-width: 720px) {
  .ds-settings-row, .ds-skeleton-row[data-variant='settings'] { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-3); }
  .ds-settings-head, .ds-settings-row, .ds-settings-row-full { padding-inline: var(--ds-space-4); }
  .ds-settings-foot { padding-inline: var(--ds-space-4); }
  .ds-settings-foot > :is(button, a) { flex: 1 1 auto; }
  .ds-settings-foot > .ds-settings-note { flex-basis: 100%; }
  .ds-preview-body { padding: var(--ds-space-4); }
}
@media (forced-colors: active) { .ds-settings-card, .ds-plan-card, .ds-preview-panel { border-color: CanvasText; } .ds-plan-card[data-current] { outline: 2px solid Highlight; } }

/* ── Entry and setup flows (dashboard grammar) ─────────────────────────────
   Split sign-in (form column + quiet product panel), result states with an
   icon tile (email sent, approved, denied), a setup checklist with a progress
   bar whose steps tick only when a real check arrives, numbered step lists,
   client tabs with product marks and a centered decision card. Surface layout
   stays in its own stylesheet. */
:root { --ds-auth-aside: 46%; --ds-auth-column: 380px; --ds-duration-check: 420ms; }

/* Split sign-in. The aside is decorative context and hides below 960px. */
.ds-auth { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100svh; color: var(--ds-ink); background: var(--ds-paper); }
.ds-auth-main { display: flex; flex-direction: column; gap: var(--ds-space-8); min-width: 0; padding: var(--ds-space-5) var(--ds-space-4) var(--ds-space-6); }
.ds-auth-brand { display: inline-flex; align-items: center; gap: var(--ds-space-2); align-self: flex-start; min-height: 36px; color: var(--ds-ink); font-size: var(--ds-text-lg); font-weight: 600; text-decoration: none; }
.ds-auth-brand > img { width: 24px; height: 24px; }
.ds-auth-body { display: grid; gap: var(--ds-space-6); width: 100%; max-width: var(--ds-auth-column); margin: auto; }
.ds-auth-heading { display: grid; gap: var(--ds-space-2); }
.ds-auth-title { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.2; }
.ds-auth-subtitle { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-base); line-height: 1.6; }
.ds-auth-body form { display: grid; gap: var(--ds-space-4); margin: 0; }
.ds-auth-body .field { display: grid; gap: var(--ds-space-2); color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 500; }
.ds-auth-body .field > input { width: 100%; min-height: 40px; font-size: var(--ds-text-input); font-weight: 400; }
.ds-auth-body button[type='submit'] { justify-content: center; width: 100%; min-height: 40px; }
.ds-auth-legal { display: grid; gap: var(--ds-space-3); justify-items: center; width: 100%; max-width: var(--ds-auth-column); margin: 0 auto; color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.6; text-align: center; }
.ds-auth-legal p { margin: 0; }
.ds-auth-legal a { color: var(--ds-muted); text-underline-offset: 3px; }
.ds-auth-legal a:hover { color: var(--ds-ink); }
.ds-auth-legal nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-space-1) var(--ds-space-4); }
.ds-auth-aside { display: none; }
.ds-auth-statement { display: grid; gap: var(--ds-space-6); max-width: 440px; }
.ds-auth-statement > p { margin: 0; color: var(--ds-ink); font-size: var(--ds-text-xl); font-weight: 500; line-height: 1.4; }
.ds-auth-statement > p > span { color: var(--ds-accent); }
.ds-auth-facts { display: grid; gap: var(--ds-space-3); margin: 0; padding: 0; list-style: none; }
.ds-auth-facts > li { display: flex; align-items: flex-start; gap: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.55; }
.ds-auth-facts > li > .icon { flex-shrink: 0; margin-top: 2px; color: var(--ds-accent); }
@media (min-width: 960px) {
  .ds-auth { grid-template-columns: minmax(0, 1fr) var(--ds-auth-aside); }
  .ds-auth-main { padding: var(--ds-space-6) var(--ds-space-10) var(--ds-space-8); }
  .ds-auth-aside { position: relative; display: grid; place-items: center; padding: var(--ds-space-12); overflow: hidden; background: var(--ds-surface-raised); border-left: 1px solid var(--ds-hairline); }
}

/* Result state: icon tile, title, one line and actions. Tones: accent (default), danger, neutral. */
.ds-result { display: grid; justify-items: start; gap: var(--ds-space-3); min-width: 0; }
.ds-result[data-align='center'] { justify-items: center; text-align: center; }
.ds-result-tile { display: inline-grid; place-items: center; width: 48px; height: 48px; color: var(--ds-accent); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 12px; box-shadow: 0 0 0 6px rgb(119 217 173 / .05); animation: ds-check-pop var(--ds-duration-check) var(--ds-ease-out) both; }
.ds-result-tile > .icon { width: 22px; height: 22px; }
.ds-result[data-tone='danger'] .ds-result-tile { color: var(--ds-danger); box-shadow: 0 0 0 6px rgb(240 170 165 / .05); }
.ds-result[data-tone='neutral'] .ds-result-tile { color: var(--ds-muted); box-shadow: none; }
.ds-result-title { margin: var(--ds-space-1) 0 0; font-size: var(--ds-text-xl); font-weight: 600; line-height: 1.3; }
.ds-result-text { max-width: 52ch; margin: 0; color: var(--ds-muted); font-size: var(--ds-text-base); line-height: 1.6; overflow-wrap: anywhere; }
.ds-result-text strong { color: var(--ds-ink); font-weight: 500; }
@keyframes ds-check-pop { 0% { opacity: 0; transform: scale(.72); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }

/* Centered decision card (device approval, consent). */
.ds-decision { width: 100%; max-width: 480px; margin-inline: auto; padding: var(--ds-space-8); background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-panel); box-shadow: 0 16px 48px rgb(0 0 0 / .28); }
.ds-decision-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-2); }
.ds-decision-actions > :is(button, a) { justify-content: center; min-height: 40px; }

/* Code to compare: large monospace characters on a raised tile. */
.ds-code-compare { display: grid; justify-items: center; gap: var(--ds-space-2); padding: var(--ds-space-5) var(--ds-space-4); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); text-align: center; }
.ds-code-compare > :first-child { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-code-compare > :last-child { color: var(--ds-ink); font-family: var(--ds-font-mono); font-size: clamp(26px, 7vw, 34px); font-weight: 600; letter-spacing: .14em; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* Setup checklist: progress bar + steps. A step ticks only when its real check arrives;
   data-fresh marks a step that completed since the last render and plays the tick once. */
.ds-checklist { min-width: 0; overflow: hidden; background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.ds-checklist-head { display: grid; gap: var(--ds-space-3); padding: var(--ds-space-4) var(--ds-space-5); background: var(--ds-surface-raised); border-bottom: 1px solid var(--ds-hairline-strong); }
.ds-checklist-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-xs); font-variant-numeric: tabular-nums; }
.ds-checklist-head .ds-progress { height: 4px; background: var(--ds-hairline-strong); }
.ds-checklist-head .ds-progress-fill { transition-duration: 600ms; }
.ds-checklist-steps { display: grid; margin: 0; padding: 0; list-style: none; }
.ds-checklist-steps > li { display: flex; align-items: center; gap: var(--ds-space-3); min-height: 48px; padding: var(--ds-space-2) var(--ds-space-5); color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-checklist-steps > li + li { border-top: 1px solid var(--ds-hairline); }
.ds-checklist-steps > li[aria-current='step'] { color: var(--ds-ink); font-weight: 500; background: rgb(119 217 173 / .03); box-shadow: inset 2px 0 0 var(--ds-accent); }
.ds-checklist-steps > li[data-complete='true'] { color: var(--ds-ink); }
.ds-check { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; color: var(--ds-muted); border: 1.5px dashed var(--ds-hairline-strong); border-radius: 50%; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
li[aria-current='step'] > .ds-check { color: var(--ds-accent); border: 1.5px solid var(--ds-accent); }
li[data-complete='true'] > .ds-check { color: var(--ds-accent-ink); background: var(--ds-accent); border: 0; }
.ds-check > .icon { width: 12px; height: 12px; stroke-width: 3; }
li[data-fresh='true'] > .ds-check { animation: ds-check-pop var(--ds-duration-check) var(--ds-ease-out) both; }
li[data-fresh='true'] > .ds-check > .icon path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ds-check-draw 360ms 160ms var(--ds-ease-out) forwards; }
@keyframes ds-check-draw { to { stroke-dashoffset: 0; } }
.ds-checklist-step-state { margin-left: auto; color: var(--ds-muted); font-size: var(--ds-text-xs); font-weight: 400; }
.ds-checklist-body { display: grid; gap: var(--ds-space-5); min-width: 0; padding: var(--ds-space-5); border-top: 1px solid var(--ds-hairline-strong); }
.ds-checklist-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-2) var(--ds-space-4); min-height: 52px; padding: var(--ds-space-2) var(--ds-space-5); color: var(--ds-muted); background: var(--ds-surface-raised); border-top: 1px solid var(--ds-hairline-strong); font-size: var(--ds-text-sm); }

/* Numbered steps with a hairline rail. <ol class="ds-steps"><li><h3>…</h3><p>…</p></li></ol> */
.ds-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: ds-step; }
.ds-steps > li { position: relative; display: grid; gap: var(--ds-space-2); min-width: 0; padding: 0 0 var(--ds-space-6) 40px; counter-increment: ds-step; }
.ds-steps > li:last-child { padding-bottom: 0; }
.ds-steps > li::before { content: counter(ds-step); position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 24px; height: 24px; color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 50%; font-family: var(--ds-font-mono); font-size: 11px; font-weight: 500; }
.ds-steps > li:not(:last-child)::after { content: ''; position: absolute; top: 30px; bottom: 6px; left: 12px; width: 1px; background: var(--ds-hairline); }
.ds-steps > li > :is(h3, h4) { margin: 2px 0 0; color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 550; line-height: 1.5; }
.ds-steps > li > p { margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.6; overflow-wrap: anywhere; }

/* Client tabs: product mark + label, inside .ds-window-tabs. Arrow keys move between tabs. */
.ds-window-tabs [role='tab'].ds-client-tab { display: inline-flex; align-items: center; gap: var(--ds-space-2); min-height: 42px; font-size: var(--ds-text-sm); }
.ds-client-tab > .ds-mark { transition: border-color var(--ds-duration-base) var(--ds-ease-out); }
.ds-client-tab[aria-selected='true'] > .ds-mark { border-color: var(--ds-accent); }
.ds-client-tab:hover { color: var(--ds-ink); }
.ds-window-panel { display: grid; gap: var(--ds-space-5); min-width: 0; padding: var(--ds-space-5); }
.ds-window-panel .ds-command > .ds-code-scroll { background: #0c0e0d; border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); font-family: var(--ds-font-mono); }
.ds-window-panel pre { margin: 0; max-height: 280px; overflow: auto; color: var(--ds-ink); background: #0c0e0d; border: 1px solid var(--ds-hairline-strong); font-family: var(--ds-font-mono); font-size: var(--ds-text-xs); line-height: 1.7; }

@media (max-width: 600px) {
  .ds-decision { padding: var(--ds-space-5); box-shadow: none; }
  .ds-decision-actions { grid-template-columns: minmax(0, 1fr); }
  .ds-checklist-head, .ds-checklist-body, .ds-checklist-foot { padding-inline: var(--ds-space-4); }
  .ds-checklist-steps > li { padding-inline: var(--ds-space-4); }
  .ds-window-panel { padding: var(--ds-space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .ds-result-tile, li[data-fresh='true'] > .ds-check, li[data-fresh='true'] > .ds-check > .icon path { animation: none !important; stroke-dashoffset: 0; }
  .ds-checklist-head .ds-progress-fill, .ds-client-tab > .ds-mark { transition: none; }
}
@media (forced-colors: active) { .ds-decision, .ds-checklist, .ds-code-compare, .ds-result-tile, .ds-check { border-color: CanvasText; } }

/* ── Step states and sticky action bar (dashboard grammar) ─────────────────
   Extends .ds-steps: <li data-state="current|complete|upcoming"> rings the
   active step in mint, fills completed steps and mutes upcoming ones. The
   action bar is a footer that sticks to the viewport bottom while its section
   scrolls: a status line on the left, actions on the right. */
.ds-steps > li[data-state='current']::before { color: var(--ds-accent); border-color: var(--ds-accent); box-shadow: 0 0 0 4px var(--ds-glow-soft); }
.ds-steps > li[data-state='complete']::before { color: var(--ds-accent-ink); background: var(--ds-accent); border-color: var(--ds-accent); }
.ds-steps > li[data-state='complete']:not(:last-child)::after { background: linear-gradient(var(--ds-accent), var(--ds-hairline)); opacity: .6; }
.ds-steps > li[data-state='upcoming']::before { color: var(--ds-muted); }
.ds-steps > li::before { transition: color var(--ds-duration-base) var(--ds-ease-out), background-color var(--ds-duration-base) var(--ds-ease-out), border-color var(--ds-duration-base) var(--ds-ease-out), box-shadow var(--ds-duration-base) var(--ds-ease-out); }
.ds-action-bar { position: sticky; bottom: var(--ds-space-3); z-index: 5; display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-2) var(--ds-space-4); min-height: 52px; padding: var(--ds-space-2) var(--ds-space-2) var(--ds-space-2) var(--ds-space-4); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); box-shadow: 0 12px 32px rgb(0 0 0 / .4); }
.ds-action-bar > :first-child:not(.ds-action-bar-actions) { flex: 1; min-width: 12rem; margin: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); }
.ds-action-bar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-2); margin-left: auto; }
@media (max-width: 600px) { .ds-action-bar { bottom: 0; } .ds-action-bar-actions { width: 100%; justify-content: flex-end; } }
@media (prefers-reduced-motion: reduce) { .ds-steps > li::before { transition: none; } }
@media (forced-colors: active) { .ds-action-bar { border-color: CanvasText; } .ds-steps > li[data-state='current']::before { border-color: Highlight; } }
