/* ============================================================
   MaxV OS v2 — Components
   ============================================================ */

/* ── Eyebrow / section labels ── */
.ds-section {
  padding: var(--s-8) var(--s-8);
  border-bottom: 1px solid var(--border);
}
.ds-section-title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text);
  margin: 0 0 var(--s-1);
  letter-spacing: -0.01em;
}
.ds-section-sub {
  font-size: var(--fs-md);
  color: var(--text-muted);
  margin: 0 0 var(--s-6);
}
.ds-grid {
  display: grid;
  gap: var(--s-4);
}

/* ── Swatches ── */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-3);
}
.swatch {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.swatch-color {
  height: 68px;
  display: flex;
  align-items: flex-end;
  padding: var(--s-2);
}
.swatch-meta {
  padding: var(--s-2) var(--s-3);
  border-top: 1px solid var(--border);
}
.swatch-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.swatch-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Type specimens ── */
.type-row {
  display: grid;
  grid-template-columns: 140px 1fr 120px;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.type-row:last-child { border-bottom: 0; }
.type-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}
.type-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Spacing / radius / shadow visualizers ── */
.scale-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  font-size: var(--fs-sm);
}
.scale-box {
  background: var(--teal-500);
  height: 12px;
  border-radius: 2px;
}
.radius-box {
  width: 64px;
  height: 64px;
  background: var(--teal-500);
  display: inline-block;
}
.radius-cell {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  padding: var(--s-3);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.shadow-cell {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 var(--s-4);
  height: 32px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur-fast);
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--teal-400); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--teal-500);
  color: var(--text-inverse);
  border-color: var(--teal-500);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08) inset, var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) { background: var(--teal-400); border-color: var(--teal-400); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--hover); }

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); }

.btn-danger-solid {
  background: var(--danger);
  color: var(--text-inverse);
  border-color: var(--danger);
}
.btn-danger-solid:hover:not(:disabled) { background: #9e2216; border-color: #9e2216; }

.btn-sm { height: 26px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.btn-lg { height: 40px; padding: 0 var(--s-5); font-size: var(--fs-base); }
.btn-icon { width: 32px; padding: 0; }
.btn-icon.btn-sm { width: 26px; }

/* ============================================================
   Badges / Status pills (flat, not gumdrop)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-border); }
.badge-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info-border); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }
.badge-accent  { background: var(--teal-50);    color: var(--teal-500); border-color: var(--teal-100); }

.badge-solid {
  background: var(--navy-500);
  color: var(--text-inverse);
  border: 0;
}
.badge-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.level-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 20px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); font-family: var(--font-mono);
}
.level-pill.l1 { background: var(--success-bg); color: var(--success); }
.level-pill.l2 { background: var(--warning-bg); color: var(--warning); }
.level-pill.l3 { background: var(--danger-bg);  color: var(--danger); }

/* ============================================================
   Cards & containers
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-padded { padding: var(--s-5); }
.card-airy { padding: var(--s-6); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.card-header h3 {
  margin: 0; font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text);
}
.card-body { padding: var(--s-5); }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.stat-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.stat-value {
  font-family: var(--font-mono);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-medium);
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-delta.flat { color: var(--text-muted); }

/* ============================================================
   Form controls
   ============================================================ */
.input, .textarea, .select {
  width: 100%;
  height: 32px;
  padding: 0 var(--s-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { height: auto; padding: var(--s-2) var(--s-3); line-height: var(--lh-base); resize: vertical; min-height: 72px; }
.input:focus, .textarea:focus, .select:focus {
  outline: 0;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(89, 172, 154, 0.18);
}
.input-with-icon {
  position: relative;
}
.input-with-icon .input { padding-left: 30px; }
.input-with-icon svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-muted);
}

.checkbox {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast);
}
.checkbox.checked {
  background: var(--teal-500);
  border-color: var(--teal-500);
  color: white;
}
.checkbox svg { width: 10px; height: 10px; display: none; }
.checkbox.checked svg { display: block; }

/* ============================================================
   Tables
   ============================================================ */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-base);
}
.tbl th {
  position: sticky; top: 0; z-index: 1;
  text-align: left;
  padding: 8px var(--s-4);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
.tbl td {
  padding: 9px var(--s-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.tbl tbody tr { transition: background var(--dur-fast); }
.tbl tbody tr:hover { background: var(--hover); cursor: pointer; }
.tbl tbody tr.selected { background: var(--teal-50); }
.tbl-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.tbl-id  { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }

/* ============================================================
   Sidebar rail
   ============================================================ */
.rail {
  width: var(--rail-w);
  background: var(--surface-muted);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: var(--s-3) 0;
  gap: var(--s-1);
  flex-shrink: 0;
  transition: width var(--dur-base) var(--ease-out);
}
.rail-brand {
  width: 36px; height: 36px;
  background: var(--navy-500);
  color: white;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  margin-bottom: var(--s-3);
  letter-spacing: -0.03em;
}
.rail-item {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  position: relative;
}
.rail-item:hover { background: var(--hover); color: var(--text); }
.rail-item.active { background: var(--teal-500); color: white; }
.rail-item svg { width: 18px; height: 18px; }
.rail-item .rail-tooltip {
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--navy-500); color: white;
  font-size: var(--fs-xs); padding: 4px 8px; border-radius: var(--r-sm);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-fast);
  z-index: 20;
}
.rail-item:hover .rail-tooltip { opacity: 1; }
.rail-spacer { flex: 1; }

/* ============================================================
   Top header
   ============================================================ */
.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 var(--s-5);
  gap: var(--s-4);
  flex-shrink: 0;
}
.topbar h1 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text);
  letter-spacing: -0.01em;
}
.topbar .breadcrumb {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-sm); color: var(--text-muted);
}
.topbar .breadcrumb .sep { opacity: 0.5; }
.topbar .breadcrumb .curr { color: var(--text); font-weight: var(--fw-semibold); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: var(--s-2); }

