/*
 * Blackbook Engine — design system
 * P0: tokens + reset + base + container.
 * Source: Venture CRM UI kit (decoded .fig) — see .agents/venture-ds/.
 * Locked decisions: Inter Tight · black-on-white · black primary ·
 * green=positive / red=negative / violet=rare accent.
 */
:root {
  /* --- Action --- */
  --ds-action-primary: #000000;
  --ds-action-primary-hover: #1A1A1A;
  --ds-action-primary-disabled: #D4D4D4;
  --ds-action-secondary-bg: #FFFFFF;
  --ds-action-secondary-border: #0A0A0A;
  --ds-action-secondary-text: #0A0A0A;
  --ds-action-outline: #0A0A0A;
  --ds-action-destructive: #DC2626;
  --ds-action-destructive-hover: #B91C1C;

  /* --- Accent (violet — sparklines, one hero highlight, selected-nav marker only) --- */
  --ds-accent: #7C3AED;
  --ds-accent-hover: #6D28D9;

  /* --- Backgrounds --- */
  --ds-bg: #FFFFFF;
  --ds-bg-subtle: #F5F5F5;
  --ds-bg-hover: #FAFAFA;
  --ds-bg-inverse: #0A0A0A;
  --ds-bg-positive-tint: #F0FDF4;
  --ds-bg-negative-tint: #FEF2F2;
  --ds-bg-accent-tint: #F5F3FF;

  /* --- Borders --- */
  --ds-border: #E5E5E5;
  --ds-border-strong: #D4D4D4;
  --ds-border-positive: #22C55E;
  --ds-border-error: #EF4444;
  --ds-border-warning: #F59E0B; /* functional only */
  --ds-border-informative: #94A3B8; /* restrained slate, not old-blue */

  /* --- Content / ink --- */
  --ds-ink: #0A0A0A;
  --ds-ink-secondary: #525252;
  --ds-ink-muted: #737373;
  --ds-ink-inverse: #FFFFFF;
  --ds-text-positive: #16A34A;
  --ds-text-negative: #DC2626;
  --ds-text-accent: #7C3AED;

  /* --- Typography --- */
  --ds-font-sans: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ds-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace; /* legacy pages only */
  --ds-display: clamp(2.5rem, 5vw, 3.75rem);
  --ds-h1: 2.25rem;
  --ds-h2: 1.875rem;
  --ds-h3: 1.5rem;
  --ds-h4: 1.25rem;
  --ds-h5: 1.125rem;
  --ds-h6: 0.875rem; /* ponytail: small heading tier kept; only used where Venture did */
  --ds-body-xl: 1.25rem;
  --ds-body-lg: 1.125rem;
  --ds-body-md: 1rem;
  --ds-body-sm: 0.875rem;
  --ds-body-xs: 0.75rem;
  --ds-caption: 0.8125rem;
  --ds-label-1: 0.8125rem;
  --ds-label-2: 0.75rem;
  --ds-label-3: 0.6875rem;
  --ds-label-4: 0.625rem;

  /* --- Spacing (4px base) --- */
  --ds-space-1: 0.25rem; /* 4px  */
  --ds-space-2: 0.5rem;  /* 8px  */
  --ds-space-3: 0.75rem; /* 12px */
  --ds-space-4: 1rem;    /* 16px */
  --ds-space-5: 1.5rem;  /* 24px */
  --ds-space-6: 2rem;    /* 32px */
  --ds-space-7: 3rem;    /* 48px */
  --ds-space-8: 4rem;    /* 64px */

  /* --- Layout --- */
  --ds-container: 1160px;
  --ds-radius: 8px;
  --ds-radius-sm: 6px;
  --ds-radius-lg: 12px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --- Base --- */
body {
  font-family: var(--ds-font-sans);
  font-size: var(--ds-body-md);
  line-height: 1.5;
  color: var(--ds-ink);
  background: var(--ds-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; }

/* --- Layout --- */
.container { max-width: var(--ds-container); margin-inline: auto; padding-inline: 28px; }

/* --- P1: Typography utilities --- */
.text-display { font-size: var(--ds-display); font-weight: 700; line-height: 1.1; }
.text-h1 { font-size: var(--ds-h1); font-weight: 700; line-height: 1.2; }
.text-h2 { font-size: var(--ds-h2); font-weight: 700; line-height: 1.2; }
.text-h3 { font-size: var(--ds-h3); font-weight: 700; line-height: 1.2; }
.text-h4 { font-size: var(--ds-h4); font-weight: 700; line-height: 1.2; }
.text-h5 { font-size: var(--ds-h5); font-weight: 700; line-height: 1.2; }
.text-h6 { font-size: var(--ds-h6); font-weight: 700; line-height: 1.2; }
.text-body-xl { font-size: var(--ds-body-xl); line-height: 1.5; }
.text-body-lg { font-size: var(--ds-body-lg); line-height: 1.5; }
.text-body-md { font-size: var(--ds-body-md); line-height: 1.5; }
.text-body-sm { font-size: var(--ds-body-sm); line-height: 1.5; }
.text-body-xs { font-size: var(--ds-body-xs); line-height: 1.5; }
.text-label-1 { font-size: var(--ds-label-1); font-weight: 600; line-height: 1.4; }
.text-label-2 { font-size: var(--ds-label-2); font-weight: 600; line-height: 1.4; }
.text-label-3 { font-size: var(--ds-label-3); font-weight: 600; line-height: 1.4; }
.text-label-4 { font-size: var(--ds-label-4); font-weight: 600; line-height: 1.4; }
.text-caption { font-size: var(--ds-caption); line-height: 1.4; }
.text-small { font-size: var(--ds-body-xs); line-height: 1.4; }

/* ink + semantic text */
.text-secondary { color: var(--ds-ink-secondary); }
.text-muted { color: var(--ds-ink-muted); }
.text-inverse { color: var(--ds-ink-inverse); }
.text-positive { color: var(--ds-text-positive); }
.text-negative { color: var(--ds-text-negative); }
.text-accent { color: var(--ds-text-accent); }

/* --- P2: Primitives --- */

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-2);
  padding: 0.625rem 1rem; border-radius: var(--ds-radius); border: 1px solid transparent;
  font-family: inherit; font-size: var(--ds-body-sm); font-weight: 600; line-height: 1.2;
  white-space: nowrap; cursor: pointer; text-decoration: none; text-underline-offset: 0;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: var(--ds-body-xs); }
