/* Fukurou Design System — Documentation site
   Theme + component preview values from live Figma (file FNLHeDQrr7JKBj81Qg7L7a).
   Source of truth remains the Figma file. */

:root,
[data-theme="light"] {
  /* Brand (Foundation — do not change) */
  --color-brand-primary: #d33f55;
  --color-brand-primary-700: #872836;
  --color-brand-secondary: #231f20;

  /* Surfaces (Theme Light) */
  --color-surface-page: #fafaf9;
  --color-surface-card: #ffffff;
  --color-surface-subtle: #f5f5f4;
  --color-surface-elevated: #ffffff;
  --color-surface-inverse: #1c1917;
  --color-surface-sidebar: #ffffff;
  --color-surface-disabled: #e7e5e4;

  /* Text */
  --color-text-default: #231f20;
  --color-text-subtle: #57534e;
  --color-text-inverse: #ffffff;
  --color-text-disabled: #78716c;
  --color-text-placeholder: #57534e;
  --color-text-action: #872836;
  --color-text-on-primary: #ffffff;
  --color-text-error: #8d1818;

  /* Border / focus */
  --color-border-default: #78716c;
  --color-border-subtle: #f5f5f4;
  --color-border-strong: #a8a29e;
  --color-border-control: #78716c;
  --color-border-focus: #d33f55;
  --color-border-error: #dc2626;
  --color-focus-gap: #fafaf9;
  --color-focus-ring-stroke: #d33f55;

  /* Text Field (Figma color/text-field/*) */
  --color-text-field-bg: #ffffff;
  --color-text-field-bg-disabled: #f5f5f4;
  --color-text-field-border: #78716c;
  --color-text-field-border-hover: #57534e;
  --color-text-field-border-error: #dc2626;
  --color-text-field-border-disabled: #d6d3d1;
  --color-text-field-text: #231f20;
  --color-text-field-placeholder: #57534e;
  --color-text-field-text-disabled: #78716c;
  --color-text-field-label: #231f20;
  --color-text-field-label-error: #8d1818;
  --color-text-field-label-disabled: #78716c;
  --color-text-field-helper: #57534e;
  --color-text-field-helper-disabled: #78716c;
  --color-text-field-error: #8d1818;
  --color-text-field-icon: #57534e;
  --color-text-field-icon-error: #8d1818;
  --color-text-field-icon-disabled: #78716c;
  --color-text-field-focus-ring: #d33f55;
  --color-text-field-focus-gap: #fafaf9;

  /* Action (live Theme: primary = neutral) */
  --color-action-primary: #000000;
  --color-action-primary-hover: #57534e;
  --color-action-primary-pressed: #44403c;
  --color-action-primary-disabled: #d6d3d1;
  --color-action-primary-text: #ffffff;
  --color-action-secondary: #231f20;
  --color-action-secondary-text: #ffffff;
  --color-action-tertiary: #d33f55;
  --color-ghost-text: #231f20;
  --color-ghost-border: #231f20;

  /* Status */
  --color-status-success: #2f9e60;
  --color-status-warning: #8b4c04;
  --color-status-danger: #dc2626;
  --color-status-info: #2f6fc4;
  --color-status-warning-soft: #d97706;

  /* Progress */
  --color-progress-fill: #d33f55;
  --color-progress-track: #f5f5f4;

  /* Control */
  --color-switch-track-on: #000000;
  --color-switch-track-off: #78716c;
  --color-switch-thumb: #ffffff;
  --color-field-bg: #ffffff;
  --color-field-border: #78716c;
  --color-jumbo-selected-border: #2f9e60;
  --color-jumbo-indicator: #2f9e60;
  --color-snackbar-bg: #ffffff;

  /* Button (color/button/* from live Figma; focus gap/ring reuse --color-focus-*) */
  --color-button-secondary-bg-hover: #1d191a;
  --color-button-secondary-bg-pressed: #161414;
  --color-button-ghost-bg-hover: #f5f5f4;
  --color-button-ghost-bg-pressed: #f4f4f4;
  --color-button-ghost-border-hover: #1d191a;
  --color-button-ghost-border-pressed: #161414;
  --color-button-ghost-border-disabled: #78716c;

  /* Text Button (color/text-button/* → color/action/tertiary/*) */
  --color-text-button-content: #d33f55;
  --color-text-button-content-hover: #ad3446;
  --color-text-button-content-pressed: #872836;
  --color-text-button-content-disabled: #d6d3d1;

  /* Icon Button (color/icon-button/*) */
  --color-icon-button-bg-hover: #fafaf9;
  --color-icon-button-bg-pressed: #000000;
  --color-icon-button-content: #d33f55;
  --color-icon-button-content-hover: #ad3446;
  --color-icon-button-content-pressed: #ffffff;
  --color-icon-button-content-disabled: #78716c;

  /* Notification Button (color/notification-button/*; body reuses icon-button vars) */
  --color-notif-badge-bg: #d33f55;        /* badge/background → brand/primary/500 (both modes) */
  --color-notif-badge-border: #fafaf9;    /* badge/border → surface/page */
  --color-notif-badge-text: #ffffff;      /* badge/text → neutral/0 */
  --color-notif-dot-bg: #d33f55;          /* dot/background → brand/primary/500 */
  --color-notif-dot-border: #fafaf9;      /* dot/border → surface/page */

  /* Card (color/card/* + elevation/card/* from live Figma) */
  --color-card-bg: #ffffff;               /* background/default → surface/card */
  --color-card-border: #78716c;           /* border/default → border/default */
  --color-card-title: #231f20;            /* title → text/default */
  --color-card-body: #57534e;             /* body → text/subtle */
  --color-card-media-bg: #f5f5f4;         /* image placeholder → surface/subtle */
  --color-card-icon-bg: #fafaf9;          /* icon container → action/primary/subtle */
  --color-card-icon: #57534e;             /* icon glyph → text/subtle */
  --shadow-card: 0 1px 2px rgba(35, 31, 32, 0.06);                                    /* elevation/card/default → Surface */
  --shadow-card-hover: 0 1px 3px rgba(35, 31, 32, 0.08), 0 1px 2px rgba(35, 31, 32, 0.04); /* elevation/card/hover → Raised */

  /* Elevation scale (elevation/* → effect/shadow/* from the live Figma file; identical in Dark) */
  --elevation-none: none;
  --elevation-surface: 0 1px 2px rgba(35, 31, 32, 0.06);                                        /* effect/shadow/50 */
  --elevation-raised: 0 1px 3px rgba(35, 31, 32, 0.08), 0 1px 2px rgba(35, 31, 32, 0.04);       /* effect/shadow/100 */
  --elevation-floating: 0 4px 8px rgba(35, 31, 32, 0.08), 0 2px 4px rgba(35, 31, 32, 0.04);     /* effect/shadow/200 */
  --elevation-popover: 0 8px 16px rgba(35, 31, 32, 0.1), 0 4px 8px rgba(35, 31, 32, 0.06);      /* effect/shadow/300 */
  --elevation-modal: 0 16px 32px rgba(35, 31, 32, 0.12), 0 8px 16px rgba(35, 31, 32, 0.08);     /* effect/shadow/400 */
  --elevation-overlay: 0 24px 48px rgba(35, 31, 32, 0.14), 0 12px 24px rgba(35, 31, 32, 0.1);   /* effect/shadow/500 */
  /* Dark-mode elevation companions named in the Figma frame */
  --color-surface-floating: #ffffff;      /* color/surface/floating → neutral/0 */
  --color-border-elevated: #e7e5e4;       /* color/border/elevated → neutral/200 */
  --color-surface-overlay: rgba(0, 0, 0, 0.55); /* color/surface/overlay */

  /* Calendar (color/calendar/* from live Figma) */
  --color-calendar-bg: #ffffff;
  --color-calendar-border: #78716c;
  --color-calendar-day-bg-hover: #fafaf9;
  --color-calendar-day-bg-selected: #d33f55;
  --color-calendar-day-text-selected: #ffffff;
  --color-calendar-day-border-today: #000000;
  --color-calendar-day-focus-ring: #d33f55;
  --shadow-popover: 0 8px 16px rgba(35, 31, 32, 0.1), 0 4px 8px rgba(35, 31, 32, 0.06);

  /* Docs chrome */
  --color-topbar-bg: rgba(250, 250, 249, 0.92);
  --color-heading: #231f20;
  --color-badge-ok-fg: #145331;
  --color-badge-warn-fg: #683903;
  --color-error-text: #8d1818;
  --color-alert-info-bg: #eef4fd;

  /* Radius / space */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --font-display: "Lora", Georgia, serif;
  --font-heading: "Lora", Georgia, serif;
  --font-body: "Poppins", system-ui, sans-serif;

  /* Type scale (Figma text styles — display/heading Lora SemiBold, body/caption Poppins Regular) */
  --text-heading-xl-size: 40px;
  --text-heading-xl-lh: 48px;
  --text-heading-lg-size: 32px;
  --text-heading-lg-lh: 40px;
  --text-heading-md-size: 24px;
  --text-heading-md-lh: 32px;
  --text-heading-sm-size: 20px;
  --text-heading-sm-lh: 28px;
  --text-body-lg-size: 18px;
  --text-body-lg-lh: 28px;
  --text-body-md-size: 16px;
  --text-body-md-lh: 24px;
  --text-body-sm-size: 14px;
  --text-body-sm-lh: 20px;
  --text-caption-size: 12px;
  --text-caption-lh: 16px;
  /* Aliases for docs supporting text (Figma caption/md) */
  --font-size-caption: var(--text-caption-size);
  --line-height-caption: var(--text-caption-lh);
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  --radius-card: var(--radius-lg);
  --radius-control: var(--radius-md);

  --color-docs-border: var(--color-border-elevated);
  --color-link: var(--color-brand-primary-700);
  --color-link-hover: var(--color-brand-primary);
  --color-nav-active-bg: rgba(211, 63, 85, 0.08);
  --color-code-bg: var(--color-surface-subtle);

  --sidebar-width: 280px;
  --header-height: 64px;
  --shadow-raised: var(--elevation-raised);
  --shadow-floating: var(--elevation-floating);
  --shadow-modal: var(--elevation-modal);

  --focus-ring: 0 0 0 2px var(--color-focus-gap), 0 0 0 4px var(--color-focus-ring-stroke);
}