/* ============================================================
   Tabs (underline, clean)
   ============================================================ */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s-5);
  background: var(--surface);
  flex-shrink: 0;
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--teal-500); }
.tab .count {
  background: var(--neutral-bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: var(--fw-bold);
  padding: 1px 6px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
}
.tab.active .count { background: var(--teal-500); color: white; }

/* Segmented control (L1/L2/L3 etc) */
.seg {
  display: inline-flex;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 2px;
}
.seg-item {
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.seg-item:hover { color: var(--text); }
.seg-item.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ============================================================
   Bar chart rows
   ============================================================ */
.bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 80px;
  align-items: center;
  gap: var(--s-3);
  padding: 6px 0;
}
.bar-label {
  font-size: var(--fs-sm);
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
  height: 8px;
  background: var(--surface-sunken);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal-400), var(--teal-500));
  border-radius: var(--r-full);
}
.bar-value {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Sparkline container */
.spark {
  width: 100%;
  height: 40px;
  display: block;
}

/* ============================================================
   Empty states
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--s-10) var(--s-6);
  color: var(--text-muted);
}
.empty-state h4 {
  color: var(--text);
  font-size: var(--fs-md);
  margin: 0 0 var(--s-1);
}
.empty-state p { margin: 0; font-size: var(--fs-sm); }

/* Toast */
.toast {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: var(--navy-500);
  color: white;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
}
.toast .badge-dot { background: var(--teal-300); }

/* Avatar / letter chip */
.avatar {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: var(--teal-100);
  color: var(--teal-600);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.avatar-sq { border-radius: var(--r-sm); }

/* Kbd */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-family: var(--font-mono); font-size: 10px; font-weight: var(--fw-semibold);
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px;
  line-height: 1;
}

/* Divider */
.divider { height: 1px; background: var(--border); border: 0; margin: var(--s-4) 0; }
.v-divider { width: 1px; align-self: stretch; background: var(--border); }

/* Icon stroke helper */
.ico { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico-lg { width: 20px; height: 20px; }
.ico-sm { width: 12px; height: 12px; }

/* ============================================================
   v3 utilities
   ============================================================ */
.tbl-dense th, .tbl-dense td { padding: 6px var(--s-4); }
.tbl-dense td { font-size: var(--fs-sm); }

.live-dot {
  width: 6px; height: 6px; border-radius: var(--r-full);
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
  animation: live-pulse 2.2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.45; }
}

.hover-bg { transition: background var(--dur-fast); }
.hover-bg:hover { background: var(--hover); }


/* ============================================================
   Brand card (clients.js renderBrandCard)
   ============================================================ */
.brand-section { margin-top: var(--s-4); }
.brand-section h4 { font-size: var(--fs-sm); margin: 0 0 var(--s-2) 0; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.brand-section .brand-field-display { font-size: var(--fs-base); line-height: 1.5; }
.brand-section .empty { color: var(--text-muted); font-style: italic; }
.brand-section textarea { width: 100%; font-family: inherit; font-size: var(--fs-sm); padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-sm); resize: vertical; }
.brand-section input[type="text"] { width: 100%; padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--fs-sm); }

.brand-actions { display: flex; gap: var(--s-2); }
.brand-meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: -8px; margin-bottom: var(--s-3); }
.brand-meta .info-meta { display: inline; }

.color-swatch { display: inline-block; width: 14px; height: 14px; border-radius: var(--r-sm); border: 1px solid var(--border); vertical-align: middle; margin-right: 6px; }