.btn-lg { padding: 0.75rem 1.25rem; font-size: var(--ds-body-md); }
.btn-primary { background: var(--ds-action-primary); color: var(--ds-ink-inverse); }
.btn-primary:hover { background: var(--ds-action-primary-hover); }
.btn-primary:disabled, .btn-primary[aria-disabled="true"] { background: var(--ds-action-primary-disabled); color: var(--ds-ink-muted); }
.btn-secondary { background: var(--ds-action-secondary-bg); color: var(--ds-action-secondary-text); border-color: var(--ds-action-secondary-border); }
.btn-secondary:hover { background: var(--ds-bg-hover); }
.btn-outline { background: transparent; color: var(--ds-action-outline); border-color: var(--ds-action-outline); }
.btn-outline:hover { background: var(--ds-bg-subtle); }
.btn-destructive { background: var(--ds-action-destructive); color: var(--ds-ink-inverse); }
.btn-destructive:hover { background: var(--ds-action-destructive-hover); }
.btn-ghost { background: transparent; color: var(--ds-ink); }
.btn-ghost:hover { background: var(--ds-bg-subtle); }
.btn-link { background: transparent; color: var(--ds-ink); padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--ds-ink-secondary); }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: var(--ds-space-1);
  padding: 0.125rem 0.5rem; border-radius: 999px; border: 1px solid transparent;
  font-size: var(--ds-label-2); font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.badge-neutral { background: var(--ds-bg-subtle); color: var(--ds-ink-secondary); border-color: var(--ds-border); }