[data-theme="dark"] {
  --color-surface-page: #000000;
  --color-surface-card: #1c1917;
  --color-surface-subtle: #292524;
  --color-surface-elevated: #292524;
  --color-surface-inverse: #f5f5f4;
  --color-surface-sidebar: #1c1917;
  --color-surface-disabled: #44403c;

  --color-text-default: #ffffff;
  --color-text-subtle: #d6d3d1;
  --color-text-inverse: #231f20;
  --color-text-disabled: #a8a29e;
  --color-text-placeholder: #d6d3d1;
  --color-text-action: #ffffff;
  --color-text-on-primary: #231f20;
  --color-text-error: #fca5a5;

  --color-border-default: #a8a29e;
  --color-border-subtle: #292524;
  --color-border-strong: #78716c;
  --color-border-control: #a8a29e;
  --color-border-focus: #ffffff;
  --color-border-error: #e55e5e;
  --color-focus-gap: #000000;
  --color-focus-ring-stroke: #ffffff;

  --color-text-field-bg: #1c1917;
  --color-text-field-bg-disabled: #292524;
  --color-text-field-border: #a8a29e;
  --color-text-field-border-hover: #78716c;
  --color-text-field-border-error: #e55e5e;
  --color-text-field-border-disabled: #44403c;
  --color-text-field-text: #ffffff;
  --color-text-field-placeholder: #d6d3d1;
  --color-text-field-text-disabled: #a8a29e;
  --color-text-field-label: #ffffff;
  --color-text-field-label-error: #f4bebe;
  --color-text-field-label-disabled: #a8a29e;
  --color-text-field-helper: #d6d3d1;
  --color-text-field-helper-disabled: #a8a29e;
  --color-text-field-error: #f4bebe;
  --color-text-field-icon: #d6d3d1;
  --color-text-field-icon-error: #f4bebe;
  --color-text-field-icon-disabled: #a8a29e;
  --color-text-field-focus-ring: #ffffff;
  --color-text-field-focus-gap: #000000;

  --color-action-primary: #ffffff;
  --color-action-primary-hover: #d6d3d1;
  --color-action-primary-pressed: #e7e5e4;
  --color-action-primary-disabled: #44403c;
  --color-action-primary-text: #231f20;
  --color-action-secondary: #f5f5f4;
  --color-action-secondary-text: #231f20;
  --color-action-tertiary: #ffffff;
  --color-ghost-text: #ffffff;
  --color-ghost-border: #f5f5f4;

  --color-status-success: #2f9e60;
  --color-status-warning: #faecdc;
  --color-status-danger: #fae1e1;
  --color-status-info: #d6e6fb;
  --color-status-warning-soft: #faecdc;

  --color-progress-fill: #d33f55;
  --color-progress-track: #292524;

  --color-switch-track-on: #ffffff;
  --color-switch-track-off: #a8a29e;
  --color-switch-thumb: #1c1917;
  --color-field-bg: #1c1917;
  --color-field-border: #a8a29e;
  --color-jumbo-selected-border: #2f9e60;
  --color-jumbo-indicator: #2f9e60;
  --color-snackbar-bg: #292524;

  --color-button-secondary-bg-hover: #e7e5e4;
  --color-button-secondary-bg-pressed: #d6d3d1;
  --color-button-ghost-bg-hover: #292524;
  --color-button-ghost-bg-pressed: #0c0b0b;
  --color-button-ghost-border-hover: #e7e5e4;
  --color-button-ghost-border-pressed: #d6d3d1;
  --color-button-ghost-border-disabled: #a8a29e;

  --color-text-button-content: #ffffff;
  --color-text-button-content-hover: #e7e5e4;
  --color-text-button-content-pressed: #d6d3d1;
  --color-text-button-content-disabled: #44403c;

  --color-icon-button-bg-hover: #1c1917;
  --color-icon-button-bg-pressed: #ffffff;
  --color-icon-button-content: #ffffff;
  --color-icon-button-content-hover: #e7e5e4;
  --color-icon-button-content-pressed: #231f20;
  --color-icon-button-content-disabled: #a8a29e;

  --color-notif-badge-bg: #d33f55;
  --color-notif-badge-border: #000000;
  --color-notif-badge-text: #ffffff;
  --color-notif-dot-bg: #d33f55;
  --color-notif-dot-border: #000000;

  --color-card-bg: #1c1917;
  --color-card-border: #a8a29e;
  --color-card-title: #ffffff;
  --color-card-body: #d6d3d1;
  --color-card-media-bg: #292524;
  --color-card-icon-bg: #1c1917;
  --color-card-icon: #d6d3d1;
  /* elevation/card/* resolve to the same Surface/Raised values in Dark (no dark alternative in Figma) */
  --shadow-card: 0 1px 2px rgba(35, 31, 32, 0.06);
  --shadow-card-hover: 0 1px 3px rgba(35, 31, 32, 0.08), 0 1px 2px rgba(35, 31, 32, 0.04);

  /* elevation/* have no Dark values in Figma — same shadows, paired with elevated surfaces + borders */
  --color-surface-floating: #44403c;      /* neutral/700 */
  --color-border-elevated: #57534e;       /* neutral/600 */
  --color-surface-overlay: rgba(255, 255, 255, 0.5);

  --color-calendar-bg: #1c1917;
  --color-calendar-border: #a8a29e;
  --color-calendar-day-bg-hover: #000000;
  --color-calendar-day-bg-selected: #ffffff;
  --color-calendar-day-text-selected: #231f20;
  --color-calendar-day-border-today: #ffffff;
  --color-calendar-day-focus-ring: #ffffff;

  --color-topbar-bg: rgba(0, 0, 0, 0.88);
  --color-heading: #ffffff;
  --color-badge-ok-fg: #86efac;
  --color-badge-warn-fg: #fcd34d;
  --color-error-text: #fca5a5;
  --color-alert-info-bg: rgba(214, 230, 251, 0.16);

  --color-docs-border: var(--color-border-elevated);
  --color-link: var(--color-brand-primary);
  --color-link-hover: var(--color-brand-primary);
  --color-nav-active-bg: rgba(211, 63, 85, 0.16);

  --shadow-raised: var(--elevation-raised);
  --shadow-floating: var(--elevation-floating);
  --shadow-modal: var(--elevation-modal);
  --shadow-popover: var(--elevation-popover);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-body-md-lh);
  color: var(--color-text-default);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(211, 63, 85, 0.06), transparent 55%),
    radial-gradient(900px 500px at -10% 40%, rgba(35, 31, 32, 0.04), transparent 50%),
    var(--color-surface-page);
  transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] {
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-link-hover);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: var(--color-brand-secondary);
  color: var(--color-text-on-primary);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

