/* ==========================================================================
   dockyard 11 — Lofting Vellum (Light) & Lofting Blueprint Dark (Dark)
   Zero-fork CSS overlay injected by cf-app; web/ remains 100% unmodified.
   ========================================================================== */

/* ── Typography & Drafting Geometry (shared across Light & Dark) ────────── */
:root {
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Martian Mono", "Geist Mono Variable", "JetBrains Mono", ui-monospace, monospace;
  --radius: 0.25rem;
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-xl: 4px;
  --radius-2xl: 5px;
  --radius-3xl: 6px;
  --radius-otto-button: 3px;
  --radius-otto-sm: 3px;
  --radius-otto-md: 4px;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: 0 2px 6px rgb(12 18 32 / 8%);
  --shadow-lg: 0 4px 12px rgb(12 18 32 / 10%);
  --shadow-card: none;
  --shadow-composer: none;
}

html,
body {
  font-family: var(--ui-font-family, var(--font-sans)) !important;
  font-feature-settings: "cv02", "cv03", "cv04";
}

/* ── LIGHT MODE: Lofting Vellum (Daylight Architectural Drafting Sheet) ─── */
:root:not(.dark),
:root:not(.dark):not([data-theme]),
:root:not(.dark)[data-theme] {
  --background: #f3f0e6;
  --shell-background: #f3f0e6;
  --app-shell-bg: #f3f0e6;
  --foreground: #14213d;
  --foreground-tertiary: #757e91;
  --card: #fbf9f2;
  --card-solid: #fbf9f2;
  --card-foreground: #14213d;
  --card-surface-bg: #fbf9f2;
  --tray: #fbf9f2;
  --popover: #fbf9f2;
  --popover-foreground: #14213d;
  --primary: #1e44c8;
  --primary-foreground: #ffffff;
  --primary-cta: #1e44c8;
  --primary-cta-foreground: #ffffff;
  --link: #1e44c8;
  --brand-accent: #1e44c8;
  --selection-background: rgba(30, 68, 200, 0.14);
  --selection-foreground: #14213d;
  --code-selection: rgba(30, 68, 200, 0.2);
  --secondary: #eae6d9;
  --secondary-foreground: #14213d;
  --muted: rgba(20, 33, 61, 0.06);
  --muted-foreground: #5b657a;
  --code-bg: #e5ebf9;
  --accent: #e5e1d3;
  --accent-foreground: #14213d;
  --border: #c4bfb0;
  --border-weak: #d6d1c2;
  --border-strong: #8e8b7d;
  --button-border: #b9b4a5;
  --input: #c4bfb0;
  --ring: #1e44c8;
  --sidebar: #eae6d9;
  --sidebar-background: #eae6d9;
  --sidebar-foreground: #14213d;
  --sidebar-primary: #1e44c8;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e0dccd;
  --sidebar-accent-foreground: #14213d;
  --sidebar-border: #c4bfb0;
  --sidebar-ring: #1e44c8;
  --sidebar-active: #dce4fa;
  --sidebar-active-foreground: #14213d;
  --composer-header-bg: #efece0;
  --composer-surface-bg: #fbf9f2;
  --composer-shadow: none;
  --session-composer-mask-bg: #f3f0e6;
  --destructive: #d4421e;
  --destructive-foreground: #ffffff;
  --success: #0e7c66;
  --warning: #b87400;
  --info: #1e44c8;
  --session-active: #1e44c8;
  --status-blue: #1e44c8;
  --status-green: #0e7c66;
  --status-yellow: #b87400;
  --status-red: #d4421e;
  --status-gray: #6b7488;
  --tag-pink: rgba(30, 68, 200, 0.1);
}

