/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */

/* ══ Tailwind: Properties Layer ══ */

@layer properties {
  @supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or
    ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
    *,
    :before,
    :after,
    ::backdrop {
      --tw-border-style: solid;
      --tw-leading: initial;
      --tw-font-weight: initial;
      --tw-tracking: initial;
      --tw-blur: initial;
      --tw-brightness: initial;
      --tw-contrast: initial;
      --tw-grayscale: initial;
      --tw-hue-rotate: initial;
      --tw-invert: initial;
      --tw-opacity: initial;
      --tw-saturate: initial;
      --tw-sepia: initial;
      --tw-drop-shadow: initial;
      --tw-drop-shadow-color: initial;
      --tw-drop-shadow-alpha: 100%;
      --tw-drop-shadow-size: initial;
      --tw-ease: initial;
      --tw-shadow: 0 0 #0000;
      --tw-shadow-color: initial;
      --tw-shadow-alpha: 100%;
      --tw-inset-shadow: 0 0 #0000;
      --tw-inset-shadow-color: initial;
      --tw-inset-shadow-alpha: 100%;
      --tw-ring-color: initial;
      --tw-ring-shadow: 0 0 #0000;
      --tw-inset-ring-color: initial;
      --tw-inset-ring-shadow: 0 0 #0000;
      --tw-ring-inset: initial;
      --tw-ring-offset-width: 0px;
      --tw-ring-offset-color: #fff;
      --tw-ring-offset-shadow: 0 0 #0000;
    }
  }
}

/* ══ Tailwind: Theme Layer ══ */

@layer theme {
  :root,
  :host {
    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",
      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
      "Liberation Mono", "Courier New", monospace;
    --color-white: #fff;
    --spacing: 0.25rem;
    --text-xs: 0.75rem;
    --text-xs--line-height: calc(1 / 0.75);
    --text-sm: 0.875rem;
    --text-sm--line-height: calc(1.25 / 0.875);
    --text-base: 1rem;
    --text-base--line-height: calc(1.5 / 1);
    --text-lg: 1.125rem;
    --text-lg--line-height: calc(1.75 / 1.125);
    --font-weight-medium: 500;
    --tracking-wide: 0.025em;
    --leading-relaxed: 1.625;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
    --shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
    --shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --default-transition-duration: 0.15s;
    --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
  }
}

/* ══ Reset & Base ══ */

