/* FigUI3 12.0.5 | Copyright (c) 2026 Rogie King | MIT | See LICENSE. */
@scope (.fb-panel, [data-figui-overlay-root]) {
/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
/* Ordered shared selectors and cascade overrides. */
@layer figui.defaults {
:scope {
  color-scheme: light dark;

  /* Background Colors */
  --figma-color-bg: light-dark(#ffffff, #2c2c2c);
  --figma-color-bg-brand: light-dark(#0d99ff, #0c8ce9);
  --figma-color-bg-menu: light-dark(#ffffff, #1e1e1e);
  --figma-color-bg-menu-hover: #0c8ce9;
  --figma-color-bg-brand-hover: light-dark(#007be5, #0a6dc2);
  --figma-color-bg-brand-pressed: light-dark(#0768cf, #105cad);
  --figma-color-bg-brand-secondary: light-dark(#0768cf, #105cad);
  --figma-color-bg-brand-tertiary: light-dark(#e5f4ff, #394360);
  --figma-color-bg-component: light-dark(#9747ff, #8a38f5);
  --figma-color-bg-component-hover: light-dark(#8638e5, #7a2ed6);
  --figma-color-bg-component-pressed: light-dark(#7c2bda, #652ca8);
  --figma-color-bg-component-secondary: light-dark(#7c2bda, #652ca8);
  --figma-color-bg-component-tertiary: light-dark(#f1e5ff, #473956);
  --figma-color-bg-danger: light-dark(#f24822, #e03e1a);
  --figma-color-bg-danger-hover: light-dark(#dc3412, #c4381c);
  --figma-color-bg-danger-pressed: light-dark(#dc3412, #c4381c);
  --figma-color-bg-danger-secondary: light-dark(#bd2915, #963323);
  --figma-color-bg-danger-tertiary: light-dark(#ffe2e0, #60332a);
  --figma-color-bg-disabled: light-dark(#d9d9d9, #757575);
  --figma-color-bg-disabled-secondary: #b3b3b3;
  --figma-color-bg-hover: light-dark(#f5f5f5, #383838);
  --figma-color-bg-active: var(--figma-color-bg-pressed);
  --figma-color-bg-inverse: light-dark(#2c2c2c, #ffffff);
  --figma-color-bg-onselected: light-dark(#bde3ff, #4a5878);
  --figma-color-bg-onselected-hover: light-dark(#bde3ff, #4a5878);
  --figma-color-bg-onselected-pressed: light-dark(#bde3ff, #4a5878);
  --figma-color-bg-pressed: light-dark(#f5f5f5, #383838);
  --figma-color-bg-secondary: light-dark(#f5f5f5, #383838);
  --figma-color-bg-selected: light-dark(#e5f4ff, #394360);
  --figma-color-bg-selected-hover: light-dark(#bde3ff, #4a5878);
  --figma-color-bg-selected-pressed: light-dark(#80caff, #394360);
  --figma-color-bg-selected-secondary: light-dark(#f2f9ff, #32394d);
  --figma-color-bg-selected-strong: light-dark(#0d99ff, #0c8ce9);
  --figma-color-bg-selected-tertiary: light-dark(#f2f9ff, #32394d);
  --figma-color-bg-success: light-dark(#14ae5c, #198f51);
  --figma-color-bg-success-hover: light-dark(#009951, #078348);
  --figma-color-bg-success-pressed: light-dark(#008043, #0a5c35);
  --figma-color-bg-success-secondary: light-dark(#008043, #0a5c35);
  --figma-color-bg-success-tertiary: light-dark(#e0f6e5, #2f483c);
  --figma-color-bg-tertiary: light-dark(#e6e6e6, #444444);
  --figma-color-bg-warning: light-dark(#ffcd29, #f3c11b);
  --figma-color-bg-warning-hover: light-dark(#ffc21a, #f2b50d);
  --figma-color-bg-warning-pressed: light-dark(#fab815, #e4a711);
  --figma-color-bg-warning-secondary: light-dark(#fab815, #e4a711);
  --figma-color-bg-warning-tertiary: light-dark(#fff1c2, #5c4100);
  --figma-color-bg-switch: light-dark(#e6e6e6, #444444);
  --figma-color-bg-slot: light-dark(
    rgba(255, 36, 189, 0.25),
    rgba(243, 22, 176, 0.25)
  );

  /* Border Colors */
  --figma-color-border: light-dark(#e6e6e6, #444444);
  --figma-color-border-brand: light-dark(#bde3ff, #105cad);
  --figma-color-border-brand-strong: light-dark(#007be5, #7cc4f8);
  --figma-color-border-component: light-dark(#e4ccff, #604d75);
  --figma-color-border-component-hover: light-dark(#9747ff, #8a38f5);
  --figma-color-border-component-strong: light-dark(#8638e5, #d6b6fb);
  --figma-color-border-danger: light-dark(#ffc7c2, #963323);
  --figma-color-border-danger-strong: light-dark(#dc3412, #fca397);
  --figma-color-border-disabled: light-dark(#e6e6e6, #444444);
  --figma-color-border-disabled-strong: light-dark(#0000004d, #ffffff66);
  --figma-color-border-menu: #383838;
  --figma-color-border-onbrand: light-dark(#007be5, #0a6dc2);
  --figma-color-border-onbrand-strong: #ffffff;
  --figma-color-border-oncomponent: light-dark(#8638e5, #7a2ed6);
  --figma-color-border-oncomponent-strong: #ffffff;
  --figma-color-border-ondanger: light-dark(#dc3412, #c4381c);
  --figma-color-border-ondanger-strong: #ffffff;
  --figma-color-border-onselected: light-dark(#bde3ff, #667799);
  --figma-color-border-onselected-strong: light-dark(#000000e5, #ffffffe5);
  --figma-color-border-onsuccess: light-dark(#009951, #078348);
  --figma-color-border-onsuccess-strong: #ffffff;
  --figma-color-border-onwarning: light-dark(#fab815, #e4a711);
  --figma-color-border-onwarning-strong: #000000e5;
  --figma-color-border-selected: light-dark(#0d99ff, #0c8ce9);
  --figma-color-border-selected-strong: light-dark(#007be5, #7cc4f8);
  --figma-color-border-strong: light-dark(#2c2c2c, #ffffffe5);
  --figma-color-border-success: light-dark(#b9ebc6, #517361);
  --figma-color-border-success-strong: light-dark(#009951, #7cd797);
  --figma-color-border-warning: light-dark(#f5dfa8, #7a5800);
  --figma-color-border-warning-strong: light-dark(#b86200, #f7d15f);
  --figma-color-border-slot: light-dark(#ff24bd, #f316b0);

  /* Focus */
  --figma-focus-outline-width: 1px;
  --figma-focus-outline-color: var(--figma-color-border-selected);
  --figma-focus-outline: var(--figma-focus-outline-width) solid var(--figma-focus-outline-color);
  --figma-focus-outline-offset: var(--figma-focus-outline-width);
  --figma-focus-outline-radius: inherit;

  /* Icon Colors */
  --figma-color-icon: light-dark(#000000e5, #ffffff);
  --figma-color-icon-brand: light-dark(#007be5, #7cc4f8);
  --figma-color-icon-brand-pressed: light-dark(#0768cf, #0c8ce9);
  --figma-color-icon-brand-secondary: light-dark(#80caff, #0a6dc2);
  --figma-color-icon-brand-tertiary: light-dark(#bde3ff, #394360);
  --figma-color-icon-component: light-dark(#8638e5, #d1a8ff);
  --figma-color-icon-component-pressed: light-dark(#7c2bda, #d6b6fb);
  --figma-color-icon-component-secondary: light-dark(#a38cc0, #7f699b);
  --figma-color-icon-component-tertiary: light-dark(#c5b2dc, #7f699b);
  --figma-color-icon-danger: light-dark(#f24822, #e03e1a);
  --figma-color-icon-danger-hover: light-dark(#bd2915, #fbbcb6);
  --figma-color-icon-danger-pressed: light-dark(#bd2915, #fbbcb6);
  --figma-color-icon-danger-secondary: light-dark(#f24822, #e03e1a);
  --figma-color-icon-danger-secondary-hover: light-dark(#f24822, #e03e1a);
  --figma-color-icon-danger-tertiary: light-dark(#f24822, #e03e1a);
  --figma-color-icon-disabled: light-dark(#0000004d, #ffffff66);
  --figma-color-icon-hover: light-dark(#000000e5, #ffffff);
  --figma-color-icon-onbrand: #ffffff;
  --figma-color-icon-onbrand-secondary: #ffffffcc;
  --figma-color-icon-onbrand-tertiary: #ffffff66;
  --figma-color-icon-oncomponent: #ffffff;
  --figma-color-icon-oncomponent-secondary: #ffffffcc;
  --figma-color-icon-oncomponent-tertiary: #ffffff66;
  --figma-color-icon-ondanger: #ffffff;
  --figma-color-icon-ondanger-secondary: #ffffffcc;
  --figma-color-icon-ondanger-tertiary: #ffffff66;
  --figma-color-icon-ondisabled: light-dark(#ffffff, #2c2c2c);
  --figma-color-icon-oninverse: light-dark(#ffffffe5, #000000e5);
  --figma-color-icon-onselected: light-dark(#000000e5, #ffffff);
  --figma-color-icon-onselected-secondary: light-dark(#00000080, #ffffffb2);
  --figma-color-icon-onselected-strong: #ffffff;
  --figma-color-icon-onselected-tertiary: light-dark(#0000004d, #ffffff66);
  --figma-color-icon-onsuccess: #ffffff;
  --figma-color-icon-onsuccess-secondary: #ffffffcc;
  --figma-color-icon-onsuccess-tertiary: #ffffff66;
  --figma-color-icon-onwarning: #000000e5;
  --figma-color-icon-onwarning-secondary: #00000080;
  --figma-color-icon-onwarning-tertiary: #0000004d;
  --figma-color-icon-pressed: light-dark(#007be5, #0a6dc2);
  --figma-color-icon-secondary: light-dark(#00000080, #ffffffb2);
  --figma-color-icon-secondary-hover: light-dark(#000000e5, #ffffff);
  --figma-color-icon-selected: light-dark(#007be5, #7cc4f8);
  --figma-color-icon-selected-secondary: light-dark(#0d99ff, #0c8ce9);
  --figma-color-icon-selected-tertiary: light-dark(#80caff, #0a6dc2);
  --figma-color-icon-success: light-dark(#009951, #7cd797);
  --figma-color-icon-success-pressed: light-dark(#008043, #a5e5b7);
  --figma-color-icon-success-secondary: light-dark(#009951, #7cd797);
  --figma-color-icon-success-tertiary: light-dark(#009951, #7cd797);
  --figma-color-icon-tertiary: light-dark(#0000004d, #fff6);
  --figma-color-icon-tertiary-hover: light-dark(#000000e5, #ffffff);
  --figma-color-icon-warning: light-dark(#b86200, #f7d15f);
  --figma-color-icon-warning-pressed: light-dark(#b86200, #f7d15f);
  --figma-color-icon-warning-secondary: light-dark(#b86200, #f7d15f);
  --figma-color-icon-warning-tertiary: light-dark(#b86200, #f7d15f);

  /* Text Colors */
  --figma-color-text: light-dark(#000000e5, #ffffff);
  --figma-color-text-brand: light-dark(#007be5, #7cc4f8);
  --figma-color-text-brand-secondary: light-dark(#007be5, #7cc4f8);
  --figma-color-text-brand-tertiary: light-dark(#007be5, #7cc4f8);
  --figma-color-text-component: light-dark(#8638e5, #d1a8ff);
  --figma-color-text-component-pressed: light-dark(#7c2bda, #d6b6fb);
  --figma-color-text-component-secondary: light-dark(#a38cc0, #a38cc0);
  --figma-color-text-component-tertiary: light-dark(#c5b2dc, #7f699b);
  --figma-color-text-danger: light-dark(#dc3412, #fca397);
  --figma-color-text-danger-secondary: light-dark(#dc3412, #fca397);
  --figma-color-text-danger-tertiary: light-dark(#dc3412, #fca397);
  --figma-color-text-disabled: light-dark(#0000004d, #ffffff66);
  --figma-color-text-hover: light-dark(#000000e5, #ffffff);
  --figma-color-text-onbrand: #ffffff;
  --figma-color-text-onbrand-secondary: #ffffffcc;
  --figma-color-text-onbrand-tertiary: #ffffff66;
  --figma-color-text-oncomponent: #ffffff;
  --figma-color-text-oncomponent-secondary: #ffffffcc;
  --figma-color-text-oncomponent-tertiary: #ffffff66;
  --figma-color-text-ondanger: #ffffff;
  --figma-color-text-ondanger-secondary: #ffffffcc;
  --figma-color-text-ondanger-tertiary: #ffffff66;
  --figma-color-text-ondisabled: light-dark(#ffffff, #2c2c2c);
  --figma-color-text-oninverse: light-dark(#ffffffe5, #000000e5);
  --figma-color-text-onselected: light-dark(#000000e5, #ffffffe5);
  --figma-color-text-onselected-secondary: light-dark(#00000080, #ffffffb2);
  --figma-color-text-onselected-strong: #ffffff;
  --figma-color-text-onselected-tertiary: light-dark(#0000004d, #ffffff66);
  --figma-color-text-onsuccess: #ffffff;
  --figma-color-text-onsuccess-secondary: #ffffffcc;
  --figma-color-text-onsuccess-tertiary: #ffffff66;
  --figma-color-text-onwarning: #000000e5;
  --figma-color-text-onwarning-secondary: #00000080;
  --figma-color-text-onwarning-tertiary: #0000004d;
  --figma-color-text-secondary: light-dark(#00000099, #ffffffb2);
  --figma-color-text-secondary-hover: light-dark(#000000e5, #ffffff);
  --figma-color-text-selection: rgba(13, 153, 255, 0.4);
  --figma-color-text-selected: light-dark(#007be5, #7cc4f8);
  --figma-color-text-selected-secondary: light-dark(#007be5, #7cc4f8);
  --figma-color-text-selected-tertiary: light-dark(#007be5, #7cc4f8);
  --figma-color-text-success: light-dark(#009951, #7cd797);
  --figma-color-text-success-secondary: light-dark(#009951, #7cd797);
  --figma-color-text-success-tertiary: light-dark(#009951, #7cd797);
  --figma-color-text-tertiary: light-dark(#0000004d, #ffffff66);
  --figma-color-text-tertiary-hover: light-dark(#000000e5, #ffffff);
  --figma-color-text-warning: light-dark(#b86200, #f7d15f);
  --figma-color-text-warning-secondary: light-dark(#b86200, #f7d15f);
  --figma-color-text-warning-tertiary: light-dark(#b86200, #f7d15f);
  --figma-color-text-menu: #ffffff;
  --figma-color-text-menu-secondary: rgba(255, 255, 255, 0.7);
  --figma-color-text-menu-tertiary: rgba(255, 255, 255, 0.7);
}
}

:scope {
  /* Typography & Sizing */
  --font-size: 16px;
  --font-family:
    Inter, AppleSystemUIFont, BlinkMacSystemFont, avenir next, avenir, segoe ui,
    helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
  --font-variant-numeric: lining-nums tabular-nums slashed-zero;
  --text-body-medium-font-size: 0.6875rem;
  --text-body-small-font-size: 0.5625rem;
  --text-body-large-font-size: 0.8125rem;
  --text-body-medium-font-weight: 450;
  --text-body-medium-line-height: 1rem;
  --text-body-medium-letter-spacing: 0.055px;
  --text-body-strong-font-weight: 550;
  --text-heading-small-font-size: 0.8125rem;
  --text-heading-small-font-weight: 550;
  --text-heading-small-line-height: 1.375rem;
  --text-heading-small-letter-spacing: -0.0025em;
  --text-heading-medium-font-size: 0.9375rem;
  --text-heading-medium-font-weight: 550;
  --text-heading-medium-line-height: 1.5625rem;
  --text-heading-medium-letter-spacing: -0.005em;
  --text-heading-large-font-size: 1.5rem;
  --text-heading-large-font-weight: 550;
  --text-heading-large-line-height: 2rem;
  --text-heading-large-letter-spacing: -0.017em;

  --body-medium-fontSize: var(--text-body-medium-font-size);
  --font-size-small: var(--text-body-small-font-size);
  --body-small-fontSize: var(--text-body-small-font-size);
  --body-large-fontSize: var(--text-body-large-font-size);
  --body-letter-spacing: 0.055px;
  --body-medium-strong-fontWeight: var(--text-body-strong-font-weight);
  --body-large-strong-fontWeight: var(--text-body-strong-font-weight);
  --body-medium-fontWeight: var(--text-body-medium-font-weight);

  --line-height: 1rem;

  /* Spacing */
  --spacer-0: 0;
  --spacer-1: 0.25rem;
  --spacer-2: 0.5rem;
  --spacer-2-5: 0.75rem;
  --spacer-3: 1rem;
  --spacer-4: 1.5rem;
  --spacer-5: 2rem;
  --spacer-6: 2.5rem;
  --spacer-half: 0.125rem;

  /* Radii */
  --radius-none: 0;
  --radius-small: 0.125rem;
  --radius-medium: 0.3125rem;
  --radius-medium-large: 0.5625rem;
  --radius-large: 0.8125rem;
  --radius-xlarge: 1.3125rem;
  --radius-xxlarge: 1.8125rem;
  --radius-xxxlarge: 2.3125rem;
  --radius-full: 9999px;
  --figma-radius-none: var(--radius-none);
  --figma-radius-small: var(--radius-small);
  --figma-radius-medium: var(--radius-medium);
  --figma-radius-medium-large: var(--radius-medium-large);
  --figma-radius-large: var(--radius-large);
  --figma-radius-xlarge: var(--radius-xlarge);
  --figma-radius-xxlarge: var(--radius-xxlarge);
  --figma-radius-xxxlarge: var(--radius-xxxlarge);
  --figma-radius-full: var(--radius-full);

  /* Transitions */
  --input-transition: all 0.08s ease-out;
  --transition-duration: 0.08s;
  --transition-timing-function: ease-out;

  /* Misc UI */
  --popover-min-width: 15rem;
  --control-height: var(--spacer-4);
  --handle-color: #fff;
  --bg-selected: #f5f5f5;
  --bg-selected-active: #e5f4ff;
  --bg-tooltip: var(--figma-color-bg-menu);
  --color-tooltip: var(--figma-color-text);
  --input-opacity-width: calc(3.25rem - 2px);

  /* Transparent Backgrounds - use light-dark() */
  --figma-color-bordertranslucent: light-dark(
    rgba(0, 0, 0, 0.1),
    rgba(255, 255, 255, 0.1)
  );
  --figma-color-bordertranslucentstrong: light-dark(
    rgba(0, 0, 0, 0.2),
    rgba(255, 255, 255, 0.2)
  );
  --figma-color-bordertranslucentstronger: light-dark(
    rgba(0, 0, 0, 0.3),
    rgba(255, 255, 255, 0.3)
  );
  --figma-color-bg-transparent: light-dark(
    rgba(0, 0, 0, 0.05),
    rgba(255, 255, 255, 0.05)
  );
  --figma-color-bg-transparent-hover: light-dark(
    rgba(0, 0, 0, 0.05),
    rgba(255, 255, 255, 0.05)
  );
  --figma-color-bg-transparent-pressed: light-dark(
    rgba(0, 0, 0, 0.1),
    rgba(255, 255, 255, 0.1)
  );
  --figma-color-bg-transparent-secondary: light-dark(
    rgba(0, 0, 0, 0.1),
    rgba(255, 255, 255, 0.1)
  );

  /* Gradients */
  --eased-fade-stops:
    var(--figma-color-bg) 0%,
    color-mix(in oklch, var(--figma-color-bg) 99.9%, transparent) 10%,
    color-mix(in oklch, var(--figma-color-bg) 99.2%, transparent) 20%,
    color-mix(in oklch, var(--figma-color-bg) 97.3%, transparent) 30%,
    color-mix(in oklch, var(--figma-color-bg) 93.6%, transparent) 40%,
    color-mix(in oklch, var(--figma-color-bg) 87.5%, transparent) 50%,
    color-mix(in oklch, var(--figma-color-bg) 78.4%, transparent) 60%,
    color-mix(in oklch, var(--figma-color-bg) 65.7%, transparent) 70%,
    color-mix(in oklch, var(--figma-color-bg) 48.8%, transparent) 80%,
    color-mix(in oklch, var(--figma-color-bg) 27.1%, transparent) 90%,
    transparent 100%;

  --checkerboard: repeating-conic-gradient(
      rgba(0, 0, 0, 0.1) 0% 25%,
      rgba(255, 255, 255, 0.1) 0% 50%
    )
    0 0 / 0.66666rem 0.66666rem;
  --checkerboard-small: repeating-conic-gradient(
      rgba(0, 0, 0, 0.2) 0% 25%,
      rgba(255, 255, 255, 0.2) 0% 50%
    )
    0 0 / 0.5rem 0.5rem;
  --checkerboard-swatch: repeating-conic-gradient(
      rgba(0, 0, 0, 0.2) 0% 25%,
      rgba(255, 255, 255, 0.2) 0% 50%
    )
    0 0 / 0.4375rem 0.4375rem;
    --checkerboard-slider: repeating-conic-gradient(
      rgba(0, 0, 0, 0.2) 0% 25%,
      rgba(255, 255, 255, 0.2) 0% 50%
    )
    0 0 / 0.375rem 0.375rem;
  --checkerboard-handle: repeating-conic-gradient(
      rgba(0, 0, 0, 0.2) 0% 25%,
      rgba(255, 255, 255, 0.2) 0% 50%
    )
    0 0 / 0.375rem 0.375rem;
  --bg-hue: linear-gradient(
    90deg,
    rgba(255, 0, 0, 1),
    rgba(255, 48, 0, 1),
    rgba(255, 96, 0, 1),
    rgba(255, 143, 0, 1),
    rgba(255, 191, 0, 1),
    rgba(255, 239, 0, 1),
    rgba(223, 255, 0, 1),
    rgba(175, 255, 0, 1),
    rgba(128, 255, 0, 1),
    rgba(80, 255, 0, 1),
    rgba(32, 255, 0, 1),
    rgba(0, 255, 16, 1),
    rgba(0, 255, 64, 1),
    rgba(0, 255, 112, 1),
    rgba(0, 255, 159, 1),
    rgba(0, 255, 207, 1),
    rgba(0, 255, 255, 1),
    rgba(0, 207, 255, 1),
    rgba(0, 159, 255, 1),
    rgba(0, 112, 255, 1),
    rgba(0, 64, 255, 1),
    rgba(0, 16, 255, 1),
    rgba(32, 0, 255, 1),
    rgba(80, 0, 255, 1),
    rgba(127, 0, 255, 1),
    rgba(175, 0, 255, 1),
    rgba(223, 0, 255, 1),
    rgba(255, 0, 239, 1),
    rgba(255, 0, 191, 1),
    rgba(255, 0, 143, 1),
    rgba(255, 0, 96, 1),
    rgba(255, 0, 48, 1)
  );

  --tip-pointer: path("M8 6L2 0H14L8 6Z");

  /* Elevations — light-dark() handles theme switching inline */
  --figma-elevation-100:
    0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)),
    inset 0px 0.75px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.1)),
    0px 1px 3px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4));

  --figma-elevation-200:
    0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.18), transparent),
    0px 3px 8px 0px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35)),
    0px 1px 3px 0px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)),
    inset 0px 0.5px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.08)),
    inset 0px 0px 0.5px 0px light-dark(transparent, rgba(255, 255, 255, 0.3));

  --figma-elevation-100-canvas:
    0 0 0.5px 0 light-dark(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)),
    0 0.5px 0 0 light-dark(transparent, rgba(255, 255, 255, 0.1)) inset,
    0 0 0.5px 0 light-dark(transparent, rgba(255, 255, 255, 0.3)) inset,
    0 1px 3px 0 light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4));


  --figma-elevation-200-canvas:
    0 0 0 0.5px light-dark(rgba(0, 0, 0, 0.10), transparent),
    0 0.5px 0 0 light-dark(transparent, rgba(255, 255, 255, 0.08)) inset,
    0 3px 8px 0 light-dark(rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.35)),
    0 0 0.5px 0 light-dark(rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.30)) inset,
    0 1px 3px 0 light-dark(rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.50));

  --figma-elevation-400-menu-panel:
    0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.12), transparent),
    0px 10px 16px 0px light-dark(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.35)),
    0px 2px 5px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35)),
    inset 0px 0.5px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.08)),
    inset 0px 0.75px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.1));

  --fig-popover-shadow:
    drop-shadow(0px 1px 1.5px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)))
    drop-shadow(0px 2.5px 6px light-dark(rgba(0, 0, 0, 0.13), rgba(0, 0, 0, 0.5)))
    drop-shadow(0px 0px 0.5px light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15)));

  --figma-elevation-500-modal-window:
    0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.08), transparent),
    0px 10px 24px 0px light-dark(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.45)),
    0px 2px 5px 0px light-dark(rgba(0, 0, 0, 0.15), transparent),
    0px 3px 5px 0px light-dark(transparent, rgba(0, 0, 0, 0.35)),
    inset 0px 0.75px 0px 0px light-dark(transparent, rgba(255, 255, 255, 0.1));

  --figma-handle-shadow:
    0px 0px 0px 1px rgba(0, 0, 0, 0.1),
    0px 0px 0.5px 0px light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.1)),
    0px 1px 3px 0px light-dark(rgba(0, 0, 0, 0.15), transparent);


  &.figma-light{
    color-scheme: light;
    background-color: var(--figma-color-bg);
  }
  &.figma-dark{
    color-scheme: dark;
    background-color: var(--figma-color-bg);
  }
}

[selected]:not([selected="false"]):not(:is(fig-tabs, fig-tab, fig-segmented-control, fig-segment, fig-select-option, fig-menu-item)) {
  --figma-color-bg: var(--figma-color-bg-selected);
  --figma-color-bg-hover: var(--figma-color-bg-selected-hover);
  --figma-color-bg-active: var(--figma-color-bg-selected-pressed);
  --figma-color-bg-pressed: var(--figma-color-bg-selected-pressed);
  --figma-color-bg-secondary: var(--figma-color-bg-selected-secondary);
  --figma-color-bg-tertiary: var(--figma-color-bg-selected-tertiary);
  --figma-color-border: var(--figma-color-border-onselected);
  --figma-color-border-strong: var(--figma-color-border-onselected-strong);
  --figma-color-icon: var(--figma-color-icon-onselected);
  --figma-color-icon-hover: var(--figma-color-icon-onselected);
  --figma-color-icon-pressed: var(--figma-color-icon-onselected);
  --figma-color-icon-secondary: var(--figma-color-icon-onselected-secondary);
  --figma-color-icon-secondary-hover: var(--figma-color-icon-onselected);
  --figma-color-icon-tertiary: var(--figma-color-icon-onselected-tertiary);
  --figma-color-icon-tertiary-hover: var(--figma-color-icon-onselected);
  --figma-color-text: var(--figma-color-text-onselected);
  --figma-color-text-hover: var(--figma-color-text-onselected);
  --figma-color-text-secondary: var(--figma-color-text-onselected-secondary);
  --figma-color-text-secondary-hover: var(--figma-color-text-onselected);
  --figma-color-text-tertiary: var(--figma-color-text-onselected-tertiary);
  --figma-color-text-tertiary-hover: var(--figma-color-text-onselected);

  color: var(--figma-color-text-selected);
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
:is(button, fig-button) {
  --fig-button-content-alignment: center;
  --fig-button-text-alignment: center;

  appearance: none;
  min-width: 0;
  height: var(--spacer-4);
  padding: 0 var(--spacer-2);
  border: 0;
  border-radius: var(--radius-medium);
  outline: 0;
  background-color: var(--figma-color-bg-brand);
  color: var(--figma-color-text-onbrand);
  display: inline-flex;
  align-items: center;
  justify-content: var(--fig-button-content-alignment);
  gap: 0;
  font-weight: 500;
  line-height: 1rem;
  text-align: var(--fig-button-text-alignment);
  user-select: none;

  &[pill]:not([pill="false"]) {
    border-radius: var(--radius-full);
  }

  &:active {
    background-color: var(--figma-color-bg-brand-pressed);
  }

  &:hover {
    background-color: var(--figma-color-bg-brand-hover);

    &:active {
      background-color: var(--figma-color-bg-brand-pressed);
      color: var(--figma-color-text-onbrand-secondary);
    }
  }

  &[variant="destructive"] {
    background-color: var(--figma-color-bg-danger);
    color: var(--figma-color-text-ondanger);

    &:hover {
      background-color: var(--figma-color-bg-danger-hover);
    }

    &:active {
      background-color: var(--figma-color-bg-danger-pressed);
      color: var(--figma-color-text-ondanger-secondary);
    }
  }

  &[variant="destructiveSecondary"] {
    box-shadow: inset 0 0 0 1px var(--figma-color-border-danger);
    padding: 0 calc(var(--spacer-2) - 1px);
    background: none;
    color: var(--figma-color-text-danger);

    &:hover {
      background-color: var(--figma-color-bg-danger-tertiary);
    }

    &:active {
      box-shadow: inset 0 0 0 1px var(--figma-color-border-danger-strong);
      background-color: var(--figma-color-bg-danger-tertiary);
      color: var(--figma-color-text-danger-secondary);
    }
  }

  &[variant="destructiveGhost"] {
    box-shadow: none;
    background: none;
    color: var(--figma-color-text-danger);

    &:hover:not(:active) {
      background-color: var(--figma-color-bg-danger-tertiary);
    }

    &:active {
      background-color: var(--figma-color-bg-danger-tertiary);
      color: var(--figma-color-text-danger-secondary);
    }
  }

  &[variant="destructiveLink"] {
    box-shadow: none;
    background: none;
    color: var(--figma-color-text-danger);

    &:hover:not(:active) {
      background-color: transparent;
    }

    &:active {
      outline: 0;
      background-color: var(--figma-color-bg-danger-tertiary);
      color: var(--figma-color-text-danger-secondary);
    }
  }

  &[variant="link"] {
    box-shadow: none;
    background: none;
    color: var(--figma-color-text-brand);

    &:hover:not(:active) {
      background-color: transparent;
    }

    &:active {
      outline: 0;
      background-color: var(--figma-color-bg-selected);
      color: var(--figma-color-text-brand);
    }
  }

  &[variant="ghost"] {
    box-shadow: none;
    background: none;
    color: var(--figma-color-text);

    &:hover:not(:active) {
      background-color: var(--figma-color-bg-transparent-hover);
    }

    &:active {
      outline: 0;
      background-color: var(--figma-color-bg-transparent-pressed);
      color: var(--figma-color-text);
    }
  }

  &[variant="ghost"][disabled]:not([disabled="false"]) {
    background-color: transparent;
  }

  &:is([variant="secondary"], [variant="property"]) {
    box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
    padding: 0 calc(var(--spacer-2) - 1px);
    background: none;
    color: var(--figma-color-text);

    &:hover {
      background-color: var(--figma-color-bg-secondary);
    }

    &:active {
      background-color: var(--figma-color-bg-transparent-pressed);
      color: var(--figma-color-text);
    }
  }

  &[variant="input"] {
    background-color: var(--figma-color-bg-secondary);
    box-shadow: none;
    color: var(--figma-color-text);

    &:hover {
      box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
      background-color: var(--figma-color-bg-transparent);
    }

    &:active {
      background-color: var(--figma-color-bg-transparent-pressed);
      color: var(--figma-color-text);
    }

    &:focus-visible {
      background-color: var(--figma-color-bg-secondary);
    }
  }

  &[variant="overlay"] {
    color-scheme: light;
    background-color: var(--figma-color-bg);
    color: var(--figma-color-text);
    box-shadow: 0 0 0 1px var(--figma-color-bordertranslucent);

    &:hover {
      background-color: var(--figma-color-bg-hover);
    }

    &:active,
    &:has(:active) {
      background-color: var(--figma-color-bg-tertiary);
      color: var(--figma-color-text);
    }
  }

  &[icon]:not([icon="false"]) {
    width: var(--spacer-4);
    padding: 0;
    flex: 0 0 var(--spacer-4);
  }

  &[disabled]:not([disabled="false"]) {
    background-color: var(--figma-color-bg-disabled);
    pointer-events: none;
    cursor: not-allowed;

    &:not([variant="secondary"]):not([variant="property"]):not(
        [variant="destructiveSecondary"]
      ):not([variant="destructiveGhost"]):not(
        [variant="destructiveLink"]
      ):not([variant="ghost"]) {
      color: var(--figma-color-text-ondisabled);
      box-shadow: none;
    }

    &:is(
      [variant="secondary"],
      [variant="property"],
      [variant="destructiveSecondary"],
      [variant="destructiveGhost"],
      [variant="destructiveLink"],
      [variant="ghost"]
    ) {
      color: var(--figma-color-text-disabled);
      background-color: transparent;
    }
  }

  &[size="large"],
  &[size="large"] > button {
    height: var(--spacer-5);
    padding: 0 var(--spacer-3);
  }

  &[size="large"][icon]:not([icon="false"]),
  &[size="large"][icon]:not([icon="false"]) > button {
    width: var(--spacer-5);
    flex-basis: var(--spacer-5);
    padding: 0;
  }

  &[icon]:not([icon="false"])[icon="compact"],
  &[icon]:not([icon="false"])[icon="compact"] > button {
    width: fit-content;
    flex-basis: auto;
    padding-inline: 0;
  }

  &[full]:not([full="false"]) {
    width: 100%;
  }

  &[inline="false"],
  &[inline="false"] > button {
    --fig-button-content-alignment: flex-start;
    --fig-button-text-alignment: start;
    display: flex;
    width: 100%;
    height: auto;
    align-items: center;
    padding: var(--spacer-1) var(--spacer-2);
  }

  &[align="start"] {
    --fig-button-content-alignment: flex-start;
    --fig-button-text-alignment: start;
  }

  &[align="center"] {
    --fig-button-content-alignment: center;
    --fig-button-text-alignment: center;
  }

  &[align="end"] {
    --fig-button-content-alignment: flex-end;
    --fig-button-text-alignment: end;
  }

  &:is([type="select"], [type="upload"]) {
    position: relative;
    overflow: hidden;

    > select,
    > input,
    > fig-dropdown {
      position: absolute;
      inset: 0;
      opacity: 0;
      appearance: none;
    }
  }

  &[inline="false"] {
    padding: 0;
  }

  &[selected]:not([selected="false"]) {
    &,
    &:hover {
      color: var(--figma-color-icon-brand);
      background-color: var(--figma-color-bg-selected);
    }
  }

  &:focus-visible,
  &[data-focus-visible],
  &:is([type="select"], [type="upload"]):focus-within {
    outline: var(--figma-focus-outline);
    outline-offset: var(--figma-focus-outline-offset);
  }

  svg {
    *[fill]:not([fill="none"]) {
      fill: currentColor;
    }

    *[stroke]:not([stroke="none"]) {
      stroke: currentColor;
    }
  }

  &[type="select"] {
    &[icon]:not([icon="false"]) {
      width: auto;
      gap: 0;
      padding-right: var(--spacer-1);
    }

    fig-dropdown {
      position: absolute;
      inset: 0;
      z-index: 1;
      opacity: 0;
    }

    &:not([icon]) fig-icon[slot="append"][name="chevron"]:not([name="none"]) {
      margin-right: calc(var(--spacer-1) * -1);
      margin-left: auto;
    }
  }

  &:has(fig-icon[slot="prepend"]) {
    padding-left: var(--spacer-1);

    &[size="large"] {
      padding-left: var(--spacer-2);
    }
  }

  &:where(fig-button) {
    height: var(--fig-button-control-height, var(--spacer-4));
    overflow: var(--fig-button-control-overflow, hidden);
    padding: var(--fig-button-control-padding, 0 var(--spacer-2));
    text-overflow: ellipsis;
    white-space: nowrap;

    > [slot="prepend"] {
      order: -1;
    }

    > :is([slot="label"], label) {
      display: block;
      flex: 0 1 auto;
      min-width: 0;
      max-width: 100%;
      overflow: hidden;
      color: inherit;
      font: inherit;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    > [slot="append"] {
      order: 1;
    }

    &[type="select"] {
      gap: var(--spacer-1);
    }

    &[variant="property"] {
      --fig-button-content-alignment: flex-start;
      --fig-button-text-alignment: start;
      width: 100%;

      &:not([selected]):not([selected="false"]) > fig-icon[slot="prepend"] {
        color: var(--figma-color-icon-secondary);
      }

      &[selected]:not([selected="false"]) {
        box-shadow: none;
      }

      &:has(> [slot="prepend"]) {
        flex: 1 1 auto;
        padding: 0 calc(var(--spacer-2) - 1px) 0 0;
      }
    }
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
/* Menu */
fig-menu {
  display: contents;
}

/*
 * Internal menu is a fig-popup inside fig-menu's shadow, so document
 * dialog[is="fig-popup"] rules don't apply. Expose part=listbox and mirror
 * the menu-theme popup chrome (same tokens as fig-select::part(listbox)).
 */
fig-menu::part(listbox) {
  --z-index: 999999;
  --fig-popup-radius: var(--radius-large);
  --fig-popup-bg-color: var(--figma-color-bg-menu);

  z-index: var(--z-index);
  position: fixed;
  margin: 0;
  border: 0;
  outline: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--fig-popup-radius);
  background-color: var(--fig-popup-bg-color);
  color: var(--figma-color-text-menu);
  color-scheme: dark;
  box-shadow: var(--figma-elevation-400-menu-panel);
  min-width: 6rem;
  max-height: calc(100vh - 1rem);
  height: max-content;
}

fig-menu > :is(fig-separator, fig-menu-separator) {
  --fig-separator-padding-inline: var(--spacer-3,0.75rem) var(--spacer-4,1rem);
}

fig-menu > [slot="trigger"] + :is(fig-separator, fig-menu-separator):has(> label) {
  --fig-separator-padding-block: 0;
  --fig-separator-stuck-padding-block: 0;
  --fig-separator-color: transparent;
  --fig-separator-margin-block: 0;
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
:is(fig-menu-item, fig-select-option) {
  --fig-menu-item-padding: var(--spacer-1,0.25rem) var(--spacer-4,1rem) var(--spacer-1,0.25rem) var(--spacer-3,0.75rem);
  box-sizing: border-box;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  text-align: left;
  gap: var(--spacer-1);
  width: 100%;
  padding: var(--fig-menu-item-padding);
  min-height: var(--spacer-4);
  height: auto;
  cursor: default;
  border-radius: var(--radius-medium);
  color: inherit;
  font-weight: var(--body-medium-fontWeight);
  position: relative;
  isolation: isolate;

  &:has(fig-icon[slot="prepend"]){
    --fig-menu-item-padding: var(--spacer-1,0.25rem) var(--spacer-4,1rem) var(--spacer-1,0.25rem) var(--spacer-2,0.5rem);
  }

  h3 {
    margin: 0 0 var(--spacer-1) 0;
    font-size: var(--text-body-medium-font-size);
    font-weight: var(--body-medium-strong-fontWeight);
    line-height: var(--line-height);
    letter-spacing: var(--body-letter-spacing);
  }

  label {
    color: var(--figma-color-text-secondary);
  }

  > :not(fig-icon):not(fig-menu) {
    flex: 1 1 auto;
    min-width: 0;
  }

  > fig-menu {
    flex: 0 0 auto;
  }

  &[size="large"]{
    --fig-menu-item-padding: var(--spacer-2) var(--spacer-4);
  }

  &::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0 var(--spacer-2);
    border-radius: var(--radius-medium);
    z-index: -1;
    background-color: transparent;
  }

  &:hover,
  &:focus-visible {
    outline: none;
    &::before {
      background-color: var(--figma-color-bg-menu-hover);
    }
  }

  & > [slot="prepend"],
  & > [slot="append"] {
    margin-top: calc(var(--spacer-1) * -1);
    margin-bottom: calc(var(--spacer-1) * -1);
  }
  & > [slot="append"] {
    margin-left: auto;
    padding-left: var(--spacer-2);
    flex: 0 0 auto;
  }

  &:has(> [slot="append"]) {
    --fig-menu-item-padding: var(--spacer-1,0.25rem) var(--spacer-3,0.75rem) var(--spacer-1,0.25rem) var(--spacer-3,0.75rem);
  }
  &:has(> [slot="prepend"]:not([data-fig-select-checkmark])) {
    --fig-menu-item-padding: var(--spacer-1,0.25rem) var(--spacer-3,0.75rem) var(--spacer-1,0.25rem) var(--spacer-2,0.5rem);
  }
  &:has(> [slot="prepend"]:not([data-fig-select-checkmark])):has(> [slot="append"]) {
    --fig-menu-item-padding: var(--spacer-1,0.25rem) var(--spacer-3,0.75rem) var(--spacer-1,0.25rem) var(--spacer-2,0.5rem);
  }

  &[subtle]:not([subtle="false"]) {
    &:hover,
    &:focus-visible {
      &::before {
        background-color: var(--figma-color-bg-secondary);
      }
    }
  }

  &[disabled]:not([disabled="false"]),
  &[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
dialog[is^="fig-popup"] {
  inset: auto;
}

dialog[is="fig-popup"] {
  --z-index: 999999;
  --fig-popup-beak-offset: 50%;
  --fig-popup-beak-width: 1rem;
  --fig-popup-beak-height: 6px;
  --fig-popup-radius: var(--radius-large);
  --fig-popup-bg-color: var(--figma-color-bg);
  --fig-popup-tip-clip-path: path(
    "M16 0H0L0 1H0.757359C1.55301 1 2.31607 1.31607 2.87868 1.87868L6.29587 5.29587C7.23704 6.23704 8.76296 6.23704 9.70413 5.29587L13.1213 1.87868C13.6839 1.31607 14.447 1 15.2426 1H16V0Z"
  );
  --fig-popup-shadow: var(--figma-elevation-400-menu-panel);

  z-index: var(--z-index);
  position: fixed;
  margin: 0;
  padding: 0;
  gap:0;
  min-width: 0;
  padding: 0;
  overflow: auto;
  border-radius: var(--fig-popup-radius);
  background-color: var(--fig-popup-bg-color);
  box-shadow: var(--fig-popup-shadow);

  &[autoresize]:not([autoresize="false"]) {
    width: max-content;
    max-width: calc(100vw - var(--spacer-4));
    max-height: calc(100vh - var(--spacer-4));
  }

  &[open]:not([open="false"]):has(> fig-content) {
    overflow: hidden;
  }

  > fig-header {
    position: sticky;
    top: 0;
    z-index: 2;
  }

  &:has(> fig-header) {
    --fig-sticky-header-size: var(--spacer-6);

    > :is(fig-separator, fig-menu-separator)[sticky]:not([sticky="false"]) {
      top: var(--fig-sticky-header-size);
    }
  }

  &[theme="dark"] {
    color-scheme: dark;
    --fig-popup-bg-color: var(--figma-color-bg);
  }

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

  &[theme="brand"],
  &[theme="canvas"] {
    --fig-popup-bg-color: var(--figma-color-bg-brand);
    color-scheme: dark;
  }

  &[theme="menu"] {
    --fig-popup-bg-color: var(--figma-color-bg-menu);
    color: var(--figma-color-text-menu);
    color-scheme: dark;
    padding: var(--spacer-2) 0;
    min-width: 6rem;
    box-shadow: var(--figma-elevation-100);

    &.fig-menu-popup {
      max-height: calc(100vh - 1rem);
      padding: 0;
      overflow: hidden;
    }
  }

  &[variant="tooltip"],
  &[variant="popover"] {
    overflow: visible;
    box-shadow: inset 0 0.5px 0 0 rgba(255, 255, 255, 0.1);
    filter: var(--fig-popover-shadow);

    &::after {
      content: "";
      background-color: inherit;
      clip-path: var(--fig-popup-tip-clip-path);
      position: absolute;
      width: var(--fig-popup-beak-width);
      height: var(--fig-popup-beak-height);
      z-index: 2;
      pointer-events: none;
    }

    &[data-beak-side="bottom"]::after {
      top: calc(100% - 1px);
      left: var(--fig-popup-beak-offset, 50%);
      transform: translateX(-50%);
    }

    &[data-beak-side="top"]::after {
      top: 1px;
      left: var(--fig-popup-beak-offset, 50%);
      transform: translate(-50%, -100%) scaleY(-1);
    }

    &[data-beak-side="left"]::after {
      left: var(--fig-popup-beak-height);
      top: var(--fig-popup-beak-offset, 50%);
      transform: translate(-100%, -50%) rotate(90deg);
    }

    &[data-beak-side="right"]::after {
      left: calc(100% - var(--fig-popup-beak-height));
      top: var(--fig-popup-beak-offset, 50%);
      transform: translate(0, -50%) rotate(-90deg);
    }
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
fig-tooltip {
  display: contents;
}

dialog[is="fig-popup"][variant="tooltip"] {
  --fig-popup-radius: var(--radius-medium, 0.3125rem);
  --fig-popup-tip-clip-path: var(--tip-pointer);
  line-height: 1rem !important;
  max-width: 180px;
  width: max-content;
  padding: 0;
  min-width: 0;
  box-shadow: inset 0 0.5px 0 0
    light-dark(rgba(0, 0, 0, 0.06), rgba(255, 255, 255, 0.1));
  filter: var(--fig-popover-shadow);
  pointer-events: none;

  & > span {
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
    width: auto;
    padding: var(--spacer-1) var(--spacer-2);
  }

  &[theme="canvas"] {
    --fig-popup-radius: 3px;
    box-shadow: none;
    filter: none;

    & > span {
      padding: 0.125rem 0.375rem;
    }
  }

  &[pointer="false"]::after {
    display: none !important;
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
fig-header {
  --fig-header-height: var(--spacer-6);
  height: var(--fig-header-height);
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: var(--spacer-1) var(--spacer-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 -1px 0 0 var(--figma-color-border);
  gap: var(--spacer-2);
  user-select: none;

  &[compact]:not([compact="false"]) {
    --fig-header-height: var(--spacer-5);
  }

  & > fig-input-text:only-child {
    width: 100%;
  }

  & > *:is(h1, h2, h3) {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    padding-left: var(--spacer-2);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;

    &:first-child {
      padding-left: var(--spacer-2);
    }
  }

  & > h3 {
    font-size: var(--text-body-medium-font-size);
    font-weight: var(--body-medium-strong-fontWeight);
    line-height: var(--line-height);
    letter-spacing: var(--body-letter-spacing);
  }

  & > span,
  & > label {
    color: var(--figma-color-text-secondary);
  }

  &[borderless]:not([borderless="false"]) {
    box-shadow: none;
  }

  & > :is(fig-switch, fig-select:not([variant="ghost"])):last-child {
    margin-right: var(--spacer-2);
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
fig-footer {
  display: flex;
  flex-shrink: 0;
  width: 100%;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--spacer-2);
  padding: var(--spacer-2-5);
  box-shadow: 0 -1px 0 0 var(--figma-color-border);

  & h3 {
    font-size: var(--text-body-medium-font-size);
    font-weight: var(--body-medium-strong-fontWeight);
    line-height: var(--line-height);
    letter-spacing: var(--body-letter-spacing);
    flex-grow: 1;
    display: flex;
    align-items: baseline;
    gap: var(--spacer-half);
  }

  & > label {
    flex-grow: 1;
    gap: var(--spacer-half);
    min-height: var(--spacer-4);
    display: flex;
    align-items: center;
    text-wrap: pretty;
  }

  & > fig-button {
    flex-shrink: 0;
  }

  &:not(:has(> fig-button)) > :is(label, h3) {
    flex-grow: 1;
    justify-content: center;
    text-align: center;
  }

  &:has(> :is(fig-button, fig-tooltip) ~ :is(fig-button, fig-tooltip)) {
    flex-wrap: wrap;

    & > :is(label, h3) {
      flex-grow: 1;
      width: 100%;
      justify-content: flex-start;
      text-align: start;
    }
  }

  &[borderless]:not([borderless="false"]) {
    box-shadow: none;
  }

  &[sticky]:not([sticky="false"]) {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin-top: auto;
    background: var(--figma-color-bg);
    border-radius: 0 0 var(--radius-large) var(--radius-large);
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
.segmented-control,
fig-segmented-control {
  display: inline-flex;
  user-select: none;
  background-color: var(--figma-color-bg-secondary);
  border: 0;
  border-radius: var(--radius-medium);
  --fig-segmented-control-height: 1.5rem;
  height: var(--fig-segmented-control-height);
  padding: 1px;
  gap: 0;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  --seg-indicator-x: 0px;
  --seg-indicator-w: 0px;
  --seg-indicator-opacity: 0;
  --seg-indicator-transition-duration: 0ms;

  &::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: var(--seg-indicator-w);
    height: calc(100% - 2px);
    transform: translateX(var(--seg-indicator-x));
    border-radius: calc(var(--radius-medium) - 1px);
    background-color: var(--figma-color-bg);
    box-shadow: 0 0 0 1px var(--figma-color-border);
    opacity: var(--seg-indicator-opacity);
    pointer-events: none;
    z-index: 0;
    transition:
      transform var(--seg-indicator-transition-duration) ease,
      width var(--seg-indicator-transition-duration) ease,
      opacity 0.12s ease;
  }

  & fig-segment {
    --figma-focus-outline-offset: 0;
    flex: 1 1 0;
    min-width: var(--fig-segmented-control-height);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    position: relative;
    z-index: 1;
    appearance: none;
    color: var(--figma-color-text-secondary);
    padding: 0 var(--spacer-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: none;
    text-transform: capitalize;

    &:has(> :is(svg, fig-icon):only-child) {
      padding: 0;
    }

    &[selected]:not([selected="false"]),
    &[selected="true"] {
      color: var(--figma-color-text);
      background-color: var(--figma-color-bg);
      border-radius: calc(var(--radius-medium) - 1px);
      box-shadow: 0 0 0 1px var(--figma-color-border);
    }

    &:focus-visible {
      outline: var(--figma-focus-outline);
      outline-offset: var(--figma-focus-outline-offset);
    }

    svg {
      *[fill] {
        fill: currentColor;
      }

      *[stroke]:not([stroke="none"]) {
        stroke: currentColor;
      }
    }
  }

  &:not([sizing]),
  &[sizing=""],
  &[sizing="equal"] {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;

    & fig-segment {
      flex: none;
    }

    &[full]:not([full="false"]) {
      display: grid;
      grid-auto-columns: minmax(0, 1fr);
    }
  }

  &[sizing="auto"] {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    flex: 0 0 auto;

    &[full]:not([full="false"]) {
      display: inline-flex;
      width: fit-content;
      flex: 0 0 auto;
      align-self: auto;
    }

    & fig-segment {
      flex: 0 0 auto;
    }
  }

  &[animated]:not([animated="false"]) {
    & fig-segment {
      &[selected]:not([selected="false"]),
      &[selected="true"] {
        background-color: transparent;
        box-shadow: none;
      }
    }
  }

  &[size="large"] {
    --fig-segmented-control-height: var(--spacer-5);
  }

  &[disabled]:not([disabled="false"]) {
    pointer-events: none;
    --seg-indicator-opacity: 0;

    fig-segment {
      color: var(--figma-color-text-disabled);
      background-color: transparent;
      box-shadow: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .segmented-control::before,
  fig-segmented-control::before {
    transition: none !important;
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
:is(fig-input-text, fig-input-number) {
  background-color: var(--figma-color-bg-secondary);
  border: 0;
  border-radius: var(--radius-medium);
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: center;
  user-select: all;
  gap: 0;
  min-width: 0;
  flex: 0 1 auto;
  color: var(--figma-color-text);
  width: 8.9375rem;

  &[full]:not([full="false"]) {
    display: flex;
    flex: 1;
    width: 100%;
  }

  &[tabular]:not([tabular="false"]) {
    font-variant-numeric: tabular-nums;

    & input {
      font-variant-numeric: tabular-nums;
    }
  }

  &[size="large"] {
    & > input,
    & > textarea {
      padding: var(--spacer-2);
    }

    & > [slot="prepend"] {
      min-width: var(--spacer-5);
    }
  }

  &[multiline]:not([multiline="false"]) {
    display: flex;
    width: 100%;
  }

  &[autoresize]:not([autoresize="false"]) :is(input, textarea) {
    field-sizing: content;
  }

  &[resizable]:not([resizable="false"]) :is(input, textarea) {
    resize: both;
  }

  &[resizable]:not([resizable="false"]):has(textarea[style*="width"]),
  &[resizable]:not([resizable="false"]):has(textarea[style*="height"]),
  &[resizable]:not([resizable="false"]):has(input[style*="width"]),
  &[resizable]:not([resizable="false"]):has(input[style*="height"]) {
    flex: unset;
  }

  & label,
  & [slot] {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  & [slot] {
    user-select: none;
    width: 1.5rem;
    color: var(--figma-color-text-secondary);
  }

  & [slot="prepend"] {
    order: 0;
    padding-right: 0;
    color: var(--figma-color-text-secondary);
    margin-right: calc(var(--spacer-2) * -1);
  }

  & > fig-icon[slot="prepend"] {
    color: var(--figma-color-icon-secondary);
  }

  & [slot="append"] {
    order: 2;
    padding-left: 0;
    margin-left: calc(var(--spacer-2) * -1);

    &[size="large"] {
      height: var(--spacer-5);
      min-width: var(--spacer-5);
    }
  }

  &[type="search"]:not([data-search-has-value])
    [data-generated="search-clear"] {
    visibility: hidden;
    pointer-events: none;
  }

  &[type="search"] > fig-icon[data-generated="search-prefix"] {
    color: var(--figma-color-icon-secondary);
  }

  &[type="search"]:focus-within > fig-icon[data-generated="search-prefix"] {
    color: var(--figma-color-icon);
  }

  & [slot="prepend"],
  & [slot="append"] {
    svg {
      *[fill]:not([fill="none"]) {
        fill: currentColor;
      }

      *[stroke]:not([stroke="none"]) {
        stroke: currentColor;
      }
    }
  }

  & input,
  & textarea {
    order: 1;
    background-color: transparent !important;
    flex: 1;

    &:focus,
    &:focus-visible,
    &:active {
      outline: 0 !important;
      box-shadow: none !important;
    }
  }

  & input[type="text"]:focus,
  & input[type="text"]:focus-visible,
  & input[type="text"]:active {
    outline: 0 !important;
    box-shadow: none !important;
  }

  & input[type="search"] {
    appearance: textfield;

    &::-webkit-search-cancel-button,
    &::-webkit-search-decoration,
    &::-webkit-search-results-button,
    &::-webkit-search-results-decoration {
      appearance: none;
      display: none;
    }
  }

  &:focus,
  &:focus-visible,
  &:has(:is(input, textarea):focus-visible) {
    outline: var(--figma-focus-outline);
    outline-offset: var(--figma-focus-outline-offset);
  }

  &:hover {
    box-shadow: inset 0 0 0 1px var(--figma-color-border);
  }

  &[disabled]:not([disabled="false"]) {
    background-color: var(--figma-color-bg);
    pointer-events: none;
    cursor: not-allowed;
    color: var(--figma-color-text-disabled);
    box-shadow: inset 0 0 0 1px var(--figma-color-border-disabled);

    & [slot] {
      color: var(--figma-color-text-disabled);
    }
  }

  &[readonly] {
    background-color: var(--figma-color-bg);
    box-shadow: inset 0 0 0 1px var(--figma-color-border-disabled);
  }

  &:is(fig-input-number)[variant="ghost"] {
    background-color: transparent;
    box-shadow: none;

    &:hover {
      box-shadow: none;
    }

    &:is(:hover, :focus-within):not([disabled]):not([disabled="false"]) {
      background-color: var(--figma-color-bg-secondary);
    }

    &[disabled]:not([disabled="false"]) {
      background-color: transparent;
      box-shadow: none;
    }
  }
}

fig-input-number > [slot],
fig-input-text[type="number"] > [slot] {
  cursor: ew-resize !important;
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
/* Dropdown */
select,
input[type="text"][list] {
  padding: var(--spacer-2);

  &:not([multiple]) {
    height: var(--fig-dropdown-height, var(--spacer-4));
    padding: 0 var(--spacer-4) 0 var(--spacer-2);
    background-color: var(--figma-color-bg);
    background-image: var(--icon-16-chevron);
    background-position: calc(100% - var(--spacer-1)) 50%;
    background-size: 1rem;
    background-repeat: no-repeat;
  }
  &[multiple] {
    overflow: auto;
    option{
      padding: var(--spacer-1) var(--spacer-2);
      border-radius: var(--radius-medium);
      &:checked {
        background-color: var(--figma-color-bg-selected-strong) !important;
      }
      &:active{
        background-color: var(--figma-color-bg-active);
      }
      &:hover{
        background-color: var(--figma-color-bg-hover);
      }
    }
  }
  border-radius: var(--radius-medium);
  display: flex;
  appearance: none;
  align-items: center;
  border: 0;
  color: var(--figma-color-text);
  box-shadow: inset 0 0 0 1px var(--figma-color-border);
  accent-color: var(--figma-color-bg-brand);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  &:focus-visible {
    outline: var(--figma-focus-outline);
    outline-offset: var(--figma-focus-outline-offset);
  }

  &::-webkit-calendar-picker-indicator {
    color-scheme: inherit;
    opacity: 0;
  }
}

input[type="text"][list],
select:not([multiple]) {
  padding-right: var(--spacer-4);
  padding-left: var(--spacer-2);
}

fig-dropdown {
  & > *:not(select) {
    display: none !important;
  }

  &[size="large"] {
    --fig-dropdown-height: var(--spacer-5);
  }

  &[full]:not([full="false"]) {
    display: flex;
    width: 100%;
  }

  &[variant="ghost"] {
    border-radius: var(--radius-medium);
    background: transparent;

    > select {
      box-shadow: none;
      background: transparent;
    }

    &:hover:not([disabled]):not([disabled="false"]) {
      background-color: var(--figma-color-bg-secondary);
    }
  }
}

/* Native select popups in Chromium webviews do not reliably inherit themed
   option colors. Style only the popup rows so the closed control continues
   to resolve FigUI's light-dark tokens from the application color scheme. */
fig-dropdown > select {
  color: inherit;

  option,
  optgroup {
    color: #1e1e1e;
    background-color: #ffffff;
  }
}
fig-dropdown,
select,
.fig-dropdown {
  display: inline-flex;
  position: relative;
  > select {
    display: flex;
    align-items: center;
    flex: 1;
    width: 100%;
  }

  /* Chevron icon using mask-image for light-dark support */
  &:not([multiple])::after {
    content: "";
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    mask-image: var(--icon-16-chevron);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    background-color: var(--figma-color-icon);
    pointer-events: none;
  }

  /* Autoresize to content width */
  &[autoresize]:not([autoresize="false"]) select {
    field-sizing: content;
  }
}

/*
MIT License
Copyright (c) 2026 Rogie King
License: https://github.com/rogie/figui3/blob/main/LICENSE
*/
.fig-mask-icon,
fig-icon {
  --size: var(--spacer-4);
  --icon: none;
  color: var(--icon-color, inherit);

  &[size="small"] {
    --size: var(--spacer-3);
  }

  display: inline-flex;
  width: var(--size);
  height: var(--size);
  align-items: center;
  justify-content: center;
  background: currentColor;
  flex-shrink: 0;
  /* Safari still requires the prefix; other engines use the standard form. */
  -webkit-mask-image: var(--icon);
  -webkit-mask-size: auto;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: var(--icon);
  mask-size: auto;
  mask-repeat: no-repeat;
  mask-position: center;

  /* Slotted SVGs/character icons paint themselves, so the mask/background pipeline must be
     fully disabled — including the inline background-color set by [color]. */
  &:has(> *),
  &:not([name]) {
    background: transparent !important;

    -webkit-mask-image: none;
    mask-image: none;
  }

  &:not([name]) {
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  & > label {
    color: inherit;
    font: inherit;
    line-height: 1;
  }

  & > svg {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    flex-shrink: 0;
  }
}

:scope {
  --icon-16-chevron: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.87868 7.12132L8 9.24264L10.1213 7.12132' stroke='grey' stroke-linecap='round'/%3E%3C/svg%3E");
  --icon-24-chevron: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.64645 10.1464C7.84171 9.95118 8.15829 9.95118 8.35355 10.1464L12 13.7929L15.6464 10.1464C15.8417 9.95118 16.1583 9.95118 16.3536 10.1464C16.5488 10.3417 16.5488 10.6583 16.3536 10.8536L12.3536 14.8536C12.1583 15.0488 11.8417 15.0488 11.6464 14.8536L7.64645 10.8536C7.45118 10.6583 7.45118 10.3417 7.64645 10.1464Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
  --icon-16-close: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.1464 4.14645C11.3417 3.95118 11.6582 3.95118 11.8534 4.14645C12.0487 4.34171 12.0487 4.65822 11.8534 4.85348L8.70696 7.99996L11.8534 11.1464C12.0487 11.3417 12.0487 11.6582 11.8534 11.8535C11.6582 12.0487 11.3417 12.0487 11.1464 11.8535L7.99993 8.70699L4.85345 11.8535C4.65819 12.0487 4.34168 12.0487 4.14642 11.8535C3.95115 11.6582 3.95115 11.3417 4.14642 11.1464L7.2929 7.99996L4.14642 4.85348C3.95115 4.65822 3.95115 4.34171 4.14642 4.14645C4.34168 3.95118 4.65819 3.95118 4.85345 4.14645L7.99993 7.29293L11.1464 4.14645Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
  --icon-24-close: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.2242 7.08154C16.4182 6.95348 16.6823 6.97551 16.8531 7.146C17.024 7.31683 17.0457 7.58084 16.9176 7.7749L16.8531 7.85303L12.7067 11.9995L16.8531 16.146L16.9176 16.2241C17.0457 16.4182 17.024 16.6822 16.8531 16.853C16.6823 17.0239 16.4183 17.0456 16.2242 16.9175L16.1461 16.853L11.9996 12.7065L7.85315 16.853C7.65789 17.0483 7.34138 17.0483 7.14612 16.853C6.95128 16.6577 6.95101 16.3411 7.14612 16.146L11.2926 11.9995L7.14612 7.85303L7.08167 7.7749C6.95389 7.58087 6.97541 7.3167 7.14612 7.146C7.31683 6.97532 7.58101 6.95376 7.77502 7.08154L7.85315 7.146L11.9996 11.2925L16.1461 7.146L16.2242 7.08154Z' fill='currentColor'/%3E%3C/svg%3E");
  --icon-24-search: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.5 6C14.5376 6 17 8.46243 17 11.5C17 12.8387 16.5206 14.0648 15.7256 15.0186L17.8535 17.1465C18.0488 17.3417 18.0488 17.6582 17.8535 17.8535C17.6583 18.0486 17.3417 18.0487 17.1465 17.8535L15.0186 15.7256C14.0648 16.5206 12.8387 17 11.5 17C8.46243 17 6 14.5376 6 11.5C6 8.46243 8.46243 6 11.5 6ZM11.5 7C9.01472 7 7 9.01472 7 11.5C7 13.9853 9.01472 16 11.5 16C13.9853 16 16 13.9853 16 11.5C16 9.01472 13.9853 7 11.5 7Z' fill='black' fill-opacity='0.9'/%3E%3C/svg%3E");
}

:scope {
  --pfb-figui-ready: 1;
  --figma-color-bg-brand: #dc2626;
  --figma-color-bg-brand-hover: #b91c1c;
  --figma-color-bg-brand-pressed: #991b1b;
  --figma-color-text-onbrand: #fff;
  --figma-color-text-onbrand-secondary: #fff;
  --figma-focus-outline-color: #dc2626;
  --figma-color-bg-menu: #27272a;
  --figma-color-bg-menu-hover: #52525b;
  --spacer-4: 28px;
  color-scheme: light;
  font-family: var(--font-family);
  font-weight: var(--text-body-medium-font-weight);
  letter-spacing: var(--text-body-medium-letter-spacing);
}
:scope.fb-panel { font-variant-numeric: var(--font-variant-numeric); }
:scope.fb-panel :is(button, input, select, textarea, fig-input-text, fig-dropdown, fig-segment, .fb-file-chip),
fig-button, fig-menu-item, dialog[is="fig-popup"] { font-family: var(--font-family); }
:scope.fb-panel :is(.fb-item-number, .fb-item-date, .fb-item-note, .fb-edit-ta, .fb-panel-save-status) { font-weight: var(--text-body-medium-font-weight); }
:scope.fb-panel :is(.fb-panel-count, .fb-status) { font-weight: var(--text-body-strong-font-weight); }
fig-button, fig-menu-item, fig-input-text, fig-dropdown, fig-segment { font-size: 14px; cursor: pointer; }
fig-header.fb-panel-head { height: 42px; padding-inline: 12px; }
fig-footer.fb-panel-foot { padding: 7px 12px; align-items: center; justify-content: space-between; border-top: 0; }
fig-footer.fb-panel-foot > fig-button { white-space: nowrap; font-size: 14px; }
fig-segmented-control.fb-panel-segment { --fig-segmented-control-height: 30px; margin: 8px 12px 0; width: auto; }
fig-segment { text-transform: none; cursor: pointer; }
.fb-panel-filters:has(fig-input-text) { padding: 7px 12px; }
.fb-panel-filters fig-input-text { flex: 1; min-width: 0; }
.fb-panel-filters fig-input-text input { font-size: 14px; }
.fb-panel-filters fig-dropdown { width: 124px; max-width: 42%; }
fig-header .fb-panel-heading strong {
  font-size: 16px;
  font-weight: var(--text-heading-medium-font-weight);
  letter-spacing: var(--text-heading-medium-letter-spacing);
}
fig-button > svg { width: 16px; height: 16px; pointer-events: none; }
fig-button[data-fb-images] { gap: 4px; min-width: 28px; white-space: nowrap; }
fig-menu::part(listbox) { min-width: 180px; }
fig-menu-item { min-height: 32px; padding-inline: 12px; }
fig-menu-item[data-fb-clear-all] { color: #fecaca; }
dialog[is="fig-popup"][variant="tooltip"] { font-size: 14px; }
}