/* —— Shell —— */
.doc-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.doc-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--color-surface-sidebar);
  border-right: 1px solid var(--color-docs-border);
  padding: var(--space-6) var(--space-4) var(--space-8);
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--color-docs-border);
  margin-bottom: var(--space-4);
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.brand-text strong {
  font-family: var(--font-heading);
  font-size: var(--text-heading-sm-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-heading-sm-lh);
}

.brand-text span {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
}

.nav-label {
  display: block;
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-caption-lh);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  padding: var(--space-3) var(--space-2) var(--space-2);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  color: var(--color-text-default);
  text-decoration: none;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
}

.nav-list a:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-default);
}

.nav-list a.is-active {
  background: var(--color-nav-active-bg);
  color: var(--color-link);
  font-weight: var(--font-weight-medium);
}

.nav-list .nav-sub {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-2);
}

.nav-list .nav-sub a {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
  padding: var(--space-1) var(--space-3);
}

.nav-list .nav-sub a.is-active {
  color: var(--color-link);
  background: var(--color-nav-active-bg);
}

.doc-main {
  min-width: 0;
}

.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
  padding: 0 var(--space-8);
  background: var(--color-topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-docs-border);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-card);
  cursor: pointer;
  color: var(--color-text-default);
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-left: auto;
}

.topbar-link {
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  text-decoration: none;
  color: var(--color-text-subtle);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-control);
}

.topbar-link:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-default);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-subtle);
  gap: 0;
}

.theme-toggle__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--color-text-subtle);
  font-family: var(--font-body);
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  cursor: pointer;
  line-height: var(--text-caption-lh);
}

.theme-toggle__btn[aria-pressed="true"] {
  background: var(--color-surface-card);
  color: var(--color-text-default);
  box-shadow: var(--shadow-raised);
}

.theme-toggle__btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.theme-toggle__label {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
  margin-right: var(--space-1);
  padding-left: var(--space-1);
}

.content {
  max-width: 920px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-8) var(--space-16);
}

/* —— Typography —— */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

h1 {
  font-size: var(--text-heading-xl-size);
  line-height: var(--text-heading-xl-lh);
  margin: 0 0 var(--space-4);
}

h2 {
  font-size: var(--text-heading-lg-size);
  line-height: var(--text-heading-lg-lh);
  margin: var(--space-16) 0 var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-docs-border);
}

h2:first-of-type {
  border-top: 0;
  margin-top: var(--space-8);
}

section > h2:first-child {
  border-top: 0;
  margin-top: 0;
}

h3 {
  font-size: var(--text-heading-sm-size);
  line-height: var(--text-heading-sm-lh);
  margin: var(--space-8) 0 var(--space-3);
}

h4 {
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  margin: var(--space-5) 0 var(--space-2);
}

p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-default);
}

.lede {
  font-size: var(--text-body-lg-size);
  line-height: var(--text-body-lg-lh);
  color: var(--color-text-subtle);
  max-width: 42rem;
}

.muted {
  color: var(--color-text-subtle);
}

code,
.token-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  background: var(--color-code-bg);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.25rem;
}

li {
  margin-bottom: var(--space-1);
}

/* —— Status / badges —— */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin: var(--space-6) 0 var(--space-8);
}

.status-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  padding: var(--space-4);
}

.status-card .label {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-1);
}

.status-card .value {
  font-weight: var(--font-weight-medium);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-medium);
  line-height: var(--text-caption-lh);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-surface-subtle);
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge--progress {
  background: var(--color-nav-active-bg);
  color: var(--color-link);
}

.badge--ok {
  background: rgba(47, 158, 96, 0.12);
  color: var(--color-badge-ok-fg);
}

.badge--warn {
  background: rgba(217, 119, 6, 0.12);
  color: var(--color-badge-warn-fg);
}

.badge--absent {
  background: var(--color-surface-subtle);
  color: var(--color-text-subtle);
}

/* —— Cards / callouts —— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.info-card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  box-shadow: var(--elevation-surface);
}

.info-card h3 {
  margin-top: 0;
}

.callout {
  border-left: 3px solid var(--color-brand-primary);
  background: rgba(211, 63, 85, 0.05);
  padding: var(--space-4) var(--space-5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-5) 0;
}

.callout--warn {
  border-left-color: var(--color-status-warning-soft);
  background: rgba(217, 119, 6, 0.08);
}

.callout--note {
  border-left-color: var(--color-status-info);
  background: var(--color-alert-info-bg);
}

.callout p:last-child {
  margin-bottom: 0;
}

.do-dont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: var(--space-5) 0;
}

.do-dont article {
  border-radius: var(--radius-card);
  padding: var(--space-4);
  border: 1px solid var(--color-docs-border);
  background: var(--color-surface-card);
}

.do-dont .do {
  border-top: 3px solid var(--color-status-success);
}

.do-dont .dont {
  border-top: 3px solid var(--color-status-danger);
}

.do-dont h4 {
  margin-top: 0;
}

/* —— Tables —— */
.table-wrap {
  overflow-x: auto;
  margin: var(--space-4) 0 var(--space-6);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  background: var(--color-surface-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
}

th,
td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-docs-border);
  vertical-align: top;
}