/* ── DARK MODE: Lofting Blueprint Dark (Architectural Cyanotype) ────────── */
.dark,
.dark:not([data-theme]),
.dark[data-theme] {
  --background: #0c1220;
  --shell-background: #0c1220;
  --app-shell-bg: #0c1220;
  --foreground: #eaecef;
  --foreground-tertiary: #667792;
  --card: #121b2e;
  --card-solid: #121b2e;
  --card-foreground: #eaecef;
  --card-surface-bg: #121b2e;
  --tray: #121b2e;
  --popover: #101829;
  --popover-foreground: #eaecef;
  --primary: #3b6ef5;
  --primary-foreground: #ffffff;
  --primary-cta: #3b6ef5;
  --primary-cta-foreground: #ffffff;
  --link: #6ea0ff;
  --brand-accent: #3b6ef5;
  --selection-background: rgba(59, 110, 245, 0.24);
  --selection-foreground: #ffffff;
  --code-selection: rgba(59, 110, 245, 0.32);
  --secondary: #152036;
  --secondary-foreground: #dce4f2;
  --muted: rgba(148, 175, 224, 0.1);
  --muted-foreground: #7f8fa8;
  --code-bg: #142038;
  --accent: #182540;
  --accent-foreground: #f2f5fa;
  --border: #22304d;
  --border-weak: #1a2640;
  --border-strong: #344a75;
  --button-border: #2a3c60;
  --input: #22304d;
  --ring: #3b6ef5;
  --sidebar: #080d18;
  --sidebar-background: #080d18;
  --sidebar-surface-image: none;
  --sidebar-foreground: #dce4f2;
  --sidebar-primary: #3b6ef5;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #131d33;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #22304d;
  --sidebar-ring: #3b6ef5;
  --sidebar-active: #162447;
  --sidebar-active-foreground: #ffffff;
  --composer-header-bg: #10182a;
  --composer-surface-bg: #121b2e;
  --composer-shadow: none;
  --session-composer-mask-bg: #0c1220;
  --menu-surface-bg: #101829;
  --menu-surface-border: #22304d;
  --tooltip-bg: #162447;
  --destructive: #e5534b;
  --destructive-foreground: #ffffff;
  --success: #10b981;
  --warning: #eab308;
  --info: #3b6ef5;
  --session-active: #3b6ef5;
  --status-blue: #3b6ef5;
  --status-green: #10b981;
  --status-yellow: #eab308;
  --status-red: #e5534b;
  --status-gray: #6e7f9c;
  --tag-pink: rgba(59, 110, 245, 0.18);
}

/* ── Clean Architectural Canvas (No Distracting Background Grid Lines) ──── */
:root:not(.dark) .app-shell {
  background-color: #f3f0e6 !important;
  background-image: none !important;
}

.dark .app-shell {
  --sidebar-edge-border: #22304d;
  background-color: #0c1220 !important;
  background-image: none !important;
}

/* ── Crisp 1px Drafting Hairlines on Sidebar & Workspace Panels ─────────── */
html:not(.dark) .conversations-sidebar:not(.is-peek) {
  background: #eae6d9 !important;
  border-right: 1px solid #c4bfb0 !important;
  box-shadow: none !important;
}

.dark .conversations-sidebar,
.dark .omnigent-native-sidebar-surface,
.dark .omnigent-sidebar-panel {
  background-color: #080d18 !important;
  background-image: none !important;
  border-right: 1px solid #22304d !important;
  box-shadow: none !important;
}

html:not(.dark) .workspace-panel-motion {
  background-color: #f7f4eb !important;
  border-left: 1px solid #c4bfb0 !important;
}

.dark .workspace-panel-motion {
  --workspace-panel-border: #22304d;
  background-color: #080d18 !important;
  border-left: 1px solid #22304d !important;
}

/* ── Architectural Boxed "DOCKYARD [11]" Wordmark in Sidebar Header ─────── */
.sidebar-brand {
  display: inline-flex !important;
  align-items: center !important;
}