@layer base {
  *,
  :after,
  :before,
  ::backdrop {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  ::file-selector-button {
    box-sizing: border-box;
    border: 0 solid;
    margin: 0;
    padding: 0;
  }

  html,
  :host {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    line-height: 1.5;
    font-family: var(
      --default-font-family,
      ui-sans-serif,
      system-ui,
      sans-serif,
      "Apple Color Emoji",
      "Segoe UI Emoji",
      "Segoe UI Symbol",
      "Noto Color Emoji"
    );
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }

  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }

  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }

  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }

  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }

  b, strong {
    font-weight: bolder;
  }

  code, kbd, samp, pre {
    font-family: var(
      --default-mono-font-family,
      ui-monospace,
      SFMono-Regular,
      Menlo,
      Monaco,
      Consolas,
      "Liberation Mono",
      "Courier New",
      monospace
    );
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }

  small {
    font-size: 80%;
  }

  sub, sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
  }

  sub { bottom: -0.25em; }
  sup { top: -0.5em; }

  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }

  :-moz-focusring {
    outline: auto;
  }

  progress {
    vertical-align: baseline;
  }

  summary {
    display: list-item;
  }

  ol, ul, menu {
    list-style: none;
  }

  img, svg, video, canvas, audio, iframe, embed, object {
    vertical-align: middle;
    display: block;
  }

  img, video {
    max-width: 100%;
    height: auto;
  }

  button, input, select, optgroup, textarea {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    opacity: 1;
    background-color: #0000;
    border-radius: 0;
  }

  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }

  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }

  ::file-selector-button {
    margin-inline-end: 4px;
  }

  ::placeholder {
    opacity: 1;
  }

  @supports (not ((-webkit-appearance: -apple-pay-button))) or
    (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentColor;
    }
    @supports (color: color-mix(in lab, red, red)) {
      ::placeholder {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }

  textarea {
    resize: vertical;
  }

  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }

  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }

  ::-webkit-datetime-edit { display: inline-flex; }
  ::-webkit-datetime-edit-fields-wrapper { padding: 0; }
  ::-webkit-datetime-edit { padding-block: 0; }
  ::-webkit-datetime-edit-year-field { padding-block: 0; }
  ::-webkit-datetime-edit-month-field { padding-block: 0; }
  ::-webkit-datetime-edit-day-field { padding-block: 0; }
  ::-webkit-datetime-edit-hour-field { padding-block: 0; }
  ::-webkit-datetime-edit-minute-field { padding-block: 0; }
  ::-webkit-datetime-edit-second-field { padding-block: 0; }
  ::-webkit-datetime-edit-millisecond-field { padding-block: 0; }
  ::-webkit-datetime-edit-meridiem-field { padding-block: 0; }
  ::-webkit-calendar-picker-indicator { line-height: 1; }

  :-moz-ui-invalid {
    box-shadow: none;
  }

  button, input:where([type="button"], [type="reset"], [type="submit"]) {
    appearance: button;
  }

  ::file-selector-button {
    appearance: button;
  }

  ::-webkit-inner-spin-button { height: auto; }
  ::-webkit-outer-spin-button { height: auto; }

  [hidden]:where(:not([hidden="until-found"])) {
    display: none !important;
  }

  /* ── App-level base ── */

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

  html, body {
    height: 100%;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    flex-direction: column;
    display: flex;
  }

  ::selection {
    background: var(--accent-subtle);
    color: var(--text-strong);
  }

  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  ::-webkit-scrollbar-track {
    background: 0 0;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 9999px;
  }

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

/* ══ Utilities (Tailwind) ══ */

