/* ==========================================================================
   dockyard 7: Lofting Vellum (Light) & Lofting Blueprint Dark (Dark)
   Matching OmniAgent Dockyard over the real T3 Code UI.
   ========================================================================== */

/* 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", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 0.25rem;
  --control-radius: 3px;
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-xl: 4px;
  --radius-2xl: 5px;
  --radius-3xl: 6px;
  --shadow-composer: none;
  --shadow-composer-dark: none;
}

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

/* LIGHT MODE: Lofting Vellum (Daylight Architectural Drafting Sheet) */
html:root:not(.dark),
html:root:not(.dark) body,
html:root:not(.dark) [data-app-sidebar] {
  --background: #f3f0e6;
  --app-chrome-background: #f3f0e6;
  --surface-raised: #fbf9f2;
  --foreground: #14213d;
  --card: #fbf9f2;
  --card-foreground: #14213d;
  --popover: #fbf9f2;
  --popover-foreground: #14213d;
  --primary: #1e44c8;
  --primary-foreground: #ffffff;
  --secondary: #eae6d9;
  --secondary-foreground: #14213d;
  --muted: #eae6d9;
  --muted-foreground: #5b657a;
  --accent: #e5e1d3;
  --accent-foreground: #14213d;
  --message-surface: #fbf9f2;
  --message-action: #1e44c8;
  --message-action-foreground: #ffffff;
  --border: #c4bfb0;
  --input: #c4bfb0;
  --ring: #1e44c8;
  --destructive: #d4421e;
  --error: #d4421e;
  --error-foreground: #b83214;
  --destructive-foreground: #b83214;
  --success: #0e7c66;
  --success-foreground: #0b6352;
  --warning: #b87400;
  --warning-foreground: #8f5900;
  --info: #1e44c8;
  --info-foreground: #1e44c8;
  --update: #1e44c8;
  --update-foreground: #1e44c8;
  --sidebar: #eae6d9;
  --sidebar-foreground: #14213d;
  --sidebar-muted-foreground: #5b657a;
  --sidebar-control-surface: #e0dccd;
  --sidebar-row-hover: #e2decf;
  --sidebar-row-active: #dce4fa;
  --sidebar-row-selected: #dce4fa;
  --sidebar-border: #c4bfb0;
  --sidebar-stage-fade: #eae6d9;
  --code-background: #e5ebf9;
  --code-foreground: #14213d;
  --terminal-background: #fbf9f2;
  --terminal-foreground: #14213d;
  --terminal-cursor: #1e44c8;
  --terminal-selection-background: rgba(30, 68, 200, 0.16);
}

/* DARK MODE: Lofting Blueprint Dark (Architectural Cyanotype) */
html:root.dark,
html:root.dark body,
html:root.dark [data-app-sidebar] {
  --background: #0c1220;
  --app-chrome-background: #0c1220;
  --surface-raised: #121b2e;
  --foreground: #eaecef;
  --card: #121b2e;
  --card-foreground: #eaecef;
  --popover: #101829;
  --popover-foreground: #eaecef;
  --primary: #3b6ef5;
  --primary-foreground: #ffffff;
  --secondary: #152036;
  --secondary-foreground: #dce4f2;
  --muted: #131d33;
  --muted-foreground: #7f8fa8;
  --accent: #182540;
  --accent-foreground: #f2f5fa;
  --message-surface: #121b2e;
  --message-action: #3b6ef5;
  --message-action-foreground: #ffffff;
  --border: #22304d;
  --input: #22304d;
  --ring: #3b6ef5;
  --destructive: #e5534b;
  --error: #e5534b;
  --error-foreground: #f87171;
  --destructive-foreground: #f87171;
  --success: #10b981;
  --success-foreground: #34d399;
  --warning: #eab308;
  --warning-foreground: #facc15;
  --info: #3b6ef5;
  --info-foreground: #6ea0ff;
  --update: #3b6ef5;
  --update-foreground: #6ea0ff;
  --sidebar: #080d18;
  --sidebar-foreground: #dce4f2;
  --sidebar-muted-foreground: #7f8fa8;
  --sidebar-control-surface: #101829;
  --sidebar-row-hover: #131d33;
  --sidebar-row-active: #162447;
  --sidebar-row-selected: #162447;
  --sidebar-border: #22304d;
  --sidebar-stage-fade: #080d18;
  --code-background: #142038;
  --code-foreground: #eaecef;
  --terminal-background: #080d18;
  --terminal-foreground: #eaecef;
  --terminal-cursor: #3b6ef5;
  --terminal-selection-background: rgba(59, 110, 245, 0.28);
  --secondary-label: #7f8fa8;
}

/* Crisp 1px Drafting Hairlines on Sidebar */
[data-app-sidebar] {
  border-right: 1px solid var(--sidebar-border) !important;
  box-shadow: none !important;
}

/* Active Sidebar Thread Left Cobalt Rule */
[data-app-sidebar] [data-active="true"]:not([aria-label="Dockyard 7 home"]),
[data-app-sidebar] a[aria-current="page"]:not([aria-label="Dockyard 7 home"]) {
  border-radius: 2px !important;
  box-shadow: inset 3px 0 0 0 var(--primary) !important;
  font-weight: 600 !important;
}

/* Drafting Hairlines & Sharp Corners on Composer, Dialogs & Popovers */
[data-slot="dialog-popup"],
[data-slot="menu-popup"] {
  border-radius: 3px !important;
  border-color: var(--border) !important;
}

:not(pre) > code {
  font-family: var(--font-mono) !important;
  border-radius: 2px !important;
  border: 1px solid var(--border) !important;
  background-color: var(--code-background) !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;
}

/* Flat, crisp architectural drafting buttons (no chubby pill radii or glossy bevels) */
button,
[data-slot="button"],
a[data-slot="button"] {
  border-radius: 3px !important;
  box-shadow: none !important;
  --tw-shadow: 0 0 #0000 !important;
  --tw-inset-shadow: 0 0 #0000 !important;
  --tw-ring-offset-shadow: 0 0 #0000 !important;
}

button::before,
[data-slot="button"]::before,
a[data-slot="button"]::before {
  box-shadow: none !important;
  border-radius: 2px !important;
}

input,
textarea,
[data-slot="input"],
[role="dialog"],
[role="menu"],
[role="listbox"] {
  border-radius: 3px !important;
  box-shadow: none !important;
  --tw-shadow: 0 0 #0000 !important;
  --tw-inset-shadow: 0 0 #0000 !important;
}

/* Keep composer surface crisp and architectural */
[data-slot="composer-surface"],
form[data-composer-form],
[class*="rounded-2xl"],
[class*="rounded-3xl"] {
  border-radius: 4px !important;
  box-shadow: none !important;
}
