:root {
  --background: #ffffff;
  --foreground: #09090b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --destructive: #ef4444;
  --ring: #a1a1aa;
  --radius: 0.75rem;
  --composer-max: 48rem;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* Surfaces — page → sunken panel → card → white chrome (lightest last).
     One value per role; do not introduce sibling greys. */
  --agent-bg: #f8fafc;          /* page behind the panes */
  --agent-sunken: #f7f8fa;      /* sunken panel chrome: side panel, tab strips, footer */
  --agent-card: #fcfcfd;        /* near-white tinted cards, chat surface */
  --agent-surface: #ffffff;     /* white chrome and raised cards */
  --agent-soft: #f3f5f8;        /* soft pill/badge fill */
  --agent-hover: #f3f4f6;       /* hover fill on rows, buttons, menu items */

  /* Lines — one seam grey, one hairline, one strong input border. */
  --agent-line: #e5e7eb;        /* pane seams, card borders */
  --agent-line-soft: #f0f1f3;   /* hairline dividers inside cards/popovers */
  --agent-line-strong: #d1d5db; /* input and control borders */

  /* Ink — the four text greys. */
  --agent-text: #111827;        /* headings, primary ink */
  --agent-body: #374151;        /* body copy */
  --agent-muted: #6b7280;       /* secondary text */
  --agent-faint: #9ca3af;       /* placeholders, timestamps */

  --agent-blue: #3659c9;
  --agent-action: rgb(34, 43, 54);
  --agent-green: #dff4e8;
  --agent-green-text: #286b4d;

  /* One chrome height for every top bar: app topbar, session header,
     side-panel headers, and tab strips all share this. */
  --chrome-h: 52px;
  --chrome-title-size: 0.94rem;

  /* Right-panel rhythm. Shells and shared panel atoms consume these values so
     domain surfaces do not invent their own insets and row densities. */
  --panel-body-x: 15px;
  --panel-body-inset: var(--panel-body-x);
  --panel-body-top: 14px;
  --panel-body-bottom: 26px;
  --panel-section-gap: 14px;
  --panel-card-padding-x: 13px;
  --panel-card-padding-y: 10px;
  --panel-row-height: 42px;
  --panel-secondary-tabs-h: 38px;

  /* Typography — prefer tokens over one-off hex in new UI */
  --text-ui-sm: 0.8125rem;   /* 13px — side panel rows, labels */
  --text-ui-base: 0.875rem;  /* 14px — chat, dense UI */
  --text-ui-md: 0.9375rem;   /* 15px — page body default */
  --text-panel-label: 0.66rem;   /* 10.56px — uppercase labels, badges */
  --text-panel-meta: 0.7rem;     /* 11.2px — captions and secondary metadata */
  --text-panel-body: 0.75rem;    /* 12px — dense values and supporting copy */
  --text-panel-primary: 0.8rem;  /* 12.8px — row titles and primary labels */
  --text-chat: #374151;      /* gray-700 — softer than near-black body copy */
  --text-chat-strong: #1f2937;
  --text-chat-heading: #1f2937;
  --leading-chat: 1.625;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #09090b;
    --foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --input: #27272a;
    --primary: #fafafa;
    --primary-foreground: #18181b;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --ring: #52525b;
  }
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

body.workspace-page {
  overflow: hidden;
  background: var(--agent-bg);
}

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

button,
input,
textarea,
select {
  font: inherit;
}
