/* ==========================================================================
   Design Tokens as CSS Custom Properties
   Source: tokens.json — Mapped/light + Responsive/Desktop
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* --- Surface (Mapped/light) --- */
  --surface-page: #fafafa;
  --surface-default-container: #fdfdfd;
  --surface-top-container: #f5f5f5;
  --surface-middle-container: #e9e9e9;
  --surface-bottom-container: #d0d0d0;
  --surface-brand-primary: #e96620;
  --surface-brand-secondary: #0063c7;
  --surface-action: #e96620;
  --surface-action-hover: #f78958;
  --surface-action-pressed: #d14000;
  --surface-action-on: #ffffff;
  --surface-disabled: #f5f5f5;
  --surface-indicator-bg: #ffe2d4;
  --surface-information: #eff7f9;
  --surface-information-indicator-bg: #dcedf3;
  --surface-success: #f1f7f2;
  --surface-success-indicator-bg: #e0eee3;
  --surface-error: #fff1f1;
  --surface-error-indicator-bg: #ffe1e1;

  /* --- Text (Mapped/light) --- */
  --text-headings: #393939;
  --text-body: #464646;
  --text-captions: #666666;
  --text-placeholder: #7d7d7d;
  --text-nav: #2b2b2b;
  --text-footer: #2b2b2b;
  --text-action: #e96620;
  --text-action-hover: #f78958;
  --text-action-pressed: #d14000;
  --text-action-disabled: #979797;
  --text-action-on: #ffffff;
  --text-action-on-hover: #fff1eb;
  --text-action-on-pressed: #ffc7ae;
  --text-status-information: #097892;
  --text-status-information-hover: #3a90a9;
  --text-status-success: #438558;
  --text-status-success-hover: #609c71;
  --text-status-error: #de515e;
  --text-status-error-hover: #ed6f76;

  /* --- Border (Mapped/light) --- */
  --border-default: #e9e9e9;
  --border-accent: #d0d0d0;
  --border-action: #f78958;
  --border-action-hover: #ffa984;
  --border-action-focus: #FFC7AE;
  --border-action-pressed: #e96620;
  --border-outline: #e96620;
  --border-disabled: #e9e9e9;
  --border-information: #3a90a9;
  --border-success: #609c71;
  --border-error: #f88c90;
  --border-width-m-action: 2px;

  /* --- Border Radius (Alias) --- */
  --radius-none: 0;
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-focus-ring: 10px;
  --radius-l: 16px;
  --radius-xl: 24px;
  --radius-xxl: 48px;

  /* --- Spacing Scale (Brand) --- */
  --space-0: 0px;
  --space-10: 1px;
  --space-25: 2px;
  --space-50: 4px;
  --space-100: 8px;
  --space-150: 12px;
  --space-200: 16px;
  --space-225: 18px;
  --space-250: 20px;
  --space-300: 24px;
  --space-400: 32px;
  --space-500: 40px;
  --space-600: 48px;
  --space-700: 56px;
  --space-800: 64px;
  --space-900: 72px;
  --space-1000: 80px;
  --space-1100: 88px;
  --space-1200: 96px;
  --space-1300: 104px;
  --space-1400: 112px;
  --space-2200: 176px;
  --space-2400: 192px;
  --space-4200: 336px;
  --space-5600: 448px;
  --space-9200: 736px;

  /* --- Fixed Padding (Responsive) --- */
  --padding-xxs: 2px;
  --padding-xs: 4px;
  --padding-s: 8px;
  --padding-s-m: 12px;
  --padding-m: 16px;
  --padding-l: 24px;
  --padding-xl: 32px;

  /* --- Jumper Spacing (Desktop) --- */
  --jumper-xl-lg: 96px;
  --jumper-lg-md: 64px;
  --jumper-md-sm: 48px;
  --jumper-sm-xs: 32px;
  --jumper-xs-xxs: 24px;
  --jumper-xxs-xxxs: 16px;
  --jumper-xxxs-tiny: 8px;
  --jumper-tiny: 4px;

  /* --- Grid (Desktop) --- */
  --grid-col-margin: 16px;
  --grid-global-margin: var(--space-2200);
  --grid-col-count: 12;
  --grid-col-width: 64px;
  --grid-col-gutter: 32px;
  --grid-row-gap: 32px;
  --grid-body-max-width: var(--space-9200);

  /* --- Cards (Desktop) --- */
  --card-xxl: 896px;
  --card-xl: var(--space-9200);
  --card-l: 672px;
  --card-m: 512px;
  --card-s: var(--space-4200);
  --card-xs: 128px;

  /* --- Typography (Desktop) --- */
  --font-primary: 'Lato', sans-serif;
  --font-icons: 'Font Awesome 6 Free';

  --hero-size: 64px;
  --hero-line: 76px;
  --hero-weight: 900;

  --h1-size: 56px;
  --h1-line: 64px;
  --h1-weight: 900;

  --h2-size: 48px;
  --h2-line: 56px;
  --h2-weight: 900;

  --h3-size: 40px;
  --h3-line: 48px;
  --h3-weight: 900;

  --h4-size: 32px;
  --h4-line: 40px;
  --h4-weight: 900;

  --h5-size: 24px;
  --h5-line: 28px;
  --h5-weight: 900;

  --h6-size: 20px;
  --h6-line: 24px;
  --h6-weight: 700;

  --body-xxl-size: 32px;
  --body-xxl-line: 44px;

  --body-xl-size: 24px;
  --body-xl-line: 40px;

  --body-l-size: 20px;
  --body-l-line: 32px;

  --body-m-size: 16px;
  --body-m-line: 26px;

  --body-s-size: 14px;
  --body-s-line: 20px;

  --body-xs-size: 12px;
  --body-xs-line: 16px;

  /* --- Button Mapped Tokens (from Figma) --- */
  --btn-primary-bg: #e96620;
  --btn-primary-bg-hover: #f78958;
  --btn-primary-bg-pressed: #d14000;
  --btn-primary-bg-disabled: #f5f5f5;
  --btn-primary-border: #f78958;
  --btn-primary-border-hover: #ffa984;
  --btn-primary-border-pressed: #e96620;
  --btn-primary-outline: #e96620;
  --btn-primary-text: #ffffff;
  --btn-primary-text-hover: #fff1eb;
  --btn-primary-text-pressed: #ffc7ae;
  --btn-icon-action-on: #ffffff;
  --btn-icon-action: #e96620;
  --btn-icon-action-hover: #f78958;
  --btn-icon-action-pressed: #d14000;
  --btn-icon-action-disabled: #979797;
  --btn-icon-on-hover: #fff1eb;
  --btn-icon-on-pressed: #ffc7ae;
  --btn-border-disabled: #e9e9e9;
  --btn-border-width: 2px;
  --btn-radius: 48px;

  /* --- Shadow (Brand scale) --- */
  --shadow-0: rgba(255, 255, 255, 0);
  --shadow-200: rgba(208, 208, 208, 0.1);
  --shadow-300: rgba(179, 179, 179, 0.1);
  --shadow-400: rgba(151, 151, 151, 0.1);
  --shadow-1100: rgba(24, 24, 24, 0.1);
  --shadow-1100-50: rgba(24, 24, 24, 0.5);

  /* --- Shadow Mapped Tokens --- */
  --shadow-default-container: var(--shadow-300);
  --shadow-button: var(--shadow-0);
  --shadow-l: var(--shadow-300);
  --shadow-offset-y: 8px;
  --shadow-blur-m: 16px;

  /* --- Shadow Shorthand --- */
  --shadow-default: 0px var(--shadow-offset-y) var(--shadow-blur-m) 0px var(--shadow-default-container);
  --shadow-btn: 0px var(--shadow-offset-y) var(--shadow-blur-m) 0px var(--shadow-button);
  --shadow-large: 0px var(--shadow-offset-y) var(--shadow-blur-m) 0px var(--shadow-l);

  /* --- Breakpoints --- */
  --bp-mobile-min: 320px;
  --bp-mobile-max: 1103px;
  --bp-desktop-min: 1104px;
  --bp-desktop-max: 1919px;
  --bp-mega-min: 1920px;

  /* --- Sidebar width --- */
  --sidebar-width: 280px;
}

/* ==========================================================================
   Dark Theme Overrides (Mapped/dark)
   Resolved from tokens.json Mapped/dark → Alias → Brand hex values
   ========================================================================== */

