/* Reused from pikpop-frontend-vite/packages/tokens and packages/design-system.
   Component rules are unchanged; the components layer is flattened for this standalone HTML page. */

/* =============================================================
   Primitive Color Tokens
   Raw palette — do NOT use directly in components.
   Reference through semantic tokens only.
   ============================================================= */

:root {
  /* ── Neutral ──────────────────────────────────────────────── */
  --primitive-neutral-0: #ffffff;
  --primitive-neutral-50: #fafafa;
  --primitive-neutral-100: #f5f5f5;
  --primitive-neutral-150: #efefef;
  --primitive-neutral-200: #ededed;
  --primitive-neutral-300: #d9d9d9;
  --primitive-neutral-400: #bdbdbd;
  /* Not on the Figma Color System board. Existing UI renders this gray. */
  --primitive-neutral-450: #b3b3b3;
  --primitive-neutral-500: #8f8f8f;
  --primitive-neutral-600: #666666;
  --primitive-neutral-700: #4d4d4d;
  --primitive-neutral-800: #2f2f2f;
  --primitive-neutral-900: #1e1e1e;

  /* Warm neutral — marketing surfaces; not on Figma Color System board yet. */
  --primitive-warm-neutral-50: #f6f5f3;
  --primitive-warm-neutral-150: #efeeea;

  /* ── Brand — Poppy ────────────────────────────────────────── */
  --primitive-poppy-50: #fff5f1;
  --primitive-poppy-100: #fee7e0;
  --primitive-poppy-200: #fdcfc7;
  --primitive-poppy-300: #fcb7ac;
  --primitive-poppy-400: #f9826e;
  --primitive-poppy-500: #f8634a;
  --primitive-poppy-600: #e25a43;
  --primitive-poppy-700: #b04635;
}

/* =============================================================
   Primitive Size Tokens
   Raw spacing, radius, stroke, and icon-size scales from Figma.
   Prefer semantic aliases in @pikpop/design-system where available.
   ============================================================= */

:root {
  /* ── Spacing ──────────────────────────────────────────────── */
  --space-0: 0px;
  --space-50: 2px;
  --space-100: 4px;
  --space-150: 6px;
  --space-200: 8px;
  --space-300: 12px;
  --space-400: 16px;
  --space-500: 20px;
  --space-600: 24px;
  --space-800: 32px;
  --space-1200: 48px;
  --space-1600: 64px;
  --space-2400: 96px;
  --space-4000: 160px;

  --space-negative-100: -4px;
  --space-negative-200: -8px;
  --space-negative-300: -12px;
  --space-negative-400: -16px;
  --space-negative-600: -24px;

  /* ── Radius ───────────────────────────────────────────────── */
  --radius-0: 0px;
  --radius-100: 4px;
  --radius-200: 8px;
  --radius-300: 12px;
  --radius-400: 16px;
  --radius-600: 24px;
  --radius-full: 9999px;

  /* ── Stroke ───────────────────────────────────────────────── */
  --stroke-hairline: 0.5px;
  --stroke-border: 1px;
  --stroke-focus-ring: 2px;

  /* ── Icon size ────────────────────────────────────────────── */
  --icon-xs: 16px;
  --icon-20: 20px;
  --icon-sm: 24px;
  --icon-md: 32px;
  --icon-lg: 40px;
  --icon-xl: 48px;
}

/* =============================================================
   Typography
   Figma Typography System (2026_Design-System, node 1195:10481).
   Size and line-height are the role. Weight is separate:
   regular 400, medium 500, semibold 600.
   ============================================================= */