.badge-positive { background: var(--ds-bg-positive-tint); color: var(--ds-text-positive); border-color: var(--ds-border-positive); }
.badge-negative { background: var(--ds-bg-negative-tint); color: var(--ds-text-negative); border-color: var(--ds-border-error); }
.badge-accent { background: var(--ds-bg-accent-tint); color: var(--ds-text-accent); border-color: var(--ds-accent); }
.badge-warning { background: var(--ds-bg-subtle); color: var(--ds-ink-secondary); border-color: var(--ds-border-warning); }
.badge-inverse { background: var(--ds-bg-inverse); color: var(--ds-ink-inverse); }

/* Tag */
.tag {
  display: inline-flex; align-items: center; gap: var(--ds-space-1);
  padding: 0.25rem 0.625rem; border-radius: var(--ds-radius-sm);
  background: var(--ds-bg-subtle); border: 1px solid var(--ds-border);
  font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-secondary); white-space: nowrap;
}

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--ds-bg-subtle); border: 1px solid var(--ds-border);
  color: var(--ds-ink); font-size: var(--ds-body-sm); font-weight: 600; flex: none;
}
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: var(--ds-body-xs); }
.avatar-lg { width: 3rem; height: 3rem; font-size: var(--ds-body-md); }
.avatar-accent { background: var(--ds-bg-accent-tint); color: var(--ds-text-accent); }

/* Form controls */
.input, .textarea, .select {
  width: 100%; padding: 0.625rem 0.75rem;
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius);
  background: var(--ds-bg); color: var(--ds-ink);
  font-family: inherit; font-size: var(--ds-body-sm); line-height: 1.4;
}
.input::placeholder, .textarea::placeholder { color: var(--ds-ink-muted); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--ds-ink-secondary); }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--ds-accent); outline-offset: 0; border-color: var(--ds-ink); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--ds-bg-subtle); color: var(--ds-ink-muted); cursor: not-allowed; }
.input-error, .input[aria-invalid="true"] { border-color: var(--ds-border-error); }
.textarea { resize: vertical; min-height: 6rem; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' stroke='%230A0A0A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem;
}
.checkbox, .radio { accent-color: var(--ds-action-primary); width: 1rem; height: 1rem; cursor: pointer; }

/* Toggle */
.toggle {
  appearance: none; width: 40px; height: 22px; border-radius: 999px;
  background: var(--ds-border-strong); position: relative; cursor: pointer;
  transition: background-color .15s; flex: none;
}
.toggle:checked { background: var(--ds-action-primary); }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--ds-ink-inverse); transition: left .15s;
}
.toggle:checked::after { left: 20px; }
.toggle:disabled { opacity: .5; cursor: not-allowed; }

/* Tooltip (use data-tooltip="…" on the element) */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ds-bg-inverse); color: var(--ds-ink-inverse);
  padding: 0.25rem 0.5rem; border-radius: var(--ds-radius-sm);
  font-size: var(--ds-body-xs); font-weight: 500; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none;
  z-index: 10;
}
.tooltip:hover::after, .tooltip:focus-visible::after { opacity: 1; visibility: visible; }

/* Divider */
.divider { border: 0; border-top: 1px solid var(--ds-border); margin: var(--ds-space-4) 0; }
.divider-vertical { border: 0; border-left: 1px solid var(--ds-border); }

/* Spinner */
.spinner {
  width: 1.25rem; height: 1.25rem; flex: none;
  border: 2px solid var(--ds-border); border-top-color: var(--ds-ink); border-radius: 50%;
  animation: ds-spin .7s linear infinite;
}
.spinner-sm { width: 0.875rem; height: 0.875rem; }
@keyframes ds-spin { to { transform: rotate(360deg) } }

/* Skeleton */
.skeleton { background: var(--ds-bg-subtle); border-radius: var(--ds-radius-sm); animation: ds-pulse 1.6s ease-in-out infinite; }
@keyframes ds-pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.5 } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.4s; }
  .skeleton { animation: none; }
}

/* --- P3: Composites --- */