.human-only-badge { font-size: var(--fs-xs); padding: 2px 6px; border-radius: var(--r-sm); background: var(--warning-bg, #fff4e0); color: var(--warning, #b25a00); font-weight: 600; margin-left: var(--s-2); text-transform: uppercase; letter-spacing: 0.04em; }

.brand-sources summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.brand-sources ul { padding-left: var(--s-4); margin: var(--s-2) 0; }
.brand-sources li { font-size: var(--fs-sm); }

/* ============================================================
   Brief modal (clients.js openGenerateBriefModal)
   ============================================================ */
.brief-modal-dialog { max-width: 720px; width: 95%; }
.brief-modal-dialog .modal-body { max-height: 75vh; overflow-y: auto; padding: 16px 24px; }

/* ============================================================
   Brief stepper — leadgen_brief_generator rec detail (PR A2)
   ============================================================ */
.brief-meta-card {
    margin-bottom: 16px;
    padding: 16px 20px;
}
.brief-meta-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--teal-dark);
}
.brief-meta-card p { margin: 4px 0; font-size: 14px; line-height: 1.5; }
.brief-meta-card details { margin-top: 8px; }
.brief-meta-card details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 0;
}
.brief-meta-card details ul { padding-left: 24px; margin: 6px 0; font-size: 13px; }
.brief-meta-topic code {
    background: var(--teal-light, #e6f3f1);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 12px;
}
.brief-sections { display: flex; flex-direction: column; gap: 16px; }

.brief-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.brief-section.is-selected {
    border-color: var(--teal-dark);
    box-shadow: 0 1px 3px rgba(20, 100, 90, 0.08);
}
.brief-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.brief-section-num {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--teal-dark);
    color: white;
    font-weight: 700;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.brief-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}
.brief-form-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #fef3c7;
    color: #78350f;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.brief-selected-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: var(--teal-light, #e6f3f1);
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
}
.brief-section-purpose {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.brief-section-compare {
    display: grid;
    gap: 12px;
}
.brief-section-compare.two-col { grid-template-columns: 1fr 1fr; }
.brief-section-compare.single-col { grid-template-columns: 1fr; }

.brief-section-col {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.brief-section-col.is-selected {
    background: var(--teal-light, #e6f3f1);
    border-color: var(--teal-dark);
}
.brief-section-col.is-empty .empty {
    margin: 12px 0;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}
.brief-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}
.brief-col-model {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.brief-col-selected {
    font-size: 12px;
    font-weight: 700;
    color: var(--teal-dark);
}

.brief-block {
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}
.brief-block:first-of-type { border-top: 0; padding-top: 0; }
.brief-block-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.brief-options { list-style: none; padding: 0; margin: 0; }
.brief-options li {
    margin: 6px 0;
    padding: 6px 8px;
    background: white;
    border-radius: 3px;
    border-left: 2px solid var(--teal-dark);
}
.brief-section-col.is-selected .brief-options li { background: white; }
.brief-opt-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--teal-dark);
    background: var(--teal-light, #e6f3f1);
    padding: 1px 6px;
    border-radius: 2px;
    margin-right: 6px;
    letter-spacing: 0.03em;
}
.brief-opt-angle {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}
.brief-opt-text {
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
}
.brief-bullets {
    list-style: disc;
    padding-left: 22px;
    margin: 4px 0 0;
}
.brief-bullets li {
    font-size: 13px;
    color: var(--text-primary);
    margin: 2px 0;
}
.brief-form-block { background: #fef9e7; padding: 8px; border-radius: 3px; margin-top: 8px; }
.brief-form-block .brief-block-label { color: #78350f; }

/* Per-column action row (PR A3 — regenerate button next to select) */
.brief-col-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.brief-col-actions .btn-sm {
    font-size: 12px;
    padding: 3px 8px;
}

/* Assemble & send bar at the bottom of the brief stepper (PR A3) */
.brief-assemble-bar {
    margin-top: 24px;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brief-assemble-ready {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--teal-dark);
}
.brief-assemble-pending {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}
.brief-assemble-btn {
    flex-shrink: 0;
    padding: 8px 16px;
}
.brief-assemble-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Assembled-brief modal (PR A3) */
.assembled-brief-dialog { max-width: 900px; width: 95%; }
.assembled-brief-dialog .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 16px 24px;
}
/* Brief generating state inside the brief modal (PR A5) */
.brief-generating {
    text-align: center;
    padding: 24px 16px 32px;
}
.brief-generating h3 {
    margin: 16px 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.brief-generating p {
    margin: 8px auto;
    max-width: 480px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}
.brief-generating-elapsed {
    margin-top: 16px !important;
    font-size: 13px;
    color: var(--teal-dark);
    font-weight: 600;
}
.brief-generating-spinner {
    margin: 0 auto;
    width: 36px; height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--teal-dark);
    border-radius: 50%;
    animation: brief-spin 0.9s linear infinite;
}
@keyframes brief-spin { to { transform: rotate(360deg); } }

.assembled-brief-textarea {
    width: 100%;
    min-height: 480px;
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    resize: vertical;
    background: #f8fafc;
    color: var(--text-primary);
}

/* Play version-history modal (playbooks.js showPlayHistory) */
.play-history-dialog { max-width: 880px; width: 95%; }
.play-history-dialog .modal-body { max-height: 70vh; overflow-y: auto; padding: 16px 24px; }
.play-history-dialog .modal-body code { font-size: 12px; }
.play-history-dialog .modal-hint {
    margin-top: 12px; font-size: 12px; color: var(--text-muted);
    font-style: italic;
}
.brief-modal-dialog form label {
  display: block;
  font-size: var(--fs-sm);
  margin-top: var(--s-3);
  color: var(--text-muted);
  font-weight: 600;
}
.brief-modal-dialog form input,
.brief-modal-dialog form select,
.brief-modal-dialog form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text);
}
.brief-modal-dialog form textarea { resize: vertical; min-height: 60px; }
.brief-modal-dialog form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brief-modal-dialog .modal-sub { color: var(--text-muted); font-size: var(--fs-sm); margin: 0 0 var(--s-3); }
.brief-modal-dialog .modal-actions {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.brief-modal-dialog .req { color: var(--danger, #dc2626); }
.brief-modal-dialog .modal-hint { display: block; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 400; margin-top: 4px; }
.brief-modal-dialog .checkbox-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--surface, #fafbfc); border: 1px solid var(--border); border-radius: var(--r-sm); margin-top: var(--s-3); cursor: pointer; }
.brief-modal-dialog .checkbox-row input[type="checkbox"] { margin: 0; width: auto; flex-shrink: 0; margin-top: 3px; }
.brief-modal-dialog .checkbox-row span { flex: 1; }
.brief-modal-dialog .checkbox-row strong { display: block; font-weight: 600; color: var(--text); }

/* (Full-LP rec stepper styles removed — the leadgen_full_lp_generation
   play was retired in favour of the export-design-folder workflow. The
   LP rec stepper UI it powered is gone too; see widget/app.js.) */

/* ── Acquisition guided step rail (project detail) ───────────────────────────
   Two-column detail body: main content + a sticky right rail showing the current
   phase rec's ordered steps (status · role · wired action) + a phase tracker. */
/* Fills the detail view's bounded height (flex:1 + min-height:0) so BOTH columns scroll
   internally — the content keeps its own overflow:auto, the rail gets its own. Wrapping the
   content-area must not break the height chain, or content clips under the overflow:hidden
   ancestor. */
.acq-detail-body { display: flex; gap: var(--s-5); align-items: stretch; flex: 1; min-height: 0; }
.acq-detail-body > .content-area { flex: 1 1 auto; min-width: 0; }
.acq-step-rail {
    flex: 0 0 280px; min-width: 0; overflow-y: auto; align-self: stretch;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); padding: var(--s-4); margin: 0 24px 16px 0;
}
.acq-step-rail:empty { display: none; }
.acq-rail-title { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-muted); margin: 0 0 var(--s-3); }

/* phase tracker */
.acq-phase-track { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-4); }
.acq-phase-pip { font-size: var(--fs-xs); font-weight: 600; padding: 3px 8px;
    border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted);
    cursor: pointer; background: var(--bg); white-space: nowrap; }