.dark-theme {
  /* --- Surface (Mapped/dark) --- */
  --surface-page: #2b2b2b;
  --surface-default-container: #393939;
  --surface-top-container: #666666;
  --surface-middle-container: #555555;
  --surface-bottom-container: #464646;
  --surface-brand-primary: #e96620;
  --surface-brand-secondary: #307edf;
  --surface-action: rgba(233, 102, 32, 0.5);
  --surface-action-hover: rgba(247, 137, 88, 0.5);
  --surface-action-pressed: rgba(209, 64, 0, 0.5);
  --surface-action-on: #393939;
  --surface-disabled: #2b2b2b;
  --surface-indicator-bg: rgba(255, 226, 212, 0.5);
  --surface-information: #00313e;
  --surface-information-indicator-bg: rgba(220, 237, 243, 0.5);
  --surface-success: #003617;
  --surface-success-indicator-bg: rgba(224, 238, 227, 0.5);
  --surface-error: #570013;
  --surface-error-indicator-bg: rgba(255, 225, 225, 0.5);

  /* --- Text (Mapped/dark) --- */
  --text-headings: #fafafa;
  --text-body: #d0d0d0;
  --text-captions: #b3b3b3;
  --text-placeholder: #666666;
  --text-nav: #ffffff;
  --text-footer: #ffffff;
  --text-action: #e96620;
  --text-action-hover: #f78958;
  --text-action-pressed: #d14000;
  --text-action-disabled: #7d7d7d;
  --text-action-on: #ffe2d4;
  --text-action-on-hover: #fff1eb;
  --text-action-on-pressed: #ffc7ae;
  --text-status-information: #8cc1d3;
  --text-status-information-hover: #63a9bf;
  --text-status-success: #a0c7a9;
  --text-status-success-hover: #7fb28c;
  --text-status-error: #ffa9ab;
  --text-status-error-hover: #f88c90;

  /* --- Border (Mapped/dark) --- */
  --border-default: #555555;
  --border-accent: #464646;
  --border-action: rgba(233, 102, 32, 0.5);
  --border-action-hover: rgba(247, 137, 88, 0.5);
  --border-action-focus: rgba(209, 64, 0, 0.5);
  --border-action-pressed: rgba(209, 64, 0, 0.5);
  --border-outline: rgba(233, 102, 32, 0.5);
  --border-disabled: #464646;
  --border-information: #004050;
  --border-success: #054722;
  --border-error: rgba(133, 0, 34, 0.5);

  /* --- Button Mapped Tokens (Mapped/dark) --- */
  --btn-primary-bg: rgba(233, 102, 32, 0.5);
  --btn-primary-bg-hover: rgba(247, 137, 88, 0.5);
  --btn-primary-bg-pressed: rgba(209, 64, 0, 0.5);
  --btn-primary-bg-disabled: #2b2b2b;
  --btn-primary-border: rgba(233, 102, 32, 0.5);
  --btn-primary-border-hover: rgba(247, 137, 88, 0.5);
  --btn-primary-border-pressed: rgba(209, 64, 0, 0.5);
  --btn-primary-outline: rgba(233, 102, 32, 0.5);
  --btn-primary-text: #ffe2d4;
  --btn-primary-text-hover: #fff1eb;
  --btn-primary-text-pressed: #ffc7ae;
  --btn-icon-action-on: #ffe2d4;
  --btn-icon-action: #e96620;
  --btn-icon-action-hover: #f78958;
  --btn-icon-action-pressed: #d14000;
  --btn-icon-action-disabled: #7d7d7d;
  --btn-icon-on-hover: #fff1eb;
  --btn-icon-on-pressed: #ffc7ae;
  --btn-border-disabled: #464646;

  /* --- Shadow Mapped Tokens (dark) --- */
  --shadow-default-container: var(--shadow-1100);
  --shadow-button: var(--shadow-1100-50);
  --shadow-l: var(--shadow-1100-50);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light-theme) {
    /* --- Surface (Mapped/dark) --- */
    --surface-page: #2b2b2b;
    --surface-default-container: #393939;
    --surface-top-container: #666666;
    --surface-middle-container: #555555;
    --surface-bottom-container: #464646;
    --surface-brand-primary: #e96620;
    --surface-brand-secondary: #307edf;
    --surface-action: rgba(233, 102, 32, 0.5);
    --surface-action-hover: rgba(247, 137, 88, 0.5);
    --surface-action-pressed: rgba(209, 64, 0, 0.5);
    --surface-action-on: #393939;
    --surface-disabled: #2b2b2b;
    --surface-indicator-bg: rgba(255, 226, 212, 0.5);
    --surface-information: #00313e;
    --surface-information-indicator-bg: rgba(220, 237, 243, 0.5);
    --surface-success: #003617;
    --surface-success-indicator-bg: rgba(224, 238, 227, 0.5);
    --surface-error: #570013;
    --surface-error-indicator-bg: rgba(255, 225, 225, 0.5);

    /* --- Text (Mapped/dark) --- */
    --text-headings: #fafafa;
    --text-body: #d0d0d0;
    --text-captions: #b3b3b3;
    --text-placeholder: #666666;
    --text-nav: #ffffff;
    --text-footer: #ffffff;
    --text-action: #e96620;
    --text-action-hover: #f78958;
    --text-action-pressed: #d14000;
    --text-action-disabled: #7d7d7d;
    --text-action-on: #ffe2d4;
    --text-action-on-hover: #fff1eb;
    --text-action-on-pressed: #ffc7ae;
    --text-status-information: #8cc1d3;
    --text-status-information-hover: #63a9bf;
    --text-status-success: #a0c7a9;
    --text-status-success-hover: #7fb28c;
    --text-status-error: #ffa9ab;
    --text-status-error-hover: #f88c90;

    /* --- Border (Mapped/dark) --- */
    --border-default: #555555;
    --border-accent: #464646;
    --border-action: rgba(233, 102, 32, 0.5);
    --border-action-hover: rgba(247, 137, 88, 0.5);
    --border-action-pressed: rgba(209, 64, 0, 0.5);
    --border-outline: rgba(233, 102, 32, 0.5);
    --border-disabled: #464646;
    --border-information: #004050;
    --border-success: #054722;
    --border-error: rgba(133, 0, 34, 0.5);

    /* --- Button Mapped Tokens (Mapped/dark) --- */
    --btn-primary-bg: rgba(233, 102, 32, 0.5);
    --btn-primary-bg-hover: rgba(247, 137, 88, 0.5);
    --btn-primary-bg-pressed: rgba(209, 64, 0, 0.5);
    --btn-primary-bg-disabled: #2b2b2b;
    --btn-primary-border: rgba(233, 102, 32, 0.5);
    --btn-primary-border-hover: rgba(247, 137, 88, 0.5);
    --btn-primary-border-pressed: rgba(209, 64, 0, 0.5);
    --btn-primary-outline: rgba(233, 102, 32, 0.5);
    --btn-primary-text: #ffe2d4;
    --btn-primary-text-hover: #fff1eb;
    --btn-primary-text-pressed: #ffc7ae;
    --btn-icon-action-on: #ffe2d4;
    --btn-icon-action: #e96620;
    --btn-icon-action-hover: #f78958;
    --btn-icon-action-pressed: #d14000;
    --btn-icon-action-disabled: #7d7d7d;
    --btn-icon-on-hover: #fff1eb;
    --btn-icon-on-pressed: #ffc7ae;
    --btn-border-disabled: #464646;

    /* --- Shadow Mapped Tokens (dark) --- */
    --shadow-default-container: var(--shadow-1100);
    --shadow-button: var(--shadow-1100-50);
    --shadow-l: var(--shadow-1100-50);
  }
}


/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
}


/* ==========================================================================
   Layout Shell
   ========================================================================== */

.site-wrapper {
  display: flex;
  height: 100vh;
}


/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface-default-container);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.sidebar-header {
  padding: var(--padding-l) var(--padding-l) var(--padding-m);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.sidebar-header h1 {
  font-size: var(--h6-size);
  font-weight: var(--h6-weight);
  line-height: var(--h6-line);
  color: var(--text-headings);
  letter-spacing: -0.5%;
}

.sidebar-header .subtitle {
  font-size: var(--body-xs-size);
  line-height: var(--body-xs-line);
  color: var(--text-captions);
  margin-top: var(--space-50);
  text-transform: uppercase;
  letter-spacing: 1%;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--padding-m) 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: var(--radius-s);
}

.sidebar-category {
  margin-bottom: var(--space-100);
}

.sidebar-category-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--padding-s) var(--padding-l);
  font-size: var(--body-xs-size);
  font-weight: 700;
  line-height: var(--body-xs-line);
  color: var(--text-captions);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-category-label:hover {
  color: var(--text-headings);
}

.sidebar-category-label .chevron {
  transition: transform 0.2s ease;
  font-size: 10px;
  color: var(--text-placeholder);
}

.sidebar-category.collapsed .chevron {
  transform: rotate(-90deg);
}

.sidebar-category.collapsed .sidebar-links {
  display: none;
}

.sidebar-links {
  list-style: none;
}

.sidebar-link {
  display: block;
  padding: var(--padding-xs) var(--padding-l) var(--padding-xs) var(--padding-xl);
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  color: var(--text-body);
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sidebar-link:hover {
  background: var(--surface-action-hover);
  border-left-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.sidebar-link:focus-visible {
  outline: 2px solid var(--surface-action-focus);
  outline-offset: -2px;
  border-radius: var(--radius-s);
}

.sidebar-link.active {
  background: var(--surface-action);
  color: var(--text-action-on);
  border-left-color: var(--border-action);
  font-weight: 700;
}


/* ==========================================================================
   Main Content
   ========================================================================== */

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-top: var(--jumper-lg-md);
  padding-bottom: var(--jumper-lg-md);
}

.page {
  display: none;
  padding: var(--jumper-lg-md) var(--grid-global-margin);
  box-sizing: border-box;
}



.page.active {
  display: block;
}


.page-breadcrumb {
  font-size: var(--body-xs-size);
  line-height: var(--body-xs-line);
  color: var(--text-captions);
  margin-bottom: var(--padding-m);
}

.page-breadcrumb span {
  color: var(--text-placeholder);
}


/* ==========================================================================
   Typography
   ========================================================================== */

  h1, h2, h3, h4, h5, h6, p, .page p, .page p.lead,
  .page .page-breadcrumb, .guidance-grid, .doc-table, .code-block,
  .page ul, .page ol, .carousel, .preview-block, .spacing-row, .swatch-grid, .type-sample,
  .theme-comparison, .theme-comparison-full {
    width: 100%;
    max-width: var(--grid-body-max-width);
  }


.page h1 {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  font-weight: var(--h3-weight);
  color: var(--text-headings);
  margin-bottom: var(--padding-m);
}

.page h2 {
  font-size: var(--h5-size);
  line-height: var(--h5-line);
  font-weight: var(--h5-weight);
  color: var(--text-headings);
  margin-top: var(--jumper-md-sm);
  margin-bottom: var(--space-200);
  padding-bottom: var(--space-100);
  border-bottom: 1px solid var(--border-default);
}

.page h3 {
  font-size: var(--h6-size);
  line-height: var(--h6-line);
  font-weight: var(--h6-weight);
  color: var(--text-headings);
  margin-top: var(--space-400);
  margin-bottom: var(--space-150);
}

.page p {
  margin-bottom: var(--space-200);
}

.page ul, .page ol {
  margin-bottom: var(--space-200);
  padding-left: var(--space-300);
}

.page li {
  margin-bottom: var(--space-100);
}

.lead {
  font-size: var(--body-l-size);
  line-height: var(--body-l-line);
  color: var(--text-captions);
  margin-bottom: var(--space-400);
}


/* ==========================================================================
   Tokens / Swatches
   ========================================================================== */

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-200);
  margin-bottom: var(--space-400);
}

