@import 'tailwindcss';

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

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-success: var(--success);
  --color-info: var(--info);
}

:root {
  color-scheme: light;
  --background: oklch(0.985 0.002 247.839);
  --foreground: oklch(0.208 0.042 265.755);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.208 0.042 265.755);
  --primary: oklch(0.623 0.214 259.815);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --secondary: oklch(0.929 0.013 255.508);
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.929 0.013 255.508);
  --muted-foreground: oklch(0.446 0.043 257.281);
  --accent: oklch(0.902 0.033 259.392);
  --accent-foreground: oklch(0.208 0.042 265.755);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.971 0.013 17.38);
  --border: oklch(0.869 0.022 252.894);
  --input: oklch(0.929 0.013 255.508);
  --ring: oklch(0.623 0.214 259.815);
  --warning: oklch(0.769 0.188 70.08);
  --warning-foreground: oklch(0.279 0.077 45.635);
  --success: oklch(0.596 0.145 163.225);
  --info: oklch(0.609 0.126 221.723);
  color: var(--foreground);
  background: var(--background);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
  line-height: 1.5;
}

.dark {
  color-scheme: dark;
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.984 0.003 247.858);
  --card: oklch(0.208 0.042 265.755);
  --card-foreground: oklch(0.984 0.003 247.858);
  --primary: oklch(0.809 0.105 251.813);
  --primary-foreground: oklch(0.208 0.042 265.755);
  --secondary: oklch(0.279 0.041 260.031);
  --secondary-foreground: oklch(0.984 0.003 247.858);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.279 0.041 260.031);
  --accent-foreground: oklch(0.984 0.003 247.858);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.971 0.013 17.38);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.809 0.105 251.813);
  --warning: oklch(0.879 0.169 91.605);
  --warning-foreground: oklch(0.279 0.077 45.635);
  --success: oklch(0.696 0.17 162.48);
  --info: oklch(0.715 0.143 215.221);
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--muted-foreground) var(--background);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 0.55rem;
  height: 0.55rem;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--background);
  border-radius: 999px;
  background: var(--muted-foreground);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--foreground);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
}

button,
input,
textarea {
  font: inherit;
}

@media (max-width: 767px) {
  .composer-picker-overlay {
    position: fixed;
    top: calc(var(--composer-picker-viewport-top, 0px) + 0.5rem);
    right: auto;
    bottom: auto;
    left: calc(var(--composer-picker-viewport-left, 0px) + 0.5rem);
    display: flex;
    width: calc(var(--composer-picker-viewport-width, 100vw) - 1rem);
    max-height: min(20rem, calc(var(--composer-picker-viewport-height, 100dvh) * 0.45));
    flex-direction: column;
    border-radius: 0.5rem;
  }

  .composer-picker-results {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }

  .composer-picker-secondary-hint {
    display: none;
  }
}

.highlighted-code pre {
  margin: 0;
  padding: 0.85rem;
  background: transparent !important;
}

.highlighted-code-wrap pre,
.highlighted-code-wrap code {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