th {
  font-weight: var(--font-weight-semibold);
  background: var(--color-surface-subtle);
  color: var(--color-text-subtle);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: 0;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-docs-border);
  vertical-align: middle;
  margin-right: var(--space-2);
}

[data-theme="dark"] .swatch {
  border-color: rgba(255, 255, 255, 0.15);
}

/* —— Component docs —— */
.component {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-docs-border);
}

.component-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.component-header h3 {
  margin: 0;
}

.preview-panel {
  background:
    linear-gradient(45deg, var(--color-surface-subtle) 25%, transparent 25%),
    linear-gradient(-45deg, var(--color-surface-subtle) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--color-surface-subtle) 75%),
    linear-gradient(-45deg, transparent 75%, var(--color-surface-subtle) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  padding: var(--space-6);
  margin: var(--space-4) 0;
  box-shadow: var(--elevation-surface);
}

.preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-4);
}

.preview-row:last-child {
  margin-bottom: 0;
}

/*
 * Wider horizontal spacing between separate component specimens in interactive previews
 * (Icon Button, Text Button, Button, Notification Button, Card variants).
 * Uses spacing/16 (64px); row gap stays tighter when rows wrap.
 */
.preview-row--spacious,
#button .preview-panel > .preview-row,
#text-button .preview-panel > .preview-row,
#icon-button .preview-panel > .preview-row,
#card .preview-panel > .preview-row {
  column-gap: var(--space-16);
  row-gap: var(--space-4);
}

@media (max-width: 768px) {
  .preview-row--spacious,
  #button .preview-panel > .preview-row,
  #text-button .preview-panel > .preview-row,
  #icon-button .preview-panel > .preview-row,
  #card .preview-panel > .preview-row {
    column-gap: var(--space-8);
    row-gap: var(--space-4);
  }
}

#icon-button .preview-panel,
#notification-button .preview-panel,
#button .preview-panel {
  overflow: visible;
}

.preview-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}

.preview-label {
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-caption-lh);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-3);
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.a11y-note {
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
  margin-top: var(--space-3);
}

/* Structured implementation / token / a11y notes */
.doc-note {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  background: var(--color-surface-card);
  font-family: var(--font-body);
  font-size: var(--font-size-caption);
  line-height: var(--line-height-caption);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-default);
}

.doc-note__group {
  display: grid;
  gap: var(--space-2);
}

.doc-note__title {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-caption);
  line-height: var(--line-height-caption);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
  letter-spacing: 0;
}

.doc-note__list {
  margin: 0;
  padding-left: 1.25rem;
}

.doc-note__list li {
  margin-bottom: var(--space-2);
  font-size: var(--font-size-caption);
  line-height: var(--line-height-caption);
  color: var(--color-text-default);
}

.doc-note__list li:last-child {
  margin-bottom: 0;
}

.doc-note code {
  font-size: 0.95em;
  line-height: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 720px) {
  .doc-note {
    padding: var(--space-4);
  }
}

/* ========================================
   Component previews (Figma-matched)
   ======================================== */

/* Buttons — pill, Poppins SemiBold 14, S32/M40/L48 */
.fk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.fk-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

.fk-btn--sm {
  height: 32px;
  padding: 0 12px;
}

.fk-btn--lg {
  height: 48px;
  padding: 0 20px;
}

/* Focus Visible — Figma focus-ring wrapper: 2px gap (surface/page) + 2px ring (border/focus), outside the body */
.fk-btn:focus-visible,
.fk-btn.is-focus-demo {
  outline: none;
  box-shadow: var(--focus-ring);
}

.fk-btn--action {
  background: var(--color-action-primary);
  color: var(--color-action-primary-text);
}

.fk-btn--action:hover:not(:disabled) {
  background: var(--color-action-primary-hover);
}

.fk-btn--action:active:not(:disabled) {
  background: var(--color-action-primary-pressed);
}

.fk-btn--secondary {
  background: var(--color-action-secondary);
  color: var(--color-action-secondary-text);
}

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

.fk-btn--secondary:active:not(:disabled) {
  background: var(--color-button-secondary-bg-pressed);
}

.fk-btn--ghost {
  background: transparent;
  color: var(--color-ghost-text);
  border-color: var(--color-ghost-border);
}

.fk-btn--ghost:hover:not(:disabled) {
  background: var(--color-button-ghost-bg-hover);
  border-color: var(--color-button-ghost-border-hover);
  color: var(--color-button-ghost-border-hover);
}

.fk-btn--ghost:active:not(:disabled) {
  background: var(--color-button-ghost-bg-pressed);
  border-color: var(--color-button-ghost-border-pressed);
  color: var(--color-button-ghost-border-pressed);
}

.fk-btn:disabled,
.fk-btn[aria-disabled="true"] {
  background: var(--color-action-primary-disabled);
  color: var(--color-text-disabled);
  border-color: transparent;
  opacity: 0.6;
  cursor: not-allowed;
}

.fk-btn--ghost:disabled,
.fk-btn--ghost[aria-disabled="true"] {
  background: transparent;
  border-color: var(--color-button-ghost-border-disabled);
  color: var(--color-text-disabled);
}

/* Text Button — Figma 452:2338: transparent, radius 0, pad 2×4, gap 4, 24px icons.
   Underline on hover only; Focus = plain 2px OUTSIDE stroke (no gap). */
.fk-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* typography/text-button/sm — Poppins SemiBold 14/20, tracking 0; weight never changes per state */
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--color-text-button-content);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 2px 4px;
  cursor: pointer;
  text-decoration: none;
  text-underline-offset: 2px;
  transition: color 0.12s ease;
}

.fk-text-btn svg {
  width: 24px;
  height: 24px;
  margin: -2px 0; /* Figma row stays 24px tall with 24px icons */
  flex-shrink: 0;
  color: currentColor;
}

.fk-text-btn--md {
  font-size: 16px;
  line-height: 20px;
}

.fk-text-btn--lg {
  font-size: 18px;
  line-height: 28px;
}

/* Hover = typography/text-button/underline/[size]: same SemiBold weight, underline added */
.fk-text-btn:hover:not(:disabled) {
  color: var(--color-text-button-content-hover);
  text-decoration: underline;
}

.fk-text-btn:active:not(:disabled) {
  color: var(--color-text-button-content-pressed);
  text-decoration: none;
}

.fk-text-btn:focus-visible,
.fk-text-btn.is-focus-demo {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 0;
  box-shadow: none;
}

.fk-text-btn:disabled {
  color: var(--color-text-button-content-disabled);
  opacity: 0.6;
  cursor: not-allowed;
  text-decoration: none;
}

/* Icon Button — Figma 452:2407: 32×32 circle, 16px icon / 12px number, color/icon-button/* */
.fk-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-icon-button-content);
  cursor: pointer;
  transition: color 0.12s ease;
}

.fk-icon-btn__body {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  transition: background-color 0.12s ease;
}

.fk-icon-btn:hover:not(:disabled) {
  color: var(--color-icon-button-content-hover);
}

.fk-icon-btn:hover:not(:disabled) .fk-icon-btn__body {
  background: var(--color-icon-button-bg-hover);
}

.fk-icon-btn:active:not(:disabled) {
  color: var(--color-icon-button-content-pressed);
}

.fk-icon-btn:active:not(:disabled) .fk-icon-btn__body {
  background: var(--color-icon-button-bg-pressed);
}