.swatch {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.swatch-color {
  height: 64px;
}

.swatch-info {
  padding: var(--padding-s);
  font-size: var(--body-xs-size);
  line-height: var(--body-xs-line);
}

.swatch-info .name {
  font-weight: 700;
  color: var(--text-headings);
  display: block;
  margin-bottom: 2px;
}

.swatch-info .value {
  color: var(--text-captions);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
}


/* ==========================================================================
   Spacing Scale
   ========================================================================== */

.spacing-row {
  display: flex;
  align-items: center;
  gap: var(--space-200);
  margin-bottom: var(--space-150);
}

.spacing-bar {
  height: 24px;
  background: var(--surface-action);
  border-radius: var(--radius-s);
  opacity: 0.7;
}

.spacing-label {
  font-size: var(--body-s-size);
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-body);
  min-width: 100px;
  flex-shrink: 0;
}

.spacing-value {
  font-size: var(--body-xs-size);
  color: var(--text-captions);
  min-width: 40px;
}


/* ==========================================================================
   Type Scale Preview
   ========================================================================== */

.type-sample {
  margin-bottom: var(--space-300);
  padding-bottom: var(--space-300);
  border-bottom: 1px solid var(--border-default);
}

.type-sample:last-child {
  border-bottom: none;
}

.type-meta {
  display: flex;
  gap: var(--space-200);
  font-size: var(--body-xs-size);
  color: var(--text-captions);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-top: var(--space-100);
}


/* ==========================================================================
   Code Blocks
   ========================================================================== */

.code-block {
  position: relative;
  margin-bottom: var(--space-400);
}

.code-block pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: var(--padding-l);
  border-radius: var(--radius-m);
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: var(--body-s-size);
  line-height: 1.6;
  tab-size: 2;
}

.code-block .copy-btn {
  position: absolute;
  top: var(--padding-s);
  right: var(--padding-s);
  padding: var(--padding-xs) var(--padding-s);
  font-size: var(--body-xs-size);
  font-family: var(--font-primary);
  background: rgba(255, 255, 255, 0.1);
  color: #d4d4d4;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background 0.15s ease;
}

.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.code-block .copy-btn:focus-visible {
  outline: 2px solid var(--surface-action-focus);
  outline-offset: 2px;
}

.code-block .copy-btn.copied {
  background: var(--text-status-success);
  color: white;
}


/* ==========================================================================
   Tables
   ========================================================================== */

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-400);
  font-size: var(--body-s-size);
}

.doc-table th {
  text-align: left;
  padding: var(--padding-s) var(--padding-m);
  font-weight: 700;
  color: var(--text-headings);
  background: var(--surface-middle-container);
  border-bottom: 2px solid var(--border-accent);
  white-space: nowrap;
}

.doc-table td {
  padding: var(--padding-s) var(--padding-m);
  border-bottom: 1px solid var(--border-default);
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: break-word;
}

.doc-table code {
  background: var(--surface-middle-container);
  padding: 1px 6px;
  border-radius: var(--radius-s);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
}

.doc-wide {
  max-width: 80vw;
}


/* ==========================================================================
   Inline tokens
   ========================================================================== */

code {
  background: var(--surface-middle-container);
  padding: 1px 6px;
  border-radius: var(--radius-s);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9em;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}


/* ==========================================================================
   Do/Don't Cards
   ========================================================================== */

.guidance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-200);
  margin-bottom: var(--space-400);
}

.guidance-card {
  border-radius: var(--radius-m);
  padding: var(--padding-l);
  border: 1px solid;
}

.guidance-card.do {
  background: var(--surface-success);
  border-color: var(--border-success);
}

.guidance-card.dont {
  background: var(--surface-error);
  border-color: var(--border-error);
}

.guidance-card .label {
  font-weight: 700;
  font-size: var(--body-s-size);
  margin-bottom: var(--space-100);
}

.guidance-card.do .label {
  color: var(--text-status-success);
}

.guidance-card.dont .label {
  color: var(--text-status-error);
}

.guidance-card p {
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  margin-bottom: 0;
}


/* ==========================================================================
   Status Badges
   ========================================================================== */

.badge {
  display: inline-block;
  font-size: var(--body-xs-size);
  font-weight: 700;
  padding: var(--padding-xs) var(--padding-s);
  border-radius: var(--radius-xxl);
  line-height: 1;
}

.badge.info {
  background: var(--surface-information);
  color: var(--text-status-information);
}

.badge.success {
  background: var(--surface-success);
  color: var(--text-status-success);
}

.badge.error {
  background: var(--surface-error);
  color: var(--text-status-error);
}


/* ==========================================================================
   Component Preview Placeholder
   ========================================================================== */

.component-preview {
  background: var(--surface-middle-container);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  padding: var(--jumper-md-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  margin-bottom: var(--space-400);
}

.component-preview .placeholder-text {
  font-size: var(--body-s-size);
  color: var(--text-placeholder);
  font-style: italic;
}


/* ==========================================================================
   Theme Comparison Layout (Light / Dark side by side)
   ========================================================================== */

.theme-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-200);
  margin-bottom: var(--space-400);
}

.theme-panel {
  padding: var(--padding-l);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.theme-panel.light-panel {
  background: #fafafa;
  border: 1px solid #d0d0d0;
}

.theme-panel.dark-panel {
  background: #2b2b2b;
  border: 1px solid #464646;
}

.theme-panel-label {
  font-size: var(--body-s-size);
  font-weight: 700;
  margin-bottom: var(--space-200);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.light-panel .theme-panel-label {
  color: #393939;
}

.dark-panel .theme-panel-label {
  color: #fafafa;
}

.theme-panel .swatch-grid {
  margin-bottom: var(--space-200);
}

.dark-panel .swatch {
  border-color: #555555;
}

.dark-panel .swatch-info .name {
  color: #fafafa;
}

.dark-panel .swatch-info .value {
  color: #b3b3b3;
}

.theme-panel .type-sample {
  border-bottom-color: #464646;
}

.dark-panel .type-meta {
  color: #b3b3b3;
}

.theme-comparison-full,
.page .theme-comparison {
  box-sizing: border-box;
}

/* ==========================================================================
   Responsive overrides (Mobile)
   ========================================================================== */

/* ==========================================================================
   Live Button Component
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--padding-s);
  padding-left: var(--padding-l);
  padding-right: var(--padding-l);
  border-width: var(--btn-border-width);
  border-style: solid;
  border-radius: var(--btn-radius);
  font-family: var(--font-primary);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  position: relative;
  overflow: clip;
}

.btn:focus-visible {
  outline: none;
}

.btn .btn-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
}

/* --- Size: S --- */
.btn.btn-s {
  padding-top: var(--padding-s);
  padding-bottom: var(--padding-s);
  padding-left: var(--padding-m);
  padding-right: var(--padding-m);
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.btn.btn-s .btn-icon {
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
}

/* --- Size: M --- */
.btn.btn-m {
  padding-top: var(--padding-s);
  padding-bottom: var(--padding-s);
  padding-left: var(--padding-l);
  padding-right: var(--padding-l);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.btn.btn-m .btn-icon {
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
}

/* --- Size: L --- */
.btn.btn-l {
  padding-top: var(--padding-s-m);
  padding-bottom: var(--padding-s-m);
  padding-left: var(--padding-xl);
  padding-right: var(--padding-xl);
   font-size: var(--body-l-size);
  line-height: var(--body-l-line);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.btn.btn-l .btn-icon {
  font-size: var(--body-l-size);
  line-height: var(--body-l-line);
}

/* --- Size: XL --- */
.btn.btn-xl {
  padding-top: var(--padding-m);
  padding-bottom: var(--padding-m);
  padding-left: var(--padding-xl);
  padding-right: var(--padding-xl);
  font-size: var(--body-l-size);
  line-height: var(--body-l-line);
  font-weight: 700;
  letter-spacing: 0;
}
.btn.btn-xl .btn-icon {
  font-size: var(--body-l-size);
  line-height: var(--body-l-line);
}

/* --- Variant: Primary --- */
.btn.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-text);
}
.btn.btn-primary .btn-icon {
  color: var(--btn-icon-action-on);
}
.btn.btn-primary:hover {
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-border-hover);
  color: var(--btn-primary-text-hover);
}
.btn.btn-primary:hover .btn-icon {
  color: var(--btn-icon-on-hover);
}
.btn.btn-primary:active {
  background: var(--btn-primary-bg-pressed);
  border-color: var(--btn-primary-border-pressed);
  color: var(--btn-primary-text-pressed);
}
.btn.btn-primary:active .btn-icon {
  color: var(--btn-icon-on-pressed);
}
.btn.btn-primary:focus-visible::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: var(--btn-border-width) solid var(--border-action-focus);
  border-radius: var(--btn-radius);
  pointer-events: none;
}
.btn.btn-primary:disabled,
.btn.btn-primary.is-disabled {
  background: var(--btn-primary-bg-disabled);
  border-color: var(--btn-border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
}
.btn.btn-primary:disabled .btn-icon,
.btn.btn-primary.is-disabled .btn-icon {
  color: var(--btn-icon-action-disabled);
}

/* --- Variant: Outline --- */
.btn.btn-outline {
  background: var(--surface-page);
  border-color: var(--btn-primary-outline);
  color: var(--text-action);
}
.btn.btn-outline .btn-icon {
  color: var(--btn-icon-action);
}
.btn.btn-outline:hover {
  border-color: var(--btn-primary-border-hover);
  color: var(--text-action-hover);
}
.btn.btn-outline:hover .btn-icon {
  color: var(--btn-icon-action-hover);
}
.btn.btn-outline:active {
  border-color: var(--btn-primary-border-pressed);
  color: var(--text-action-pressed);
}
.btn.btn-outline:active .btn-icon {
  color: var(--btn-icon-action-pressed);
}
.btn.btn-outline:focus-visible::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: var(--btn-border-width) solid var(--border-action-focus);
  border-radius: var(--btn-radius);
  pointer-events: none;
}
.btn.btn-outline:disabled,
.btn.btn-outline.is-disabled {
  border-color: var(--btn-border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
}
.btn.btn-outline:disabled .btn-icon,
.btn.btn-outline.is-disabled .btn-icon {
  color: var(--btn-icon-action-disabled);
}

/* --- Icon-only Button --- */
.btn.btn-icon-only {
  gap: 0;
}
.btn.btn-icon-only.btn-s {
  padding: var(--padding-s);
}
.btn.btn-icon-only.btn-m {
  padding: var(--padding-s-m);
}
.btn.btn-icon-only.btn-l {
  padding: var(--padding-m);
}
.btn.btn-icon-only.btn-xl {
  padding: var(--padding-l);
}
.btn.btn-icon-only .btn-icon {
  width: auto;
  line-height: 1;
}

/* --- Button Group Component --- */
.btn-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-s);
  background: var(--surface-page);
  overflow: hidden;
}

