/* Hide model selector */
.composer-model-wrap { display: none !important; }

/* ── Daqi / Hitouch brand skin — full expression ── */
/* Brand: #993366 wine red.  A deliberate, layered accent throughout the UI. */

:root {
  /* ── Surfaces ── */
  --bg: #FAF9FB;
  --sidebar: #F3F1F6;
  --surface: #FFFFFF;
  --border: #E8E4ED;
  --border2: rgba(0, 0, 0, 0.10);

  /* ── Text ── */
  --text: #1D1B20;
  --muted: #6B6776;
  --strong: #0F0D12;
  --em: #49454F;

  /* ── Accent core ── */
  --accent: #993366;
  --accent-hover: #7A2952;
  --accent-text: #7A2952;
  --accent-bg: rgba(153, 51, 102, 0.07);
  --accent-bg-strong: rgba(153, 51, 102, 0.14);

  /* ── Code ── */
  --code-bg: #F4F1F7;
  --code-inline-bg: rgba(20, 19, 17, 0.05);
  --code-text: #7A2952;
  --pre-text: #1D1B20;

  /* ── Chrome ── */
  --topbar-bg: rgba(250, 249, 251, 0.94);
  --main-bg: rgba(250, 249, 251, 0.6);
  --input-bg: rgba(20, 19, 17, 0.03);
  --hover-bg: rgba(153, 51, 102, 0.04);

  /* ── Focus ── */
  --focus-ring: rgba(153, 51, 102, 0.28);
  --focus-glow: rgba(153, 51, 102, 0.08);

  /* ── Semantics ── */
  --blue: #8B6999;
  --gold: #993366;

  /* ── User bubble ── */
  --user-bubble-bg: #EDEAF2;
  --user-bubble-border: #DDD9E5;
  --user-bubble-text: #1D1B20;
  --user-bubble-placeholder: #6B6776;
  --user-selection-bg: rgba(153, 51, 102, 0.18);
  --user-selection-text: #1D1B20;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Buttons — brand gradient hero elements
   ═══════════════════════════════════════════════════════════════════════════ */

:root:not(.dark) .new-chat-btn {
  background: linear-gradient(135deg, #993366 0%, #8B2D5A 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(153, 51, 102, 0.25);
  transition: box-shadow 0.2s, transform 0.15s;
}
:root:not(.dark) .new-chat-btn:hover {
  background: linear-gradient(135deg, #A8386F 0%, #7A2952 100%);
  box-shadow: 0 4px 14px rgba(153, 51, 102, 0.35);
  transform: translateY(-1px);
}

:root button.send-btn {
  background: linear-gradient(135deg, #993366 0%, #7A2952 100%);
  border: none;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(153, 51, 102, 0.3);
  transition: box-shadow 0.2s, transform 0.1s;
}
:root button.send-btn:hover {
  background: linear-gradient(135deg, #A8386F 0%, #8B2D5A 100%);
  box-shadow: 0 3px 12px rgba(153, 51, 102, 0.4);
  transform: scale(1.03);
}
:root button.send-btn svg { fill: #fff; }

/* Primary buttons */
:root .btn.primary {
  background: linear-gradient(135deg, #993366 0%, #8B2D5A 100%);
  border: none;
  color: #fff;
  box-shadow: 0 1px 3px rgba(153, 51, 102, 0.25);
  border-radius: 8px;
}
:root .btn.primary:hover {
  background: linear-gradient(135deg, #A8386F 0%, #7A2952 100%);
  box-shadow: 0 2px 8px rgba(153, 51, 102, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Topbar — brand-colored identity
   ═══════════════════════════════════════════════════════════════════════════ */

:root .app-titlebar {
  background: linear-gradient(135deg, #993366 0%, #8B2D5A 100%);
  color: #fff;
}
:root .app-titlebar-title,
:root .app-titlebar-sub { color: #fff; }
:root .app-titlebar-icon { color: rgba(255,255,255,0.9); }
:root .app-titlebar-hamburger { color: rgba(255,255,255,0.9); }
:root .app-titlebar-reload { color: rgba(255,255,255,0.8); }
:root .app-titlebar-reload:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   Composer — brand-accented input
   ═══════════════════════════════════════════════════════════════════════════ */

:root .composer-box {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(153, 51, 102, 0.04);
}
:root .composer-box:focus-within {
  border-color: #993366;
  box-shadow: 0 0 0 3px rgba(153, 51, 102, 0.08);
}
:root .composer-divider { background: linear-gradient(to right, transparent, rgba(153,51,102,0.15), transparent); }

/* ═══════════════════════════════════════════════════════════════════════════
   Sidebar — active session brand stripe + brand-tinted hovers
   ═══════════════════════════════════════════════════════════════════════════ */

:root .session-item.active {
  border-left: 3px solid #993366;
  background: rgba(153, 51, 102, 0.06);
}
:root .session-item:hover {
  background: rgba(153, 51, 102, 0.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Assistant messages — subtle brand left-border thread
   ═══════════════════════════════════════════════════════════════════════════ */

:root .msg-row[data-role="assistant"] .msg-body {
  border-left: 3px solid rgba(153, 51, 102, 0.15);
  padding-left: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   User messages — soft card with brand-tinted border
   ═══════════════════════════════════════════════════════════════════════════ */

:root .msg-row[data-role="user"] .msg-body {
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--user-bubble-bg);
  border: 1px solid var(--user-bubble-border);
}
:root .msg-row[data-role="user"] .msg-body code {
  color: var(--user-bubble-text);
  background: rgba(20, 19, 17, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tool cards — brand-aware states
   ═══════════════════════════════════════════════════════════════════════════ */

:root .tool-card {
  background: rgba(20, 19, 17, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
:root .tool-card:hover { border-color: rgba(153, 51, 102, 0.2); }
:root .tool-card-running {
  background: var(--accent-bg);
  border-color: rgba(153, 51, 102, 0.25);
  border-left: 3px solid #993366;
}
:root .tool-card-name { color: var(--muted); font-weight: 500; }
:root .tool-arg-key { color: #993366; }
:root .tool-card-more { color: var(--accent-text); }
:root .tool-card-running-dot { background: #993366; box-shadow: 0 0 6px rgba(153, 51, 102, 0.4); }

/* ═══════════════════════════════════════════════════════════════════════════
   Links & text accents
   ═══════════════════════════════════════════════════════════════════════════ */

:root a { color: #993366; }
:root a:hover { color: #7A2952; }

/* ═══════════════════════════════════════════════════════════════════════════
   Selection — brand highlight
   ═══════════════════════════════════════════════════════════════════════════ */

:root ::selection { background: rgba(153, 51, 102, 0.22); color: #1D1B20; }

/* ═══════════════════════════════════════════════════════════════════════════
   Scrollbar — subtle brand thumb
   ═══════════════════════════════════════════════════════════════════════════ */

:root ::-webkit-scrollbar-thumb { background: rgba(153, 51, 102, 0.2); border-radius: 8px; }
:root ::-webkit-scrollbar-thumb:hover { background: rgba(153, 51, 102, 0.35); }
:root ::-webkit-scrollbar-track { background: transparent; }

/* ═══════════════════════════════════════════════════════════════════════════
   Agent health banner — brand treatment
   ═══════════════════════════════════════════════════════════════════════════ */

:root .agent-health-banner { border-left: 3px solid #993366; }

/* ═══════════════════════════════════════════════════════════════════════════
   Approval buttons — brand-accented primary
   ═══════════════════════════════════════════════════════════════════════════ */

:root .approval-btn.yolo { border-color: #993366; color: #993366; }
:root .approval-btn.yolo:hover { background: rgba(153, 51, 102, 0.08); }
:root .approval-btn.always { background: linear-gradient(135deg, #993366 0%, #8B2D5A 100%); border-color: transparent; color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   Fleet — workspace lock (no switching, no creation, files panel only)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hide dictation / voice input button */
:root #btnMic { display: none !important; }

/* Hide profile switcher chip in composer */
:root #profileChipWrap { display: none !important; }

/* Settings button — invisible but preserved in layout (Easter egg: click 6× in 3s) */
:root .rail [data-panel="settings"],
:root .sidebar-nav [data-panel="settings"] {
  opacity: 0;
}

/* Hide workspace switcher chip in composer */
:root #composerWorkspaceChip { display: none !important; }

/* Hide "Add space" button in workspaces panel header */
:root #panelWorkspaces .panel-head-btn[onclick*="openWorkspaceCreate"] { display: none !important; }

/* Hide workspace dropdown (belt-and-suspenders with JS patch) */
:root .ws-dropdown { display: none !important; }

/* Keep the files panel toggle visible — ensure it stays */
:root #btnWorkspacePanelToggle { display: flex !important; }

/* Hide workspace management panel from rail navigation */
:root button[data-panel="workspaces"] { display: none !important; }

/* Hide unused rail nav tabs (kanban, skills, profiles, insights, logs, tasks) */
:root .rail [data-panel="kanban"],
:root .rail [data-panel="skills"],
:root .rail [data-panel="profiles"],
:root .rail [data-panel="insights"],
:root .rail [data-panel="logs"],
:root .rail [data-panel="tasks"],
:root .sidebar-nav [data-panel="kanban"],
:root .sidebar-nav [data-panel="skills"],
:root .sidebar-nav [data-panel="profiles"],
:root .sidebar-nav [data-panel="insights"],
:root .sidebar-nav [data-panel="logs"],
:root .sidebar-nav [data-panel="tasks"] {
  display: none !important;
}

/* Hide workspace detail view action buttons (activate/edit/delete) */
:root #btnActivateWorkspaceDetail,
:root #btnEditWorkspaceDetail,
:root #btnDeleteWorkspaceDetail { display: none !important; }

/* Hide workspace search/dropdown footer actions (choose path, manage) */
:root .ws-dropdown-footer { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE — Hitouch brand palette
   Overrides :root.dark base (gold) with wine-red #993366 identity.
   All selectors use :root.dark to match the webui's dark-theme class.
   ═══════════════════════════════════════════════════════════════════════════ */

:root.dark {
  /* ── Surfaces ── */
  --bg: #1A1318;
  --sidebar: #211922;
  --surface: #261D24;
  --border: #3D2E38;
  --border2: rgba(255, 255, 255, 0.12);

  /* ── Text ── */
  --text: #EDE8EC;
  --muted: #A399A7;
  --strong: #F5F1F4;
  --em: #C9BDC5;

  /* ── Accent core — slightly brighter for dark backgrounds ── */
  --accent: #B8477A;
  --accent-hover: #CC5588;
  --accent-text: #C4628E;
  --accent-bg: rgba(153, 51, 102, 0.15);
  --accent-bg-strong: rgba(153, 51, 102, 0.25);

  /* ── Code ── */
  --code-bg: #221B20;
  --code-inline-bg: rgba(255, 255, 255, 0.06);
  --code-text: #D491AB;
  --pre-text: #EDE8EC;

  /* ── Chrome ── */
  --topbar-bg: rgba(26, 19, 24, 0.96);
  --main-bg: rgba(26, 19, 24, 0.5);
  --input-bg: rgba(255, 255, 255, 0.04);
  --hover-bg: rgba(153, 51, 102, 0.08);

  /* ── Focus ── */
  --focus-ring: rgba(184, 71, 122, 0.35);
  --focus-glow: rgba(184, 71, 122, 0.1);

  /* ── Semantics ── */
  --blue: #A090B5;
  --gold: #B8477A;

  /* ── User bubble ── */
  --user-bubble-bg: #2D2229;
  --user-bubble-border: #3D2E38;
  --user-bubble-text: #EDE8EC;
  --user-bubble-placeholder: #A399A7;
  --user-selection-bg: rgba(153, 51, 102, 0.3);
  --user-selection-text: #F5F1F4;
}

/* ── Dark mode: Buttons ──────────────────────────────────────────────────── */

:root.dark .new-chat-btn {
  background: linear-gradient(135deg, #993366 0%, #7A2952 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
:root.dark .new-chat-btn:hover {
  background: linear-gradient(135deg, #B8477A 0%, #993366 100%);
  box-shadow: 0 4px 14px rgba(153, 51, 102, 0.5);
  transform: translateY(-1px);
}

:root.dark button.send-btn {
  background: linear-gradient(135deg, #993366 0%, #7A2952 100%);
  border: none;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
:root.dark button.send-btn:hover {
  background: linear-gradient(135deg, #B8477A 0%, #993366 100%);
  box-shadow: 0 3px 12px rgba(153, 51, 102, 0.5);
  transform: scale(1.03);
}
:root.dark button.send-btn svg { fill: #fff; }

:root.dark .btn.primary {
  background: linear-gradient(135deg, #993366 0%, #8B2D5A 100%);
  border: none;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
}
:root.dark .btn.primary:hover {
  background: linear-gradient(135deg, #B8477A 0%, #993366 100%);
  box-shadow: 0 2px 8px rgba(153, 51, 102, 0.5);
}

/* ── Dark mode: Topbar ───────────────────────────────────────────────────── */

:root.dark .app-titlebar {
  background: linear-gradient(135deg, #7A2952 0%, #5C1F3E 100%);
  color: #fff;
}
:root.dark .app-titlebar-title,
:root.dark .app-titlebar-sub { color: #fff; }
:root.dark .app-titlebar-icon { color: rgba(255, 255, 255, 0.85); }
:root.dark .app-titlebar-hamburger { color: rgba(255, 255, 255, 0.85); }
:root.dark .app-titlebar-reload { color: rgba(255, 255, 255, 0.7); }
:root.dark .app-titlebar-reload:hover { color: #fff; }

/* ── Dark mode: Composer ─────────────────────────────────────────────────── */

:root.dark .composer-box {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
:root.dark .composer-box:focus-within {
  border-color: #B8477A;
  box-shadow: 0 0 0 3px rgba(184, 71, 122, 0.15);
}
:root.dark .composer-divider {
  background: linear-gradient(to right, transparent, rgba(153, 51, 102, 0.2), transparent);
}

/* ── Dark mode: Sidebar ──────────────────────────────────────────────────── */

:root.dark .session-item.active {
  border-left: 3px solid #B8477A;
  background: rgba(153, 51, 102, 0.1);
}
:root.dark .session-item:hover {
  background: rgba(153, 51, 102, 0.06);
}

/* ── Dark mode: Messages ─────────────────────────────────────────────────── */

:root.dark .msg-row[data-role="assistant"] .msg-body {
  border-left: 3px solid rgba(184, 71, 122, 0.2);
  padding-left: 16px;
}
:root.dark .msg-row[data-role="user"] .msg-body {
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--user-bubble-bg);
  border: 1px solid var(--user-bubble-border);
}
:root.dark .msg-row[data-role="user"] .msg-body code {
  color: var(--user-bubble-text);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Dark mode: Tool cards ────────────────────────────────────────────────── */

:root.dark .tool-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
:root.dark .tool-card:hover { border-color: rgba(184, 71, 122, 0.3); }
:root.dark .tool-card-running {
  background: var(--accent-bg);
  border-color: rgba(184, 71, 122, 0.35);
  border-left: 3px solid #B8477A;
}
:root.dark .tool-card-name { color: var(--muted); font-weight: 500; }
:root.dark .tool-arg-key { color: #C4628E; }
:root.dark .tool-card-more { color: var(--accent-text); }
:root.dark .tool-card-running-dot {
  background: #B8477A;
  box-shadow: 0 0 6px rgba(184, 71, 122, 0.5);
}

/* ── Dark mode: Links & selection ────────────────────────────────────────── */

:root.dark a { color: #C4628E; }
:root.dark a:hover { color: #D491AB; }
:root.dark ::selection { background: rgba(153, 51, 102, 0.3); color: #F5F1F4; }

/* ── Dark mode: Scrollbar ────────────────────────────────────────────────── */

:root.dark ::-webkit-scrollbar-thumb { background: rgba(184, 71, 122, 0.25); border-radius: 8px; }
:root.dark ::-webkit-scrollbar-thumb:hover { background: rgba(184, 71, 122, 0.4); }
:root.dark ::-webkit-scrollbar-track { background: transparent; }

/* ── Dark mode: Agent health banner ──────────────────────────────────────── */

:root.dark .agent-health-banner { border-left: 3px solid #B8477A; }

/* ── Dark mode: Approval buttons ─────────────────────────────────────────── */

:root.dark .approval-btn.yolo { border-color: #B8477A; color: #C4628E; }
:root.dark .approval-btn.yolo:hover { background: rgba(184, 71, 122, 0.12); }
:root.dark .approval-btn.always {
  background: linear-gradient(135deg, #993366 0%, #7A2952 100%);
  border-color: transparent;
  color: #fff;
}

/* [FLEET] Hide model selector */
.composer-model-wrap { display: none !important; }
.composer-model-chip { display: none !important; }

/* [FLEET] Hide update notification */
.update-banner, .update-notification, [data-update-banner], .update-available { display: none !important; }

/* [FLEET] Hide model selector on mobile too */
.composer-mobile-config-btn { display: none !important; }
.composer-mobile-config-panel { display: none !important; }
.composer-model-chip { display: none !important; }
.composer-model-wrap { display: none !important; }