:root {
  /* English, numbers, and code use Inter. Chinese falls through to PingFang SC. */
  --font-cjk: "PingFang SC", system-ui, sans-serif;
  --font-sans:
    "Inter", "PingFang SC", system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Paragraph spacing on the type board. Same length as --space-100. */
  --paragraph-spacing: 4px;

  /* Caption — 12 / 18 / 0 */
  --font-size-caption: 12px;
  --line-height-caption: 18px;
  --letter-spacing-caption: 0px;

  /* Heading 03 — 20 / 30 / -0.6px */
  --font-size-heading-03: 20px;
  --line-height-heading-03: 30px;
  --letter-spacing-heading-03: -0.6px;

  /* Heading 02 — 24 / 32 / 0 */
  --font-size-heading-02: 24px;
  --line-height-heading-02: 32px;
  --letter-spacing-heading-02: 0px;

  /* Heading 01 — 30 / 38 / 0 */
  --font-size-heading-01: 30px;
  --line-height-heading-01: 38px;
  --letter-spacing-heading-01: 0px;

  /* Heading 00 — 36 / 44 / 0 */
  --font-size-heading-00: 36px;
  --line-height-heading-00: 44px;
  --letter-spacing-heading-00: 0px;

  /* Display — 60 / 80 / -1% (board). -1% of 60px is -0.6px. */
  --font-size-display: 60px;
  --line-height-display: 80px;
  --letter-spacing-display: -1%;

  /* Same sizes as Heading 02 and Heading 00. Existing call sites use these names. */
  --font-size-heading-sm: var(--font-size-heading-02);
  --line-height-heading-sm: var(--line-height-heading-02);
  --font-size-heading-lg: var(--font-size-heading-00);
  --line-height-heading-lg: var(--line-height-heading-00);

  /* Not on the Figma type board. ClosingSection uses this size. */
  --font-size-heading-md: 28px;
  --line-height-heading-md: 36px;
}

