/*
  Cove Estates — AI Marketing Command Centre
  Design tokens sourced verbatim from ../../../_templates/digital-brand-tokens.css
  and ../../../_context/COVE_DIGITAL_BRAND_SYSTEM.md (verified from the live
  coveestate.com production CSS, audited 2026-09-20). This is an internal
  demo interface — not the live Cove website.
*/

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/PlusJakartaSans-website-verified.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --cove-background: #0A0A0A;
  --cove-foreground: #F5F0E8;
  --cove-card: #111111;
  --cove-card-foreground: #F5F0E8;
  --cove-secondary: #1A1A1A;
  --cove-muted: #1A1A1A;
  --cove-muted-foreground: #9A9A9A;
  --cove-input: #1A1A1A;
  --cove-border: #2A2A2A;

  --cove-primary: #C9A84C;
  --cove-primary-foreground: #0A0A0A;
  --cove-accent: #B8963E;
  --cove-accent-foreground: #0A0A0A;
  --cove-ring: #C9A84C;

  --cove-nav-backdrop: rgba(10, 10, 10, 0.72);
  --cove-nav-hairline: rgba(201, 168, 76, 0.15);

  --cove-font-sans: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", -apple-system, sans-serif;

  --cove-radius: 0px;
  --cove-radius-pill: 9999px;

  --cove-shadow-card-hover:
    0 40px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(201, 168, 76, 0.3),
    0 0 40px rgba(201, 168, 76, 0.08);
  --cove-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);

  --cove-ease-card: cubic-bezier(0.16, 1, 0.3, 1);

  /* Status colours — not part of the verified brand token set; used only for
     internal demo status badges (approval/task states), kept desaturated so
     they read as system UI, not brand colour. */
  --status-complete: #4CAF6D;
  --status-pending: #C9A84C;
  --status-blocked: #D9634A;
  --status-not-connected: #6B6B6B;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cove-background);
  color: var(--cove-foreground);
  font-family: var(--cove-font-sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--cove-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--cove-primary);
  margin-bottom: 10px;
}