@layer utilities {
  .relative { position: relative; }
  .static { position: static; }

  .container { width: 100%; }
  @media (min-width: 40rem) { .container { max-width: 40rem; } }
  @media (min-width: 48rem) { .container { max-width: 48rem; } }
  @media (min-width: 64rem) { .container { max-width: 64rem; } }
  @media (min-width: 80rem) { .container { max-width: 80rem; } }
  @media (min-width: 96rem) { .container { max-width: 96rem; } }

  .block { display: block; }
  .flex { display: flex; }
  .hidden { display: none; }
  .table { display: table; }

  .max-h-\[120px\] { max-height: 120px; }
  .min-h-\[40px\] { min-height: 40px; }
  .w-\[240px\] { width: 240px; }
  .w-full { width: 100%; }
  .min-w-0 { min-width: calc(var(--spacing) * 0); }

  .flex-1 { flex: 1; }
  .min-h-0 { min-height: 0; }
  .shrink-0 { flex-shrink: 0; }
  .cursor-pointer { cursor: pointer; }
  .resize { resize: both; }
  .resize-none { resize: none; }
  .flex-col { flex-direction: column; }
  .items-center { align-items: center; }
  .items-end { align-items: flex-end; }
  .justify-between { justify-content: space-between; }

  .gap-2 { gap: calc(var(--spacing) * 2); }
  .gap-3 { gap: calc(var(--spacing) * 3); }
  .gap-4 { gap: calc(var(--spacing) * 4); }

  .overflow-hidden { overflow: hidden; }
  .overflow-y-auto { overflow-y: auto; }

  .rounded { border-radius: 0.25rem; }
  .rounded-lg { border-radius: var(--radius-lg); }
  .rounded-md { border-radius: var(--radius-md); }

  .border {
    border-style: var(--tw-border-style);
    border-width: 1px;
  }

  .border-t {
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
  }

  .border-r {
    border-right-style: var(--tw-border-style);
    border-right-width: 1px;
  }

  .border-b {
    border-bottom-style: var(--tw-border-style);
    border-bottom-width: 1px;
  }

  .border-none {
    --tw-border-style: none;
    border-style: none;
  }

  .border-\[var\(--border\)\] { border-color: var(--border); }

  .bg-\[var\(--accent-dim\)\] { background-color: var(--accent-dim); }
  .bg-\[var\(--surface\)\] { background-color: var(--surface); }
  .bg-\[var\(--surface2\)\] { background-color: var(--surface2); }
  .bg-transparent { background-color: #0000; }

  .p-4 { padding: calc(var(--spacing) * 4); }
  .px-2 { padding-inline: calc(var(--spacing) * 2); }
  .px-2\.5 { padding-inline: calc(var(--spacing) * 2.5); }
  .px-3 { padding-inline: calc(var(--spacing) * 3); }
  .px-4 { padding-inline: calc(var(--spacing) * 4); }
  .py-0\.5 { padding-block: calc(var(--spacing) * 0.5); }
  .py-1 { padding-block: calc(var(--spacing) * 1); }
  .py-1\.5 { padding-block: calc(var(--spacing) * 1.5); }
  .py-2 { padding-block: calc(var(--spacing) * 2); }
  .py-2\.5 { padding-block: calc(var(--spacing) * 2.5); }
  .py-3 { padding-block: calc(var(--spacing) * 3); }

  .text-base {
    font-size: var(--text-base);
    line-height: var(--tw-leading, var(--text-base--line-height));
  }

  .text-lg {
    font-size: var(--text-lg);
    line-height: var(--tw-leading, var(--text-lg--line-height));
  }

  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }

  .text-xs {
    font-size: var(--text-xs);
    line-height: var(--tw-leading, var(--text-xs--line-height));
  }

  .leading-none {
    --tw-leading: 1;
    line-height: 1;
  }

  .leading-relaxed {
    --tw-leading: var(--leading-relaxed);
    line-height: var(--leading-relaxed);
  }

  .font-\[var\(--font-body\)\] {
    --tw-font-weight: var(--font-body);
    font-weight: var(--font-body);
  }

  .font-medium {
    --tw-font-weight: var(--font-weight-medium);
    font-weight: var(--font-weight-medium);
  }

  .tracking-wide {
    --tw-tracking: var(--tracking-wide);
    letter-spacing: var(--tracking-wide);
  }

  .whitespace-nowrap { white-space: nowrap; }

  .text-\[var\(--accent\)\] { color: var(--accent); }
  .text-\[var\(--error\)\] { color: var(--error); }
  .text-\[var\(--muted\)\] { color: var(--muted); }
  .text-\[var\(--text\)\] { color: var(--text); }
  .text-\[var\(--text-strong\)\] { color: var(--text-strong); }
  .text-white { color: var(--color-white); }

  .filter {
    filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,)
      var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,)
      var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
  }

  .transition-colors {
    transition-property: color, background-color, border-color, outline-color,
      text-decoration-color, fill, stroke, --tw-gradient-from,
      --tw-gradient-via, --tw-gradient-to;
    transition-timing-function: var(
      --tw-ease,
      var(--default-transition-timing-function)
    );
    transition-duration: var(--tw-duration, var(--default-transition-duration));
  }

  .ease-out {
    --tw-ease: var(--ease-out);
    transition-timing-function: var(--ease-out);
  }

  @media (hover: hover) {
    .hover\:border-\[var\(--border-strong\)\]:hover {
      border-color: var(--border-strong);
    }
    .hover\:bg-\[var\(--accent\)\]:hover {
      background-color: var(--accent);
    }
    .hover\:text-\[var\(--text\)\]:hover {
      color: var(--text);
    }
  }

  .focus\:border-\[var\(--border-strong\)\]:focus {
    border-color: var(--border-strong);
  }

  .focus\:ring-1:focus {
    --tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0
      calc(1px + var(--tw-ring-offset-width))
      var(--tw-ring-color, currentcolor);
    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow),
      var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
  }

  .focus\:ring-\[var\(--accent-subtle\)\]:focus {
    --tw-ring-color: var(--accent-subtle);
  }

  .focus\:outline-none:focus {
    --tw-outline-style: none;
    outline-style: none;
  }

  .disabled\:cursor-default:disabled { cursor: default; }
  .disabled\:opacity-40:disabled { opacity: 0.4; }
}