.acq-phase-pip.done { color: var(--success); border-color: var(--success); }
.acq-phase-pip.current { color: #fff; background: #3b7d74; border-color: #3b7d74; }

/* steps */
.acq-rail-prog { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--s-3); }
.acq-rail-step { display: flex; gap: 8px; padding: var(--s-2) 0; border-top: 1px solid var(--border); }
.acq-rail-step:first-of-type { border-top: none; }
.acq-rail-ico { flex: 0 0 16px; font-size: 13px; line-height: 1.5; }
.acq-rail-ico.done { color: var(--success); }
.acq-rail-ico.current { color: #3b7d74; }
.acq-rail-ico.skipped { color: var(--text-muted); }
.acq-rail-ico.pending { color: var(--border); }
.acq-rail-main { flex: 1 1 auto; min-width: 0; }
.acq-rail-step-title { font-size: var(--fs-sm); line-height: 1.35; }
.acq-rail-step.done .acq-rail-step-title { color: var(--text-muted); }
.acq-rail-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.acq-rail-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px;
    background: var(--bg); border: 1px solid var(--border); color: var(--text-muted); }
.acq-rail-tag.role { color: #3b7d74; border-color: #3b7d74; }
.acq-rail-act { margin-top: 5px; }
.acq-rail-act .btn-sm { font-size: 11px; padding: 2px 8px; }
.acq-rail-empty { font-size: var(--fs-xs); color: var(--text-muted); }

/* On phone-ish widths the guided-steps rail is too dense + buried the content, so HIDE it —
   the phase tabs + cards carry the flow on mobile; the rail is a desktop power-user aid. */
@media (max-width: 760px) {
    .acq-detail-body { flex-direction: column; min-height: 0; }
    .acq-step-rail { display: none; }
    .acq-detail-body > .content-area { flex: 1 1 auto; min-width: 0; }
}

/* ── Canonical 5-phase FLOW RAIL + cards (GET /flow-state) ───────────────────── */
/* Colour buckets shared by the horizontal rail, the Overview cards, and list chips. */
.acq-flow-rail { margin: 0 0 var(--s-3); }
.acq-flow-rail-msg { font-size: var(--fs-sm); color: var(--text-muted);
    padding: var(--s-3) var(--s-4); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-md); }
.acq-flow-steps { display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4); }
.acq-flow-conn { flex: 1 1 12px; height: 2px; min-width: 12px; background: var(--border); }
.acq-flow-step { display: flex; align-items: center; gap: 7px; padding: 5px 10px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--bg);
    cursor: pointer; white-space: nowrap; font: inherit; }