/* ---------- App shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #070707;
  border-right: 1px solid var(--cove-border);
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--cove-border);
}
.sidebar-brand img { height: 34px; width: auto; }
.sidebar-brand .brand-meta { display: flex; flex-direction: column; }
.sidebar-brand .brand-meta strong { font-size: 13px; letter-spacing: 0.5px; }
.sidebar-brand .brand-meta span { font-size: 10px; color: var(--cove-muted-foreground); letter-spacing: 1px; text-transform: uppercase; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list button {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cove-muted-foreground);
  border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav-list button:hover { color: var(--cove-foreground); background: rgba(255,255,255,0.03); }
.nav-list button.active {
  color: var(--cove-foreground);
  border-left-color: var(--cove-primary);
  background: rgba(201,168,76,0.08);
}
.nav-list .nav-icon { font-size: 15px; width: 18px; text-align: center; opacity: 0.85; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--cove-border);
  font-size: 11px;
  color: var(--cove-muted-foreground);
  line-height: 1.6;
}
.sidebar-footer .demo-chip {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--cove-border);
  color: var(--status-blocked);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.main {
  min-width: 0;
  padding: 0 0 80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--cove-nav-backdrop);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cove-nav-hairline);
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar h1 { font-size: 22px; }
.topbar .topbar-sub { font-size: 12px; color: var(--cove-muted-foreground); margin-top: 4px; font-weight: 400; }
.topbar-badge {
  border: 1px solid var(--status-blocked);
  color: var(--status-blocked);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 10px;
  white-space: nowrap;
}

.view { padding: 32px 40px; display: none; }
.view.active { display: block; }

/* ---------- Layout primitives ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.section { margin-bottom: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; }
.section-head p { color: var(--cove-muted-foreground); font-size: 13px; max-width: 60ch; }

.card {
  background: var(--cove-card);
  border: 1px solid var(--cove-border);
  border-radius: var(--cove-radius);
  padding: 20px;
}
.card-hover { transition: box-shadow .3s var(--cove-ease-card), border-color .3s ease; }
.card-hover:hover { box-shadow: var(--cove-shadow-card-hover); border-color: rgba(201,168,76,0.35); }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-value { font-size: 34px; font-weight: 800; color: var(--cove-primary); line-height: 1; }
.stat-card .stat-label { font-size: 12px; color: var(--cove-muted-foreground); text-transform: uppercase; letter-spacing: 1px; }
.stat-card .stat-note { font-size: 11px; color: var(--cove-muted-foreground); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--cove-primary);
  background: var(--cove-primary);
  color: var(--cove-primary-foreground);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 11px 22px;
  cursor: pointer;
  border-radius: var(--cove-radius);
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--cove-accent); border-color: var(--cove-accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--cove-primary); }
.btn-outline:hover { background: rgba(201,168,76,0.1); color: var(--cove-primary); }
.btn-ghost { background: transparent; border-color: var(--cove-border); color: var(--cove-foreground); }
.btn-ghost:hover { background: rgba(255,255,255,0.04); }
.btn[disabled], .btn.disabled {
  cursor: not-allowed;
  opacity: 0.4;
  background: var(--cove-secondary);
  border-color: var(--cove-border);
  color: var(--cove-muted-foreground);
}
.btn[disabled]:hover, .btn.disabled:hover { background: var(--cove-secondary); }
.btn-sm { padding: 7px 14px; font-size: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border: 1px solid var(--cove-border);
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-complete { color: var(--status-complete); border-color: var(--status-complete); }
.badge-complete .badge-dot { background: var(--status-complete); }
.badge-pending { color: var(--status-pending); border-color: var(--status-pending); }
.badge-pending .badge-dot { background: var(--status-pending); }
.badge-blocked { color: var(--status-blocked); border-color: var(--status-blocked); }
.badge-blocked .badge-dot { background: var(--status-blocked); }
.badge-neutral { color: var(--cove-muted-foreground); }
.badge-neutral .badge-dot { background: var(--cove-muted-foreground); }
.badge-not-connected { color: var(--status-not-connected); border-style: dashed; }

.banner {
  border: 1px solid var(--cove-border);
  border-left: 3px solid var(--cove-primary);
  background: rgba(201,168,76,0.06);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--cove-foreground);
  margin-bottom: 20px;
}
.banner strong { color: var(--cove-primary); }
.banner.warn { border-left-color: var(--status-blocked); background: rgba(217,99,74,0.08); }
.banner.warn strong { color: var(--status-blocked); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--cove-border); vertical-align: top; }
th { color: var(--cove-muted-foreground); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
tr:last-child td { border-bottom: none; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--cove-border);
  scrollbar-color: var(--cove-primary) var(--cove-secondary);
  scrollbar-width: thin;
}
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-track { background: var(--cove-secondary); }
.table-wrap::-webkit-scrollbar-thumb { background: var(--cove-primary); }
.table-wrap table { margin: 0; }
.table-wrap th, .table-wrap td { border-color: var(--cove-border); }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--cove-muted-foreground); font-weight: 700; }
.form-field input, .form-field select, .form-field textarea {
  background: var(--cove-input);
  border: 1px solid var(--cove-border);
  color: var(--cove-foreground);
  padding: 11px 12px;
  border-radius: var(--cove-radius);
  width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--cove-ring);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox-row input { width: auto; }

.pipeline-wrap { position: relative; }
.pipeline-wrap::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 12px;
  width: 56px;
  background: linear-gradient(to right, transparent, var(--cove-background));
  pointer-events: none;
}
.pipeline-wrap.at-end::after { display: none; }
.pipeline-scroll-hint {
  font-size: 11px;
  color: var(--cove-primary);
  text-align: right;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-color: var(--cove-primary) var(--cove-secondary);
  scrollbar-width: thin;
}
.pipeline::-webkit-scrollbar { height: 8px; }
.pipeline::-webkit-scrollbar-track { background: var(--cove-secondary); }
.pipeline::-webkit-scrollbar-thumb { background: var(--cove-primary); }
.pipeline-step {
  flex: 0 0 200px;
  border: 1px solid var(--cove-border);
  background: var(--cove-card);
  padding: 16px;
  position: relative;
}
.pipeline-step + .pipeline-step { margin-left: 28px; }
.pipeline-step::before {
  content: "→";
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cove-primary);
  font-size: 16px;
}
.pipeline-step .step-num { font-size: 10px; color: var(--cove-primary); font-weight: 700; letter-spacing: 1px; }
.pipeline-step h4 { font-size: 14px; margin: 6px 0 6px; }
.pipeline-step p { font-size: 11px; color: var(--cove-muted-foreground); }
.pipeline-parallel { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.pipeline-parallel .pipeline-step { flex: none; }

.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.agent-card h3 { font-size: 15px; margin-bottom: 6px; }
.agent-card .agent-role { font-size: 11px; color: var(--cove-primary); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 10px; }
.agent-card p { font-size: 13px; color: #C9C4B8; margin-bottom: 8px; }
.agent-card .agent-meta { font-size: 11px; color: var(--cove-muted-foreground); border-top: 1px solid var(--cove-border); padding-top: 10px; margin-top: 10px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cove-border); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button {
  all: unset;
  cursor: pointer;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cove-muted-foreground);
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--cove-primary); border-bottom-color: var(--cove-primary); }

.screenshot-crop {
  display: block;
  position: relative;
  overflow: hidden;
  height: 220px;
  border: 1px solid var(--cove-border);
  background: var(--cove-secondary);
  padding: 0;
  margin: 0;
  cursor: pointer;
  width: 100%;
  font: inherit;
}
.screenshot-crop img { width: 100%; height: auto; object-fit: cover; object-position: top center; }
.screenshot-crop:hover { border-color: var(--cove-primary); }

.library-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.library-card img { width: 100%; height: 160px; object-fit: cover; border-bottom: 1px solid var(--cove-border); }
.library-card .library-body { padding: 16px; }
.library-card h4 { font-size: 14px; margin-bottom: 4px; }
.library-card .library-meta { font-size: 11px; color: var(--cove-muted-foreground); margin-bottom: 10px; }

.property-snapshot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.property-snapshot-hero img { width: 100%; height: 320px; object-fit: cover; border: 1px solid var(--cove-border); }
.property-snapshot-gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.property-snapshot-gallery img { width: 100%; height: 56px; object-fit: cover; border: 1px solid var(--cove-border); }
.property-facts { display: flex; flex-direction: column; gap: 12px; }
.fact-row { border-bottom: 1px solid var(--cove-border); padding-bottom: 10px; }
.fact-row:last-child { border-bottom: none; }
.fact-row .fact-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--cove-muted-foreground); margin-bottom: 3px; }
.fact-row .fact-value { font-size: 14px; }
@media (max-width: 860px) {
  .property-snapshot { grid-template-columns: 1fr; }
  .property-snapshot-gallery { grid-template-columns: repeat(4, 1fr); }
}

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 22px 1fr; gap: 14px; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cove-border); background: var(--cove-background); margin-top: 4px; }
.timeline-dot.complete { border-color: var(--status-complete); background: var(--status-complete); }
.timeline-dot.pending { border-color: var(--status-pending); background: var(--status-pending); }
.timeline-line { width: 2px; flex: 1; background: var(--cove-border); margin: 2px 0; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content { padding-bottom: 26px; }
.timeline-content h4 { font-size: 14px; margin-bottom: 4px; }
.timeline-content p { font-size: 12px; color: var(--cove-muted-foreground); }
.timeline-notes { margin-top: 6px; }
.timeline-notes summary {
  cursor: pointer; list-style: none; font-size: 11px; color: var(--cove-primary);
  text-transform: uppercase; letter-spacing: .5px; font-weight: 700; display: inline-block;
}
.timeline-notes summary::-webkit-details-marker { display: none; }
.timeline-notes summary::before { content: "+ "; }
.timeline-notes[open] summary::before { content: "– "; }
.timeline-notes p { line-height: 1.6; max-width: 62ch; }

.pill-select { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill-select button {
  all: unset;
  cursor: pointer;
  border: 1px solid var(--cove-border);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cove-foreground);
}
.pill-select button:hover { border-color: var(--cove-primary); }
.pill-select button.active { border-color: var(--cove-primary); background: rgba(201,168,76,0.1); color: var(--cove-primary); }

.code-block {
  background: #060606;
  border: 1px solid var(--cove-border);
  padding: 16px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
}

.muted { color: var(--cove-muted-foreground); }
.small { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.flex-gap { display: flex; gap: 10px; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.searchbox {
  background: var(--cove-input);
  border: 1px solid var(--cove-border);
  color: var(--cove-foreground);
  padding: 11px 12px;
  width: 100%;
}

.property-picker-results {
  border: 1px solid var(--cove-border);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
}
.property-picker-results button {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--cove-border);
}
.property-picker-results button:last-child { border-bottom: none; }
.property-picker-results button:hover { background: rgba(201,168,76,0.08); }
.property-picker-results .p-meta { font-size: 11px; color: var(--cove-muted-foreground); margin-top: 2px; }

.selected-property {
  border: 1px solid var(--cove-primary);
  background: rgba(201,168,76,0.06);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
}

.toggle-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--cove-border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--cove-primary); cursor: pointer; }
.toggle-row label { font-size: 13px; cursor: pointer; }

footer.app-footer {
  padding: 24px 40px;
  border-top: 1px solid var(--cove-border);
  font-size: 11px;
  color: var(--cove-muted-foreground);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
  .library-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: the single sidebar becomes a drawer (see the drawer rules further
   down); it is no longer a horizontal scrolling strip. */