.btn-group-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--padding-s);
  padding: var(--padding-s) var(--padding-m);
  background: var(--surface-page);
  border: none;
  border-right: 2px solid var(--border-default);
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-body);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-group-item:last-child {
  border-right: none;
}

.btn-group-item .btn-group-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--body-m-size);
  width: 18px;
  line-height: 1;
  color: inherit;
}

.btn-group-item:hover {
  background: var(--surface-action-hover);
  border-right-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.btn-group-item.selected {
  background: var(--surface-action);
  border-right-color: var(--border-action);
  color: var(--text-action-on);
}

.btn-group-item:disabled,
.btn-group-item.is-disabled {
  background: var(--surface-disabled);
  border-right-color: var(--border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
}

.btn-group-item:focus-visible {
  outline: 2px solid var(--surface-action-focus);
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}

.btn-group-item.btn-group-icon-only {
  padding: var(--padding-s-m);
}

.btn-group-item.show-hover {
  background: var(--surface-action-hover);
  border-right-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.btn-group-item.show-selected {
  background: var(--surface-action);
  border-right-color: var(--border-action);
  color: var(--text-action-on);
}

/* Force-show states for documentation */
.btn.show-hover {
  background: var(--btn-primary-bg-hover);
  border-color: var(--btn-primary-border-hover);
  color: var(--btn-primary-text-hover);
}
.btn.show-hover .btn-icon { color: var(--btn-icon-on-hover); }

.btn.btn-outline.show-hover {
  background: var(--surface-page);
  border-color: var(--btn-primary-border-hover);
  color: var(--text-action-hover);
}
.btn.btn-outline.show-hover .btn-icon { color: var(--btn-icon-action-hover); }

.btn.show-pressed {
  background: var(--btn-primary-bg-pressed);
  border-color: var(--btn-primary-border-pressed);
  color: var(--btn-primary-text-pressed);
}
.btn.show-pressed .btn-icon { color: var(--btn-icon-on-pressed); }

.btn.btn-outline.show-pressed {
  background: var(--surface-page);
  border-color: var(--btn-primary-border-pressed);
  color: var(--text-action-pressed);
}
.btn.btn-outline.show-pressed .btn-icon { color: var(--btn-icon-action-pressed); }

.btn.show-focus,
.btn:focus-visible {
  overflow: visible;
}

.btn.show-focus::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: var(--btn-border-width) solid var(--border-action-focus);
  border-radius: var(--btn-radius);
  pointer-events: none;
}

.btn.btn-outline.show-focus::after {
  border-color: var(--border-action-focus);
}

/* --- Text Link Component --- */
/* --- Text Link Base --- */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--padding-s);
  font-family: var(--font-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
  background: none;
  border: none;
  padding: 0;
}

.text-link .link-icon {
  font-family: var(--font-icons);
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}

.text-link .link-label {
  transition: text-decoration-color 0.15s ease;
}

/* --- Body Link (M) --- */
.text-link.text-link-m {
  position: relative;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-action);
}

.text-link.text-link-m:hover .link-label,
.text-link.text-link-m.link-label:hover,
.text-link.text-link-m.show-hover .link-label {
  text-decoration: underline;
}
.text-link.text-link-m:hover,
.text-link.text-link-m.show-hover {
  color: var(--text-action-hover);
}

.text-link.text-link-m:active,
.text-link.text-link-m.show-pressed {
  color: var(--text-action-pressed);
}

/* Body Link M focus ring: Figma inset -4px top/bottom, -8px left, -9px right from content */
.text-link.text-link-m:focus-visible,
.text-link.text-link-m.show-focus {
  outline: none;
}

.text-link.text-link-m:focus-visible::after,
.text-link.text-link-m.show-focus::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -9px;
  bottom: -4px;
  left: -8px;
  border: 2px solid var(--border-action-focus);
  border-radius: var(--radius-focus-ring);
  pointer-events: none;
}

.text-link.text-link-m.is-disabled {
  color: var(--text-body);
  background: var(--border-default);
  padding: 0 2px;
  border-radius: var(--radius-s);
  cursor: not-allowed;
}


/* .show-focus for Small Link only; Body Link M uses ::after above */
.text-link.text-link-s.show-focus {
  outline: 2px solid var(--border-action-focus);
  outline-offset: 6px;
  border-radius: var(--radius-focus-ring);
}

/* --- Small Link (S) --- */
.text-link.text-link-s {
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-body);
}

.text-link.text-link-s:hover .link-label,
.text-link.text-link-s.link-label:hover,
.text-link.text-link-s.show-hover .link-label {
  text-decoration: underline;
}
.text-link.text-link-s:hover,
.text-link.text-link-s.show-hover {
  color: var(--text-action-hover);
}

.text-link.text-link-s:active,
.text-link.text-link-s.show-pressed {
  color: var(--text-action-pressed);
}

.text-link.text-link-s:focus-visible {
  outline: 2px solid var(--border-action-focus);
  outline-offset: 6px;
  border-radius: var(--radius-focus-ring);
}

.text-link.text-link-s.is-disabled {
  color: var(--text-body);
  background: var(--border-default);
  padding: 0 2px;
  border-radius: var(--radius-s);
  cursor: not-allowed;
}

.text-link.text-link-s.active .link-label {
  text-decoration: underline;
}

/* --- Small Link Status Types --- */
.text-link.text-link-s.type-information { color: var(--text-status-information); }
.text-link.text-link-s.type-information:hover,
.text-link.text-link-s.type-information.show-hover { color: var(--text-status-information-hover); }
.text-link.text-link-s.type-information:hover .link-label,
.text-link.text-link-s.type-information.show-hover .link-label { text-decoration: underline; }

.text-link.text-link-s.type-success { color: var(--text-status-success); }
.text-link.text-link-s.type-success:hover,
.text-link.text-link-s.type-success.show-hover { color: var(--text-status-success-hover); }
.text-link.text-link-s.type-success:hover .link-label,
.text-link.text-link-s.type-success.show-hover .link-label { text-decoration: underline; }

.text-link.text-link-s.type-error { color: var(--text-status-error); }
.text-link.text-link-s.type-error:hover,
.text-link.text-link-s.type-error.show-hover { color: var(--text-status-error-hover); }
.text-link.text-link-s.type-error:hover .link-label,
.text-link.text-link-s.type-error.show-hover .link-label { text-decoration: underline; }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  font-family: var(--font-primary);
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  font-weight: 700;
}

.breadcrumb-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--padding-s);
  color: var(--text-body);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.breadcrumb-item .breadcrumb-icon {
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
}

.breadcrumb-item:hover,
.breadcrumb-item.show-hover {
  color: var(--text-action-hover);
}

/* Breadcrumb crumb focus: Figma Small Link pattern, uniform 6px inset from content */
.breadcrumb-item:focus-visible,
.breadcrumb-item.show-focus {
  outline: 2px solid var(--border-action-focus);
  outline-offset: 6px;
  border-radius: var(--radius-focus-ring);
}

.breadcrumb-item.current .link-label {
  text-decoration: underline;
}

.breadcrumb-item.current:hover,
.breadcrumb-item.current.show-hover {
  color: var(--text-action-hover);
}