.acq-flow-step:hover { border-color: var(--border-strong); }
.acq-flow-step.current { border-color: var(--teal-500); box-shadow: 0 0 0 2px var(--teal-100); }
.acq-flow-step.is-locked { opacity: .55; }
.acq-flow-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--neutral); flex: 0 0 auto; }
.acq-flow-step.good .acq-flow-dot { background: var(--success); }
.acq-flow-step.run  .acq-flow-dot { background: var(--info); }
.acq-flow-step.attn .acq-flow-dot { background: var(--warning); }
.acq-flow-step.bad  .acq-flow-dot { background: var(--danger); }
.acq-flow-step.lock .acq-flow-dot { background: var(--border-strong); }
.acq-flow-step-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.acq-flow-chip { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
    border: 1px solid transparent; white-space: nowrap; }
.acq-flow-chip.good { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.acq-flow-chip.run  { background: var(--info-bg);    color: var(--info);    border-color: var(--info-border); }
.acq-flow-chip.attn { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.acq-flow-chip.bad  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-border); }
.acq-flow-chip.lock { background: var(--surface-sunken); color: var(--text-muted); border-color: var(--border); }
.acq-flow-primary { display: flex; align-items: center; gap: 10px; margin-top: var(--s-3);
    flex-wrap: wrap; }
.acq-flow-primary-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase;
    letter-spacing: .03em; color: var(--text-muted); }

/* Overview phase cards */
.acq-flow-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--s-4); margin-bottom: var(--s-4); }
.acq-flow-card { border-left: 3px solid var(--border); }
.acq-flow-card.good { border-left-color: var(--success); }
.acq-flow-card.run  { border-left-color: var(--info); }
.acq-flow-card.attn { border-left-color: var(--warning); }
.acq-flow-card.bad  { border-left-color: var(--danger); }
.acq-flow-card.lock { border-left-color: var(--border-strong); opacity: .82; }
.acq-flow-card.current { box-shadow: 0 0 0 2px var(--teal-100); }
.acq-flow-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acq-flow-card-head h4 { margin: 0; font-size: var(--fs-sm); }
.acq-flow-cur-tag { font-size: 10px; font-weight: 600; color: var(--teal-600); }
.acq-flow-facts { margin: 8px 0 0; display: flex; flex-direction: column; gap: 2px; }
.acq-flow-fact { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); }
.acq-flow-fact .k { color: var(--text-muted); text-transform: capitalize; }
.acq-flow-fact .v { color: var(--text); font-weight: 500; text-align: right; }
.acq-flow-blockers { margin: 8px 0 0; padding-left: 18px; font-size: var(--fs-xs); color: var(--warning); }
.acq-flow-blockers li { margin: 2px 0; }
.acq-flow-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.acq-flow-link { font-size: var(--fs-xs); color: var(--teal-600); cursor: pointer; }
.acq-flow-link:hover { text-decoration: underline; }
.acq-flow-card-cta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* List-row flow cell */
.acq-flow-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.acq-flow-cell-phase { font-size: var(--fs-sm); font-weight: 600; }
.acq-flow-cell-next { font-size: var(--fs-xs); color: var(--text-muted);
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
    .acq-flow-steps { gap: 6px; }
    .acq-flow-conn { display: none; }
}

/* ─── NAV_V2 — rail-as-navigation phase workspaces ─────────────────────────── */
.acq-flow-step.selected { background: var(--surface-sunken); border-color: var(--border-strong); }
.acq-nav-switch { cursor: pointer; text-decoration: underline; color: var(--text-muted); }
.acq-nav-switch:hover { color: var(--text); }

.acq-ws-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.acq-ws-head h2 { margin: 0; font-size: var(--fs-lg, 18px); }
.acq-ws-sub { flex-basis: 100%; font-size: var(--fs-sm); color: var(--text-muted); }