/* App shell */
.sidebar {
  width: 240px; flex: none;
  display: flex; flex-direction: column; gap: var(--ds-space-1);
  padding: var(--ds-space-3);
  background: var(--ds-bg); border-right: 1px solid var(--ds-border);
}
.nav-item {
  display: flex; align-items: center; gap: var(--ds-space-2);
  padding: 0.5rem 0.75rem; border-radius: var(--ds-radius);
  color: var(--ds-ink-secondary); font-size: var(--ds-body-sm); font-weight: 500;
  text-decoration: none; transition: background-color .12s, color .12s;
}
.nav-item:hover { background: var(--ds-bg-subtle); color: var(--ds-ink); }
.nav-item.is-active { background: var(--ds-bg-accent-tint); color: var(--ds-text-accent); } /* violet = selected-nav marker */
.topbar {
  display: flex; align-items: center; gap: var(--ds-space-3);
  height: 64px; padding: 0 var(--ds-space-4);
  background: var(--ds-bg); border-bottom: 1px solid var(--ds-border);
}
.board-toolbar {
  display: flex; align-items: center; gap: var(--ds-space-2); flex-wrap: wrap;
  padding: var(--ds-space-3) var(--ds-space-4);
  background: var(--ds-bg); border-bottom: 1px solid var(--ds-border);
}

/* Card */
.card { background: var(--ds-bg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); padding: var(--ds-space-4); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); margin-bottom: var(--ds-space-3); }
.card-title { font-size: var(--ds-h5); font-weight: 700; }

/* Stat tile */
.stat-tile { background: var(--ds-bg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); padding: var(--ds-space-4); }
.stat-tile .stat-label { font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-muted); }
.stat-tile .stat-value { font-size: var(--ds-h2); font-weight: 700; margin-top: var(--ds-space-1); }
.stat-delta-up { color: var(--ds-text-positive); font-size: var(--ds-body-sm); font-weight: 600; }
.stat-delta-down { color: var(--ds-text-negative); font-size: var(--ds-body-sm); font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--ds-body-sm); }
.table th { text-align: left; font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-muted); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--ds-border-strong); white-space: nowrap; }
.table td { padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--ds-border); vertical-align: middle; }
.table tbody tr:hover { background: var(--ds-bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Dropdown (CSS-only; JS toggles .is-open if needed) */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 11rem; background: var(--ds-bg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius); box-shadow: 0 8px 24px rgba(10,10,10,.12); padding: var(--ds-space-1); z-index: 20; opacity: 0; visibility: hidden; transition: opacity .12s; }
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { opacity: 1; visibility: visible; }
.dropdown-item { display: flex; align-items: center; gap: var(--ds-space-2); width: 100%; padding: 0.5rem 0.625rem; border-radius: var(--ds-radius-sm); font-size: var(--ds-body-sm); color: var(--ds-ink); background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; }
.dropdown-item:hover { background: var(--ds-bg-subtle); }
.dropdown-item.is-danger { color: var(--ds-text-negative); }

/* Modal (toggle .is-open) */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,10,10,.5); display: flex; align-items: center; justify-content: center; padding: var(--ds-space-4); z-index: 100; opacity: 0; visibility: hidden; transition: opacity .15s; }
.modal-overlay.is-open { opacity: 1; visibility: visible; }
.modal { background: var(--ds-bg); border-radius: var(--ds-radius-lg); max-width: 480px; width: 100%; padding: var(--ds-space-5); box-shadow: 0 20px 60px rgba(10,10,10,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--ds-space-3); }
.modal-title { font-size: var(--ds-h4); font-weight: 700; }

/* Toast */
.toast { position: fixed; bottom: var(--ds-space-5); right: var(--ds-space-5); display: flex; align-items: center; gap: var(--ds-space-2); background: var(--ds-bg-inverse); color: var(--ds-ink-inverse); padding: 0.75rem 1rem; border-radius: var(--ds-radius); font-size: var(--ds-body-sm); font-weight: 500; box-shadow: 0 8px 24px rgba(10,10,10,.2); z-index: 120; }
.toast-positive { background: var(--ds-text-positive); }
.toast-negative { background: var(--ds-text-negative); }