.breadcrumb-item.is-disabled {
  color: var(--text-body);
  background: var(--border-default);
  padding: 0 2px;
  border-radius: var(--radius-s);
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Carousel --- */
.carousel {
  display: flex;
  flex-direction: column;
  gap: var(--padding-m);
  width: 100%;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
}

.carousel-track {
  display: flex;
  gap: var(--padding-m);
  transition: transform 0.35s ease;
}

.carousel-track > * {
  flex: 0 0 auto;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: var(--padding-m);
}

.carousel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 4px 12px;
  flex-shrink: 0;
  border: var(--border-width-m-action) solid var(--border-action);
  border-radius: var(--radius-xxl);
  background: var(--surface-default-container);
  color: var(--text-action);
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.carousel-btn:hover, .carousel-btn.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.carousel-btn:active, .carousel-btn.show-pressed {
  background: var(--surface-default-container);
  border-color: var(--border-action-pressed);
  color: var(--surface-action-pressed);
}

.carousel-btn:focus-visible, .carousel-btn.show-focus {
  outline: none;
}
.carousel-btn:focus-visible::after, .carousel-btn.show-focus::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: var(--border-width-m-action) solid var(--border-action-focus);
  border-radius: var(--radius-xxl);
  pointer-events: none;
}

.carousel-btn.is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
  pointer-events: none;
}

.carousel-bar {
  flex: 1;
  height: 8px;
  background: var(--surface-indicator-bg);
  border-radius: var(--radius-xxl);
  overflow: hidden;
  position: relative;
}

.carousel-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--surface-action);
  border-radius: var(--radius-xxl);
  transition: left 0.35s ease, width 0.35s ease;
}

/* --- State preview rows --- */
.state-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-300);
  margin-bottom: var(--space-200);
}

.state-label {
  min-width: 120px;
  font-size: var(--body-s-size);
  font-weight: 700;
  color: var(--text-captions);
  text-transform: capitalize;
}


/* ==========================================================================
   Pattern: Filter (composed UI)
   ========================================================================== */

.pattern-filter {
  box-sizing: border-box;
  background: var(--surface-default-container);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
}

.pattern-filter.pattern-filter-mobile {
  width: 100%;
  max-width: var(--card-s);
  padding: var(--padding-m);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pattern-filter.pattern-filter-mobile.pattern-filter-mobile-expanded {
  gap: var(--jumper-sm-xs);
}

.pattern-filter.pattern-filter-desktop {
  width: 100%;
  max-width: 1105px;
  padding: var(--jumper-xs-xxs);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--jumper-sm-xs);
}

.pattern-filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: var(--padding-m);
}

/* Figma size S: open filter + close are the same 34×34 circular control. */
.pattern-filter.pattern-filter-mobile .pattern-filter-header .btn.btn-icon-only.btn-s {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: var(--radius-xxl);
}

.pattern-filter.pattern-filter-mobile .pattern-filter-header .btn.btn-primary.btn-icon-only.btn-s:focus-visible::after,
.pattern-filter.pattern-filter-mobile .pattern-filter-header .btn.btn-outline.btn-icon-only.btn-s:focus-visible::after,
.pattern-filter.pattern-filter-mobile .pattern-filter-header .btn.btn-icon-only.btn-s.show-focus::after {
  border-radius: var(--radius-xxl);
}

.pattern-filter-body {
  display: flex;
  flex-direction: column;
  gap: var(--padding-m);
  width: 100%;
}

/* Figma size M: criteria row is 1057px inside the 1105px frame (horizontal padding 2× --jumper-xs-xxs). */
.pattern-filter.pattern-filter-desktop .pattern-filter-body {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: var(--jumper-xs-xxs);
  justify-content: flex-start;
  width: 100%;
  max-width: min(100%, calc(1105px - 2 * var(--jumper-xs-xxs)));
  margin-inline: auto;
  box-sizing: border-box;
}

.pattern-filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--padding-xxs);
  min-width: 0;
  width: 100%;
}

/* Desktop: criterion columns share extra row space; 128px is the accordion minimum, not a fixed column width. */
.pattern-filter.pattern-filter-desktop .pattern-filter-field {
  flex: 1 1 0;
  min-width: 128px;
  width: auto;
  max-width: none;
  gap: var(--padding-s);
}

.pattern-filter-field > .sel-accordion-group {
  width: 100%;
}

.pattern-filter.pattern-filter-desktop .pattern-filter-field .sel-accordion-stack {
  width: 100%;
  min-width: 0;
}

.pattern-filter.pattern-filter-desktop .pattern-filter-field .sel-accordion-category {
  box-sizing: border-box;
  width: 100%;
  min-width: 128px;
}

/* Figma size S: label row to selector uses 2px gap (--padding-xxs); desktop keeps Selector Accordion token gap on the group. */
.pattern-filter.pattern-filter-mobile .pattern-filter-field .sel-accordion-group {
  gap: var(--padding-xxs);
}

.pattern-filter.pattern-filter-desktop .sel-accordion-category > span:first-of-type {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pattern-filter-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--padding-m);
  align-items: center;
}

/* CTA: natural button width; horizontal growth goes to criterion columns (each min 128px). */
.pattern-filter.pattern-filter-desktop .pattern-filter-cta {
  flex: 0 0 auto;
  min-width: 0;
  align-self: stretch;
  padding-top: var(--jumper-sm-xs);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pattern-filter.pattern-filter-desktop .pattern-filter-cta .btn {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
}

/* --- Search by Need: Button Group inside Filter pattern --- */
.pattern-filter-body--need {
  display: flex;
  flex-direction: column;
  gap: var(--jumper-xxs-xxxs);
  width: 100%;
  align-items: center;
}

/* Desktop Need: override the row direction set by .pattern-filter-body on desktop */
.pattern-filter.pattern-filter-desktop .pattern-filter-body.pattern-filter-body--need {
  flex-direction: column;
  align-items: center;
  gap: var(--jumper-xxs-xxxs);
}

/* Mobile: stacked button group, full width */
.pattern-filter.pattern-filter-mobile .pattern-filter-body--need .btn-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.pattern-filter.pattern-filter-mobile .pattern-filter-body--need .btn-group-item {
  justify-content: flex-start;
  border-right: none;
  border-bottom: 1px solid var(--border-default);
}

.pattern-filter.pattern-filter-mobile .pattern-filter-body--need .btn-group-item:last-child {
  border-bottom: none;
}

/* Desktop: intrinsic-width button group, not stretched */
.pattern-filter.pattern-filter-desktop .pattern-filter-body--need .btn-group {
  align-self: center;
}

/* Filter overrides icon color to action orange for all items */
.pattern-filter .btn-group-item .btn-group-icon {
  color: var(--btn-icon-action);
}

.pattern-filter .btn-group-item:is(:hover, .selected, .show-hover, .show-selected) .btn-group-icon,
.pattern-filter .btn-group-item:is(:disabled, .is-disabled) .btn-group-icon {
  color: inherit;
}

/* Snackbar inside need body: desktop = 728px, mobile = full width */
.pattern-filter.pattern-filter-desktop .pattern-filter-body--need .snackbar {
  width: var(--space-9200);
}
.pattern-filter.pattern-filter-mobile .pattern-filter-body--need .snackbar {
  width: 100%;
}

/* Need CTA row (mobile only) */
.pattern-filter-cta-row--need-only {
  display: flex;
  flex-wrap: wrap;
  gap: var(--padding-m);
  align-items: center;
  width: 100%;
}

/* --- Responsive Filter: auto-switches at --bp-tablet-max / --bp-desktop-min --- */
.pattern-filter-responsive {
  box-sizing: border-box;
  background: var(--surface-default-container);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  width: 100%;
}

/* ---- Mobile / Tablet (max-width: 1103px) ---- */
@media (max-width: 1103px) {
  .pattern-filter-responsive {
    max-width: var(--card-s);
    padding: var(--padding-m);
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .pattern-filter-responsive.pattern-filter-expanded {
    gap: var(--jumper-sm-xs);
  }

  /* Hide desktop toggle, show mobile header */
  .pattern-filter-responsive .pattern-filter-toggle-desktop {
    display: none;
  }
  .pattern-filter-responsive .pattern-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .pattern-filter-responsive .pattern-filter-header .toggle-selector {
    width: 260px;
    height: 40px;
  }
  .pattern-filter-responsive .pattern-filter-header .btn.btn-icon-only.btn-s {
    box-sizing: border-box;
    width: 34px; height: 34px;
    min-width: 34px; min-height: 34px;
    padding: 0;
    border-radius: var(--radius-xxl);
  }

  /* Body hidden when collapsed; shown when .pattern-filter-expanded */
  .pattern-filter-responsive .pattern-filter-body {
    display: none;
    flex-direction: column;
    gap: var(--padding-m);
    width: 100%;
  }
  .pattern-filter-responsive.pattern-filter-expanded .pattern-filter-body {
    display: flex;
  }

  /* Need: stacked button group */
  .pattern-filter-responsive .pattern-filter-body--need {
    flex-direction: column;
    align-items: center;
    gap: var(--jumper-xxs-xxxs);
  }
  .pattern-filter-responsive .pattern-filter-body--need .btn-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .pattern-filter-responsive .pattern-filter-body--need .btn-group-item {
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--border-default);
  }
  .pattern-filter-responsive .pattern-filter-body--need .btn-group-item:last-child {
    border-bottom: none;
  }
  .pattern-filter-responsive .pattern-filter-body--need .snackbar {
    width: 100%;
  }

  /* Mobile: hide desktop CTA column, show mobile CTA row */
  .pattern-filter-responsive .pattern-filter-cta {
    display: none;
  }
  .pattern-filter-responsive .pattern-filter-cta-row {
    display: flex;
    gap: var(--padding-m);
    flex-wrap: wrap;
  }
}

/* ---- Desktop (min-width: 1104px) ---- */
@media (min-width: 1104px) {
  .pattern-filter-responsive {
    max-width: 1105px;
    margin-inline: auto;
    padding: var(--jumper-xs-xxs);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--jumper-sm-xs);
  }

  /* Hide mobile header, show desktop toggle */
  .pattern-filter-responsive .pattern-filter-header {
    display: none;
  }
  .pattern-filter-responsive .pattern-filter-toggle-desktop {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  .pattern-filter-responsive .pattern-filter-toggle-desktop .toggle-selector {
    width: 310px;
    height: 46px;
  }

  /* Body always visible on desktop */
  .pattern-filter-responsive .pattern-filter-body {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: var(--jumper-xs-xxs);
    width: 100%;
    max-width: min(100%, calc(1105px - 2 * var(--jumper-xs-xxs)));
    margin-inline: auto;
  }
  .pattern-filter-responsive .pattern-filter-field {
    flex: 1 1 0;
    min-width: 128px;
    width: auto;
    gap: var(--padding-s);
  }
  .pattern-filter-responsive .pattern-filter-cta {
    flex: 0 0 auto;
    padding-top: var(--jumper-sm-xs);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Desktop: hide mobile CTA rows */
  .pattern-filter-responsive .pattern-filter-cta-row {
    display: none;
  }

  /* Need body: column, centered */
  .pattern-filter-responsive .pattern-filter-body.pattern-filter-body--need {
    flex-direction: column;
    align-items: center;
    gap: var(--jumper-xxs-xxxs);
  }
  .pattern-filter-responsive .pattern-filter-body--need .snackbar {
    width: var(--space-9200);
  }
}

/* ==========================================================================
   Form Components
   ========================================================================== */

/* --- Field (Input) --- */
.form-field {
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  min-width: 336px;
  width: 100%;
  padding: var(--padding-s) var(--padding-s-m);
  background: var(--surface-default-container);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-m);
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  color: var(--text-body);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.form-field:hover, .form-field.is-placeholder:hover {
  border-color: var(--border-action-hover);
  color: var(--text-action-hover);
}

.form-field:focus-within {
  border-color: var(--border-action);
  outline: none;
}

.form-field:focus-within::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--border-action-focus);
  border-radius: 12px;
  pointer-events: none;
}