@media (max-width: 860px) {
  .sidebar-brand .brand-meta strong,
  .sidebar-brand .brand-meta span { white-space: nowrap; }
  .topbar { padding: 14px 16px; gap: 10px; }
  .view { padding: 24px 20px; }
}

@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2, .agent-grid, .library-grid, .checkbox-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 18px; }
  .pipeline { flex-direction: column; }
  .pipeline-step + .pipeline-step { margin-left: 0; margin-top: 28px; }
  .pipeline-step::before { content: "↓"; left: 50%; top: -22px; transform: translateX(-50%); }
}

/* =========================================================================
   CHAT-FIRST REDESIGN — added in the v2 refinement pass.
   Everything below is additive; nothing above this line was removed, so
   every previously-working view/behaviour keeps its original styling.
   ========================================================================= */

/* ---------- Motion tokens (respect prefers-reduced-motion globally) ---------- */
:root {
  --cove-motion-fast: 180ms;
  --cove-motion-med: 380ms;
  --cove-motion-slow: 600ms;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Sidebar nav groups (Primary / Advanced) ---------- */
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cove-muted-foreground);
  padding: 14px 12px 6px;
}
.nav-group-label:first-child { padding-top: 0; }
.nav-advanced-toggle {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--cove-muted-foreground);
}
.nav-advanced-toggle:hover { color: var(--cove-foreground); }
.nav-advanced-toggle .chev { transition: transform var(--cove-motion-fast) ease; font-size: 9px; }
.nav-advanced-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.nav-advanced-group { display: flex; flex-direction: column; gap: 2px; overflow: hidden; transition: grid-template-rows var(--cove-motion-med) ease; }
.nav-advanced-group[hidden] { display: none; }

/* Page-transition fade for the active view */
.view { animation: coveViewIn var(--cove-motion-med) ease both; }
@keyframes coveViewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Elevation on interactive cards site-wide */
.card-hover, .agent-node, .kpi-card, .starter-chip, .library-card {
  transition: transform var(--cove-motion-fast) ease, box-shadow var(--cove-motion-fast) ease, border-color var(--cove-motion-fast) ease;
}
.card-hover:hover, .agent-node:hover, .kpi-card:hover, .starter-chip:hover { transform: translateY(-2px); }

/* ---------- Demo mode indicator ---------- */
.demo-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--cove-primary);
  color: var(--cove-primary);
  background: rgba(201, 168, 76, 0.08);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 7px 14px;
  margin-bottom: 22px;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cove-primary);
  animation: covePulse 2s ease-in-out infinite;
}
@keyframes covePulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(201,168,76,.5); } 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(201,168,76,0); } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--cove-card);
  border: 1px solid var(--cove-primary);
  color: var(--cove-foreground);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--cove-shadow-lg);
  animation: coveToastIn var(--cove-motion-med) ease both;
  max-width: 320px;
}
.toast.leaving { animation: coveToastOut var(--cove-motion-med) ease both; }
@keyframes coveToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes coveToastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }

/* ---------- Modal (deliverable preview) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(5,5,5,0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 998; padding: 24px;
  animation: coveFadeIn var(--cove-motion-fast) ease both;
}
.modal-overlay[hidden] { display: none; }
@keyframes coveFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--cove-card);
  border: 1px solid var(--cove-border);
  max-width: 900px; width: 100%; max-height: 88vh;
  /* Single scroll region: the box itself never scrolls — only .modal-body does.
     Previously both this box AND .md-preview scrolled independently, producing
     two nested scrollbars for document previews. */
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: coveModalIn var(--cove-motion-med) var(--cove-ease-card) both;
}
@keyframes coveModalIn { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--cove-border); flex-shrink: 0; background: var(--cove-card); }
.modal-head h3 { font-size: 15px; }
.modal-close { all: unset; cursor: pointer; font-size: 20px; color: var(--cove-muted-foreground); padding: 4px 8px; }
.modal-close:hover { color: var(--cove-foreground); }
.modal-body { padding: 20px; flex: 1; min-height: 0; overflow-y: auto; }
.modal-body img { width: 100%; border: 1px solid var(--cove-border); }