#demoForm,
#knowledge-demo,
#training-demo,
#demoCategoryList,
.care-card {
  /* ── Radii ────────────────────────────────────────────────── */
  /* Semantic compatibility aliases for existing components. */
  --radius-sm: var(--radius-100);
  --radius-md: var(--radius-200);
  --radius-lg: var(--radius-300);
  --radius-xl: var(--radius-400);
  --radius-2xl: var(--radius-600);

  /* ── Elevation ────────────────────────────────────────────── */
  /* Depth of the shadow. Flush surfaces use shadow-none. */
  --elevation-subtle:
    0 1px 2px rgb(30 30 30 / 4%), 0 1px 3px rgb(30 30 30 / 2%);
  --elevation-soft: 0 2px 6px rgb(30 30 30 / 6%), 0 1px 2px rgb(30 30 30 / 3%);
  --elevation-medium:
    0 6px 18px rgb(30 30 30 / 8%), 0 2px 6px rgb(30 30 30 / 4%);
  --elevation-strong:
    0 12px 32px rgb(30 30 30 / 10%), 0 4px 12px rgb(30 30 30 / 5%);

  --effect-conversation-2: -20px 30px 43.4px -10px rgb(0 0 0 / 5%);
  --effect-elevation-1: var(--elevation-subtle);
  --effect-elevation-2: var(--elevation-soft);
  /* Not on the Elevation board. ClosingSection uses this shadow. */
  --effect-elevation-3: 0 18px 44px rgb(30 30 30 / 26%);
  --effect-elevation-3-hover: 0 26px 56px rgb(30 30 30 / 32%);
  --effect-drop-shadow-lg: 0 10px 18px rgb(30 30 30 / 22%);

  /* ── Motion ───────────────────────────────────────────────── */
  --motion-duration-fast: 150ms;
  --motion-duration-hover: 220ms;
  --motion-duration-disclosure: 320ms;
  --motion-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --motion-ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);

  /* ── Scrollbar (#996) ───────────────────────────────────────── */
  --scrollbar-size: 16px;
  --scrollbar-thumb-inset: 5px;
  --scrollbar-thumb-inset-active: 4px;
  --color-scrollbar-thumb: var(--primitive-neutral-400);
  --color-scrollbar-thumb-active: var(--primitive-neutral-500);
  --color-scrollbar-track-active: var(--color-bg-elevated);

  /* ── Primitive Scale (Tailwind utilities) ─────────────────── */
  /* Generates: bg-neutral-*, text-neutral-*, border-neutral-*, … */
  --color-neutral-0: var(--primitive-neutral-0);
  --color-neutral-50: var(--primitive-neutral-50);
  --color-neutral-100: var(--primitive-neutral-100);
  --color-neutral-150: var(--primitive-neutral-150);
  --color-neutral-200: var(--primitive-neutral-200);
  --color-neutral-300: var(--primitive-neutral-300);
  --color-neutral-400: var(--primitive-neutral-400);
  --color-neutral-500: var(--primitive-neutral-500);
  --color-neutral-600: var(--primitive-neutral-600);
  --color-neutral-700: var(--primitive-neutral-700);
  --color-neutral-800: var(--primitive-neutral-800);
  --color-neutral-900: var(--primitive-neutral-900);

  /* Generates: bg-poppy-*, text-poppy-*, border-poppy-*, … */
  --color-poppy-50: var(--primitive-poppy-50);
  --color-poppy-100: var(--primitive-poppy-100);
  --color-poppy-200: var(--primitive-poppy-200);
  --color-poppy-300: var(--primitive-poppy-300);
  --color-poppy-400: var(--primitive-poppy-400);
  --color-poppy-500: var(--primitive-poppy-500);
  --color-poppy-600: var(--primitive-poppy-600);
  --color-poppy-700: var(--primitive-poppy-700);

  /* ── Semantic: Text ───────────────────────────────────────── */
  /* Utility prefix: text-text-* */
  --color-text-primary: var(
    --primitive-neutral-900
  ); /* Default body text            */
  --color-text-secondary: var(
    --primitive-neutral-600
  ); /* Supporting / meta text       */
  --color-text-tertiary: #8a8a8a; /* Placeholder / hint text      */
  --color-text-disabled: #a3a3a3; /* Non-interactive text         */
  --color-text-inverse: var(
    --primitive-neutral-0
  ); /* Text on dark/filled surfaces */
  --color-text-inverse-secondary: rgb(255 255 255 / 76%);
  --color-text-brand: var(
    --primitive-poppy-700
  ); /* Brand-accented text          */

  /* ── Semantic: Background ─────────────────────────────────── */
  /* Utility prefix: bg-bg-* */
  --color-bg-app: var(
    --primitive-warm-neutral-50
  ); /* Warm marketing-page backdrop */
  --color-bg-canvas: var(
    --primitive-neutral-100
  ); /* Page-level background        */
  --color-bg-surface: var(
    --primitive-neutral-0
  ); /* Card / panel surface         */
  --color-bg-muted: var(
    --primitive-warm-neutral-150
  ); /* Muted grouped-content surface */
  --color-bg-subtle: #fbfbfb; /* Subtle inset surface         */
  --color-bg-elevated: #f7f7f7; /* Elevated / floating surface  */
  --color-bg-brand-subtle: var(
    --primitive-poppy-50
  ); /* Brand-tinted surface         */
  --color-bg-brand-subtle-hover: var(
    --primitive-poppy-100
  ); /* Brand-tinted surface (hover/emphasis) */
  --color-bg-brand-subtle-selected: var(
    --primitive-poppy-200
  ); /* Brand-tinted surface (selected emphasis) */
  --color-bg-brand: var(
    --primitive-poppy-500
  ); /* Solid brand fill             */
  --color-bg-brand-hover: var(
    --primitive-poppy-600
  ); /* Solid brand fill (hover)     */
  --color-bg-brand-selected: var(
    --primitive-poppy-700
  ); /* Solid brand fill (selected)  */
  --color-bg-hover: var(
    --primitive-neutral-100
  ); /* Hover state overlay          */
  --color-bg-selected: var(
    --primitive-neutral-150
  ); /* Selected state overlay       */
  --color-bg-disabled: #f7f7f7; /* Disabled surface             */
  --color-bg-media-scrim: rgb(77 77 77 / 40%); /* Failed media overlay */
  --color-bg-inverse: var(
    --primitive-neutral-900
  ); /* Solid dark surface (tooltips, inverted panels) */
  --color-bg-inverse-subtle: rgb(255 255 255 / 10%);

  /* ── Semantic: Border ─────────────────────────────────────── */
  /* Utility prefix: border-border-* */
  --color-default-tertiary: var(--primitive-neutral-450);
  --color-border-default: var(
    --primitive-neutral-300
  ); /* Standard dividers & inputs  */
  --color-border-subtle: var(
    --primitive-neutral-200
  ); /* Hairline / low-contrast     */
  --color-border-strong: var(
    --primitive-neutral-900
  ); /* Emphasis border             */
  --color-border-card: #e5e5e5; /* Card outline                */
  --color-border-brand: var(
    --primitive-poppy-600
  ); /* Brand-colored border        */
  --color-border-brand-subtle: #f3b5ab; /* Soft brand border           */
  --color-border-brand-hover: var(
    --primitive-poppy-700
  ); /* Brand border (hover)        */
  --color-border-brand-subtle-hover: var(
    --primitive-poppy-400
  ); /* Soft brand border (hover)   */
  --color-border-inverse: rgb(255 255 255 / 36%);
  --color-border-inverse-hover: rgb(255 255 255 / 70%);

  /* ── Semantic: Icon ───────────────────────────────────────── */
  /* Utility prefix: text-icon-* (SVG fill / stroke)            */
  --color-icon-default: var(
    --primitive-neutral-900
  ); /* Default icon                 */
  --color-icon-secondary: var(
    --primitive-neutral-600
  ); /* Secondary / supporting icon  */
  --color-icon-tertiary: #8a8a8a; /* Decorative / hint icon       */
  --color-icon-default-tertiary: var(--primitive-neutral-450);
  --color-icon-disabled: #a3a3a3; /* Disabled icon                */
  --color-icon-inverse: var(
    --primitive-neutral-0
  ); /* Icon on filled surface       */
  --color-icon-brand: var(
    --primitive-poppy-700
  ); /* Brand icon                   */
  --color-icon-brand-hover: var(
    --primitive-poppy-500
  ); /* Brand icon (hover)           */
  --color-icon-selected: var(
    --primitive-neutral-800
  ); /* Active / selected icon       */
  --color-icon-border-strong: var(
    --primitive-neutral-900
  ); /* Icon used as border emphasis  */

  /* ── Semantic: Status — Success ──────────────────────────── */
  --color-success-fill: #17b26a; /* Icon / indicator fill  */
  --color-success-text: #067647; /* Text on success bg     */
  --color-success-bg: #eafbf3; /* Tinted surface         */
  --color-success-border: #b7e4c7; /* Border                 */

  /* ── Semantic: Status — Warning ──────────────────────────── */
  --color-warning-fill: #bf6a02;
  --color-warning-text: #8a4b00;
  --color-warning-bg: #fff3d6;
  --color-warning-border: #ffe3a3;

  /* ── Semantic: Status — Error ────────────────────────────── */
  --color-error-fill: #d92d20;
  --color-error-text: #b42318;
  --color-error-bg: #fef3f2;
  --color-error-border: #f5b7af;

  /* ── Semantic: Status — Info ─────────────────────────────── */
  --color-info-fill: var(--primitive-neutral-700);
  --color-info-text: var(--primitive-neutral-900);
  --color-info-bg: var(--primitive-neutral-100);
  --color-info-border: #e5e5e5;

  /* ── Agent Colors (Figma: semantic/agent/{agent}/…) ───────── */
  /* Each agent: bg · bg-subtle · text-on-subtle · border-subtle */

  /* Poppy */
  --color-agent-poppy-bg: var(--primitive-poppy-500);
  --color-agent-poppy-bg-subtle: var(--primitive-poppy-50);
  --color-agent-poppy-text-on-subtle: var(--primitive-poppy-700);
  --color-agent-poppy-border-subtle: #f3b5ab;

  /* Kira */
  --color-agent-kira-bg: #ef3e7f;
  --color-agent-kira-bg-subtle: #fff1f6;
  --color-agent-kira-text-on-subtle: #ef3e7f;
  --color-agent-kira-border-subtle: #ffd3e2;

  /* Pinn */
  --color-agent-pinn-bg: #1875ff;
  --color-agent-pinn-bg-subtle: #e8f1ff;
  --color-agent-pinn-text-on-subtle: #1875ff;
  --color-agent-pinn-border-subtle: #cfe0ff;

  /* Piki */
  --color-agent-piki-bg: #ffda44;
  --color-agent-piki-bg-subtle: #fff8cc;
  --color-agent-piki-text-on-subtle: #9a4d00;
  --color-agent-piki-border-subtle: #ffeda3;
}

