/* NAWA palette from Agentium frontend-ng/src/app/features/nawa/nawa-theme.scss.
   Loaded in the initial HTML head; CUSTOM_CSS_URL remains a runtime fallback. */
:root, .light {
  --bg: #f7f5f3;
  --surface-1: #f7f5f3;
  --surface-2: #ffffff;
  --surface-3: #efebe7;
  --surface-4: #efebe7;
  --surface-5: #f2eeea;
  --surface-6: #e5ded7;
  --surface-7: #d8cec5;
  --surface-hover: #efebe7;
  --surface-active: #e9e1d9;
  --text-primary: #171412;
  --text-secondary: #5b514a;
  --text-tertiary: #665b53;
  --text-body: #51473f;
  --text-icon: #665b53;
  --text-muted: #786b60;
  --border: #d8d0c9;
  --border-1: #d8d0c9;
  --border-muted: #d8d0c9;
  --workflow-edge: #c8b9ae;
  --brand: #b52a00;
  --brand-hover: #d2451c;
  --brand-agent: #b52a00;
  --brand-accent: #b52a00;
  --brand-accent-hover: #d2451c;
  --brand-secondary: #b52a00;
  --selection: #b52a00;
  --selection-muted: #b52a001a;
  --code-bg: #f2eeea;
  --code-foreground: #171412;
  --auth-primary-btn-bg: #b52a00;
  --auth-primary-btn-border: #b52a00;
  --auth-primary-btn-text: #ffffff;
  --auth-primary-btn-hover-bg: #9f2500;
  --auth-primary-btn-hover-border: #9f2500;
  --auth-primary-btn-hover-text: #ffffff;
}
.dark {
  --bg: #151618;
  --surface-1: #1c1d20;
  --surface-2: #27292d;
  --surface-3: #222428;
  --surface-4: #2c2e33;
  --surface-5: #24262a;
  --surface-6: #393c42;
  --surface-7: #484c53;
  --surface-hover: #2a2c31;
  --surface-active: #343036;
  --text-primary: #f1f0ee;
  --text-secondary: #c9cbd0;
  --text-tertiary: #a8abb3;
  --text-body: #d2d3d7;
  --text-icon: #a8abb3;
  --text-icon-muted: #90959f;
  --text-muted: #989da6;
  --text-subtle: #858b95;
  --border: #35383e;
  --border-1: #35383e;
  --border-muted: #35383e;
  --workflow-edge: #707681;
  --brand: #c62f00;
  --brand-hover: #de4820;
  --brand-agent: #d44923;
  --brand-accent: #c62f00;
  --brand-accent-hover: #de4820;
  --brand-secondary: #e86744;
  --selection: #e86744;
  --selection-muted: #e8674424;
  --code-bg: #202226;
  --code-foreground: #f1f0ee;
}
/* The release's auth shell has a fixed SVG wordmark. Keep its home link,
   replacing only the artwork with the supplied, unmodified NAWA asset. */
a[aria-label='Sim home'], a[aria-label='NAWA home'] {
  width: 150px;
  height: 44px !important;
  background: url('./nawa-logo.png') center / contain no-repeat;
}
a[aria-label='Sim home'] > *, a[aria-label='NAWA home'] > * { visibility: hidden; }
/* Compact wordmark integrated into the rail. The dark treatment lifts the
   anthracite lettering while keeping the original colored geometry intact. */
[aria-label='Workspace sidebar'] {
  display: flex;
  flex-direction: column;
}
[aria-label='Workspace sidebar'] > div {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}
[aria-label='Workspace sidebar']::before {
  content: '';
  display: block;
  flex: 0 0 32px;
  width: 112px;
  height: 32px;
  margin: 18px 18px 10px;
  background: url('./nawa-logo.png') center / contain no-repeat;
}
.dark [aria-label='Workspace sidebar']::before {
  filter: invert(1) hue-rotate(180deg);
}
[aria-label='Workspace sidebar'][data-collapsed]::before { display: none; }
/* Distinct work surfaces and quiet canvas texture provide visual depth. */
[aria-label='Workflow panel'], [aria-label='Terminal'] {
  background-color: var(--surface-1);
}
.react-flow.workflow-container {
  background-image: radial-gradient(circle, #8b81772b 0.8px, transparent 0.8px);
  background-size: 22px 22px;
}
.dark .react-flow.workflow-container {
  background-image: radial-gradient(circle, #ffffff18 0.8px, transparent 0.8px);
}
[aria-label='Workspace sidebar'] [aria-current='page'] {
  box-shadow: inset 2px 0 0 var(--brand-accent);
}
button[aria-label='Run workflow'], button[aria-label='Run'] {
  --brand-accent: #b52a00;
}
img[src*='/branding/nawa-logo.png'] { object-fit: contain; }
/* Primary actions use the brick accent rather than the upstream neutral fill. */
button[aria-label='Run'],
.desktop-title-bar-page button[type='submit'] {
  background-color: var(--brand-accent);
  color: #fff;
  border-color: var(--brand-accent);
}
button[aria-label='Run']:hover:not(:disabled),
.desktop-title-bar-page button[type='submit']:hover:not(:disabled) {
  background-color: #9f2500;
  border-color: #9f2500;
  color: #fff;
}
/* Keep first-paint, hydrated, and live drag geometry under the same bounds.
   The minimum wins on narrow windows, matching the resize handles. */
.panel-container {
  width: clamp(290px, var(--panel-width, 320px), max(290px, 40vw));
}
.terminal-container {
  height: clamp(30px, var(--terminal-height, 206px), max(30px, 70vh));
}
/* First-paint Chat shell. Generated content reserves the tab and loading view
   without inserting nodes into React's server-rendered tree before hydration. */
aside[aria-label='Workflow panel']:not([data-nawa-docked]) div:has(> [data-tab-button='toolbar'])::before {
  content: 'Chat';
  box-sizing: border-box;
  display: block;
  height: 28px;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  padding: 5px 8px;
  background: var(--surface-5);
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 16px;
}
html[data-nawa-chat-start='native'] aside[aria-label='Workflow panel']:not([data-nawa-docked]) div:has(> [data-tab-button='toolbar'])::before {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
html:not([data-nawa-chat-start='native']) aside[aria-label='Workflow panel']:not([data-nawa-docked]) [data-tab-button] {
  background: transparent !important;
  border-color: transparent !important;
  color: var(--text-secondary) !important;
}
html:not([data-nawa-chat-start='native']) aside[aria-label='Workflow panel']:not([data-nawa-docked]) div:has(> [data-tab-content='editor']) {
  position: relative;
  min-height: 0;
  background: var(--bg);
}
html:not([data-nawa-chat-start='native']) aside[aria-label='Workflow panel']:not([data-nawa-docked]) [data-tab-content] {
  visibility: hidden;
}
html:not([data-nawa-chat-start='native']) aside[aria-label='Workflow panel']:not([data-nawa-docked]) div:has(> [data-tab-content='editor'])::after {
  content: 'Loading NAWA Chat…';
  position: absolute;
  inset: 12px 0 0;
  display: grid;
  place-content: center;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 12px;
}