/* ---------- Count-up KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi-card {
  background: var(--cove-card);
  border: 1px solid var(--cove-border);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.kpi-card .kpi-icon { font-size: 20px; color: var(--cove-primary); opacity: .9; }
.kpi-card .kpi-value { font-size: 36px; font-weight: 800; color: var(--cove-foreground); line-height: 1; }
.kpi-card .kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--cove-muted-foreground); }
.kpi-ring-wrap { position: absolute; right: 16px; top: 16px; width: 44px; height: 44px; }
.kpi-ring-wrap svg { transform: rotate(-90deg); }
.kpi-ring-track { fill: none; stroke: var(--cove-border); stroke-width: 4; }
.kpi-ring-fill { fill: none; stroke: var(--cove-primary); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.16,1,.3,1); }

/* ---------- Collapsible "operational details" ---------- */
details.details-panel {
  border: 1px solid var(--cove-border);
  background: var(--cove-card);
  margin-top: 8px;
}
details.details-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cove-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.details-panel summary::-webkit-details-marker { display: none; }
details.details-panel summary::after { content: "+"; font-size: 16px; color: var(--cove-muted-foreground); }
details.details-panel[open] summary::after { content: "–"; }
details.details-panel .details-body { padding: 4px 18px 18px; animation: coveViewIn var(--cove-motion-fast) ease both; }

/* ---------- Asset chip (replaces raw file-path text in primary cards) ---------- */
.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cove-border);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cove-primary);
  cursor: pointer;
  background: transparent;
}
.asset-chip:hover { border-color: var(--cove-primary); background: rgba(201,168,76,0.08); }

/* =========================================================================
   AI TEAM — orchestrator hub visual
   ========================================================================= */
.orchestrator-hub { display: flex; flex-direction: column; align-items: center; gap: 0; }
.orchestrator-node {
  border: 1px solid var(--cove-primary);
  background: linear-gradient(180deg, rgba(201,168,76,0.12), rgba(201,168,76,0.02));
  padding: 20px 28px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(201,168,76,0.08);
}
.orchestrator-node .agent-role { justify-content: center; display: block; text-align: center; }
.orchestrator-node h3 { font-size: 17px; margin: 6px 0; }
.orchestrator-node p { font-size: 13px; color: #C9C4B8; }
.hub-spine { width: 2px; height: 32px; background: linear-gradient(180deg, var(--cove-primary), var(--cove-border)); }
.hub-spine.animated { background-size: 100% 200%; animation: coveSpineFlow 2.4s linear infinite; }
@keyframes coveSpineFlow { 0% { background-position: 0 0; } 100% { background-position: 0 -200%; } }

.specialist-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1040px;
  padding-top: 24px;
  position: relative;
}
.specialist-row::before {
  content: "";
  position: absolute;
  top: 0; left: 12.5%; right: 12.5%;
  height: 2px;
  background: var(--cove-border);
}
.agent-node {
  background: var(--cove-card);
  border: 1px solid var(--cove-border);
  padding: 16px;
  cursor: pointer;
  position: relative;
  text-align: left;
}
.agent-node::before {
  content: "";
  position: absolute;
  top: -24px; left: 50%;
  width: 2px; height: 24px;
  background: var(--cove-border);
  transform: translateX(-50%);
}
.agent-node .step-num { color: var(--cove-primary); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.agent-node h4 { font-size: 13px; margin: 6px 0 4px; }
.agent-node p { font-size: 12px; color: var(--cove-muted-foreground); line-height: 1.5; }
.agent-node.selected { border-color: var(--cove-primary); box-shadow: 0 0 0 1px var(--cove-primary), 0 0 30px rgba(201,168,76,.12); }
.agent-node.selected::before { background: var(--cove-primary); }

.approval-gate {
  margin-top: 28px;
  border: 1px dashed var(--status-blocked);
  color: var(--status-blocked);
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
}

.agent-detail-panel {
  margin-top: 24px;
  border: 1px solid var(--cove-primary);
  background: var(--cove-card);
  padding: 22px;
  max-width: 1040px;
  width: 100%;
}
.agent-detail-panel[hidden] { display: none; }
.agent-detail-panel h3 { font-size: 16px; margin-bottom: 8px; }
.agent-detail-panel .agent-meta { border-top: none; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--cove-border); }

@media (max-width: 1100px) {
  .specialist-row { grid-template-columns: repeat(2, 1fr); }
  .specialist-row::before { left: 25%; right: 25%; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .specialist-row { grid-template-columns: 1fr; }
  .specialist-row::before { display: none; }
  .agent-node::before { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   AI MARKETING ASSISTANT — chat-first home
   ========================================================================= */
.main.chat-mode { height: 100vh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#view-assistant.active { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 0; min-height: 0; }

/* ---- Chat workspace: single full-width chat column ---- */
.chat-workspace { flex: 1; min-height: 0; display: flex; overflow: hidden; position: relative; }

/* ---- Chats nested inside the single sidebar, under AI Marketing Assistant ---- */
.nav-row { display: flex; align-items: stretch; gap: 0; }
.nav-row .nav-main-btn { flex: 1; min-width: 0; }
.nav-sub-toggle {
  all: unset; box-sizing: border-box; cursor: pointer;
  width: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--cove-muted-foreground); font-size: 10px;
  transition: transform var(--cove-motion-fast) ease, color var(--cove-motion-fast) ease;
}
.nav-sub-toggle:hover { color: var(--cove-primary); }
.nav-sub-toggle[aria-expanded="true"] { transform: rotate(90deg); color: var(--cove-primary); }

.nav-chats-group {
  display: flex; flex-direction: column; gap: 6px;
  margin: 4px 0 8px 10px; padding: 8px 0 8px 8px;
  border-left: 1px solid var(--cove-border);
  max-width: 100%; overflow-x: hidden;
}
.nav-chats-group[hidden] { display: none; }
.chats-new-btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  border: 1px solid var(--cove-primary); color: var(--cove-primary);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 10px; text-align: center;
}
.chats-new-btn:hover { background: rgba(201,168,76,0.1); }
.chats-reset-btn {
  all: unset; box-sizing: border-box; cursor: pointer;
  font-size: 10px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--cove-muted-foreground); padding: 6px 2px;
}
.chats-reset-btn:hover { color: var(--status-blocked); }
.conv-search-input {
  width: 100%; background: var(--cove-input); border: 1px solid var(--cove-border);
  color: var(--cove-foreground); padding: 7px 9px; font-size: 12px;
}
.conv-search-input:focus { outline: none; border-color: var(--cove-primary); }
.conv-list { max-height: 34vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--cove-border) transparent; }
.conv-list::-webkit-scrollbar { width: 6px; }
.conv-list::-webkit-scrollbar-thumb { background: var(--cove-border); }
.conv-group-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--cove-muted-foreground); padding: 8px 4px 4px;
}
.conv-item {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 4px 7px 6px; cursor: pointer; position: relative;
  border-left: 2px solid transparent;
  transition: background var(--cove-motion-fast) ease;
  max-width: 100%;
}
.conv-item:hover { background: rgba(255,255,255,0.03); }
.conv-item.active { background: rgba(201,168,76,0.08); border-left-color: var(--cove-primary); }
/* min-width:0 is what lets a flex child actually shrink and ellipsis instead
   of forcing the row (and the whole sidebar) to overflow horizontally. */