/* Source: packages/design-system/src/components/Textfield/Textfield.css */

.textfield {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-200);
  width: 100%;
  font-family: var(--font-sans);
}

.textfield__label {
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.textfield__control {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: var(--space-300);
  width: 100%;
  min-height: 44px;
  padding: var(--space-300) var(--space-400);
  border: 0;
  border-radius: var(--radius-200);
  background: var(--color-bg-surface);
  box-shadow: inset 0 0 0 var(--stroke-border) var(--color-border-default);
}

.textfield--chip .textfield__control {
  padding-left: var(--space-300);
}

.textfield--long .textfield__control {
  align-items: flex-start;
  min-height: 120px;
  height: 120px;
}

.textfield.is-hovered .textfield__control,
.textfield__control:hover {
  box-shadow: inset 0 0 0 var(--stroke-border) var(--color-neutral-400);
}

.textfield.is-focused .textfield__control,
.textfield__control:focus-within {
  box-shadow: inset 0 0 0 var(--stroke-border) var(--color-border-brand);
}

.textfield--error .textfield__control,
.textfield--error .textfield__control:hover,
.textfield--error.is-hovered .textfield__control,
.textfield--error .textfield__control:focus-within,
.textfield--error.is-focused .textfield__control {
  background: var(--color-error-bg);
  box-shadow: inset 0 0 0 1.5px var(--color-error-fill);
}

.textfield--error .textfield__label,
.textfield--error .textfield__helper,
.textfield--error .textfield__helper-icon {
  color: var(--color-error-text);
}

.textfield--disabled .textfield__label,
.textfield--disabled .textfield__helper,
.textfield--disabled .textfield__helper-icon {
  color: var(--color-text-disabled);
}

.textfield--disabled .textfield__control,
.textfield--disabled .textfield__control:hover,
.textfield--disabled.is-hovered .textfield__control,
.textfield--disabled .textfield__control:focus-within {
  background: var(--color-bg-disabled);
  box-shadow: inset 0 0 0 var(--stroke-border) var(--color-border-default);
}

.textfield__trailing {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--icon-20);
  height: var(--icon-20);
  color: var(--color-icon-secondary);
}