.form-field.is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
}

.form-field .field-icon {
  flex-shrink: 0;
  font-size: var(--body-m-size);
  line-height: 1;
  width: 18px;
  text-align: center;
  color: inherit;
}

.form-field input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  outline: none;
  min-width: 0;
}

.form-field input::placeholder {
  color: var(--text-placeholder);
}

.form-field.is-placeholder {
  color: var(--text-placeholder);
}

.form-field.show-hover {
  border-color: var(--border-action-hover);
  color: var(--text-action-hover);
}

.form-field.show-focus {
  border-color: var(--border-action);
}

.form-field.show-focus::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--border-action-focus);
  border-radius: 12px;
  pointer-events: none;
}

/* --- Input Group (Label + Field + Hint) --- */
.input-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.input-group > .input-label + .form-field {
  margin-top: var(--padding-s);
}

.input-group > .form-field + .input-hint {
  margin-top: var(--padding-xs);
}

.input-label {
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  position: relative;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.01em;
  color: var(--text-body);
}

.input-label.label-required::before {
  content: '*';
  position: absolute;
  left: -9px;
  top: 0;
  color: var(--text-status-error);
}

.input-label .label-icon {
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: 1;
  letter-spacing: 0.025em;
  color: inherit;
}

.input-hint {
  font-family: var(--font-primary);
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  color: var(--text-body);
}

.input-hint.hint-error { color: var(--text-status-error); }
.input-hint.hint-success { color: var(--text-status-success); }
.input-hint.hint-information { color: var(--text-status-information); }

.form-field.field-error { border-color: var(--border-error); }
.form-field.field-success { border-color: var(--border-success); }
.form-field.field-information { border-color: var(--border-information); }

.form-field.field-error .field-icon.field-status-icon { color: var(--text-status-error); }
.form-field.field-success .field-icon.field-status-icon { color: var(--text-status-success); }
.form-field.field-information .field-icon.field-status-icon { color: var(--text-status-information); }

.form-field.field-error:hover,
.form-field.field-error.show-hover {
  background: var(--surface-error);
  border-color: var(--border-error);
  color: var(--text-body);
}

.form-field.field-success:hover,
.form-field.field-success.show-hover {
  background: var(--surface-success);
  border-color: var(--border-success);
  color: var(--text-body);
}

.form-field.field-information:hover,
.form-field.field-information.show-hover {
  background: var(--surface-information);
  border-color: var(--border-information);
  color: var(--text-body);
}

/* --- Text Area --- */
.form-textarea {
  display: block;
  width: 100%;
  min-width: 336px;
  min-height: 224px;
  padding: var(--padding-m);
  background: var(--surface-default-container);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-m);
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  color: var(--text-body);
  resize: vertical;
  transition: border-color 0.15s ease;
}

.form-textarea::placeholder { color: var(--text-placeholder); }
.form-textarea:hover { border-color: var(--border-action-hover); }
.form-textarea:focus {
  border-color: var(--border-action); 
  outline: 2px solid var(--border-action-focus);
  outline-offset: 3px;
  border-radius: var(--radius-m);
}

/* --- Checkbox --- */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-100);
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  color: var(--text-body);
}

.form-checkbox input[type="checkbox"] {
  appearance: none;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--surface-default-container);
  border: 1px solid var(--border-action);
  border-radius: var(--radius-s);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.form-checkbox input[type="checkbox"]:checked {
  background: var(--surface-action);
  border-color: var(--border-action);
}

.form-checkbox input[type="checkbox"]:checked::after {
  content: '\f00c';
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  color: var(--surface-action-on);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

.form-checkbox input[type="checkbox"]:hover,
.form-checkbox input[type="checkbox"].show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
}

.form-checkbox input[type="checkbox"]:checked:hover::after,
.form-checkbox input[type="checkbox"]:checked.show-hover::after {
  color: var(--text-action-on-hover);
}

.form-checkbox input[type="checkbox"]:focus-visible,
.form-checkbox input[type="checkbox"].show-focus {
  outline: 2px solid var(--border-action-focus);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

.form-checkbox input[type="checkbox"]:disabled,
.form-checkbox input[type="checkbox"].is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  cursor: not-allowed;
}

.form-checkbox input[type="checkbox"]:checked:disabled::after,
.form-checkbox input[type="checkbox"]:checked.is-disabled::after {
  color: var(--text-action-disabled);
}

.form-checkbox input[type="checkbox"].has-error {
  background: var(--surface-error);
  border-color: var(--border-error);
}

.form-checkbox input[type="checkbox"]:checked.has-error {
  background: var(--surface-error);
  border-color: var(--border-error);
}

.form-checkbox input[type="checkbox"]:checked.has-error::after {
  color: var(--text-status-error);
}

/* --- Radio Button --- */
.form-radio {
  display: flex;
  align-items: center;
  gap: var(--space-100);
  padding: var(--padding-xs) 0;
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  color: var(--text-body);
}

.form-radio input[type="radio"] {
  appearance: none;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--surface-default-container);
  border: 1px solid var(--border-action);
  border-radius: 104px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.form-radio input[type="radio"]:checked {
  background: var(--surface-action);
  border-color: var(--border-action);
}

.form-radio input[type="radio"]:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-radio input[type="radio"]:hover,
.form-radio input[type="radio"].show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
}

.form-radio input[type="radio"]:checked:hover::after,
.form-radio input[type="radio"]:checked.show-hover::after {
  background: var(--text-action-on-hover);
}

.form-radio input[type="radio"]:focus-visible,
.form-radio input[type="radio"].show-focus {
  outline: 2px solid var(--border-action-focus);
  outline-offset: 2px;
}

.form-radio input[type="radio"]:disabled,
.form-radio input[type="radio"].is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  cursor: not-allowed;
}

.form-radio input[type="radio"]:checked:disabled::after,
.form-radio input[type="radio"]:checked.is-disabled::after {
  background: white;
}

.form-radio input[type="radio"].has-error {
  background: var(--surface-error);
  border-color: var(--border-error);
}

.form-radio input[type="radio"]:checked.has-error {
  background: var(--surface-error);
  border-color: var(--border-error);
}

.form-radio input[type="radio"]:checked.has-error::after {
  background: var(--text-status-error);
}

/* --- Toggle Switch --- */
.form-toggle {
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  color: var(--text-body);
}

.toggle-track {
  width: 48px;
  height: 24px;
  flex-shrink: 0;
  background: var(--surface-action-on);
  border: 2px solid var(--border-action);
  border-radius: 104px;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-track .toggle-knob {
  position: absolute;
  width: 26px;
  height: 16px;
  top: 2px;
  left: 2px;
  background: var(--btn-icon-action);
  border-radius: 100px;
  transition: left 0.2s ease, background 0.2s ease;
}

.form-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-toggle input[type="checkbox"]:checked + .toggle-track {
  background: var(--surface-action);
}

.form-toggle input[type="checkbox"]:checked + .toggle-track .toggle-knob {
  left: 16px;
  background: var(--btn-icon-action-on);
}

.toggle-track.show-checked {
  background: var(--surface-action);
}
.toggle-track.show-checked .toggle-knob {
  left: 16px;
  background: var(--btn-icon-action-on);
}

/* Hover */
.form-toggle:hover .toggle-track,
.toggle-track.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
}
.form-toggle:hover .toggle-track .toggle-knob,
.toggle-track.show-hover .toggle-knob {
  background: var(--btn-icon-on-hover);
}
.form-toggle input[type="checkbox"]:checked:hover + .toggle-track,
.toggle-track.show-checked.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
}
.form-toggle input[type="checkbox"]:checked:hover + .toggle-track .toggle-knob,
.toggle-track.show-checked.show-hover .toggle-knob {
  background: var(--btn-icon-on-hover);
}