.conv-item-body { flex: 1; min-width: 0; max-width: 100%; overflow: hidden; }
.conv-item-title {
  font-size: 12px; color: var(--cove-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.conv-item.active .conv-item-title { color: var(--cove-primary); font-weight: 600; }
.conv-item-time { font-size: 10px; color: var(--cove-muted-foreground); margin-top: 1px; }

/* Three-dot overflow menu — a fixed-width column (never grows), so it can
   never collide with the truncated title next to it. */
.conv-item-menu { position: relative; flex-shrink: 0; width: 22px; }
.conv-item-menu-btn {
  all: unset; box-sizing: border-box; cursor: pointer; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--cove-muted-foreground); font-size: 14px; line-height: 1;
  border-radius: 4px;
  opacity: 0;
}
.conv-item:hover .conv-item-menu-btn,
.conv-item.active .conv-item-menu-btn,
.conv-item-menu.open .conv-item-menu-btn,
.conv-item-menu-btn:focus-visible {
  opacity: 1;
}
.conv-item-menu-btn:hover { color: var(--cove-primary); background: rgba(255,255,255,0.06); }
.conv-item-menu-dropdown {
  display: none; position: absolute; top: calc(100% + 2px); right: 0; z-index: 40;
  min-width: 128px; background: #141414; border: 1px solid var(--cove-border);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55);
  flex-direction: column; padding: 4px;
}
.conv-item-menu.open .conv-item-menu-dropdown { display: flex; }
.conv-item-menu-dropdown button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  padding: 8px 10px; font-size: 12.5px; color: var(--cove-foreground);
  border-radius: 3px;
}
.conv-item-menu-dropdown button:hover { background: rgba(201,168,76,0.12); color: var(--cove-primary); }
.conv-item-menu-dropdown button.danger:hover { background: rgba(217,99,74,0.14); color: var(--status-blocked); }
.conv-item-rename-input {
  width: 100%; background: var(--cove-input); border: 1px solid var(--cove-primary);
  color: var(--cove-foreground); font-size: 13px; padding: 4px 6px;
}
.conv-empty { padding: 14px 6px; text-align: center; color: var(--cove-muted-foreground); font-size: 11.5px; }

.chat-main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ---- Sidebar rail collapse (icon-only), ChatGPT/Claude style ---- */
.sidebar-rail-toggle {
  all: unset; box-sizing: border-box; cursor: pointer;
  width: 26px; height: 26px; flex-shrink: 0; margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--cove-muted-foreground); font-size: 13px;
}
.sidebar-rail-toggle:hover { color: var(--cove-primary); }

.app-shell.rail { grid-template-columns: 68px 1fr; }
.app-shell.rail .sidebar { padding: 28px 10px; align-items: center; }
.app-shell.rail .nav-label,
.app-shell.rail .brand-meta,
.app-shell.rail .nav-group-label,
.app-shell.rail .nav-chats-group,
.app-shell.rail .nav-sub-toggle,
.app-shell.rail .nav-advanced-toggle .chev { display: none; }
.app-shell.rail .sidebar-brand { justify-content: center; padding-bottom: 14px; }
.app-shell.rail .sidebar-brand img { height: 26px; }
.app-shell.rail .sidebar-rail-toggle { margin: 0; transform: rotate(180deg); }
.app-shell.rail .nav-list button { justify-content: center; padding: 11px 0; }
.app-shell.rail .nav-list .nav-icon { width: auto; font-size: 17px; }
.app-shell.rail .runtime-status-btn { justify-content: center; padding: 8px 0; }

/* ---- Runtime status (replaces repeated "internal demo" warnings) ---- */
.runtime-status-btn {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--cove-border); color: var(--cove-muted-foreground);
  font-size: 11px; letter-spacing: .5px;
}
.runtime-status-btn:hover { border-color: var(--cove-primary); color: var(--cove-primary); }
.runtime-status-badge {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--cove-border); color: var(--cove-muted-foreground);
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  padding: 7px 12px; white-space: nowrap; flex-shrink: 0;
}
.runtime-status-badge:hover { border-color: var(--cove-primary); color: var(--cove-primary); }
.runtime-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--status-complete);
  flex-shrink: 0; box-shadow: 0 0 6px rgba(76,175,109,.5);
}

.topbar-menu-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: none;
  width: 34px; height: 34px; align-items: center; justify-content: center;
  color: var(--cove-foreground); font-size: 17px; flex-shrink: 0;
}
.topbar-titles { flex: 1; min-width: 0; }
.sidebar-backdrop { display: none; }

.assistant-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 32px 40px 12px; }
.assistant-composer {
  flex: 0 0 auto;
  padding: 16px 40px 24px;
  border-top: 1px solid var(--cove-border);
  background: linear-gradient(180deg, transparent, rgba(10,10,10,0.4) 40%);
}

/* Hero: controlled max-width + fluid type so the greeting never wraps into
   an oversized two-line block, with tighter vertical rhythm. */
