/* GENERATED FROM tokens.json BY scripts/build-tokens.mjs -- DO NOT EDIT.
 * Edit tokens.json instead; the dev server regenerates this file on change. */
@import "tailwindcss";
@import "tw-animate-css";
@plugin "@tailwindcss/typography";

@custom-variant dark (&:is(.dark *));

@theme inline {
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-border: hsl(var(--border));
  --color-input: hsl(var(--input));
  --color-ring: hsl(var(--ring));

  --color-card: hsl(var(--card));
  --color-card-foreground: hsl(var(--card-foreground));
  --color-card-border: hsl(var(--card-border));

  --color-popover: hsl(var(--popover));
  --color-popover-foreground: hsl(var(--popover-foreground));
  --color-popover-border: hsl(var(--popover-border));

  --color-primary: hsl(var(--primary));
  --color-primary-foreground: hsl(var(--primary-foreground));
  --color-primary-border: var(--primary-border);

  --color-secondary: hsl(var(--secondary));
  --color-secondary-foreground: hsl(var(--secondary-foreground));
  --color-secondary-border: var(--secondary-border);

  --color-muted: hsl(var(--muted));
  --color-muted-foreground: hsl(var(--muted-foreground));
  --color-muted-border: var(--muted-border);

  --color-accent: hsl(var(--accent));
  --color-accent-foreground: hsl(var(--accent-foreground));
  --color-accent-border: var(--accent-border);

  --color-destructive: hsl(var(--destructive));
  --color-destructive-foreground: hsl(var(--destructive-foreground));
  --color-destructive-border: var(--destructive-border);

  --color-chart-1: hsl(var(--chart-1));
  --color-chart-2: hsl(var(--chart-2));
  --color-chart-3: hsl(var(--chart-3));
  --color-chart-4: hsl(var(--chart-4));
  --color-chart-5: hsl(var(--chart-5));

  --color-sidebar: hsl(var(--sidebar));
  --color-sidebar-foreground: hsl(var(--sidebar-foreground));
  --color-sidebar-border: hsl(var(--sidebar-border));
  --color-sidebar-primary: hsl(var(--sidebar-primary));
  --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
  --color-sidebar-primary-border: var(--sidebar-primary-border);
  --color-sidebar-accent: hsl(var(--sidebar-accent));
  --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
  --color-sidebar-accent-border: var(--sidebar-accent-border);
  --color-sidebar-ring: hsl(var(--sidebar-ring));

  --font-sans: var(--app-font-sans);
  --font-serif: var(--app-font-serif);
  --font-mono: var(--app-font-mono);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

/* LIGHT MODE */
:root {
  --button-outline: rgba(0,0,0, .10);
  --badge-outline: rgba(0,0,0, .05);

  /* Automatic computation of border around primary / danger buttons */
  --opaque-button-border-intensity: -8; /* In terms of percentages */

  /* Backgrounds applied on top of other backgrounds when hovered/active */
  --elevate-1: rgba(0,0,0, .03);
  --elevate-2: rgba(0,0,0, .08);

  --background: __DS_LIGHT_BACKGROUND__;
  --foreground: __DS_LIGHT_FOREGROUND__;
  --border: __DS_LIGHT_BORDER__;
  --card: __DS_LIGHT_CARD__;
  --card-foreground: __DS_LIGHT_CARDFOREGROUND__;
  --sidebar: __DS_LIGHT_SIDEBAR__;
  --sidebar-foreground: __DS_LIGHT_SIDEBARFOREGROUND__;
  --sidebar-border: __DS_LIGHT_SIDEBARBORDER__;
  --sidebar-primary: __DS_LIGHT_SIDEBARPRIMARY__;
  --sidebar-primary-foreground: __DS_LIGHT_SIDEBARPRIMARYFOREGROUND__;
  --sidebar-accent: __DS_LIGHT_SIDEBARACCENT__;
  --sidebar-accent-foreground: __DS_LIGHT_SIDEBARACCENTFOREGROUND__;
  --sidebar-ring: __DS_LIGHT_SIDEBARRING__;
  --popover: __DS_LIGHT_POPOVER__;
  --popover-foreground: __DS_LIGHT_POPOVERFOREGROUND__;
  --primary: __DS_LIGHT_PRIMARY__;
  --primary-foreground: __DS_LIGHT_PRIMARYFOREGROUND__;
  --secondary: __DS_LIGHT_SECONDARY__;
  --secondary-foreground: __DS_LIGHT_SECONDARYFOREGROUND__;
  --muted: __DS_LIGHT_MUTED__;
  --muted-foreground: __DS_LIGHT_MUTEDFOREGROUND__;
  --accent: __DS_LIGHT_ACCENT__;
  --accent-foreground: __DS_LIGHT_ACCENTFOREGROUND__;
  --destructive: __DS_LIGHT_DESTRUCTIVE__;
  --destructive-foreground: __DS_LIGHT_DESTRUCTIVEFOREGROUND__;
  --input: __DS_LIGHT_INPUT__;
  --ring: __DS_LIGHT_RING__;
  --chart-1: __DS_LIGHT_CHART1__;
  --chart-2: __DS_LIGHT_CHART2__;
  --chart-3: __DS_LIGHT_CHART3__;
  --chart-4: __DS_LIGHT_CHART4__;
  --chart-5: __DS_LIGHT_CHART5__;

  --app-font-sans: __DS_FONT_SANS__;
  --app-font-serif: __DS_FONT_SERIF__;
  --app-font-mono: __DS_FONT_MONO__;
  --radius: __DS_RADIUS__;
  --spacing: __DS_SPACING__;

  /* Computed contrast borders (fallback then modern color-mix syntax). */
  --sidebar-primary-border: hsl(var(--sidebar-primary));
  --sidebar-primary-border: hsl(from hsl(var(--sidebar-primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --sidebar-accent-border: hsl(var(--sidebar-accent));
  --sidebar-accent-border: hsl(from hsl(var(--sidebar-accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --primary-border: hsl(var(--primary));
  --primary-border: hsl(from hsl(var(--primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --secondary-border: hsl(var(--secondary));
  --secondary-border: hsl(from hsl(var(--secondary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --muted-border: hsl(var(--muted));
  --muted-border: hsl(from hsl(var(--muted)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --accent-border: hsl(var(--accent));
  --accent-border: hsl(from hsl(var(--accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --destructive-border: hsl(var(--destructive));
  --destructive-border: hsl(from hsl(var(--destructive)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);

  --card-border: hsl(var(--card));
  --popover-border: hsl(var(--popover));
}

.dark {
  --button-outline: rgba(255,255,255, .10);
  --badge-outline: rgba(255,255,255, .05);

  --opaque-button-border-intensity: 9;  /* In terms of percentages */

  --elevate-1: rgba(255,255,255, .04);
  --elevate-2: rgba(255,255,255, .09);

  --background: __DS_DARK_BACKGROUND__;
  --foreground: __DS_DARK_FOREGROUND__;
  --border: __DS_DARK_BORDER__;
  --card: __DS_DARK_CARD__;
  --card-foreground: __DS_DARK_CARDFOREGROUND__;
  --sidebar: __DS_DARK_SIDEBAR__;
  --sidebar-foreground: __DS_DARK_SIDEBARFOREGROUND__;
  --sidebar-border: __DS_DARK_SIDEBARBORDER__;
  --sidebar-primary: __DS_DARK_SIDEBARPRIMARY__;
  --sidebar-primary-foreground: __DS_DARK_SIDEBARPRIMARYFOREGROUND__;
  --sidebar-accent: __DS_DARK_SIDEBARACCENT__;
  --sidebar-accent-foreground: __DS_DARK_SIDEBARACCENTFOREGROUND__;
  --sidebar-ring: __DS_DARK_SIDEBARRING__;
  --popover: __DS_DARK_POPOVER__;
  --popover-foreground: __DS_DARK_POPOVERFOREGROUND__;
  --primary: __DS_DARK_PRIMARY__;
  --primary-foreground: __DS_DARK_PRIMARYFOREGROUND__;
  --secondary: __DS_DARK_SECONDARY__;
  --secondary-foreground: __DS_DARK_SECONDARYFOREGROUND__;
  --muted: __DS_DARK_MUTED__;
  --muted-foreground: __DS_DARK_MUTEDFOREGROUND__;
  --accent: __DS_DARK_ACCENT__;
  --accent-foreground: __DS_DARK_ACCENTFOREGROUND__;
  --destructive: __DS_DARK_DESTRUCTIVE__;
  --destructive-foreground: __DS_DARK_DESTRUCTIVEFOREGROUND__;
  --input: __DS_DARK_INPUT__;
  --ring: __DS_DARK_RING__;
  --chart-1: __DS_DARK_CHART1__;
  --chart-2: __DS_DARK_CHART2__;
  --chart-3: __DS_DARK_CHART3__;
  --chart-4: __DS_DARK_CHART4__;
  --chart-5: __DS_DARK_CHART5__;

  --sidebar-primary-border: hsl(var(--sidebar-primary));
  --sidebar-primary-border: hsl(from hsl(var(--sidebar-primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --sidebar-accent-border: hsl(var(--sidebar-accent));
  --sidebar-accent-border: hsl(from hsl(var(--sidebar-accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --primary-border: hsl(var(--primary));
  --primary-border: hsl(from hsl(var(--primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --secondary-border: hsl(var(--secondary));
  --secondary-border: hsl(from hsl(var(--secondary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --muted-border: hsl(var(--muted));
  --muted-border: hsl(from hsl(var(--muted)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --accent-border: hsl(var(--accent));
  --accent-border: hsl(from hsl(var(--accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --destructive-border: hsl(var(--destructive));
  --destructive-border: hsl(from hsl(var(--destructive)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);

  --card-border: hsl(var(--card));
  --popover-border: hsl(var(--popover));
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply font-sans antialiased bg-background text-foreground;
  }
}

@layer utilities {
  /* Hide ugly search cancel button in Chrome until we can style it properly */
  input[type="search"]::-webkit-search-cancel-button {
    @apply hidden;
  }

  /* Placeholder styling for contentEditable div */
  [contenteditable][data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: hsl(var(--muted-foreground));
    pointer-events: none;
  }

  .no-default-hover-elevate {}

  .no-default-active-elevate {}

  .toggle-elevate::before,
  .toggle-elevate-2::before {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0px;
    border-radius: inherit;
    z-index: -1;
  }

  .toggle-elevate.toggle-elevated::before {
    background-color: var(--elevate-2);
  }

  .border.toggle-elevate::before {
    inset: -1px;
  }

  .hover-elevate:not(.no-default-hover-elevate),
  .active-elevate:not(.no-default-active-elevate),
  .hover-elevate-2:not(.no-default-hover-elevate),
  .active-elevate-2:not(.no-default-active-elevate) {
    position: relative;
    z-index: 0;
  }

  .hover-elevate:not(.no-default-hover-elevate)::after,
  .active-elevate:not(.no-default-active-elevate)::after,
  .hover-elevate-2:not(.no-default-hover-elevate)::after,
  .active-elevate-2:not(.no-default-active-elevate)::after {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0px;
    border-radius: inherit;
    z-index: 999;
  }

  .hover-elevate:hover:not(.no-default-hover-elevate)::after,
  .active-elevate:active:not(.no-default-active-elevate)::after {
    background-color: var(--elevate-1);
  }

  .hover-elevate-2:hover:not(.no-default-hover-elevate)::after,
  .active-elevate-2:active:not(.no-default-active-elevate)::after {
    background-color: var(--elevate-2);
  }

  .border.hover-elevate:not(.no-hover-interaction-elevate)::after,
  .border.active-elevate:not(.no-active-interaction-elevate)::after,
  .border.hover-elevate-2:not(.no-hover-interaction-elevate)::after,
  .border.active-elevate-2:not(.no-active-interaction-elevate)::after,
  .border.hover-elevate:not(.no-hover-interaction-elevate)::after {
    inset: -1px;
  }
}