.textfield--disabled .textfield__trailing {
  color: var(--color-icon-disabled);
}

.textfield__trailing svg {
  display: block;
}

.textfield__input,
.textfield__area {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  outline: 0;
}

.textfield__area {
  flex: 1 0 0;
  min-height: 0;
  height: 100%;
  resize: vertical;
}

.textfield__input::placeholder,
.textfield__area::placeholder {
  color: var(--color-text-tertiary);
}

.textfield__input:disabled,
.textfield__area:disabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.textfield--disabled .textfield__input::placeholder,
.textfield--disabled .textfield__area::placeholder {
  color: var(--color-text-disabled);
}

.textfield__chips {
  display: flex;
  flex: 1 0 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-200);
  min-width: 0;
}

.textfield__chips .textfield__input {
  flex: 1 0 8ch;
  width: auto;
}

.textfield__helper {
  display: flex;
  align-items: center;
  gap: var(--space-100);
  margin: 0;
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

.textfield__helper-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--icon-xs);
  height: var(--icon-xs);
  color: var(--color-icon-secondary);
}

.textfield__helper-icon svg {
  display: block;
}

/* Source: packages/design-system/src/components/Select/Select.css */

.select-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-200);
  min-width: 0;
  height: 32px;
  padding: 0 var(--space-300);
  border: var(--stroke-border) solid var(--color-border-default);
  border-radius: var(--radius-200);
  background: var(--color-bg-surface);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.select-trigger[data-state="open"] {
  border-color: var(--color-border-brand);
}

.select-trigger:focus-visible {
  outline: var(--stroke-focus-ring) solid var(--color-border-strong);
  outline-offset: var(--space-50);
}

.select-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.select-trigger__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-trigger__icon {
  flex: none;
  width: var(--icon-xs);
  height: var(--icon-xs);
  color: var(--color-icon-default);
}

/* Radix 会把 z-index 同步到定位容器上；高度不超过弹出方向上的可用空间。 */
.dropdown.select-content {
  z-index: 50;
  max-width: var(--radix-popover-content-available-width);
  max-height: min(401px, var(--radix-popover-content-available-height));
}