.acq-ws-sec { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px;
    background: var(--surface, #fff); }
.acq-ws-sec-head { display: flex; width: 100%; align-items: center; gap: 8px; padding: 10px 14px;
    background: none; border: 0; cursor: pointer; font: inherit; font-weight: 600;
    text-align: left; color: var(--text); }
.acq-ws-sec-head:hover { background: var(--surface-sunken); border-radius: 8px; }
.acq-ws-caret { margin-left: auto; color: var(--text-muted); transition: transform .15s; }
.acq-ws-sec.open > .acq-ws-sec-head .acq-ws-caret { transform: rotate(90deg); }
.acq-ws-sec-body { display: none; padding: 2px 12px 12px; }
.acq-ws-sec.open > .acq-ws-sec-body { display: block; }
.acq-ws-sec-body > .content-card { box-shadow: none; border: 0; padding: 4px 0 0; margin: 0 0 10px; }

.acq-ws-locked { border-left: 3px solid var(--border-strong); }
.acq-ws-locked h3 { margin-top: 0; }
.acq-ws-done { border-left: 3px solid var(--success); }

/* Assistant drawer — persistent panel; NO backdrop, so the rail stays visible and
   interactive while the conversation is open. */
.acq-assist-drawer { position: fixed; top: 0; right: -500px; width: 460px; max-width: 94vw;
    height: 100%; background: var(--surface, #fff); box-shadow: -8px 0 24px rgba(0,0,0,.18);
    z-index: 70; display: flex; flex-direction: column; transition: right .2s ease; }
.acq-assist-drawer.open { right: 0; }
.acq-assist-head { display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.acq-assist-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px; }
.acq-assist-body .acq-conv { display: flex; flex-direction: column; height: 100%; min-height: 0;
    margin: 0; }
.acq-assist-body .conv-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#acq-assist-btn strong { color: var(--danger); }

/* ── Structured entity-relationships editor ─────────────────────────────────── */
.ent-bucket { margin-top: 14px; }
.ent-bucket-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ent-bucket-head strong { font-size: var(--fs-sm); }
.ent-tip { cursor: help; width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid var(--border);
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-style: italic; font-weight: 700; color: var(--text-muted); }
.ent-bucket-head .btn-sm { margin-left: auto; font-size: 11px; padding: 2px 8px; }
.ent-rows { display: flex; flex-direction: column; gap: 6px; }
.ent-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ent-row .input { font-size: 12px; padding: 4px 7px; }
.ent-row .ent-name { flex: 1 1 150px; }
.ent-row .ent-detail { flex: 1 1 180px; }
.ent-row .ent-url { flex: 1 1 150px; }
.ent-row .ent-source { flex: 0 0 92px; }
.ent-row .ent-del { flex: 0 0 auto; padding: 2px 9px; line-height: 1.2; }

/* ── Authors (E-E-A-T) editor ───────────────────────────────────────────────── */
.auth-card { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px;
    margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.auth-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.auth-grid .input { flex: 1 1 160px; }
.auth-card .input { font-size: 12px; padding: 4px 7px; }
.auth-card textarea.input { resize: vertical; }
.auth-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

/* ── Structured artifact form primitives (canonical / audience) ─────────────── */
.fld-label { display: block; margin: 10px 0 3px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.fld-block { margin-top: 4px; }
.sl-list, .ol-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.sl-row { display: flex; gap: 6px; align-items: center; }
.sl-row .sl-val { flex: 1 1 auto; }
.sl-del { flex: 0 0 auto; padding: 2px 9px; }
.ol-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ol-row .input { flex: 1 1 150px; font-size: 12px; padding: 4px 7px; }
.fld-block .input, #art-edit-canonical_definition .input { font-size: 12px; padding: 4px 7px; }

/* ── Audience & positioning editor ──────────────────────────────────────────── */
.fld-section { margin: 14px 0 4px; font-size: var(--fs-sm); font-weight: 700; }
.aud-seg { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 8px; }
.aud-seg > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-sm); }
.aud-positioning { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.proof-row .input { flex: 1 1 130px; }

/* ── Page metadata table ────────────────────────────────────────────────────── */
.pm-table td { vertical-align: top; }
.pm-table .input { font-size: 12px; padding: 4px 6px; width: 100%; }
.pm-table th:nth-child(2), .pm-table th:nth-child(4) { min-width: 130px; }

/* ─── Process Workbench (Projects → ⚙ Process) ──────────────────────────────── */
/* Two-column workbench: the step chain on the left, a vertically split detail
   pane on the right (identity/play on top, the run surface underneath). */
.acq-wb-navbtn { font-weight: 600; }
.acq-wb-headbar { flex-basis: 100%; display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; margin-top: 6px; }
.acq-wb-scope { display: inline-flex; align-items: center; gap: 6px; }
.acq-wb-scope select { font: inherit; font-size: var(--fs-sm); padding: 3px 6px;
    border: 1px solid var(--border); border-radius: var(--r-sm, 6px); background: var(--surface, #fff);
    max-width: 380px; }
.acq-wb-dry { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); }

.acq-wb-body { display: flex; gap: 12px; align-items: flex-start; }
.acq-wb-rail { flex: 0 0 300px; max-width: 300px; max-height: 74vh; overflow: auto;
    border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff);
    padding: 6px; }
.acq-wb-rail:focus-visible { outline: 2px solid var(--teal-500, #0d9488); outline-offset: 1px; }
.acq-wb-panes { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.acq-wb-pane-top, .acq-wb-pane-bottom { min-width: 0; }

.acq-wb-phase { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-muted); padding: 8px 6px 3px; }
.acq-wb-railtools { display: flex; gap: 6px; align-items: center; padding: 2px 4px 6px;
    border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.acq-wb-railtools .info-meta { flex: 1 1 auto; }
/* Collapsible phase group header — a 70-step chain is a map, not a scroll. */
.acq-wb-phase-btn { display: flex; width: 100%; gap: 6px; align-items: center;
    text-align: left; background: none; border: 1px solid transparent; border-radius: 6px;
    font: inherit; cursor: pointer; position: sticky; top: 0; z-index: 1;
    background: var(--surface, #fff); }
.acq-wb-phase-btn:hover { background: var(--surface-sunken); }
.acq-wb-phase-btn:focus-visible { outline: 2px solid var(--teal-500, #0d9488); outline-offset: 1px; }
.acq-wb-phase-btn.open { color: var(--text); }
.acq-wb-caret { flex: 0 0 auto; font-size: 10px; }
.acq-wb-phase-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; }
.acq-wb-phase-meta { flex: 0 0 auto; display: flex; gap: 4px; align-items: center;
    font-weight: 600; text-transform: none; letter-spacing: 0; }
.acq-wb-step { display: flex; width: 100%; gap: 8px; align-items: flex-start; text-align: left;
    padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: none;
    font: inherit; cursor: pointer; }
.acq-wb-step:hover { background: var(--surface-sunken); }
.acq-wb-step.selected { background: var(--surface-sunken); border-color: var(--border-strong); }
.acq-wb-step:focus-visible { outline: 2px solid var(--teal-500, #0d9488); outline-offset: 1px; }
.acq-wb-step .acq-flow-dot { margin-top: 5px; }
.acq-wb-step .acq-flow-dot.good { background: var(--success); }
.acq-wb-step .acq-flow-dot.run  { background: var(--info); }
.acq-wb-step .acq-flow-dot.bad  { background: var(--danger); }
.acq-wb-step .acq-flow-dot.lock { background: var(--border-strong); }
.acq-wb-step-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acq-wb-step-label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.acq-wb-step-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.acq-wb-chip { font-size: 10px; font-weight: 600; padding: 0 6px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-muted); background: var(--surface-sunken); }
.acq-wb-chip.play { color: var(--teal-600, #0f766e); border-color: var(--teal-100, #ccfbf1); }
.acq-wb-chip.det  { color: var(--text-muted); }
.acq-wb-chip.ver  { font-family: var(--font-mono, monospace); }
.acq-wb-run { font-size: 10px; font-weight: 600; }
.acq-wb-run.good { color: var(--success); }
.acq-wb-run.run  { color: var(--info); }
.acq-wb-run.bad  { color: var(--danger); }
.acq-wb-run.lock { color: var(--text-muted); }
/* AMBER IS RESERVED FOR EVIDENCE. `stale` means we can demonstrate the output is
   behind (older play version / upstream ran later / the prompt changed after it
   was produced). Everything else that merely lacks provenance is `unverified`
   and reads GREY — it is the normal state of every pre-workbench artifact, not a
   problem to fix. When every step was amber, amber meant nothing. */
.acq-wb-stale { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px;
    background: var(--warning-bg, #fef3c7); color: var(--warning, #92400e);
    border: 1px solid var(--warning-border, #fde68a); cursor: help; }
.acq-wb-unverified { font-size: 10px; font-weight: 600; padding: 0 6px; border-radius: 999px;
    background: var(--surface-sunken); color: var(--text-muted);
    border: 1px solid var(--border); cursor: help; }
/* `running` — an attempt is IN FLIGHT (the run row is written when a step
   STARTS, not when it finishes). Blue, not amber: nothing is wrong, something is
   happening. `interrupted` — an attempt started and was killed before it could
   finish (edge timeout, container replaced mid-request). RED, and deliberately
   louder than `failed`, because this is the state that used to render as an
   ABSENCE: the step looked like it had never been attempted at all. */
.acq-wb-running { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px;
    background: var(--info-bg, #dbeafe); color: var(--info, #1e40af);
    border: 1px solid var(--info-border, #bfdbfe); cursor: help; }
.acq-wb-interrupted { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px;
    background: var(--danger-bg, #fee2e2); color: var(--danger, #991b1b);
    border: 1px solid var(--danger-border, #fecaca); cursor: help; }

/* Step reference — the copyable "cite this exact point in the process" chip. */
.acq-wb-ref { display: inline-flex; align-items: center; gap: 4px; }
.acq-wb-ref code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px;
    background: var(--surface-sunken); border: 1px solid var(--border);
    border-radius: 4px; padding: 1px 5px; color: var(--text); user-select: all; }
.acq-wb-ref input { font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px;
    border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; width: 22em; }
.acq-wb-ref .acq-wb-copied { font-size: 10px; font-weight: 600; color: var(--success); }

.acq-wb-specs { display: flex; flex-direction: column; gap: 6px; }
.acq-wb-spec { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.acq-wb-spec .k { flex: 0 0 92px; color: var(--text-muted); font-weight: 600; }
.acq-wb-spec .v { flex: 1 1 auto; min-width: 0; }

/* Snapshot / prompt viewers — collapsed by default, painted in windows. */
.acq-wb-snap { border: 1px solid var(--border); border-radius: 6px; margin-top: 8px; }
.acq-wb-snaphead { display: flex; width: 100%; align-items: center; gap: 4px; padding: 6px 10px;
    background: none; border: 0; font: inherit; font-weight: 600; font-size: var(--fs-sm);
    cursor: pointer; text-align: left; color: var(--text); }
.acq-wb-snaphead:hover { background: var(--surface-sunken); border-radius: 6px; }
.acq-wb-snaphead.open .acq-ws-caret { transform: rotate(90deg); }
.acq-wb-snaphead-static { padding: 6px 10px; }
.acq-wb-snapbody { padding: 0 10px 8px; }
.acq-wb-pre { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px;
    line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin: 0;
    max-height: 420px; overflow: auto; background: var(--surface-sunken); padding: 8px;
    border-radius: 6px; }
.acq-wb-pre.short { max-height: 180px; }
.acq-wb-more { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acq-wb-editor { width: 100%; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; }
.acq-wb-newver summary { cursor: pointer; list-style: none; }

.acq-wb-runpick { margin: 4px 0 8px; }
.acq-wb-vactive { background: var(--success-bg, #ecfdf5); }
.acq-wb-banner { border-left: 3px solid var(--warning, #d97706); background: var(--warning-bg, #fffbeb); }
.acq-wb-nodata { border-left: 3px solid var(--border-strong); }
.acq-wb-result { border-left: 3px solid var(--info, #2563eb); }
.acq-wb-dryban { font-size: var(--fs-xs); font-weight: 700; color: var(--info, #1d4ed8);
    background: var(--info-bg, #eff6ff); border: 1px solid var(--info-border, #bfdbfe);
    border-radius: 6px; padding: 4px 8px; margin-bottom: 8px; display: inline-block; }
.acq-wb-diffpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

@media (max-width: 900px) {
    .acq-wb-body { flex-direction: column; }
    .acq-wb-rail { flex: 1 1 auto; max-width: none; width: 100%; max-height: 40vh; }
    .acq-wb-diffpair { grid-template-columns: 1fr; }
}

/* ── Projects LITE (audit + operator inputs; Claude Code orchestrates) ────── */
.prl-row{cursor:pointer}
.prl-row:hover{background:var(--surface-hover,#f6f4ef)}
.prl-dim{color:var(--text-muted,#6E675D);font-size:.85rem}
.prl-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:6px 0}
.prl-head-links{display:flex;gap:14px}
.prl-link{color:var(--red,#CE1B0C);cursor:pointer;font-size:.9rem;text-decoration:none}
.prl-link:hover{text-decoration:underline}
.prl-rail{display:flex;gap:6px;padding:8px 0;flex-wrap:wrap}
.prl-phase{padding:7px 14px;border-radius:999px;cursor:pointer;border:1px solid var(--sand,#E6E0D2);font-size:.9rem;color:var(--ink,#221F1C)}
.prl-phase.is-on{background:var(--ink,#221F1C);color:#fff;border-color:var(--ink,#221F1C)}
.prl-dot-done{color:#2e7d32}.prl-dot-in_progress{color:#b26a00}.prl-dot-todo{color:#bbb}
.prl-step{display:flex;align-items:center;gap:10px;padding:7px 4px;border-bottom:1px solid var(--cream-200,#F2EEE4);cursor:pointer}
.prl-step:hover{background:var(--cream-200,#F2EEE4)}
.prl-step-label{flex:1;font-size:.92rem}
.prl-chip{font-size:.72rem;font-weight:700;padding:2px 8px;border-radius:6px;background:#eee;color:#555;text-transform:uppercase;letter-spacing:.03em}
.prl-chip-current,.prl-chip-ok,.prl-chip-completed{background:#e5f2e6;color:#2e7d32}
.prl-chip-stale{background:#fdf0dc;color:#b26a00}
.prl-chip-failed,.prl-chip-interrupted{background:#fdecea;color:#c62828}
.prl-chip-unverified,.prl-chip-backfilled{background:#eceff1;color:#607d8b}
.prl-chip-retired{background:#f1efe9;color:#8a8478;text-decoration:line-through}
.prl-step-off{cursor:default;opacity:.75}
.prl-scope{margin:0 0 8px;font-size:.85rem}
.prl-step-detail{margin-top:14px;border-top:2px solid var(--cream-200,#F2EEE4);padding-top:10px}
.prl-run{display:flex;gap:10px;align-items:center;padding:3px 0;font-size:.88rem}
.prl-json summary{cursor:pointer;color:var(--red,#CE1B0C);font-size:.85rem;margin:6px 0}
.prl-json pre{background:var(--cream-50,#faf8f3);border:1px solid var(--sand,#E6E0D2);border-radius:8px;padding:10px;font-size:.75rem;max-height:420px;overflow:auto;white-space:pre-wrap}
.prl-ta{width:100%;box-sizing:border-box;margin:6px 0;font-size:.85rem}

/* Projects LITE — build cost card */
.prl-scroll { overflow-x: auto; }
.prl-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.prl-table th, .prl-table td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--border-color, #e2e2e2); }
.prl-table td:nth-child(n+2), .prl-table th:nth-child(n+2) { text-align: right; }

/* Projects LITE — design system + section library (2b v2 surfaces). These tables are
   text, not numbers, so they opt OUT of the cost card's right-aligned columns. */
.prl-table.prl-left td, .prl-table.prl-left th { text-align: left; }
.prl-swatches { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
                font-size: .8rem; margin: 6px 0 10px; }
.prl-swatch { white-space: nowrap; }
/* Figma route: per-page status table (projects-lite.js prFigmaStatusHtml) */
.prl-chip-ready{background:#2e7d32;color:#fff}
.prl-chip-never_run{background:#f1efe9;color:#8a8478}
.prl-fs{min-width:720px}
.prl-fs td{vertical-align:top}
.prl-fs-url{word-break:break-all;max-width:260px}
.prl-fs-blocked td{background:#fdf6f5}
.prl-fs-blk summary{cursor:pointer;white-space:nowrap}
.prl-fs-blk ul{margin:6px 0 0;padding-left:16px;max-width:360px;white-space:normal}
.prl-fs-blk li{margin-bottom:4px}