/* ══ Theme Variables ══ */

:root,
[data-theme="dark"] {
  --bg: #0f1115;
  --bg-elevated: #181b22;
  --bg-hover: #1e2128;
  --surface: #14161d;
  --surface2: #1a1d25;
  --text: #e4e4e7;
  --text-strong: #fafafa;
  --muted: #71717a;
  --border: #27272a;
  --border-strong: #3f3f46;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --accent-dim: #16a34a;
  --accent-subtle: #4ade801f;
  --user-bg: #1e2028;
  --user-border: #2a2d36;
  --assistant-bg: #1a1d25;
  --assistant-border: #27272a;
  --error: #ef4444;
  --warn: #f59e0b;
  --ok: #22c55e;
  --shadow-sm: 0 1px 2px #00000040;
  --shadow-md: 0 4px 12px #0000004d;
  --shadow-lg: 0 12px 28px #0006;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fafafa;
  --bg-elevated: #fff;
  --bg-hover: #f0f0f0;
  --surface: #f5f5f5;
  --surface2: #ebebeb;
  --text: #3f3f46;
  --text-strong: #18181b;
  --muted: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-dim: #166534;
  --accent-subtle: #16a34a1a;
  --user-bg: #f0f0f0;
  --user-border: #d4d4d8;
  --assistant-bg: #f5f5f5;
  --assistant-border: #e4e4e7;
  --error: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --shadow-sm: 0 1px 2px #0000000f;
  --shadow-md: 0 4px 12px #00000014;
  --shadow-lg: 0 12px 28px #0000001f;
  color-scheme: light;
}

/* ══ Animations ══ */

@keyframes pulse {
  50% { opacity: 0.5; }
}

@keyframes msg-in {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dot-bounce {
  0%, 60%, to { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ══ Tailwind: @property Declarations ══ */

@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }
@property --tw-leading { syntax: "*"; inherits: false; }
@property --tw-font-weight { syntax: "*"; inherits: false; }
@property --tw-tracking { syntax: "*"; inherits: false; }
@property --tw-blur { syntax: "*"; inherits: false; }
@property --tw-brightness { syntax: "*"; inherits: false; }
@property --tw-contrast { syntax: "*"; inherits: false; }
@property --tw-grayscale { syntax: "*"; inherits: false; }
@property --tw-hue-rotate { syntax: "*"; inherits: false; }
@property --tw-invert { syntax: "*"; inherits: false; }
@property --tw-opacity { syntax: "*"; inherits: false; }
@property --tw-saturate { syntax: "*"; inherits: false; }
@property --tw-sepia { syntax: "*"; inherits: false; }
@property --tw-drop-shadow { syntax: "*"; inherits: false; }
@property --tw-drop-shadow-color { syntax: "*"; inherits: false; }
@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@property --tw-drop-shadow-size { syntax: "*"; inherits: false; }
@property --tw-ease { syntax: "*"; inherits: false; }
@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-shadow-color { syntax: "*"; inherits: false; }
@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }
@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }
@property --tw-ring-color { syntax: "*"; inherits: false; }
@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-inset-ring-color { syntax: "*"; inherits: false; }
@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
@property --tw-ring-inset { syntax: "*"; inherits: false; }
@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0; }
@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }
@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