/* Focus = focus-ring wrapper: 2px gap (icon-button/focus/gap) + 2px ring (icon-button/focus/ring) outside the circle */
.fk-icon-btn:focus-visible,
.fk-icon-btn.is-focus-demo {
  outline: none;
  box-shadow: var(--focus-ring);
}

.fk-icon-btn:disabled {
  color: var(--color-icon-button-content-disabled);
  opacity: 0.6;
  cursor: not-allowed;
}

.fk-icon-btn:disabled .fk-icon-btn__body {
  background: transparent;
}

/* Composed components (Snackbar / Alert / Modal close) bind their own close-icon tokens in Figma; keep them on text/default */
.fk-snackbar .fk-icon-btn,
.fk-alert .fk-icon-btn,
.fk-modal .fk-icon-btn,
.fk-snackbar .fk-icon-btn:hover,
.fk-alert .fk-icon-btn:hover,
.fk-modal .fk-icon-btn:hover,
.fk-snackbar .fk-icon-btn:active,
.fk-alert .fk-icon-btn:active,
.fk-modal .fk-icon-btn:active {
  color: var(--color-text-default);
}

.fk-snackbar .fk-icon-btn:hover .fk-icon-btn__body,
.fk-alert .fk-icon-btn:hover .fk-icon-btn__body,
.fk-modal .fk-icon-btn:hover .fk-icon-btn__body,
.fk-snackbar .fk-icon-btn:active .fk-icon-btn__body,
.fk-alert .fk-icon-btn:active .fk-icon-btn__body,
.fk-modal .fk-icon-btn:active .fk-icon-btn__body {
  background: var(--color-surface-subtle);
}

.fk-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.fk-icon-btn__num {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

/* Notification Button — Figma 391:211. Icon Button body + 20px filled bell; badge sits on top of the
   32px body (outside normal flow) and does not move it. Badge strokes are OUTSIDE in Figma → box-shadow. */
.fk-notif-btn .fk-icon-btn__body svg {
  width: 20px;
  height: 20px;
}

/* Figma Disabled variant keeps full opacity: bell → content/disabled, badge unchanged */
.fk-notif-btn:disabled {
  opacity: 1;
}

.fk-notif-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-notif-dot-bg);
  box-shadow: 0 0 0 2px var(--color-notif-dot-border);
  pointer-events: none;
}

.fk-notif-badge--count {
  top: -2px;
  right: 0;
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background: var(--color-notif-badge-bg);
  box-shadow: 0 0 0 2px var(--color-notif-badge-border);
  color: var(--color-notif-badge-text);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
}

/* Card — Figma 87:12: 340 wide, radius/12, 1px inside stroke, padding 0 on the root;
   media (image flush / icon in content) + content (density/card/padding 24, gap 16).
   Status=Default → elevation/Surface; Status=Hover → elevation/Raised. */
.fk-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 340px);
  border-radius: var(--radius-lg);
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.12s ease;
}

.fk-card:hover {
  box-shadow: var(--shadow-card-hover);
}

/* Media=Image: 160px area flush to the top/left/right; the root clip gives it the top radius */
.fk-card__media {
  display: block;
  width: 100%;
  height: 160px;
  background: var(--color-card-media-bg);
  flex-shrink: 0;
}

.fk-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fk-card__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

/* Media=Icon: 48×48 container (action/primary/subtle, radius/12) with a 24px icon slot inside the padded content */
.fk-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--color-card-icon-bg);
  color: var(--color-card-icon);
  flex-shrink: 0;
}

.fk-card__icon svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* heading/sm */
.fk-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 0;
  margin: 0;
  color: var(--color-card-title);
  overflow-wrap: break-word;
}

/* body/md */
.fk-card__body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--color-card-body);
  overflow-wrap: break-word;
}

.fk-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fields */
.fk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: min(100%, 280px);
}

.fk-field--wide {
  width: min(100%, 428px);
}

.fk-field__label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
}

.fk-field label,
.fk-field__label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  color: var(--color-text-field-label);
}

.fk-field__required {
  color: var(--color-text-field-label-error);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

/* Error / Disabled recolour the label (Figma label/error, label/disabled) */
.fk-field:has(> .fk-input-shell.is-error) label,
.fk-field:has(> .fk-input-shell.is-error) .fk-field__label {
  color: var(--color-text-field-label-error);
}

.fk-field:has(> .fk-input-shell.is-disabled) {
  opacity: 0.6;
}

.fk-field:has(> .fk-input-shell.is-disabled) label,
.fk-field:has(> .fk-input-shell.is-disabled) .fk-field__label,
.fk-field:has(> .fk-input-shell.is-disabled) .fk-field__required {
  color: var(--color-text-field-label-disabled);
}

.fk-field:has(> .fk-input-shell.is-disabled) .fk-helper {
  color: var(--color-text-field-helper-disabled);
}

.fk-field:has(> .fk-input-shell.is-disabled) .fk-helper__icon {
  color: var(--color-text-field-icon-disabled);
}

/* Input container: Medium h48 / px16, Small h40 / px12, radius 8, 1px border */
.fk-input-shell {
  --fk-shell-pad: 16px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 var(--fk-shell-pad);
  border: 1px solid var(--color-text-field-border);
  border-radius: var(--radius-md);
  background: var(--color-text-field-bg);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.fk-input-shell--sm {
  --fk-shell-pad: 12px;
  height: 40px;
}

.fk-input-shell:hover:not(.is-disabled):not(.is-error),
.fk-input-shell.is-hover-demo:not(.is-disabled):not(.is-error) {
  border-color: var(--color-text-field-border-hover);
}

/* Active (editing): 2px border/hover, cancel button visible. Mouse or keyboard. */
.fk-input-shell:focus-within:not(.is-disabled),
.fk-input-shell.is-active-demo:not(.is-disabled) {
  border-color: var(--color-text-field-border-hover);
  border-width: 2px;
}

/* Focus Visible: keyboard only — 2px ring outside a 2px gap (radius 8 + 2 = 10) */
.fk-input-shell:has(> input:focus-visible),
.fk-input-shell.is-focus-demo {
  box-shadow: 0 0 0 2px var(--color-text-field-focus-gap), 0 0 0 4px var(--color-text-field-focus-ring);
}

.fk-input-shell.is-error {
  border-color: var(--color-text-field-border-error);
}

.fk-input-shell.is-error:focus-within,
.fk-input-shell.is-error.is-active-demo {
  border-color: var(--color-text-field-border-error);
}

.fk-input-shell.is-disabled {
  background: var(--color-text-field-bg-disabled);
  border-color: var(--color-text-field-border-disabled);
  cursor: not-allowed;
}

.fk-input-shell input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  color: var(--color-text-field-text);
  outline: none;
  box-shadow: none;
  padding: 0;
}

/* Shell owns Focus Visible. Kill the global :focus-visible ring on the inner input. */
.fk-input-shell input:focus,
.fk-input-shell input:focus-visible {
  outline: none;
  box-shadow: none;
}

.fk-input-shell--sm input {
  font-size: 14px;
  line-height: 20px;
}

.fk-input-shell input::placeholder {
  color: var(--color-text-field-placeholder);
  opacity: 1;
}

.fk-input-shell input:disabled {
  color: var(--color-text-field-text-disabled);
  cursor: not-allowed;
}

.fk-input-shell .fk-leading,
.fk-input-shell .fk-trailing {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-text-field-icon);
}