/* Focus */
.form-toggle input[type="checkbox"]:focus-visible + .toggle-track,
.toggle-track.show-focus {
  outline: none;
}
.form-toggle input[type="checkbox"]:focus-visible + .toggle-track::after,
.toggle-track.show-focus::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--border-action-focus);
  border-radius: 104px;
  pointer-events: none;
}

/* Disabled */
.form-toggle input[type="checkbox"]:disabled + .toggle-track,
.toggle-track.is-disabled {
  background: #f5f5f5;
  border-color: var(--border-default);
  cursor: not-allowed;
}
.form-toggle input[type="checkbox"]:disabled + .toggle-track .toggle-knob,
.toggle-track.is-disabled .toggle-knob {
  background: var(--btn-icon-action-disabled);
}

/* --- Toggle Selector --- */
.toggle-selector {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  background: var(--surface-action-on);
  border: 2px solid var(--surface-action);
  border-radius: 48px;
  overflow: clip;
  height: 40px;
}

.toggle-selector-pill {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 1px;
  right: 50%;
  background: var(--surface-action);
  border: 1px solid var(--border-action);
  border-radius: 48px;
  pointer-events: none;
  transition: left 300ms cubic-bezier(0.4, 0, 0.58, 1),
              right 300ms cubic-bezier(0.4, 0, 0.58, 1);
}

.toggle-selector.right-active .toggle-selector-pill {
  left: 50%;
  right: 1px;
}

.toggle-selector-option {
  position: relative;
  z-index: 1;
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  color: var(--text-action);
  white-space: nowrap;
  transition: color 300ms cubic-bezier(0.4, 0, 0.58, 1);
}

.toggle-selector-option.is-active {
  color: var(--text-action-on);
  cursor: default;
}

.toggle-selector-option:hover:not(.is-active) {
  color: var(--text-action-hover);
}
.toggle-selector-option.is-active:hover {
  color: var(--text-action-on-hover);
}
.toggle-selector-option.show-hover:not(.is-active) {
  color: var(--text-action-hover);
}
.toggle-selector-option.is-active.show-hover {
  color: var(--text-action-on-hover);
}

.toggle-selector-option:active:not(.is-active) {
  color: var(--text-action-pressed);
}
.toggle-selector-option.is-active:active {
  color: var(--text-action-on-pressed);
}
.toggle-selector-option.show-pressed:not(.is-active) {
  color: var(--text-action-pressed);
}
.toggle-selector-option.is-active.show-pressed {
  color: var(--text-action-on-pressed);
}

.toggle-selector-option:focus-visible {
  outline: none;
}
.toggle-selector-option:focus-visible::after,
.toggle-selector-option.show-focus::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--border-action-focus);
  border-radius: 48px;
  pointer-events: none;
}

.toggle-selector.toggle-selector-desktop {
  height: 46px;
}
.toggle-selector.toggle-selector-desktop .toggle-selector-option {
  padding: 0 16px;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
}

/* --- Menu --- */
.menu-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 336px;
  border: 1px solid var(--border-default);
  border-bottom: none;
  border-radius: var(--radius-m);
  overflow: clip;
}

.menu-item {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  min-width: 336px;
  width: 100%;
  padding: var(--padding-s-m) var(--padding-m);
  background: var(--surface-default-container);
  border: none;
  border-bottom: 2px solid var(--border-default);
  cursor: pointer;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
  color: var(--text-body);
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.menu-nav .menu-item {
  min-width: 0;
}

.menu-nav .menu-item:last-child {
  border-bottom: none;
}

.menu-item-icon {
  flex-shrink: 0;
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  color: inherit;
}

.menu-item-label {
  flex: 1 0 0;
  min-width: 0;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
  color: inherit;
}

.menu-item:hover,
.menu-item.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.menu-item:active,
.menu-item.show-pressed {
  background: var(--surface-action-pressed);
  border-color: var(--border-action-pressed);
  color: var(--text-action-on-pressed);
}

.menu-item.is-selected {
  background: var(--surface-action);
  border-color: var(--border-action);
  color: var(--text-action-on);
}

.menu-item.is-selected:hover,
.menu-item.is-selected.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.menu-item.is-selected:active,
.menu-item.is-selected.show-pressed {
  background: var(--surface-action-pressed);
  border-color: var(--border-action-pressed);
  color: var(--text-action-on-pressed);
}

.menu-item:focus-visible {
  outline: none;
}
.menu-item:focus-visible::after,
.menu-item.show-focus::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -6px;
  border: 2px solid var(--border-action-focus);
  border-radius: var(--radius-s);
  pointer-events: none;
}

.menu-item.is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Selector Accordion --- */
.sel-accordion-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--jumper-xxxs-tiny);
  min-width: var(--card-xs);
  width: 100%;
}

/* Wraps category + dropdown so width:100% resolves inside flex parents (e.g. state rows, filter columns). */
.sel-accordion-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.state-row > .sel-accordion-group {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--card-s);
}

.sel-accordion-label {
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
  color: var(--text-body);
}

.sel-accordion-label .label-icon {
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  color: inherit;
}

.sel-accordion-dropdown {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.sel-accordion-dropdown[hidden] {
  display: none;
}

.sel-accordion-dropdown.is-collapsed {
  height: 0;
  overflow: hidden;
}

.sel-accordion-dropdown.is-animating {
  overflow: hidden;
  transition: height 0.3s ease-in-out;
}

.sel-accordion-category {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--jumper-xxs-xxxs);
  width: 100%;
  padding: var(--padding-s) var(--padding-m);
  background: var(--surface-default-container);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  overflow: clip;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
  color: var(--text-body);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  position: relative;
}

.sel-accordion-category .sel-accordion-icon {
  flex-shrink: 0;
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  color: inherit;
  transition: transform 0.3s ease-in-out;
}

.sel-accordion-category.is-expanded {
  border-radius: var(--radius-m) var(--radius-m) 0 0;
}

.sel-accordion-category.is-expanded .sel-accordion-icon {
  transform: rotate(180deg);
}

.sel-accordion-category:hover,
.sel-accordion-category.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.sel-accordion-category:active,
.sel-accordion-category.show-pressed {
  background: var(--surface-action-pressed);
  border-color: var(--border-action-pressed);
  color: var(--text-action-on-pressed);
}

.sel-accordion-category:focus-visible {
  outline: none;
  overflow: visible;
}
.sel-accordion-category.show-focus {
  overflow: visible;
}
.sel-accordion-category:focus-visible::after,
.sel-accordion-category.show-focus::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--border-action-focus);
  border-radius: var(--radius-focus-ring);
  pointer-events: none;
}

.sel-accordion-category.is-expanded:focus-visible::after,
.sel-accordion-category.is-expanded.show-focus::after {
  border-radius: var(--radius-focus-ring) var(--radius-focus-ring) 0 0;
}

.sel-accordion-category.is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
  pointer-events: none;
}

.sel-accordion-option {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  padding: var(--padding-s) var(--padding-m);
  background: var(--surface-default-container);
  border-left: 1px solid var(--border-default);
  border-right: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0;
  overflow: clip;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-primary);
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  color: var(--text-body);
  text-align: left;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sel-accordion-option:last-child {
  border-radius: 0 0 var(--radius-m) var(--radius-m);
}

.sel-accordion-option:hover,
.sel-accordion-option.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.sel-accordion-option:active,
.sel-accordion-option.show-pressed {
  background: var(--surface-action-pressed);
  border-color: var(--border-action-pressed);
  color: var(--text-action-on-pressed);
}

.sel-accordion-option.is-selected {
  background: var(--surface-action);
  border-color: var(--border-action);
  color: var(--text-action-on);
}

.sel-accordion-option.is-selected:hover,
.sel-accordion-option.is-selected.show-hover {
  background: var(--surface-action-hover);
  border-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}

.sel-accordion-option.is-selected:active,
.sel-accordion-option.is-selected.show-pressed {
  background: var(--surface-action-pressed);
  border-color: var(--border-action-pressed);
  color: var(--text-action-on-pressed);
}

.sel-accordion-option:focus-visible {
  outline: none;
  overflow: visible;
}
.sel-accordion-option.show-focus {
  overflow: visible;
}
.sel-accordion-option:focus-visible::after,
.sel-accordion-option.show-focus::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 2px solid var(--border-action-focus);
  border-radius: 0;
  pointer-events: none;
}

.sel-accordion-option:last-child:focus-visible::after,
.sel-accordion-option:last-child.show-focus::after {
  border-radius: 0 0 var(--radius-focus-ring) var(--radius-focus-ring);
}

.sel-accordion-option.is-disabled {
  background: var(--surface-disabled);
  border-color: var(--border-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Progress Bar --- */
.progress-bar {
  display: flex;
  flex-direction: column;
  gap: var(--jumper-xxs-xxxs);
  align-items: flex-start;
  width: 100%;
}

.progress-bar-label {
  display: flex;
  gap: var(--jumper-xxxs-tiny);
  align-items: center;
  width: 100%;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--h6-size);
  line-height: var(--h6-line);
  letter-spacing: -0.1px;
  color: var(--text-headings);
}

.progress-bar-label-text {
  flex-shrink: 0;
  white-space: nowrap;
}

.progress-bar-label-value {
  flex: 1 0 0;
  min-width: 0;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface-indicator-bg);
  border-radius: var(--radius-xxl);
  overflow: clip;
  position: relative;
}

.progress-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--surface-action);
  border-radius: var(--radius-xxl);
}

.progress-bar.progress-bar-sm .progress-bar-label {
  font-size: var(--body-m-size);
  line-height: var(--body-s-line);
  letter-spacing: -0.08px;
}

.progress-bar.progress-bar-sm .progress-bar-track {
  height: 4px;
}