.assistant-hero { max-width: 720px; margin: 1vh auto 0; text-align: center; }
.assistant-hero[hidden] { display: none; }
.assistant-greeting {
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.12;
  margin: 0 auto 8px;
  max-width: 30ch;
  text-wrap: balance;
}
.assistant-subhead { font-size: 15px; color: var(--cove-muted-foreground); margin: 0 auto 14px; }

.starter-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px auto 12px; max-width: 640px; }
.starter-chip {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid var(--cove-border);
  color: var(--cove-foreground);
  font-size: 13px;
  padding: 10px 16px;
  background: var(--cove-card);
}
.starter-chip:hover { border-color: var(--cove-primary); color: var(--cove-primary); }

.btn-demo { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Composer box (shared visual for hero + pinned state) */
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid var(--cove-border);
  background: var(--cove-card);
  padding: 12px 14px;
  max-width: 760px;
  margin: 0 auto;
  transition: border-color var(--cove-motion-fast) ease, box-shadow var(--cove-motion-fast) ease;
}
.composer-box:focus-within { border-color: var(--cove-primary); box-shadow: 0 0 0 1px var(--cove-primary); }
.composer-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--cove-foreground);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  max-height: 160px;
  padding: 8px 0;
  overflow: hidden;
}
.composer-box textarea:focus { outline: none; }
.composer-icon-btn {
  all: unset;
  box-sizing: border-box;
  cursor: not-allowed;
  color: var(--cove-muted-foreground);
  font-size: 16px;
  padding: 8px;
  border: 1px solid var(--cove-border);
  position: relative;
}
.composer-icon-btn .coming-soon-tag {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 8px; letter-spacing: .5px; white-space: nowrap; color: var(--cove-muted-foreground);
  text-transform: uppercase;
}
.composer-send { flex-shrink: 0; }

.composer-property-row { max-width: 760px; margin: 0 auto 10px; display: flex; justify-content: center; }
.property-chip-btn {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid var(--cove-border);
  color: var(--cove-muted-foreground);
  font-size: 12px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.property-chip-btn:hover { border-color: var(--cove-primary); color: var(--cove-primary); }
.property-chip-btn.selected { border-color: var(--cove-primary); color: var(--cove-primary); background: rgba(201,168,76,0.08); }
.composer-property-picker { position: relative; }
.composer-property-picker .property-picker-results {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  margin-bottom: 6px;
  background: var(--cove-card);
  z-index: 5;
}

/* ---------- Chat log ---------- */
.chat-log { max-width: 820px; width: 100%; min-width: 0; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 12px; }
.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }
.chat-row.assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: 78%;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  animation: coveMsgIn var(--cove-motion-med) var(--cove-ease-card) both;
}
@keyframes coveMsgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-row.user .chat-bubble { background: var(--cove-primary); color: var(--cove-primary-foreground); }
.chat-row.assistant .chat-bubble { background: var(--cove-card); border: 1px solid var(--cove-border); max-width: 100%; width: 100%; }
.chat-property-tag { display: inline-block; margin-top: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }

/* Staged progress card */
.stage-list { display: flex; flex-direction: column; gap: 0; }
.stage-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; opacity: .4; transition: opacity var(--cove-motion-med) ease; }
.stage-item[data-status="active"], .stage-item[data-status="done"] { opacity: 1; }
.stage-marker {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--cove-border);
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--cove-motion-fast) ease, background var(--cove-motion-fast) ease;
}
.stage-item[data-status="active"] .stage-marker { border-color: var(--cove-primary); box-shadow: 0 0 0 4px rgba(201,168,76,0.15); animation: coveGlow 1.1s ease-in-out infinite; }
.stage-item[data-status="done"] .stage-marker { border-color: var(--cove-primary); background: var(--cove-primary); }
.stage-item[data-status="done"] .stage-marker::after { content: "✓"; font-size: 11px; color: var(--cove-primary-foreground); }
@keyframes coveGlow { 0%, 100% { box-shadow: 0 0 0 4px rgba(201,168,76,0.15); } 50% { box-shadow: 0 0 0 7px rgba(201,168,76,0.05); } }
.stage-label { font-size: 13.5px; }
.stage-agent { font-size: 11px; color: var(--cove-muted-foreground); margin-left: auto; padding-left: 12px; white-space: nowrap; }

/* Result cards ("Campaign Ready for Review") */
.result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.result-header h3 { font-size: 16px; }
/* Both grids below live only inside chat responses, where the conversation
   sidebar (272px) plus the main nav sidebar (260px) can leave far less
   width than the raw viewport suggests — so unlike other grids on this
   page, these default to 1 column and only widen once there's reliably
   enough room for both sidebars to be open AND multiple columns to fit. */
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; width: 100%; min-width: 0; }
@media (min-width: 1300px) { .result-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.result-card {
  border: 1px solid var(--cove-border);
  background: var(--cove-secondary);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.result-card .result-card-title { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--cove-primary); font-weight: 700; }
.result-card .result-card-body { font-size: 13px; color: var(--cove-foreground); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.result-card img.result-thumb { width: 100%; height: 90px; object-fit: cover; border: 1px solid var(--cove-border); }
.result-card .result-thumb-row { display: flex; gap: 4px; }
.result-card .result-thumb-row img { width: 100%; height: 54px; object-fit: cover; border: 1px solid var(--cove-border); }
.result-placeholder { color: var(--cove-muted-foreground); font-style: italic; font-size: 12.5px; }

@media (max-width: 640px) {
  .assistant-scroll { padding: 20px 16px 8px; }
  .assistant-composer { padding: 12px 16px 18px; }
  .assistant-greeting { font-size: 26px; }
  .chat-bubble { max-width: 92%; }
  .result-grid { grid-template-columns: 1fr; }
  .composer-property-picker .property-picker-results { width: 260px; }
}

/* =========================================================================
   Single sidebar — mobile drawer behaviour (Chats expand inside the drawer)
   ========================================================================= */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.rail { grid-template-columns: 1fr; }
  .topbar-menu-btn { display: flex; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
    width: min(86vw, 320px); height: 100vh;
    flex-direction: column; align-items: stretch;
    overflow-y: auto; padding: 24px 18px;
    transform: translateX(-100%);
    transition: transform var(--cove-motion-med) var(--cove-ease-card);
  }
  .sidebar.drawer-open { transform: translateX(0); }
  /* Rail mode is a desktop affordance only — never shrink the mobile drawer. */
  .app-shell.rail .sidebar { padding: 24px 18px; align-items: stretch; }
  .app-shell.rail .nav-label,
  .app-shell.rail .brand-meta,
  .app-shell.rail .nav-group-label,
  .app-shell.rail .nav-sub-toggle { display: revert; }
  .app-shell.rail .nav-chats-group:not([hidden]) { display: flex; }
  .app-shell.rail .nav-list button { justify-content: flex-start; padding: 11px 12px; }
  .sidebar-rail-toggle { display: none; }
  .conv-list { max-height: 40vh; }

  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 29; opacity: 0; pointer-events: none;
    transition: opacity var(--cove-motion-med) ease;
  }
  .sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }
  .sidebar-backdrop[hidden] { display: none; }
}