.fk-input-shell.is-disabled .fk-leading,
.fk-input-shell.is-disabled .fk-trailing {
  color: var(--color-text-field-icon-disabled);
}

/* Active cancel: 32px Icon Button with 16px cancel glyph (Figma Active / Error Active) */
.fk-field__cancel {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-field-icon);
  cursor: pointer;
}

.fk-field__cancel svg {
  width: 16px;
  height: 16px;
}

.fk-input-shell:focus-within:not(.is-disabled) .fk-field__cancel,
.fk-input-shell.is-active-demo:not(.is-disabled) .fk-field__cancel {
  display: inline-flex;
}

.fk-field__cancel:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-field-text);
}

.fk-field__cancel:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Helper / Error rows: gap 4, optional 16px icon, caption 12/16 */
.fk-helper,
.fk-error {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
}

.fk-helper {
  color: var(--color-text-field-helper);
}

.fk-error {
  color: var(--color-text-field-error);
}

.fk-helper__icon,
.fk-error__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.fk-helper__icon {
  color: var(--color-text-field-icon);
}

.fk-error__icon {
  color: var(--color-text-field-icon-error);
}

#text-field .fk-field {
  width: min(100%, 320px);
}

#text-field .preview-panel {
  overflow: visible;
}

/* Search */
.fk-search .fk-input-shell {
  padding-left: 12px;
}

.fk-search .fk-input-shell:focus-within {
  padding-left: 11px;
}

.fk-search-ico {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-text-subtle);
}

.fk-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  flex-shrink: 0;
}

.fk-clear.is-visible {
  display: inline-flex;
}

.fk-clear:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-default);
}

.fk-clear:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Dropdown */
.fk-dropdown {
  position: relative;
  width: min(100%, 320px);
}

.fk-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--color-field-border);
  border-radius: var(--radius-md);
  background: var(--color-field-bg);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text-default);
  cursor: pointer;
  text-align: left;
}

.fk-dropdown__trigger:hover {
  border-color: var(--color-text-default);
}

.fk-dropdown__trigger:focus-visible {
  box-shadow: var(--focus-ring);
  border-color: var(--color-border-focus);
}

.fk-dropdown__trigger[aria-expanded="true"] {
  border-color: var(--color-border-focus);
}

.fk-dropdown__value.is-placeholder {
  color: var(--color-text-placeholder);
}

.fk-dropdown__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-subtle);
}

.fk-dropdown__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--elevation-popover);
  display: none;
}

.fk-dropdown__menu.is-open {
  display: block;
}

.fk-dropdown__option {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-default);
  text-align: left;
  cursor: pointer;
}

.fk-dropdown__option:hover,
.fk-dropdown__option:focus-visible {
  background: var(--color-surface-subtle);
  outline: none;
}

.fk-dropdown__option[aria-selected="true"] {
  background: rgba(211, 63, 85, 0.08);
  font-weight: 500;
}

/* Date Picker */
.fk-datepicker {
  position: relative;
  width: min(100%, 320px);
}

.fk-datepicker .fk-field {
  width: 100%;
}

.fk-datepicker__anchor {
  position: relative;
}

.fk-datepicker__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--color-field-border);
  border-radius: var(--radius-md);
  background: var(--color-field-bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-default);
  cursor: pointer;
  text-align: left;
}

.fk-datepicker__trigger:hover {
  border-color: var(--color-text-default);
}

.fk-datepicker__trigger:focus-visible {
  box-shadow: var(--focus-ring);
  border-color: var(--color-border-focus);
  outline: none;
}

.fk-datepicker__trigger[aria-expanded="true"] {
  border-color: var(--color-action-primary);
  border-width: 2px;
  padding: 0 15px;
}

.fk-datepicker__value.is-placeholder {
  color: var(--color-text-placeholder);
}

.fk-datepicker__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-subtle);
}

.fk-calendar {
  position: absolute;
  z-index: 40;
  top: calc(100% + 2px);
  left: 0;
  width: min(100%, 308px);
  padding: 16px;
  border: 1px solid var(--color-calendar-border);
  border-radius: var(--radius-lg);
  background: var(--color-calendar-bg);
  box-shadow: var(--shadow-popover);
}

.fk-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 32px;
  margin-bottom: 12px;
}

.fk-calendar__month {
  flex: 1;
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
  color: var(--color-text-default);
}

.fk-calendar__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
}

.fk-calendar__nav:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-default);
}

.fk-calendar__nav:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.fk-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}

.fk-calendar__weekdays span {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 24px;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--color-text-subtle);
}

.fk-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.fk-calendar__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-default);
  cursor: pointer;
}

.fk-calendar__day:hover:not(:disabled):not([aria-selected="true"]) {
  background: var(--color-calendar-day-bg-hover);
}

.fk-calendar__day:focus-visible {
  border-color: var(--color-calendar-day-focus-ring);
  outline: none;
}

.fk-calendar__day[aria-selected="true"] {
  background: var(--color-calendar-day-bg-selected);
  color: var(--color-calendar-day-text-selected);
}

.fk-calendar__day.is-today:not([aria-selected="true"]) {
  border-color: var(--color-calendar-day-border-today);
}

.fk-calendar__day.is-today:not([aria-selected="true"]):focus-visible {
  border-color: var(--color-calendar-day-focus-ring);
}

.fk-calendar__day.is-outside {
  color: var(--color-text-subtle);
}

.fk-calendar__day.is-unavailable {
  text-decoration: line-through;
}

.fk-calendar__day:disabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.fk-calendar__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 24px;
  margin-top: 12px;
}

.fk-calendar__footer-btn {
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--color-text-default);
  cursor: pointer;
}

.fk-calendar__footer-btn:hover {
  text-decoration: underline;
}

.fk-calendar__footer-btn:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

/* Checkbox / Radio */
.fk-control {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 420px;
}

.fk-control input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.fk-control__indicator {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--color-border-control);
  background: var(--color-surface-card);
  display: grid;
  place-items: center;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.fk-check .fk-control__indicator {
  border-radius: 4px;
}

.fk-radio .fk-control__indicator {
  border-radius: var(--radius-full);
}

.fk-control__mark {
  display: none;
  width: 12px;
  height: 12px;
  color: var(--color-action-primary-text);
}

.fk-radio .fk-control__mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-action-primary);
}

.fk-control input:checked + .fk-control__indicator {
  background: var(--color-action-primary);
  border-color: var(--color-action-primary);
}

.fk-radio input:checked + .fk-control__indicator {
  background: var(--color-surface-card);
  border-color: var(--color-action-primary);
}

.fk-control input:checked + .fk-control__indicator .fk-control__mark {
  display: block;
}

.fk-control input:focus-visible + .fk-control__indicator {
  box-shadow: var(--focus-ring);
}

.fk-control input:disabled + .fk-control__indicator {
  background: var(--color-surface-disabled);
  border-color: var(--color-action-primary-disabled);
}

.fk-control input:disabled ~ .fk-control__content {
  color: var(--color-text-disabled);
}

.fk-control__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fk-control__label {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  cursor: pointer;
}

.fk-control__desc {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-subtle);
}

.fk-control input:disabled ~ .fk-control__content .fk-control__label {
  cursor: not-allowed;
}

/* Switch — track 44×24, thumb 20 */
.fk-switch {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 400px;
}

.fk-switch__btn {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-switch-track-off);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.fk-switch__btn[aria-checked="true"] {
  background: var(--color-switch-track-on);
}