/* Tabs */
.tabs { display: flex; gap: var(--ds-space-1); border-bottom: 1px solid var(--ds-border); }
.tab { padding: 0.5rem 0.75rem; font-size: var(--ds-body-sm); font-weight: 600; color: var(--ds-ink-muted); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab:hover { color: var(--ds-ink); }
.tab.is-active { color: var(--ds-ink); border-bottom-color: var(--ds-action-primary); }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--ds-space-2); padding: var(--ds-space-7) var(--ds-space-4); color: var(--ds-ink-muted); }
.empty-state .empty-icon { font-size: 2rem; }

/* Progress bar */
.progress-bar { height: 6px; background: var(--ds-bg-subtle); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--ds-action-primary); border-radius: 999px; }
.progress-bar-fill.is-positive { background: var(--ds-border-positive); }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: var(--ds-space-2); font-size: var(--ds-body-sm); color: var(--ds-ink-muted); }
.breadcrumb a { color: var(--ds-ink-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--ds-ink); text-decoration: underline; }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; color: var(--ds-border-strong); margin-right: var(--ds-space-2); }

/* Accordion (native <details>/<summary>) */
.accordion { border: 1px solid var(--ds-border); border-radius: var(--ds-radius); background: var(--ds-bg); }
.accordion summary { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; cursor: pointer; font-size: var(--ds-body-sm); font-weight: 600; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; color: var(--ds-ink-muted); font-weight: 600; }
.accordion[open] summary::after { content: '−'; }
.accordion .accordion-body { padding: 0 1rem 0.75rem; font-size: var(--ds-body-sm); color: var(--ds-ink-secondary); }

/* Search input */
.search-input input {
  width: 100%; padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius);
  font: inherit; font-size: var(--ds-body-sm); background-color: var(--ds-bg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><circle cx='7' cy='7' r='4.5' fill='none' stroke='%23737373' stroke-width='1.5'/><path d='M10.5 10.5L14 14' stroke='%23737373' stroke-width='1.5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: left 0.75rem center;
}
.search-input input:focus { outline: 2px solid var(--ds-accent); outline-offset: 0; border-color: var(--ds-ink); }

/* List item */
.list-item { display: flex; align-items: center; gap: var(--ds-space-3); padding: 0.625rem 0.75rem; border-radius: var(--ds-radius); font-size: var(--ds-body-sm); }
.list-item:hover { background: var(--ds-bg-subtle); }
.list-item-title { font-weight: 600; color: var(--ds-ink); }
.list-item-sub { font-size: var(--ds-body-xs); color: var(--ds-ink-muted); }
.list-item-meta { margin-left: auto; font-size: var(--ds-body-xs); color: var(--ds-ink-muted); }

/* --- P4: Page archetypes --- */

/* App pages */
.dashboard-shell { display: flex; min-height: 100vh; }
.dashboard-shell .dashboard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dashboard-shell .dashboard-content { padding: var(--ds-space-5); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-4); flex-wrap: wrap; }
.page-title { font-size: var(--ds-h2); font-weight: 700; }
.page-actions { display: flex; gap: var(--ds-space-2); }
.data-table-page, .form-page, .detail-page { padding: var(--ds-space-5); display: flex; flex-direction: column; gap: var(--ds-space-4); }

/* Board (kanban) */
.board-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--ds-space-4); align-items: start; }
.board-column { display: flex; flex-direction: column; gap: var(--ds-space-2); background: var(--ds-bg-subtle); border-radius: var(--ds-radius-lg); padding: var(--ds-space-3); }
.board-column-title { font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-secondary); padding: 0 var(--ds-space-2) var(--ds-space-2); }
.board-card { background: var(--ds-bg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius); padding: var(--ds-space-3); }

/* Auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--ds-space-4); background: var(--ds-bg-subtle); }
.auth-card { width: 100%; max-width: 24rem; background: var(--ds-bg); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); padding: var(--ds-space-6); box-shadow: 0 8px 24px rgba(10,10,10,.08); }

/* Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--ds-border); border-radius: var(--ds-radius); overflow: hidden; }
.calendar-dow { font-size: var(--ds-label-3); font-weight: 600; color: var(--ds-ink-muted); padding: 0.375rem; border-bottom: 1px solid var(--ds-border); }
.calendar-day { min-height: 72px; padding: var(--ds-space-1); border-top: 1px solid var(--ds-border); border-left: 1px solid var(--ds-border); font-size: var(--ds-body-xs); color: var(--ds-ink-secondary); }
.calendar-day.is-today { background: var(--ds-bg-accent-tint); }
.calendar-day.is-muted { color: var(--ds-ink-muted); }

/* Marketing */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ds-space-6); align-items: center; padding: var(--ds-space-8) 0; }
.hero-eyebrow { font-size: var(--ds-label-1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ds-accent); }
.hero h1 { font-size: var(--ds-display); line-height: 1.1; margin-top: var(--ds-space-3); }
.hero-sub { font-size: var(--ds-body-lg); color: var(--ds-ink-secondary); margin-top: var(--ds-space-3); max-width: 34rem; }
.hero-cta { display: flex; gap: var(--ds-space-3); margin-top: var(--ds-space-5); flex-wrap: wrap; }
@media (max-width: 768px) { .hero { grid-template-columns: 1fr; } }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--ds-space-5); }
.feature-card { padding: var(--ds-space-5); }
.feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: var(--ds-radius); background: var(--ds-bg-subtle); margin-bottom: var(--ds-space-3); }
.pricing-card { display: flex; flex-direction: column; gap: var(--ds-space-4); padding: var(--ds-space-6); }
.pricing-card.is-featured { border-color: var(--ds-action-primary); box-shadow: 0 8px 24px rgba(10,10,10,.08); }
.pricing-price { font-size: var(--ds-h1); font-weight: 700; }
.pricing-period { font-size: var(--ds-body-sm); color: var(--ds-ink-muted); }
.blog-card { display: flex; flex-direction: column; gap: var(--ds-space-2); padding: var(--ds-space-4); text-decoration: none; }
.blog-card:hover { border-color: var(--ds-border-strong); }
.blog-card .blog-date { font-size: var(--ds-label-3); color: var(--ds-ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.blog-card h3 { font-size: var(--ds-h5); }
.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-5); flex-wrap: wrap; background: var(--ds-bg-inverse); color: var(--ds-ink-inverse); border-radius: var(--ds-radius-lg); padding: var(--ds-space-7) var(--ds-space-6); }
.cta-banner h2 { font-size: var(--ds-h3); color: var(--ds-ink-inverse); margin: 0; }
.cta-banner .cta-sub { color: rgba(255,255,255,.7); }
.footer { border-top: 1px solid var(--ds-border); padding: var(--ds-space-6) 0; color: var(--ds-ink-muted); font-size: var(--ds-body-sm); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-4); flex-wrap: wrap; }
.footer-links { display: flex; gap: var(--ds-space-4); }
.footer-links a { color: var(--ds-ink-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--ds-ink); }

/* --- P5: Marketing site revamp (2026-08-20) — shared chrome + home archetypes --- */

/* Site nav (shared chrome) */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--ds-bg);
  border-bottom: 1px solid var(--ds-border);
}
.site-nav .nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-4);
  flex-wrap: wrap; padding: 0.75rem 0;
}
.site-nav .logo { display: inline-flex; align-items: center; gap: var(--ds-space-2); text-decoration: none; }
.site-nav .logo img { height: 30px; }
.nav-links { display: flex; align-items: center; gap: var(--ds-space-1); flex-wrap: wrap; }
.nav-links a {
  padding: 0.5rem 0.75rem; border-radius: var(--ds-radius);
  font-size: var(--ds-body-sm); font-weight: 600; color: var(--ds-ink-secondary);
  text-decoration: none;
}
.nav-links a:hover { color: var(--ds-ink); background: var(--ds-bg-subtle); }
.nav-links a[aria-current="page"] { color: var(--ds-ink); }
.nav-cta { display: flex; align-items: center; gap: var(--ds-space-2); }
@media (max-width: 720px) { .nav-cta { width: 100%; justify-content: center; } }