/* =========================================================================
   Artifact cards, previews, skeletons, empty states
   ========================================================================= */
/* Vertical-stack layout deliberately avoids the "will two buttons + a
   two-line title fit on one row" breakpoint problem — it is correct at
   any column width the grid below ever produces, with or without the
   conversation sidebar open. */
.artifact-card {
  border: 1px solid var(--cove-border);
  background: var(--cove-secondary);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color var(--cove-motion-fast) ease, transform var(--cove-motion-fast) ease;
}
.artifact-card:hover { border-color: rgba(201,168,76,0.4); transform: translateY(-1px); }
.artifact-card-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.artifact-icon {
  flex-shrink: 0; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--cove-card); border: 1px solid var(--cove-border); color: var(--cove-primary); font-size: 15px;
}
.artifact-body { flex: 1; min-width: 0; }
.artifact-title { font-size: 13px; font-weight: 600; color: var(--cove-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-meta { font-size: 11px; color: var(--cove-muted-foreground); margin-top: 2px; }
.artifact-actions { display: flex; gap: 6px; }
.artifact-actions .btn { flex: 1; min-width: 0; }
.artifact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; min-width: 0; }
@media (min-width: 1300px) { .artifact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.modal-box.modal-wide { max-width: 1100px; }
.gallery-frame { position: relative; background: #000; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.gallery-frame img { max-height: 70vh; width: auto; margin: 0 auto; display: block; }
.gallery-nav {
  all: unset; box-sizing: border-box; cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: rgba(10,10,10,0.6); color: var(--cove-foreground); font-size: 18px; border: 1px solid var(--cove-border);
}
.gallery-nav:hover { background: rgba(201,168,76,0.25); border-color: var(--cove-primary); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-counter { text-align: center; padding: 10px; font-size: 12px; color: var(--cove-muted-foreground); }
.gallery-thumbs { display: flex; gap: 6px; padding: 0 16px 16px; overflow-x: auto; }
.gallery-thumbs img { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--cove-border); cursor: pointer; opacity: .6; }
.gallery-thumbs img.active { opacity: 1; border-color: var(--cove-primary); }

.pdf-preview-frame { width: 100%; height: 72vh; border: none; background: #525659; }
.docx-preview-body { padding: 4px; }
.docx-summary-box {
  background: var(--cove-card); border: 1px solid var(--cove-border); padding: 20px; margin-bottom: 16px;
  font-size: 13px; line-height: 1.7; color: var(--cove-foreground); max-height: 50vh; overflow-y: auto;
}
.docx-summary-box h4 { font-size: 13px; color: var(--cove-primary); margin: 12px 0 4px; }
.docx-summary-box h4:first-child { margin-top: 0; }

/* Skeleton loaders */
.skel { background: linear-gradient(90deg, var(--cove-secondary) 25%, var(--cove-border) 37%, var(--cove-secondary) 63%); background-size: 400% 100%; animation: coveSkeleton 1.6s ease infinite; }
@keyframes coveSkeleton { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel-line { height: 12px; margin-bottom: 8px; }
.skel-card { height: 90px; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--cove-muted-foreground); }
.empty-state .empty-icon { font-size: 32px; color: var(--cove-primary); margin-bottom: 12px; opacity: .8; }
.empty-state h4 { color: var(--cove-foreground); font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 13px; max-width: 40ch; margin: 0 auto; }

/* Confirm dialog (delete conversation) */
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn-danger { background: #B94A3D; border-color: #B94A3D; color: #fff; }
.btn-danger:hover { background: #9C3E33; border-color: #9C3E33; }

/* Glass/depth touches */
.assistant-composer { backdrop-filter: blur(8px); }
.chat-row.assistant .chat-bubble { box-shadow: 0 12px 30px rgba(0,0,0,0.25); }
.provider-disabled-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--cove-muted-foreground); border: 1px dashed var(--cove-border); padding: 4px 8px;
}

/* ---------- Alva real-campaign document previews (additive) ---------- */
/* No max-height/overflow here on purpose — .modal-body is the single scroll
   region (see above); this used to also scroll internally, producing a
   double/nested scrollbar. Readable max-width comes from .modal-box's own
   max-width (900px, 1100px for .modal-wide). */
.md-preview { padding: 4px 4px 12px; font-size: 13.5px; line-height: 1.6; overflow-wrap: break-word; max-width: 720px; margin: 0 auto; }
.modal-wide .md-preview { max-width: 900px; }
.md-preview h1 { font-size: 20px; color: var(--cove-primary); margin: 0 0 12px; }
.md-preview h2 { font-size: 16px; color: var(--cove-primary); margin: 22px 0 8px; }
.md-preview h3, .md-preview h4 { font-size: 14px; margin: 16px 0 6px; }
.md-preview p { margin: 8px 0; }
.md-preview ul, .md-preview ol { margin: 8px 0 8px 20px; padding: 0; }
.md-preview blockquote { margin: 10px 0; padding: 6px 14px; border-left: 2px solid var(--cove-primary); color: var(--cove-muted-foreground); }
.md-preview code { background: var(--cove-secondary); padding: 1px 5px; font-size: 12px; }
.md-preview pre { background: var(--cove-secondary); padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; }
.md-preview hr { border: 0; border-top: 1px solid var(--cove-border); margin: 16px 0; }
.md-table-scroll { overflow-x: auto; margin: 10px 0; }
.md-preview table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.md-preview th, .md-preview td { border: 1px solid var(--cove-border); padding: 6px 9px; text-align: left; vertical-align: top; }
.md-preview th { background: var(--cove-secondary); color: var(--cove-primary); }
.doc-preview-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px;
  position: sticky; bottom: -20px; padding: 10px 0 10px;
  background: linear-gradient(0deg, var(--cove-card) 60%, rgba(17,17,17,0));
}
/* Download / Open Raw File are secondary actions — smaller, outlined, not
   competing visually with the content above them. */
.doc-preview-actions .btn { opacity: 0.9; }
.doc-preview-actions .btn:hover { opacity: 1; }

/* Technical evidence — the raw file-path/status metadata table collapses by
   default so a reviewer sees the document's actual content first. */
.tech-evidence {
  margin: 0 0 18px 0; border: 1px solid var(--cove-border); background: var(--cove-secondary);
}
.tech-evidence summary {
  cursor: pointer; padding: 9px 12px; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: var(--cove-muted-foreground);
  list-style: none;
}
.tech-evidence summary::-webkit-details-marker { display: none; }
.tech-evidence summary::before { content: "▸ "; color: var(--cove-primary); }
.tech-evidence[open] summary::before { content: "▾ "; }
.tech-evidence .md-table-scroll { margin: 0; padding: 0 12px 12px; }
@media (max-width: 600px) { .md-preview { max-height: 62vh; font-size: 13px; } }
.result-card-body pre.result-pre { background: var(--cove-secondary); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; margin: 6px 0; font-family: var(--cove-font-sans); }
#approvals-alva-section[hidden] { display: none; }
#approvals-alva { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
#approvals-alva .card { min-width: 0; overflow-wrap: anywhere; }

.result-grid.result-grid-wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
#library-grid .library-card { min-width: 0; }
#library-grid .library-body .flex-gap { flex-wrap: wrap; }

/* =======================================================================
   Alva completion result — decluttered presentation (Round 2)
   ======================================================================= */

/* ---- Compact completion header ---- */
.alva-complete-header { margin-bottom: 4px; }
.alva-complete-titlebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alva-complete-titlebar h3 { font-size: 19px; margin: 0; }
.alva-complete-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--cove-muted-foreground); }
.alva-meta-sep { opacity: 0.5; }

/* ---- Section labels (replace big "result-header" per-block chrome) ---- */
.alva-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--cove-muted-foreground); margin: 0 0 10px 0; padding-top: 4px;
  border-top: 1px solid var(--cove-border); padding-top: 16px;
}
.alva-section-label:first-child { border-top: none; padding-top: 0; }