/* Source: packages/design-system/src/components/Button/Button.css */
/* Same contract as the old theme.css Button: utilities in @layer utilities
   can override these defaults via className. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-200);
  border: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.button--xs {
  height: 32px;
  padding: 6px var(--space-300);
  border-radius: var(--radius-200);
  font-size: 14px;
  line-height: 20px;
}

.button--sm {
  height: 36px;
  padding: 8px var(--space-400);
  border-radius: var(--radius-200);
  font-size: 14px;
  line-height: 20px;
}

.button--md {
  height: 48px;
  padding: var(--space-300) var(--space-400);
  border-radius: var(--radius-300);
  font-size: 16px;
  line-height: 24px;
}

.button--lg {
  height: 56px;
  padding: var(--space-400) var(--space-800);
  border-radius: var(--radius-300);
  font-size: 16px;
  line-height: 24px;
}

.button--icon {
  padding: 0;
  border-radius: var(--radius-200);
}

.button--icon.button--xs {
  width: 32px;
}

.button--icon.button--sm {
  width: 36px;
}

.button--icon.button--md {
  width: 48px;
}

.button--icon.button--lg {
  width: 56px;
}

.button--primary.button--brand {
  color: var(--color-text-inverse);
  background: var(--color-bg-brand);
}

.button--primary.button--brand:not(:disabled):hover {
  background: var(--color-bg-brand-hover);
}

.button--primary.button--neutral {
  color: var(--color-text-inverse);
  background: var(--primitive-neutral-800);
}

.button--primary.button--destructive {
  color: var(--color-text-inverse);
  background: var(--color-error-fill);
}

.button--primary.button--destructive:not(:disabled):hover {
  background: var(--color-error-text);
}

.button--primary.button--inverse {
  color: var(--color-text-brand);
  background: var(--color-bg-surface);
}

.button--primary.button--inverse:not(:disabled):hover {
  color: var(--color-icon-brand-hover);
  background: var(--color-bg-brand-subtle);
}

.button--secondary {
  background: var(--color-bg-surface);
  border: 1px solid;
}

.button--secondary.button--brand {
  color: var(--color-text-brand);
  border-color: var(--color-border-brand);
}

.button--secondary.button--neutral {
  color: var(--color-text-primary);
  border-color: var(--color-border-default);
}

.button--secondary.button--destructive {
  color: var(--color-error-text);
  border-color: var(--color-error-border);
}

.button--secondary.button--inverse {
  color: var(--color-text-inverse);
  background: transparent;
  border-color: var(--color-border-inverse);
}

.button--tertiary {
  background: transparent;
}

.button--tertiary.button--brand {
  color: var(--color-text-brand);
}

.button--tertiary.button--neutral {
  color: var(--color-text-primary);
}

.button--tertiary.button--destructive {
  color: var(--color-error-text);
}

.button--secondary:not(:disabled):hover,
.button--tertiary:not(:disabled):hover {
  background: var(--color-bg-hover);
}

.button--secondary.button--destructive:not(:disabled):hover,
.button--tertiary.button--destructive:not(:disabled):hover {
  background: var(--color-error-bg);
}

.button--secondary.button--inverse:not(:disabled):hover {
  background: var(--color-bg-inverse-subtle);
  border-color: var(--color-border-inverse-hover);
}

.button:focus-visible {
  outline: 0;
  background: var(--color-bg-brand-hover);
  border: 2px solid var(--primitive-poppy-700);
}

.button--primary.button--destructive:focus-visible {
  background: var(--color-error-fill);
  border-color: var(--color-error-text);
}

.button--secondary.button--destructive:focus-visible,
.button--tertiary.button--destructive:focus-visible {
  color: var(--color-error-text);
  background: var(--color-error-bg);
  border-color: var(--color-error-text);
}

.button--primary.button--inverse:focus-visible {
  color: var(--color-icon-brand-hover);
  background: var(--color-bg-surface);
  border-color: var(--color-bg-surface);
}

.button--secondary.button--inverse:focus-visible {
  color: var(--color-text-inverse);
  background: var(--color-bg-inverse-subtle);
  border-color: var(--color-border-inverse-hover);
}

.button:disabled {
  cursor: not-allowed;
  color: var(--primitive-neutral-100);
  background: var(--primitive-neutral-400);
  border-color: var(--primitive-neutral-400);
}

.button__loader {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 800ms linear infinite;
}

.button__icon {
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
}

.button__icon > svg {
  width: 100%;
  height: 100%;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition-duration: 0ms;
  }

  .button__loader {
    animation-duration: 1.5s;
  }
}