.sidebar-brand > span {
  display: inline-block !important;
  width: 148px !important;
  height: 22px !important;
  color: transparent !important;
  user-select: none !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  background-repeat: no-repeat !important;
  background-position: left center !important;
  background-size: contain !important;
  background-image: url("/_dockyard/wordmark-light.svg") !important;
}

.dark .sidebar-brand > span {
  background-image: url("/_dockyard/wordmark-dark.svg") !important;
}

/* ── Technical Drafting Micro-Headers & Active Session Left Cobalt Rule ─── */
.conversations-sidebar .sidebar-header-row {
  border-bottom: 1px solid var(--sidebar-border) !important;
}

.conversations-sidebar h2,
.conversations-sidebar h2 button,
.conversations-sidebar h3 {
  font-family: var(--font-sans) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

.conversations-sidebar a[class*="bg-[var(--sidebar-active)]"],
.conversations-sidebar a[aria-current="page"],
.conversations-sidebar [data-active="true"] {
  border-radius: 2px !important;
  box-shadow: inset 3px 0 0 0 var(--primary) !important;
  font-weight: 600 !important;
}

/* ── Share Button: Replace Hardcoded Pink Gradient with Diazo Cobalt ────── */
.share-button-glassy,
.dark .share-button-glassy {
  background: var(--primary) !important;
  background-image: none !important;
  border: 1px solid var(--primary) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
}

.share-button-glassy:hover:not(:disabled),
.dark .share-button-glassy:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary) 88%, black) !important;
  background-image: none !important;
}

/* ── Composer, Header, Message Bubbles & Inline Code Chips ──────────────── */
.composer-reference-surface {
  border-radius: 3px !important;
  border-width: 1px !important;
  border-color: var(--border) !important;
  background-color: var(--composer-surface-bg) !important;
  box-shadow: none !important;
}

.dark .composer-reference-surface {
  border-width: 1px !important;
  border-color: #22304d !important;
  background-color: #121b2e !important;
  box-shadow: none !important;
}

.dark :is(.composer-add-menu, .composer-host-menu, .composer-agent-menu) {
  background-color: #101829 !important;
  border-color: #22304d !important;
  border-radius: 3px !important;
  backdrop-filter: none !important;
}

:root:not(.dark) :is(.composer-add-menu, .composer-host-menu, .composer-agent-menu) {
  background-color: #fbf9f2 !important;
  border-color: #c4bfb0 !important;
  border-radius: 3px !important;
}

.session-header-glass {
  border-bottom: 1px solid var(--border) !important;
}

.dark .session-header-glass::before {
  background: rgba(12, 18, 32, 0.94) !important;
}

:root:not(.dark) .session-header-glass::before {
  background: rgba(243, 240, 230, 0.94) !important;
}

/* Sharp architectural drafting corners on user prompt bubbles & cards */
[role="log"] [class*="rounded-2xl"],
[role="log"] [class*="rounded-xl"],
[role="log"] [class*="rounded-lg"] {
  border-radius: 3px !important;
}

button[aria-label="Send"],
button[aria-label="Start session"] {
  border-radius: 3px !important;
}

button[aria-label="Send"]:not(:disabled),
button[aria-label="Start session"]:not(:disabled) {
  background-color: var(--primary) !important;
  color: #ffffff !important;
}

:not(pre) > code {
  font-family: var(--font-mono) !important;
  border-radius: 2px !important;
  border: 1px solid var(--border-weak) !important;
  background-color: var(--code-bg) !important;
  padding: 1px 5px !important;
}

.dark :not(pre) > code {
  border-color: #24375c !important;
  color: #9cc0ff !important;
}

:root:not(.dark) :not(pre) > code {
  border-color: #c5d1f0 !important;
  color: #162a68 !important;
}

/* Tighten overly soft card/button radii into architectural drafting edges */
button,
input,
textarea,
[role="dialog"],
[role="menu"],
[role="listbox"] {
  --tw-shadow: 0 0 #0000;
}