/* ---- Featured Deliverables grid ---- */
.featured-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 12px;
}
.featured-card {
  display: flex; flex-direction: column; background: var(--cove-card);
  border: 1px solid var(--cove-border); overflow: hidden; cursor: pointer;
  transition: border-color var(--cove-motion-fast) ease;
}
.featured-card:hover { border-color: var(--cove-primary); }
.featured-thumb { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #000; flex-shrink: 0; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.featured-title-row { display: flex; align-items: center; gap: 8px; }
.featured-icon { font-size: 14px; flex-shrink: 0; }
.featured-title { font-size: 13.5px; font-weight: 700; color: var(--cove-foreground); overflow-wrap: anywhere; }
.featured-desc { font-size: 12px; color: var(--cove-muted-foreground); line-height: 1.5; margin: 0; }
.featured-status { margin-top: -2px; }
.featured-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.featured-actions .btn { flex: 1; min-width: 0; }

/* ---- Campaign Intelligence accordions ---- */
.intel-accordion-group { display: flex; flex-direction: column; gap: 6px; }
.intel-accordion { border: 1px solid var(--cove-border); background: var(--cove-card); }
.intel-accordion summary {
  cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600;
  color: var(--cove-foreground); list-style: none; display: flex; align-items: center; gap: 8px;
}
.intel-accordion summary::-webkit-details-marker { display: none; }
.intel-accordion summary::before { content: "\25B8"; color: var(--cove-primary); font-size: 11px; }
.intel-accordion[open] summary::before { content: "\25BE"; }
.intel-accordion summary:hover { color: var(--cove-primary); }
.intel-body { padding: 2px 14px 16px 14px; font-size: 13px; line-height: 1.6; }
.intel-body p { margin: 6px 0; }

/* ---- Governance & QA (collapsed by default, muted until opened) ---- */
.governance-accordion { border-color: var(--cove-border); }
.governance-accordion summary { color: var(--cove-muted-foreground); }
.gov-checklist { list-style: none; margin: 4px 0 4px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gov-checklist li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.gov-icon { flex-shrink: 0; width: 16px; text-align: center; font-size: 12px; margin-top: 1px; }
.gov-pass { color: var(--status-complete); }
.gov-warn { color: var(--status-blocked); }
.gov-pending { color: var(--status-pending); }

/* ---- Agent activity (compact chip row, one per specialist) ---- */
.agent-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-chip { font-size: 11.5px; font-weight: 600; padding: 6px 11px; border: 1px solid var(--cove-border); white-space: nowrap; }
.agent-chip-complete { color: var(--status-complete); border-color: rgba(76,175,109,0.35); background: rgba(76,175,109,0.08); }
.agent-chip-muted { color: var(--cove-muted-foreground); }
.agent-chip-pending { color: var(--status-pending); border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.08); }

/* ---- WhatsApp preview modal ---- */
.wa-preview-img { max-width: 340px; width: 100%; margin: 0 auto; display: block; border: 1px solid var(--cove-border); }

@media (max-width: 600px) {
  .featured-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-actions .btn { flex: none; width: 100%; }
}