/* Section rhythm */
.section { padding: var(--ds-space-8) 0; }
.section-alt { background: var(--ds-bg-subtle); }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto var(--ds-space-7); }
.section-head .eyebrow { font-size: var(--ds-label-1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ds-ink-muted); }
.section-head h1 { font-size: var(--ds-h1); margin-top: var(--ds-space-3); }
.section-head h2 { font-size: var(--ds-h2); margin-top: var(--ds-space-3); }
.section-head p { color: var(--ds-ink-secondary); margin-top: var(--ds-space-3); font-size: var(--ds-body-lg); }

/* Split hero (two-column — product visual right, Venture home style) */
.hero--split { display: block; }
.hero--split .container { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ds-space-7); align-items: center; }
@media (max-width: 768px) { .hero--split .container { grid-template-columns: 1fr; } }

/* Narrative lede */
.lede { max-width: 40rem; margin: 0 auto; font-size: var(--ds-body-lg); color: var(--ds-ink-secondary); }
.lede p + p { margin-top: var(--ds-space-4); }
.lede strong { color: var(--ds-ink); }

/* Engine steps */
.engine-steps { display: grid; gap: var(--ds-space-5); max-width: 46rem; margin: 0 auto; }
.engine-step { display: grid; grid-template-columns: 3.5rem 1fr; gap: var(--ds-space-4); align-items: baseline; text-align: left; }
.engine-step .step-num { font-size: var(--ds-label-1); font-weight: 600; color: var(--ds-ink-muted); font-variant-numeric: tabular-nums; }
.engine-step h3 { font-size: var(--ds-h5); }
.engine-step p { color: var(--ds-ink-secondary); margin-top: var(--ds-space-1); font-size: var(--ds-body-sm); }

/* Proof band (stats-only) */
.proof-band { background: var(--ds-bg-inverse); color: var(--ds-ink-inverse); padding: var(--ds-space-8) 0; }
.proof-stats { max-width: 40rem; margin: 0 auto; text-align: center; }
.proof-stats .proof-big { font-size: clamp(3rem, 7vw, 5rem); font-weight: 700; line-height: 1; }
.proof-stats .proof-big--muted { color: rgba(255, 255, 255, 0.45); }
.proof-stats .proof-caption { color: rgba(255, 255, 255, 0.7); margin: var(--ds-space-2) auto 0; font-size: var(--ds-body-sm); max-width: 18rem; }
.proof-stats .proof-ratio { margin-top: var(--ds-space-5); color: var(--ds-text-accent); font-weight: 600; font-size: var(--ds-body-sm); }

/* Board preview (hero dashboard mockup — David swaps in the real execution board later) */
.board-preview { background: var(--ds-bg); color: var(--ds-ink); border-radius: var(--ds-radius-lg); padding: var(--ds-space-5); border: 1px solid var(--ds-border); box-shadow: 0 16px 40px rgba(10, 10, 10, 0.10); }
.board-preview-title { font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--ds-space-4); }
.board-preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ds-space-3); margin-bottom: var(--ds-space-4); }
.board-preview-stats .bps { background: var(--ds-bg-subtle); border-radius: var(--ds-radius); padding: var(--ds-space-3); }
.board-preview-stats .bps b { display: block; font-size: var(--ds-h5); }
.board-preview-stats .bps span { font-size: var(--ds-label-3); color: var(--ds-ink-muted); }
.board-row { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); padding: var(--ds-space-3) 0; border-top: 1px solid var(--ds-border); }
.board-row:first-of-type { border-top: 0; }
.board-row h4 { font-size: var(--ds-body-sm); font-weight: 600; }
.board-row p { font-size: var(--ds-body-xs); color: var(--ds-ink-muted); margin-top: 2px; }
.board-row .board-meta { flex: none; text-align: right; }