.fk-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-switch-thumb);
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fk-switch__btn[aria-checked="true"] .fk-switch__thumb {
  transform: translateX(20px);
}

.fk-switch__btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.fk-switch__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fk-switch__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fk-switch__label {
  font-size: 16px;
  line-height: 24px;
}

.fk-switch__desc {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-subtle);
}

/* Jumbo Select */
.fk-jumbo-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(100%, 340px);
}

.fk-jumbo {
  display: flex;
  width: 100%;
  padding: 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.fk-jumbo__inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 12px 20px;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--color-surface-card);
  transition: border-color 0.12s ease, background-color 0.12s ease, border-width 0.12s ease, padding 0.12s ease;
}

.fk-jumbo:hover .fk-jumbo__inner {
  border-color: var(--color-border-default);
  background: var(--color-surface-subtle);
}

.fk-jumbo:focus-visible {
  box-shadow: var(--focus-ring);
  border-radius: 14px;
}

.fk-jumbo[aria-checked="true"] .fk-jumbo__inner {
  border-width: 2px;
  border-color: var(--color-jumbo-selected-border);
  background: rgba(47, 158, 96, 0.06);
  padding: 11px 19px;
}

.fk-jumbo__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--color-surface-subtle);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--color-text-subtle);
}

.fk-jumbo__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fk-jumbo__label {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.fk-jumbo__sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--color-text-subtle);
}

.fk-jumbo__check {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  margin-top: 2px;
}

.fk-jumbo[aria-checked="true"] .fk-jumbo__check {
  background: var(--color-jumbo-indicator);
  border-color: var(--color-jumbo-indicator);
}

/* Snackbar */
.fk-snackbar-host {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 56px;
}

.fk-snackbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--color-snackbar-bg);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-floating);
  font-size: 14px;
  line-height: 20px;
}

.fk-snackbar--success {
  border-color: var(--color-status-success);
}

.fk-snackbar--warning {
  border-color: var(--color-status-warning-soft);
}

.fk-snackbar--danger {
  border-color: var(--color-status-danger);
}

.fk-snackbar--info {
  border-color: var(--color-status-info);
}

.fk-snackbar__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-status-success);
}

.fk-snackbar__msg {
  flex: 1;
  min-width: 0;
}

.fk-snackbar__close {
  flex-shrink: 0;
}

.fk-snackbar[hidden] {
  display: none;
}

/* Alert */
.fk-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(100%, 640px);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-card);
}

.fk-alert--info {
  border-color: var(--color-status-info);
  background: var(--color-alert-info-bg);
}

.fk-alert--success {
  border-color: var(--color-status-success);
  background: rgba(47, 158, 96, 0.06);
}

.fk-alert--warning {
  border-color: var(--color-status-warning-soft);
  background: rgba(217, 119, 6, 0.08);
}

.fk-alert--danger {
  border-color: var(--color-status-danger);
  background: rgba(220, 38, 38, 0.06);
}

.fk-alert__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.fk-alert__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fk-alert__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  margin: 0;
}

.fk-alert__msg {
  font-size: 14px;
  line-height: 20px;
  margin: 0;
  color: var(--color-text-subtle);
}

.fk-alert[hidden] {
  display: none;
}

/* Tooltip */
.fk-tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.fk-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: 270px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  font-size: 14px;
  line-height: 20px;
  box-shadow: var(--shadow-floating);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.fk-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-surface-inverse);
}

.fk-tooltip-wrap:hover .fk-tooltip,
.fk-tooltip-wrap:focus-within .fk-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.fk-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--color-surface-overlay);
}

.fk-modal-backdrop[hidden] {
  display: none;
}

.fk-modal {
  width: min(100%, 480px);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-default);
  background: var(--color-surface-card);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fk-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fk-modal__title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  margin: 0;
  color: var(--color-heading);
}

.fk-modal__body {
  font-size: 16px;
  line-height: 24px;
  margin: 0;
  color: var(--color-text-default);
}

.fk-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

body.modal-open {
  overflow: hidden;
}

/* Pagination — item 40×40 */
.fk-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fk-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-default);
  cursor: pointer;
}

.fk-page:hover:not(:disabled):not(.is-ellipsis) {
  background: var(--color-surface-subtle);
}

.fk-page.is-active {
  background: var(--color-action-primary);
  color: var(--color-action-primary-text);
  font-weight: 600;
}

.fk-page:focus-visible {
  box-shadow: var(--focus-ring);
}

.fk-page:disabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.fk-page.is-ellipsis {
  cursor: default;
  pointer-events: none;
}

.fk-page--nav {
  width: 32px;
  height: 32px;
}

/* Progress */
.fk-progress {
  width: min(100%, 360px);
}

.fk-progress-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 21px;
}

.fk-progress-header .value {
  color: var(--color-text-subtle);
}

.fk-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-progress-track);
  overflow: hidden;
}

.fk-track--sm {
  height: 4px;
}

.fk-track--lg {
  height: 12px;
}

.fk-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  background: var(--color-progress-fill);
  transition: width 0.2s ease;
}

.fk-progress-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  max-width: 360px;
}

.fk-progress-control input[type="range"] {
  flex: 1;
  accent-color: var(--color-progress-fill);
}

.fk-progress-grid {
  display: grid;
  gap: 20px;
  width: min(100%, 360px);
}

/* Misc docs */
/* —— Foundation / Color documentation —— */
.eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-caption-lh);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand-primary);
}

.color-section {
  margin: var(--space-6) 0 var(--space-10);
}

.color-section__header h3 {
  margin-top: 0;
}

.color-section__header p {
  max-width: 46rem;
  color: var(--color-text-subtle);
}

.color-group {
  margin: var(--space-8) 0;
}

.color-group__header {
  margin-bottom: var(--space-4);
}

.color-group__header h4 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.color-group__subtitle {
  margin: 0;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}

.brand-card {
  display: flex;
  gap: var(--space-4);
  align-items: stretch;
  padding: var(--space-4);
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  box-shadow: var(--elevation-surface);
}

.brand-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}

.brand-card__body h5 {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.color-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-control);
  overflow: hidden;
  min-width: 0;
}

.color-card.is-brand {
  box-shadow: inset 0 0 0 1px rgba(211, 63, 85, 0.35);
}

.color-swatch {
  height: 64px;
  border-bottom: 1px solid var(--color-border-subtle);
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08);
}

.color-swatch--lg {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(28, 25, 23, 0.12);
  box-shadow: none;
}

[data-theme="dark"] .color-swatch {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .color-swatch--lg {
  border-color: rgba(255, 255, 255, 0.18);
}

.color-card__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
}

.color-step {
  font-size: var(--text-caption-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
}

.color-token {
  display: block;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  word-break: break-all;
  background: transparent;
  padding: 0;
  color: var(--color-text-default);
}

.color-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
  text-transform: uppercase;
}

.inline-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(28, 25, 23, 0.15);
  vertical-align: -2px;
  margin-right: 8px;
}

[data-theme="dark"] .inline-swatch {
  border-color: rgba(255, 255, 255, 0.2);
}

.token-table code {
  background: transparent;
  padding: 0;
}

.color-guidance ul {
  margin-bottom: 0;
}

.color-guidance li {
  margin-bottom: 0.4rem;
}

/* Legacy ramp helpers (kept for any residual uses) */
.ramp {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0;
}

.ramp-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface-card);
}

.ramp-item .chip {
  height: 48px;
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.08);
}