/* --- Snackbar --- */
.snackbar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: var(--card-xl);
  background: var(--surface-default-container);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-default);
  overflow: clip;
}

.snackbar-content {
  display: flex;
  gap: var(--padding-m);
  align-items: flex-start;
  padding: var(--padding-m);
  width: 100%;
}

.snackbar-icon-text {
  display: flex;
  flex: 1 0 0;
  gap: var(--padding-s);
  align-items: center;
  align-self: stretch;
  min-width: 0;
}

.snackbar-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  width: 20px;
  flex-shrink: 0;
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-l-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.5px;
  text-align: center;
  color: var(--text-action);
}

.snackbar.snackbar-success .snackbar-icon { color: var(--text-status-success); }
.snackbar.snackbar-error .snackbar-icon { color: var(--text-status-error); }
.snackbar.snackbar-information .snackbar-icon { color: var(--text-status-information); }

.snackbar-text {
  display: flex;
  flex-direction: column;
  flex: 1 0 0;
  gap: var(--jumper-xxxs-tiny);
  align-items: flex-start;
  min-width: 0;
}

.snackbar-heading {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--body-l-size);
  line-height: var(--body-m-line);
  letter-spacing: -0.1px;
  color: var(--text-action);
}

.snackbar.snackbar-success .snackbar-heading { color: var(--text-status-success); }
.snackbar.snackbar-error .snackbar-heading { color: var(--text-status-error); }
.snackbar.snackbar-information .snackbar-heading { color: var(--text-status-information); }

p.snackbar-body {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
  color: var(--text-body);
  margin: 0;
  max-width: none;
}

.snackbar-close {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-l-size);
  line-height: var(--body-l-line);
  letter-spacing: 0.05px;
  text-align: center;
  color: var(--text-body);
}

.snackbar.snackbar-success .text-link.text-link-m { color: var(--text-status-success); }
.snackbar.snackbar-success .text-link.text-link-m:hover { color: var(--text-status-success-hover); }
.snackbar.snackbar-error .text-link.text-link-m { color: var(--text-status-error); }
.snackbar.snackbar-error .text-link.text-link-m:hover { color: var(--text-status-error-hover); }
.snackbar.snackbar-information .text-link.text-link-m { color: var(--text-status-information); }
.snackbar.snackbar-information .text-link.text-link-m:hover { color: var(--text-status-information-hover); }

.snackbar.snackbar-success .progress-bar-track { background: var(--surface-success-indicator-bg); }
.snackbar.snackbar-success .progress-bar-fill { background: var(--text-status-success); }
.snackbar.snackbar-error .progress-bar-track { background: var(--surface-error-indicator-bg); }
.snackbar.snackbar-error .progress-bar-fill { background: var(--text-status-error); }
.snackbar.snackbar-information .progress-bar-track { background: var(--surface-information-indicator-bg); }
.snackbar.snackbar-information .progress-bar-fill { background: var(--text-status-information); }

/* --- Alert (Snackbar Alert) --- */
.alert {
  display: flex;
  gap: var(--padding-s);
  align-items: flex-start;
  padding: var(--padding-s-m);
  background: var(--surface-default-container);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-s);
  overflow: clip;
}

.alert-icon-text {
  display: flex;
  flex: 1 0 0;
  gap: var(--padding-s);
  align-items: flex-start;
  min-width: 0;
}

.alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: var(--body-m-line);
  flex-shrink: 0;
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  text-align: center;
  color: var(--text-headings);
}

.alert-text {
  display: flex;
  flex-direction: column;
  flex: 1 0 0;
  gap: var(--padding-xxs);
  align-items: flex-start;
  min-width: 0;
}

.alert-heading {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: -0.08px;
  color: var(--text-headings);
}

.alert-body {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: var(--body-s-size);
  line-height: var(--body-s-line);
  color: var(--text-body);
}

.alert-close {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  text-align: center;
  color: var(--text-body);
}

.alert.alert-success {
  background: var(--surface-success);
  border-color: var(--border-success);
}
.alert.alert-error {
  background: var(--surface-error);
  border-color: var(--border-error);
}
.alert.alert-information {
  background: var(--surface-information);
  border-color: var(--border-information);
}

.alert.alert-success .alert-icon,
.alert.alert-success .alert-heading,
.alert.alert-success .alert-body,
.alert.alert-success .alert-close { color: var(--text-status-success); }

.alert.alert-error .alert-icon,
.alert.alert-error .alert-heading,
.alert.alert-error .alert-body,
.alert.alert-error .alert-close { color: var(--text-status-error); }

.alert.alert-information .alert-icon,
.alert.alert-information .alert-heading,
.alert.alert-information .alert-body,
.alert.alert-information .alert-close { color: var(--text-status-information); }

.alert.alert-success .text-link.text-link-s { color: var(--text-status-success); }
.alert.alert-success .text-link.text-link-s:hover { color: var(--text-status-success-hover); }
.alert.alert-error .text-link.text-link-s { color: var(--text-status-error); }
.alert.alert-error .text-link.text-link-s:hover { color: var(--text-status-error-hover); }
.alert.alert-information .text-link.text-link-s { color: var(--text-status-information); }
.alert.alert-information .text-link.text-link-s:hover { color: var(--text-status-information-hover); }

/* --- Tab Bar --- */
.tab-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-default);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--padding-s);
  padding: var(--padding-s);
  position: relative;
  white-space: nowrap;
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.16px;
  font-weight: 400;
  color: var(--text-body);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-default);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-item .tab-icon {
  font-family: var(--font-icons);
  font-weight: 900;
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.4px;
  color: var(--text-action);
}

.tab-item.selected {
  font-weight: 700;
  border-bottom-color: var(--border-action);
}

.tab-item:hover, .tab-item.show-hover {
  background: var(--surface-action-hover);
  border-bottom-color: var(--border-action-hover);
  color: var(--text-action-on-hover);
}
.tab-item:hover .tab-icon, .tab-item.show-hover .tab-icon {
  color: var(--text-action-on-hover);
}

.tab-item:focus-visible, .tab-item.show-focus {
  outline: none;
}
.tab-item:focus-visible::after, .tab-item.show-focus::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--border-action-focus);
  border-radius: var(--radius-s);
  pointer-events: none;
}
.tab-item.selected:focus-visible::after, .tab-item.selected.show-focus::after {
  inset: -4px -4px -6px -4px;
}

.tab-item.is-disabled {
  background: var(--surface-disabled);
  color: var(--text-action-disabled);
  cursor: not-allowed;
  pointer-events: none;
}
.tab-item.is-disabled .tab-icon {
  color: var(--text-action-disabled);
}
.tab-item.is-disabled.selected {
  border-bottom-color: var(--border-disabled);
}

/* --- Form Example Card --- */
.form-example-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--jumper-md-sm);
  padding: var(--jumper-md-sm) var(--grid-global-margin);
  background: var(--surface-page);
  border-radius: var(--radius-m);
  overflow: clip;
}

.form-example-card .card-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--jumper-xxxs-tiny);
  text-align: center;
}

.form-example-card .card-heading h3 {
  font-family: var(--font-primary);
  font-weight: 900;
  font-size: var(--h4-size);
  line-height: var(--h4-line);
  color: var(--text-headings);
  margin: 0;
  border: none;
  padding: 0;
}

.form-example-card .card-heading p {
  font-family: var(--font-primary);
  font-size: var(--body-m-size);
  line-height: var(--body-m-line);
  letter-spacing: 0.01em;
  color: var(--text-body);
  margin: 0;
}

.form-example-card .card-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--jumper-sm-xs);
  width: 100%;
}

.form-example-card .card-inputs .form-field,
.form-example-card .card-inputs .form-textarea {
  width: 100%;
}

.form-example-row {
  display: flex;
  flex-direction: row;
  gap: var(--jumper-lg-md);
  align-items: flex-start;
}

.form-example-row .example-desktop > *,
.form-example-row .example-mobile > * {
  border: 1px dashed purple;
}

.form-example-row .example-desktop {
  width: var(--grid-body-max-width);
}

.form-example-row .example-desktop .form-example-card {
  max-width: var(--space-9200);
}

.form-example-row .example-mobile {
  width: 384px;
}


@media (max-width: 800px) {
  :root {
    --sidebar-width: 240px;
    --hero-size: 40px;
    --hero-line: 44px;
    --h1-size: 32px;
    --h1-line: 40px;
    --h2-size: 28px;
    --h2-line: 36px;
    --h3-size: 24px;
    --h3-line: 32px;
    --h4-size: 20px;
    --h4-line: 28px;
    --h5-size: 18px;
    --h5-line: 24px;
    --h6-size: 16px;
    --h6-line: 20px;
    --body-xxl-size: 24px;
    --body-xxl-line: 36px;
    --body-xl-size: 20px;
    --body-xl-line: 32px;
    --body-m-line: 26px;
    --body-xs-line: 16px;
    --jumper-xl-lg: 64px;
    --jumper-lg-md: 48px;
    --jumper-md-sm: 32px;
    --jumper-sm-xs: 24px;
    --jumper-xs-xxs: 16px;
    --jumper-xxs-xxxs: 8px;
    --jumper-xxxs-tiny: 4px;
    --jumper-tiny: 2px;
    --grid-col-margin: 8px;
    --grid-global-margin: 16px;
    --grid-col-count: 4;
    --grid-col-width: 72px;
    --grid-col-gutter: 16px;
    --grid-row-gap: 16px;
    --grid-body-max-width: var(--space-4200);
    --card-xxl: var(--space-4200);
    --card-xl: var(--space-4200);
    --card-l: 336px;
    --card-m: 336px;
    --card-s: 336px;
    --card-xs: 336px;
  }
}