/* Footer columns */
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--ds-space-6); }
.footer-grid h4 { font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-secondary); margin-bottom: var(--ds-space-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-2); }
.footer-grid a { color: var(--ds-ink-muted); text-decoration: none; font-size: var(--ds-body-sm); }
.footer-grid a:hover { color: var(--ds-ink); }
.footer-brand img { height: 30px; }
.footer-brand p { color: var(--ds-ink-muted); font-size: var(--ds-body-sm); margin-top: var(--ds-space-2); max-width: 22rem; }
.footer-bottom { margin-top: var(--ds-space-6); padding-top: var(--ds-space-4); border-top: 1px solid var(--ds-border); color: var(--ds-ink-muted); font-size: var(--ds-body-xs); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- P5: Subpage support (features, intel-assets, pricing, about, contact, blog) --- */

/* Two-column feature grid (detail cards with bullets) */
.feature-grid--2 { grid-template-columns: repeat(2, 1fr); }
.feature-grid--2 .feature-card p { color: var(--ds-ink-secondary); margin-top: var(--ds-space-2); }
.feature-grid--2 .feature-card ul { list-style: none; margin: var(--ds-space-3) 0 0; padding: 0; display: grid; gap: var(--ds-space-2); }
.feature-grid--2 .feature-card li { padding-left: 1.25rem; position: relative; font-size: var(--ds-body-sm); color: var(--ds-ink-secondary); }
.feature-grid--2 .feature-card li::before { content: '—'; position: absolute; left: 0; color: var(--ds-ink-muted); }
@media (max-width: 768px) { .feature-grid--2 { grid-template-columns: 1fr; } }

/* Article prose (blog) */
.article { max-width: 44rem; margin: 0 auto; }
.article p { font-size: var(--ds-body-lg); line-height: 1.7; color: var(--ds-ink-secondary); }
.article p + p { margin-top: var(--ds-space-4); }
.article h2 { font-size: var(--ds-h3); margin: var(--ds-space-7) 0 var(--ds-space-3); color: var(--ds-ink); }
.article h3 { font-size: var(--ds-h4); margin: var(--ds-space-6) 0 var(--ds-space-2); color: var(--ds-ink); }
.article ul, .article ol { color: var(--ds-ink-secondary); font-size: var(--ds-body-lg); padding-left: 1.5rem; }
.article li { margin-top: var(--ds-space-2); }
.article strong { color: var(--ds-ink); }
.article .illustration { display: block; max-width: 100%; height: auto; border-radius: var(--ds-radius-lg); margin: var(--ds-space-5) auto; }

/* Blog index + article meta */
.blog-meta { display: flex; align-items: center; justify-content: center; gap: var(--ds-space-3); color: var(--ds-ink-muted); font-size: var(--ds-label-2); margin-top: var(--ds-space-4); }
.blog-meta .avatar { font-size: var(--ds-body-xs); overflow: hidden; }
.blog-meta .avatar img { width: 100%; height: 100%; object-fit: cover; }
.blog-card .blog-date { font-size: var(--ds-label-3); color: var(--ds-ink-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.blog-card h3 { font-size: var(--ds-h5); }
.blog-card p { color: var(--ds-ink-secondary); font-size: var(--ds-body-sm); }
.blog-card .tag { align-self: flex-start; }

/* Pricing cards + FAQ */
.pricing-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-2); }
.pricing-card li { padding-left: 1.25rem; position: relative; font-size: var(--ds-body-sm); color: var(--ds-ink-secondary); }
.pricing-card li::before { content: '—'; position: absolute; left: 0; color: var(--ds-ink-muted); }
.faq-list { display: grid; gap: var(--ds-space-3); max-width: 44rem; margin: 0 auto; }

/* Contact form */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--ds-space-4); max-width: 44rem; margin: 0 auto; }
.form-field { display: grid; gap: var(--ds-space-2); }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: var(--ds-label-2); font-weight: 600; color: var(--ds-ink-secondary); }
.form-status { margin-top: var(--ds-space-2); font-size: var(--ds-body-sm); font-weight: 600; min-height: 1.5em; }
.form-status[data-state="ok"] { color: var(--ds-text-positive); }
.form-status[data-state="error"] { color: var(--ds-text-negative); }
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