.ramp-item .meta {
  padding: 6px 8px;
  font-size: 0.7rem;
  color: var(--color-text-subtle);
}

@media (max-width: 900px) {
  .color-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .brand-card {
    flex-direction: column;
  }

  .color-swatch--lg {
    width: 100%;
    height: 80px;
  }
}

/* —— Foundation / Typography documentation —— */
.typography-section {
  margin: var(--space-6) 0 var(--space-10);
}

.typography-section__header h3 {
  margin-top: 0;
}

.typography-section__header p {
  max-width: 46rem;
  color: var(--color-text-subtle);
}

/* Foundation — Elevation & Shadow (Figma 255:1944) */
.elevation-section {
  margin: var(--space-6) 0 var(--space-10);
}

.elevation-section__header h3 {
  margin-top: 0;
}

.elevation-section__header p {
  max-width: 46rem;
  color: var(--color-text-subtle);
}

.elevation-group {
  margin: var(--space-8) 0;
}

.elevation-group__header {
  margin-bottom: var(--space-4);
}

.elevation-group__header h4 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.elevation-group__subtitle {
  margin: 0;
  max-width: 46rem;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.elevation-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.elevation-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* Neutral stage: page colour so the shadow reads against the same backdrop as in Figma */
.elevation-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-5);
  background: var(--color-surface-page);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* 160×80, radius 12, surface/card fill, 1px border/subtle — same as the Figma preview */
.elevation-preview {
  width: 160px;
  height: 80px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-subtle);
}

.elevation-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.elevation-meta h5 {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.elevation-tokens {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.shadow-token {
  display: inline-block;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  background: var(--color-code-bg);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-text-default);
}

.shadow-style {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
}

.shadow-style code {
  font-size: 0.95em;
}

.shadow-value {
  margin: 2px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-default);
  font-variant-numeric: tabular-nums;
}

.shadow-usage {
  margin: 0;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.elevation-table code {
  white-space: nowrap;
}

.elevation-companions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.elevation-companion {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  align-items: flex-start;
  padding: var(--space-4);
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
}

/* Light | Dark swatch pair */
.elevation-companion__swatches {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.elevation-companion__swatches span {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(28, 25, 23, 0.12);
  background-image: linear-gradient(45deg, rgba(120, 113, 108, 0.25) 25%, transparent 25%, transparent 75%, rgba(120, 113, 108, 0.25) 75%),
    linear-gradient(45deg, rgba(120, 113, 108, 0.25) 25%, transparent 25%, transparent 75%, rgba(120, 113, 108, 0.25) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

.elevation-dark-demo {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
  margin-top: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface-page);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
}

.elevation-dark-demo__panel {
  height: 96px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-floating);
  border: 1px solid var(--color-border-elevated);
  box-shadow: var(--elevation-floating);
}

@media (max-width: 720px) {
  .elevation-dark-demo {
    grid-template-columns: minmax(0, 1fr);
  }
}

.type-group {
  margin: var(--space-8) 0;
}

.type-group h4 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.type-group__intro {
  margin: 0 0 var(--space-4);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.type-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.type-family-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  box-shadow: var(--elevation-surface);
}

.type-family-sample {
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  color: var(--color-heading);
}

.type-family-sample--display {
  font-family: var(--font-heading);
  font-size: var(--text-heading-xl-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--text-heading-xl-lh);
}

.type-family-sample--body {
  font-family: var(--font-body);
  font-size: var(--text-heading-md-size);
  font-weight: var(--font-weight-regular);
  line-height: var(--text-heading-md-lh);
}

.type-family-card__body h5 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.type-family-card__body p {
  margin: var(--space-2) 0 0;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.type-token {
  display: inline-block;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  word-break: break-word;
  background: var(--color-code-bg);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
}

.type-meta {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
}

.type-specimen-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.type-specimen-row {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  box-shadow: var(--elevation-surface);
}

.type-specimen-row__label {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: var(--space-3);
}

.type-preview {
  margin: 0;
  color: var(--color-text-default);
  overflow-wrap: anywhere;
}

.type-preview--display-lg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
}

.type-preview--heading-xl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  line-height: 48px;
}

.type-preview--heading-md {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 32px;
}

.type-preview--body-md {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
}

.type-preview--caption-md {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
}

.type-preview--button-md {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
}

/* Type scale — grouped specimen rows: preview | metadata */
.type-scale {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.type-scale-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: var(--space-3);
}

.type-scale-group__head h5 {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-md-size);
  line-height: var(--text-body-md-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-heading);
}

.type-scale-group__head p {
  margin: 0;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.type-scale-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.type-specimen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: var(--space-4) var(--space-6);
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-docs-border);
}

.type-specimen:last-child {
  border-bottom: 0;
}

.type-specimen__preview {
  margin: 0;
  min-width: 0;
  color: var(--color-text-default);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.type-specimen__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-left: var(--space-5);
  border-left: 1px solid var(--color-docs-border);
}

.type-specimen__meta .type-token {
  align-self: flex-start;
  font-size: 0.8rem;
  word-break: normal;
}

.type-use {
  margin: 0;
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-default);
}

.type-detail {
  display: grid;
  grid-template-columns: minmax(118px, max-content) max-content; /* fixed first column keeps rows aligned */
  gap: var(--space-1) var(--space-4);
  margin: var(--space-1) 0 0;
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
}

.type-detail > div {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.type-detail dt {
  color: var(--color-text-subtle);
}

.type-detail dt::after {
  content: ":";
}

.type-detail dd {
  margin: 0;
  color: var(--color-text-default);
  font-variant-numeric: tabular-nums;
}

.type-guidance ul {
  margin-bottom: 0;
}

.type-guidance li {
  margin-bottom: 0.4rem;
}

@media (max-width: 900px) {
  .type-preview--heading-xl {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    line-height: 1.2;
  }

  .type-specimen {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  }
}

@media (max-width: 720px) {
  .type-specimen {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .type-specimen__meta {
    padding-left: 0;
    padding-top: var(--space-3);
    border-left: 0;
    border-top: 1px solid var(--color-docs-border);
  }

  .type-detail {
    grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
  }
}

.comp-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.comp-index a {
  display: block;
  padding: var(--space-4);
  background: var(--color-surface-card);
  border: 1px solid var(--color-docs-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text-default);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comp-index a:hover {
  border-color: var(--color-brand-primary);
  box-shadow: var(--elevation-surface);
}

.comp-index strong {
  display: block;
  margin-bottom: 4px;
}

.comp-index span {
  font-size: var(--text-caption-size);
  line-height: var(--text-caption-lh);
  color: var(--color-text-subtle);
}

.footer-note {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-docs-border);
  font-size: var(--text-body-sm-size);
  line-height: var(--text-body-sm-lh);
  color: var(--color-text-subtle);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Mobile —— */
@media (max-width: 900px) {
  .doc-shell {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-width), 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--elevation-floating);
  }

  body.nav-open .doc-sidebar {
    transform: translateX(0);
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--color-surface-overlay);
    z-index: 18;
  }

  h1 {
    font-size: var(--text-heading-lg-size);
    line-height: var(--text-heading-lg-lh);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .content {
    padding: var(--space-6) var(--space-4) var(--space-12);
  }

  .doc-topbar {
    padding: 0 var(--space-4);
  }

  .do-dont {
    grid-template-columns: 1fr;
  }

  .theme-toggle__label {
    display: none;
  }
}
