/* Glass menus (Josh, 2026-10-08: "make both programs menus a little more transparent so we can see the colors
   stuff behind"). Every menu, panel and dialog on the Agent Bridge pages becomes a translucent, blurred surface
   over the ambient motion canvas (bridge_motion.css). --bridge-glass is the opacity (1 = the old solid look);
   Settings > Appearance > Menu transparency changes it and bridge_settings.js remembers it per browser.
   Loaded last on purpose: these rules override bridge_dashboard.css's !important surfaces. */
:root { --bridge-glass: 0.78; }

/* ORBCORE product theme (Server Farm Swarm's warm black and gold) for the Bridge pages; the default stays teal. */
html[data-theme="orbcore"] {
  --bridge-bg: #0c0b09; --bridge-surface: #181512; --bridge-raised: #221d18; --bridge-border: #3a332c;
  --bridge-text: #f5f2ed; --bridge-muted: #8a8279; --bridge-blue: #c4a77d; --bridge-green: #5cb85c;
  --bridge-red: #d9534f; --bridge-amber: #f0ad4e;
  --bg: #0c0b09; --panel: #181512; --panel2: #221d18; --border: #3a332c; --text: #f5f2ed; --dim: #8a8279;
  --accent: #c4a77d; --accent-dim: #8f7a5a; --line: #3a332c; --fg: #f5f2ed; --muted: #8a8279;
}
html[data-theme="orbcore"] body { background: var(--bridge-bg) !important; }
html[data-theme="orbcore"] #bridge-background {
  background:
    radial-gradient(circle at 50% -15%, color-mix(in srgb, var(--bm-primary) 10%, transparent), transparent 52%),
    linear-gradient(145deg, #0c0b09 0%, #17120b 52%, #0a0806 100%);
}

/* The dashboard: header, section nav, the tasks panel, every secondary shell and card, the chat, the dialogs. */
header, #bridge-nav {
  background: color-mix(in srgb, var(--bridge-bg, #07111f) calc(var(--bridge-glass) * 100%), transparent) !important;
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}
#tasks-panel, .secondary-shell > summary, .secondary-shell > .secondary-content, .card, .compose,
#chat-panel[data-chat-look="v2"] .chat-sidebar, #chat-panel[data-chat-look="v2"] .chat-card,
#chat-panel[data-chat-look="v2"] #chat-messages, .task-cleanup-review, #usage-panel .usage-card, .usage-card, #scope-panel .card, #media-panel .media-job,
.bots-policy, .bots-form, .bots-workers {
  background: color-mix(in srgb, var(--bridge-surface, #0d1a2b) calc(var(--bridge-glass) * 100%), transparent) !important;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.task-card, .card-head, #chat-panel[data-chat-look="v2"] .chat-message, .task-control input, .task-control select,
#chat-panel[data-chat-look="v2"] .chat-field select, #chat-panel[data-chat-look="v2"] #chat-input, .compose textarea,
.compose select {
  background: color-mix(in srgb, var(--bridge-bg, #07111f) calc(var(--bridge-glass) * 100%), transparent) !important;
}
#chat-panel[data-chat-look="v2"] .chat-message.user {
  background: var(--bridge-blue, var(--accent)) !important;
}
#chat-panel[data-chat-look="v2"] .chat-message.error {
  background: color-mix(in srgb, #450a0a calc(var(--bridge-glass) * 100%), transparent) !important;
}
pre, .task-value pre {
  background: color-mix(in srgb, var(--bridge-bg, #07111f) calc(var(--bridge-glass) * 100%), transparent) !important;
}

/* Dialogs stay readable: a floor of 14 points more opacity than the panels and a stronger blur, so what is behind
   them becomes a wash of colour rather than legible text. */
#routing-menu, #status-report, #bridge-motion-settings, #bridge-settings {
  background: color-mix(in srgb, var(--bridge-surface, #0d1a2b) min(100%, calc(var(--bridge-glass) * 100% + 14%)), transparent) !important;
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
}

/* The Spider, crawl browser and Unweave pages (their own palettes, same idea). */
.spider section, .spider-browse section, .spider-browse .sb-card, .spider-browse header, .spider header,
.unweave header, .unweave main section, .unweave nav.tabs button.on, .uw-card, .uw-empty {
  background: color-mix(in srgb, var(--panel, #161b22) calc(var(--bridge-glass) * 100%), transparent) !important;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.spider input, .spider select, .spider textarea, .spider-browse input, .spider-browse select, .spider pre,
.spider-browse pre, .unweave input, .unweave select {
  background: color-mix(in srgb, var(--bg, #0d1117) calc(var(--bridge-glass) * 100%), transparent) !important;
}

@media (prefers-reduced-transparency: reduce) {
  :root { --bridge-glass: 1; }
}
