/* ═══════════════════════════════════════════════════════════════
   AgencyOS — workspace-v5.css
   V5 Blue Project Detail shell: header card (back button, title, meta
   badges, actions) and the numbered process rail. Presentation only —
   scoped to #viewWorkspace; markup, handlers and tab gating untouched.
   Tokens come from settings-v5.css (--st-*).
   ═══════════════════════════════════════════════════════════════ */
body #viewWorkspace { --wv-line: var(--st-line, #cddfe4); --wv-surface: var(--st-surface, #fff); --wv-surface-2: var(--st-surface-2, #e3f0f3); --wv-ink: var(--st-ink, #17252b); --wv-muted: var(--st-muted, #566a73); --wv-a: var(--st-primary, #167da0); --wv-b: var(--st-primary-2, #24aa9f); --wv-soft: var(--st-soft, #deeff7); }

/* header card */
body #viewWorkspace .workspace-header.page-header {
  margin: 24px 24px 12px; padding: 16px 20px; border: 1px solid var(--wv-line); border-radius: 18px;
  background: radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--wv-b) 14%, transparent), transparent 40%), linear-gradient(135deg, var(--wv-surface), color-mix(in srgb, var(--wv-soft) 70%, var(--wv-surface)));
  box-shadow: var(--st-shadow, 0 14px 40px rgba(21, 82, 101, .12)); color: var(--wv-ink);
}
body #viewWorkspace .ws-header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 58px; padding: 0; border: 0; background: none; }
body #viewWorkspace .ws-header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
body #viewWorkspace .breadcrumb-root-link {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: color-mix(in srgb, var(--wv-a) 10%, var(--wv-surface)); color: var(--wv-a); font-size: 0; cursor: pointer; transition: background-color .15s ease, transform .15s ease;
}
body #viewWorkspace .breadcrumb-root-link::before { content: "←"; font-size: 20px; font-weight: 700; line-height: 1; }
body #viewWorkspace .breadcrumb-root-link:hover { background: color-mix(in srgb, var(--wv-a) 18%, var(--wv-surface)); transform: translateX(-1px); }
body #viewWorkspace .ws-header-divider { display: none; }
body #viewWorkspace .ws-project-identity { display: grid; gap: 6px; min-width: 0; }
body #viewWorkspace .ws-project-name { margin: 0; color: var(--wv-ink); font-size: 22px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body #viewWorkspace .ws-project-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body #viewWorkspace .ws-id-chip { color: var(--wv-muted); font-size: 13px; font-weight: 600; }
body #viewWorkspace .ws-id-dot { display: none; }
body #viewWorkspace #wsHeaderStack, body #viewWorkspace #wsHeaderPhase {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--wv-a) 40%, var(--wv-line)); border-radius: 7px;
  background: color-mix(in srgb, var(--wv-a) 9%, var(--wv-surface)); color: var(--wv-a); font-size: 11.5px; font-weight: 700;
}
body #viewWorkspace .ws-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
body #viewWorkspace .ws-header-right .action-btn.ghost, body #viewWorkspace .ws-header-right .rp-mobile-trigger {
  height: 40px; padding: 0 14px; border: 1px solid var(--wv-line); border-radius: 11px; background: var(--wv-surface); color: var(--wv-ink); font-size: 13px; font-weight: 600;
}
body #viewWorkspace .ws-header-right .action-btn.ghost:hover { border-color: color-mix(in srgb, var(--wv-a) 50%, var(--wv-line)); color: var(--wv-a); }
body #viewWorkspace .ws-header-right .pv5-wsbtn { height: 40px; border-radius: 11px; }

/* process rail (the real, clickable workflow tab strip) */
body #viewWorkspace .workspace-tabs.page-toolbar {
  counter-reset: wv-step; display: flex; align-items: stretch; gap: 0; height: 78px; margin: 0 24px 16px; padding: 0; overflow: hidden;
  border: 1px solid var(--wv-line); border-radius: 18px; background: var(--wv-surface); box-shadow: var(--st-shadow, 0 14px 40px rgba(21, 82, 101, .12));
}
body #viewWorkspace .workspace-tabs .tab-btn {
  counter-increment: wv-step; position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 11px; height: auto; padding: 0 16px; margin: 0;
  border: 0; border-right: 1px solid var(--wv-line); border-radius: 0; background: transparent; color: var(--wv-ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease;
}
body #viewWorkspace .workspace-tabs .tab-btn:last-child { border-right: 0; }
body #viewWorkspace .workspace-tabs .tab-btn > svg { display: none; }
body #viewWorkspace .workspace-tabs .tab-btn::before {
  content: counter(wv-step); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: color-mix(in srgb, var(--wv-a) 10%, var(--wv-surface)); color: var(--wv-muted); font-size: 11px; font-weight: 800;
}
body #viewWorkspace .workspace-tabs .tab-btn:hover { background: color-mix(in srgb, var(--wv-a) 5%, var(--wv-surface)); color: var(--wv-ink); }
body #viewWorkspace .workspace-tabs .tab-btn.active { background: linear-gradient(135deg, var(--wv-soft), color-mix(in srgb, var(--wv-b) 22%, var(--wv-surface))); color: var(--wv-ink); box-shadow: none; }
body #viewWorkspace .workspace-tabs .tab-btn.active::before { background: linear-gradient(135deg, var(--wv-a), var(--wv-b)); color: #fff; }
body #viewWorkspace .workspace-tabs .tab-btn.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; top: auto; width: auto; height: 4px; border-radius: 4px 4px 0 0; background: linear-gradient(90deg, var(--wv-a), var(--wv-b)); }
body #viewWorkspace .workspace-tabs .tab-btn:focus-visible { outline: 2px solid var(--wv-a); outline-offset: -3px; }
body #viewWorkspace .workspace-tabs .tab-lock-icon { margin-left: auto; }
body #viewWorkspace .workspace-tabs .tab-audit-badge { margin-left: auto; }

@media (max-width: 900px) {
  body #viewWorkspace .workspace-header.page-header, body #viewWorkspace .workspace-tabs.page-toolbar { margin-left: 12px; margin-right: 12px; }
  body #viewWorkspace .workspace-tabs.page-toolbar { overflow-x: auto; }
  body #viewWorkspace .workspace-tabs .tab-btn { flex: 0 0 auto; min-width: 150px; }
}

/* narrow content column (right panel open): let the header wrap and tighten the rail */
body #viewWorkspace .ws-header-row { flex-wrap: wrap; row-gap: 12px; }
body #viewWorkspace .ws-header-left { flex: 1 1 260px; }
body #viewWorkspace .ws-header-right { flex: 0 1 auto; }
body #viewWorkspace .workspace-tabs .tab-btn { gap: 8px; padding: 0 10px; white-space: nowrap; }
body #viewWorkspace .workspace-tabs .tab-btn::before { width: 24px; height: 24px; font-size: 10.5px; }
body #viewWorkspace .workspace-tabs .tab-lock-icon { margin-left: 2px; }
body #viewWorkspace .workspace-tabs .tab-audit-badge { margin-left: 2px; }
body #viewWorkspace .workspace-tabs .tab-btn { overflow: hidden; }
body #viewWorkspace .workspace-header.page-header { height: auto; min-height: 0; max-height: none; overflow: visible; flex: 0 0 auto; }
body #viewWorkspace .ws-header-right { width: 100%; justify-content: flex-start; }
body #viewWorkspace .claude-usage-topbar { margin-top: 12px; }
body #viewWorkspace .ws-header-row { height: auto; border-bottom: 0; }
body #viewWorkspace .claude-usage-topbar { flex: 0 0 auto; justify-content: flex-start; padding: 0; overflow: visible; border-top: 1px solid var(--wv-line); padding-top: 10px; }
body #viewWorkspace .claude-usage-topbar:empty { display: none; }

/* ── content tokens: remap the legacy palette inside the project view to the V5 tokens ── */
body #viewWorkspace {
  --bg-base: var(--st-bg); --bg-elevated: var(--st-surface); --bg-hover: var(--st-surface-2); --bg-overlay: var(--st-surface); --bg-modal: var(--st-surface); --bg-active: var(--st-soft);
  --border-subtle: var(--st-line); --border-muted: var(--st-line); --border-accent: var(--st-line);
  --text-primary: var(--st-ink); --text-secondary: var(--st-ink); --text-muted: var(--st-muted);
  --cyan: var(--st-primary); --cyan-dim: color-mix(in srgb, var(--st-primary) 12%, transparent); --cyan-glow: color-mix(in srgb, var(--st-primary) 25%, transparent);
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px;
  --border: var(--st-line); --border-default: var(--st-line); --border-strong: var(--st-line);
  --surface-1: var(--st-surface); --surface-2: var(--st-surface-2); --surface-3: var(--st-surface-2);
  --bg-secondary: var(--st-surface); --bg-tertiary: var(--st-surface-2); --text: var(--st-ink); --muted: var(--st-muted);
  background: var(--st-bg); color: var(--st-ink); font-family: var(--app-font, Inter, 'Outfit', system-ui, sans-serif);
}
body #viewWorkspace .main-area, body #viewWorkspace .tab-content-area { background: var(--st-bg); }
body #viewWorkspace #rightPanel, body #viewWorkspace .right-panel { background: var(--st-surface); border-left: 1px solid var(--st-line); }
body #viewWorkspace .tab-panel-inner { padding: 4px 24px 32px; }
body #viewWorkspace .action-btn { border-radius: 11px; font-weight: 600; }
body #viewWorkspace .action-btn.primary { border-color: transparent; background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)); color: #fff; font-weight: 700; box-shadow: 0 8px 20px color-mix(in srgb, var(--st-primary) 24%, transparent); }

/* ── tab content frame, section headers, action buttons ── */
body #viewWorkspace .tab-panel-inner { padding: 4px 24px 32px; box-sizing: border-box; }
body #viewWorkspace .section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px solid var(--st-line); }
body #viewWorkspace .section-title { margin: 0; color: var(--st-ink); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
body #viewWorkspace .section-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body #viewWorkspace .inline-btn, body #viewWorkspace .section-meta .inline-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--st-line) !important; border-radius: 10px;
  background: var(--st-surface) !important; color: var(--st-ink) !important; font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
body #viewWorkspace .inline-btn:hover { border-color: color-mix(in srgb, var(--st-primary) 55%, var(--st-line)) !important; color: var(--st-primary) !important; }
body #viewWorkspace .inline-btn.amber { color: #b7791f !important; border-color: color-mix(in srgb, #d29922 45%, var(--st-line)) !important; background: color-mix(in srgb, #d29922 8%, var(--st-surface)) !important; }
body #viewWorkspace #sendToClientBtn { border-color: transparent !important; background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)) !important; color: #fff !important; font-weight: 700; box-shadow: 0 8px 20px color-mix(in srgb, var(--st-primary) 22%, transparent); }
body #viewWorkspace #sendToClientBtn:hover { color: #fff !important; }
body #viewWorkspace .hp-approval-details > summary { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px dashed var(--st-line); border-radius: 10px; color: var(--st-muted); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
body #viewWorkspace .hp-status-badge { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border: 1px solid var(--st-line); border-radius: 999px; background: var(--st-surface-2); color: var(--st-muted); font-size: 12px; font-weight: 700; }

/* polish */
body #viewWorkspace .tab-panel, body #viewWorkspace .tab-content-area.page-content { background: transparent; }
body #viewWorkspace .tab-content-area { padding-top: 4px; }
body #viewWorkspace .tab-panel-inner { padding-top: 8px; }
body #viewWorkspace .claude-usage-topbar { margin-top: 4px; }
body #viewWorkspace .audit-step, body #viewWorkspace .dv-card, body #viewWorkspace .deploy-card { border-radius: 14px; }
body #viewWorkspace .audit-header, body #viewWorkspace .wa-header { font-family: inherit; }
body #viewWorkspace .audit-progress-label, body #viewWorkspace [class*="audit"] [class*="count"] { font-family: inherit; letter-spacing: 0; }

/* eight tabs in the narrow column: tighten */
body #viewWorkspace .workspace-tabs .tab-btn { gap: 6px; padding: 0 8px; font-size: 11.5px; }
body #viewWorkspace .workspace-tabs .tab-btn::before { width: 22px; height: 22px; font-size: 10px; }
body #viewWorkspace .workspace-tabs .tab-lock-icon { display: none; }
body #viewWorkspace .workspace-tabs .tab-audit-badge { padding: 0 5px; font-size: 10px; margin-left: 0; }
body #viewWorkspace .tab-btn.tab-locked::before { opacity: .6; }
/* brief hero + read-brief shell */
body #viewWorkspace #tab-brief .brief-hero, body #viewWorkspace #briefHero { border-radius: 18px; border: 1px solid var(--st-line); box-shadow: var(--st-shadow); }
body #viewWorkspace #tab-brief .brief-editable-textarea { min-height: 220px; padding: 14px 16px; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface); color: var(--st-ink); font: inherit; font-size: 14.5px; line-height: 1.6; }
body #viewWorkspace #tab-brief .brief-editable-textarea:focus { outline: none; border-color: var(--st-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-primary) 13%, transparent); }
body #viewWorkspace #tab-brief .field-label { color: var(--st-muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
body #viewWorkspace #tab-brief .panel-two-col { display: block; }
body #viewWorkspace #tab-brief .brief-sidebar { margin-top: 16px; }

/* header: identity left, actions right on one row (wraps only when the column is narrow) */
body #viewWorkspace .ws-header-row { flex-wrap: nowrap; align-items: center; }
body #viewWorkspace .ws-header-left { flex: 1 1 0; min-width: 0; }
body #viewWorkspace .ws-header-right { width: auto; flex: 0 1 auto; flex-wrap: nowrap; justify-content: flex-end; }
body #viewWorkspace .ws-header-right > * { flex: none; }
body #viewWorkspace .ws-version-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--st-line); border-radius: 999px; background: var(--st-surface-2); color: var(--st-muted); font-size: 12px; font-weight: 700; }
@media (max-width: 1100px) {
  body #viewWorkspace .ws-header-row { flex-wrap: wrap; }
  body #viewWorkspace .ws-header-left { flex: 1 1 100%; }
  body #viewWorkspace .ws-header-right { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
}

/* ── Brief tab: Project Brief header, build-awareness hero, step rail and step panel ── */
body #viewWorkspace #tab-brief .brief-main > .section-header .section-title { font-size: 22px; }
body #viewWorkspace #tab-brief #briefReadBtn { height: 40px; padding: 0 18px; border: 0 !important; border-radius: 11px; background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)) !important; color: #fff !important; font-weight: 700; box-shadow: 0 8px 20px color-mix(in srgb, var(--st-primary) 24%, transparent); }
body #viewWorkspace #tab-brief .brief-field-group { display: grid; gap: 10px; margin-bottom: 18px; }
body #viewWorkspace #briefHero { padding: 22px 24px; border: 1px solid var(--st-line); border-radius: 20px; background: radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--st-primary-2) 14%, transparent), transparent 45%), var(--st-surface); box-shadow: var(--st-shadow); }
body #viewWorkspace #briefHero [class*="eyebrow"], body #viewWorkspace #briefHero [class*="label"]:first-child { display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 999px; background: var(--st-primary); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
body #viewWorkspace #briefHero h1, body #viewWorkspace #briefHero h2, body #viewWorkspace #briefHero [class*="title"] { color: var(--st-ink); font-weight: 800; letter-spacing: -.01em; }

body #viewWorkspace .rbi-workspace { margin-top: 20px; }
body #viewWorkspace .rbi-workspace-eyebrow { color: var(--st-primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
body #viewWorkspace .rbi-workspace-helper { margin: 4px 0 0; color: var(--st-muted); font-size: 14px; }
body #viewWorkspace .rbi-workspace-header { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--st-line); }
body #viewWorkspace .rbi-workspace-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
body #viewWorkspace .rbi-rail { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-surface); box-shadow: var(--st-shadow); }
body #viewWorkspace .rbi-step-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--st-ink); text-align: left; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
body #viewWorkspace .rbi-step-btn:hover { background: var(--st-surface-2); }
body #viewWorkspace .rbi-step-btn.rbi-step-active { border-color: color-mix(in srgb, var(--st-primary) 45%, var(--st-line)); background: linear-gradient(135deg, var(--st-soft), color-mix(in srgb, var(--st-primary-2) 14%, var(--st-surface))); box-shadow: none; }
body #viewWorkspace .rbi-step-num { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--st-surface-2); color: var(--st-muted); font-size: 13px; font-weight: 800; }
body #viewWorkspace .rbi-step-active .rbi-step-num { background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)); color: #fff; }
body #viewWorkspace .rbi-step-label { font-size: 13.5px; font-weight: 700; }
body #viewWorkspace .rbi-content { min-width: 0; padding: 22px 24px; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-surface); box-shadow: var(--st-shadow); }
body #viewWorkspace .rbi-step-eyebrow { color: var(--st-primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
body #viewWorkspace .rbi-step-status-title { color: var(--st-ink); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
body #viewWorkspace .rbi-step-footer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--st-line); }
@media (max-width: 1100px) { body #viewWorkspace .rbi-workspace-body { grid-template-columns: minmax(0, 1fr); } }
body #viewWorkspace #briefHero [class*="label"]:first-child:not([class*="eyebrow"]) { display: block; height: auto; padding: 0; border-radius: 0; background: none; color: var(--st-muted); letter-spacing: .08em; }
body #viewWorkspace .rbi-step-container { min-width: 0; }
body #viewWorkspace .rbi-step-container-active { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
body #viewWorkspace .rbi-step-container-active > * { min-width: 0; max-width: 100%; }
body #viewWorkspace .cbir-intel-card { border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface-2); padding: 16px 18px; }
body #viewWorkspace .rbi-step-container-active { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 14px; align-items: stretch; }
body #viewWorkspace .rbi-step-container-active > * { width: 100%; flex: 0 0 auto; position: static; }

/* ── Read Brief steps 1-3 content (cbir/bbd/bdr): V5 cards, rows, fields and chips ── */
body #viewWorkspace .rbi-content { font-size: 14px; color: var(--st-ink); }
body #viewWorkspace .cbir-intel-card, body #viewWorkspace .cbir-col { border: 1px solid var(--st-line); border-radius: 16px; background: var(--st-surface); padding: 18px 20px; overflow: visible; box-shadow: none; }
body #viewWorkspace .cbir-col { padding: 0; overflow: hidden; }
body #viewWorkspace .cbir-col-header, body #viewWorkspace .cbir-intel-card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; margin: 0 0 14px; border-bottom: 1px solid var(--st-line); background: none; }
body #viewWorkspace .cbir-col-header { padding: 14px 20px; margin: 0; background: var(--st-surface-2); }
body #viewWorkspace .cbir-col-title { color: var(--st-ink); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .cbir-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--st-primary) 40%, var(--st-line)); background: color-mix(in srgb, var(--st-primary) 9%, var(--st-surface)); color: var(--st-primary); font-size: 11.5px; font-weight: 700; letter-spacing: 0; text-transform: none; }
body #viewWorkspace .cbir-badge-warn { border-color: color-mix(in srgb, #d29922 45%, var(--st-line)); background: color-mix(in srgb, #d29922 10%, var(--st-surface)); color: #b7791f; }
body #viewWorkspace .cbir-intel-value { color: var(--st-ink); font-size: 14px; line-height: 1.6; }
body #viewWorkspace .exec-narrative { padding: 16px 20px; color: var(--st-ink); font-size: 14.5px; line-height: 1.65; }
body #viewWorkspace .exec-details-summary { padding: 12px 20px; border-top: 1px solid var(--st-line); color: var(--st-primary); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
body #viewWorkspace .bbd-group, body #viewWorkspace .cbir-detect-group { padding: 18px 20px; border: 1px solid var(--st-line); border-radius: 16px; background: var(--st-surface); margin: 0 0 14px; }
body #viewWorkspace .bbd-group-title, body #viewWorkspace .cbir-detect-group-title { margin: 0 0 14px; color: var(--st-primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
body #viewWorkspace .cbir-detect-group-label, body #viewWorkspace .bdr-label-row .field-label, body #viewWorkspace .cbir-intel-label { color: var(--st-muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .bbd-grid-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
body #viewWorkspace .bbd-row { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); min-width: 0; }
body #viewWorkspace .bbd-row-label { color: var(--st-muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .bbd-row-value, body #viewWorkspace .cbir-intel-field .cbir-intel-value { color: var(--st-ink); font-size: 14px; font-weight: 600; }
body #viewWorkspace .bbd-row-wide, body #viewWorkspace .bbd-row-full { padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); margin-bottom: 10px; }
body #viewWorkspace .cbir-intel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
body #viewWorkspace .cbir-intel-field { padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); }
body #viewWorkspace .bdr-field-wrap, body #viewWorkspace .brief-field-group { display: grid; gap: 8px; }
body #viewWorkspace .bdr-select, body #viewWorkspace .bdr-other-input, body #viewWorkspace .cbir-text-input, body #viewWorkspace .rbi-content input[type="text"], body #viewWorkspace .rbi-content input[type="url"], body #viewWorkspace .rbi-content select, body #viewWorkspace .rbi-content textarea {
  width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); color: var(--st-ink); font: inherit; font-size: 14px; box-sizing: border-box; outline: none;
}
body #viewWorkspace .rbi-content textarea { padding: 12px 14px; line-height: 1.6; }
body #viewWorkspace .bdr-select:focus, body #viewWorkspace .bdr-other-input:focus, body #viewWorkspace .cbir-text-input:focus, body #viewWorkspace .rbi-content input:focus, body #viewWorkspace .rbi-content select:focus, body #viewWorkspace .rbi-content textarea:focus { border-color: var(--st-primary); background: var(--st-surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-primary) 13%, transparent); }
body #viewWorkspace .bdr-source-badge, body #viewWorkspace .brief-detected, body #viewWorkspace .brief-conf-high, body #viewWorkspace .brief-conf-medium { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
body #viewWorkspace .bdr-src-high { border: 1px solid color-mix(in srgb, var(--st-teal) 45%, var(--st-line)); background: color-mix(in srgb, var(--st-teal) 10%, var(--st-surface)); color: var(--st-teal); }
body #viewWorkspace .bdr-src-medium { border: 1px solid color-mix(in srgb, #d29922 45%, var(--st-line)); background: color-mix(in srgb, #d29922 10%, var(--st-surface)); color: #b7791f; }
body #viewWorkspace .cbir-labeled-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--st-line); align-items: start; }
body #viewWorkspace .cbir-labeled-row-label { color: var(--st-muted); font-size: 12.5px; font-weight: 700; }
body #viewWorkspace .cbir-labeled-row-value { color: var(--st-ink); font-size: 14px; font-weight: 600; }
body #viewWorkspace .bdr-field-help { color: var(--st-muted); font-size: 12.5px; line-height: 1.5; }
body #viewWorkspace .rbi-inline-link-btn { color: var(--st-primary); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
body #viewWorkspace .cbir-nav-intent-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
body #viewWorkspace .cbir-plan-btn { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface); color: var(--st-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
body #viewWorkspace .cbir-plan-btn:hover { border-color: var(--st-primary); color: var(--st-primary); }
body #viewWorkspace .cbir-plan-btn-subtle { border-color: transparent; background: transparent; color: var(--st-muted); }
body #viewWorkspace .cbir-page-table { display: grid; gap: 8px; }
body #viewWorkspace .cbir-page-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); }
body #viewWorkspace .cbir-page-row-name { color: var(--st-ink); font-size: 14px; font-weight: 800; }
body #viewWorkspace .cbir-page-row-purpose { color: var(--st-muted); font-size: 13.5px; line-height: 1.55; }
body #viewWorkspace .cbir-sections-tags { display: flex; flex-wrap: wrap; gap: 6px; }
body #viewWorkspace .cbir-caps-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
body #viewWorkspace .rbi-info-trigger { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--st-line); border-radius: 50%; background: var(--st-surface); color: var(--st-muted); font-size: 11px; font-weight: 800; cursor: help; }
body #viewWorkspace .cbir-gaps { padding: 10px 14px; border: 1px solid color-mix(in srgb, #d29922 40%, var(--st-line)); border-radius: 12px; background: color-mix(in srgb, #d29922 8%, var(--st-surface)); color: #8a6417; font-size: 13px; }
@media (max-width: 760px) { body #viewWorkspace .bbd-grid-2col, body #viewWorkspace .cbir-intel-grid, body #viewWorkspace .cbir-labeled-row, body #viewWorkspace .cbir-page-row { grid-template-columns: minmax(0, 1fr); } }
body #viewWorkspace .rbi-content input, body #viewWorkspace .rbi-content select, body #viewWorkspace .rbi-content textarea, body #viewWorkspace .bdr-select, body #viewWorkspace .bdr-other-input { text-transform: none; letter-spacing: 0; }
body #viewWorkspace .cbir-intel-card .cbir-detect-group, body #viewWorkspace .cbir-detect-group .cbir-detect-group { border: 0; padding: 0; background: none; margin-bottom: 12px; }
body #viewWorkspace .cbir-detect-group .cbir-detect-group { border-top: 1px solid var(--st-line); padding-top: 14px; border-radius: 0; }
body #viewWorkspace .cbir-detect-group > .cbir-detect-group:first-of-type { border-top: 0; padding-top: 0; }
body #viewWorkspace .rbi-step-container-active .inline-btn.primary, body #viewWorkspace .rbi-step-container-active [class*="mark-reviewed"] { border-color: transparent !important; }
body #viewWorkspace .rbi-content .inline-btn.primary { background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)) !important; color: #fff !important; border-color: transparent !important; font-weight: 700; }

/* ── dropdowns: one V5 select look (chevron, no native arrow) ── */
body #viewWorkspace .rbi-content select, body #viewWorkspace .bdr-select, body #viewWorkspace .cbir-select, body #viewWorkspace .cbir-font-slot-controls select {
  -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer;
  background-color: var(--st-surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667b84' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 14px;
}
body #viewWorkspace .rbi-content select option { background: var(--st-surface); color: var(--st-ink); }
body #viewWorkspace .rbi-content select:disabled { opacity: .6; cursor: not-allowed; }

/* ── step 6: colour roles + fonts ── */
body #viewWorkspace .cbir-design-intel-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
body #viewWorkspace .cbir-color-role-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface-2); min-width: 0; }
body #viewWorkspace .cbir-color-role-swatch { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--st-line); box-shadow: inset 0 0 0 2px var(--st-surface); }
body #viewWorkspace .cbir-color-role-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
body #viewWorkspace .cbir-color-role-toprow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body #viewWorkspace .cbir-color-role-label { color: var(--st-ink); font-size: 13px; font-weight: 800; }
body #viewWorkspace .cbir-color-role-hexvalue { color: var(--st-muted); font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
body #viewWorkspace .cbir-color-role-actions, body #viewWorkspace .cbir-color-role-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
body #viewWorkspace .cbir-color-role-meta { color: var(--st-muted); font-size: 12px; }
body #viewWorkspace .cbir-design-intel-fonts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
body #viewWorkspace .cbir-font-slot-panel { padding: 16px; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface-2); min-width: 0; }
body #viewWorkspace .cbir-font-slot-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
body #viewWorkspace .cbir-font-slot-label { color: var(--st-muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .cbir-font-slot-family { color: var(--st-ink); font-size: 14px; font-weight: 700; }
body #viewWorkspace .cbir-font-slot-preview { padding: 12px 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface); color: var(--st-ink); }
body #viewWorkspace .cbir-plan-btn-primary { border-color: transparent; background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)); color: #fff; }
body #viewWorkspace .cbir-plan-btn-primary:hover { color: #fff; filter: brightness(1.05); }
body #viewWorkspace .cbir-palette-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
body #viewWorkspace .cbir-swatch-item, body #viewWorkspace .cbir-typo-item { padding: 10px 12px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); }
body #viewWorkspace .cbir-swatch { width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--st-line); }

/* ── step 7: review status, questions, approval ── */
body #viewWorkspace .rbi-step7-review-row { display: flex; gap: 8px; flex-wrap: wrap; }
body #viewWorkspace .rbi-step7-review-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid var(--st-line); border-radius: 999px; background: var(--st-surface-2); color: var(--st-ink); font-size: 12.5px; font-weight: 700; }
body #viewWorkspace .rbi-step7-review-chip-blocking { border-color: color-mix(in srgb, #e5534b 45%, var(--st-line)); color: #d1453d; }
body #viewWorkspace .cbir-questions-wrap { padding: 18px 20px; border: 1px solid var(--st-line); border-radius: 16px; background: var(--st-surface); }
body #viewWorkspace .cbir-questions-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--st-line); }
body #viewWorkspace .cbir-questions-title { color: var(--st-ink); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .brief-q-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--st-primary) 12%, var(--st-surface)); color: var(--st-primary); font-size: 12px; font-weight: 800; }
body #viewWorkspace .brief-q-tier-heading { margin: 14px 0 8px; color: var(--st-muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
body #viewWorkspace .brief-q-tier-heading-required { color: #d1453d; }
body #viewWorkspace .brief-no-questions { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--st-teal) 8%, var(--st-surface)); color: var(--st-teal); font-weight: 600; }
body #viewWorkspace .brief-question-item { margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--st-line); border-left: 4px solid var(--st-primary); border-radius: 12px; background: var(--st-surface-2); }
body #viewWorkspace .brief-question-item-recommended { border-left-color: #d29922; }
body #viewWorkspace .brief-q-tier-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, #d29922 12%, var(--st-surface)); color: #b7791f; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
body #viewWorkspace .brief-q-text { color: var(--st-ink); font-size: 14px; font-weight: 700; }
body #viewWorkspace .brief-q-reason { color: var(--st-muted); font-size: 12.5px; }
body #viewWorkspace .brief-q-answer-wrap { display: flex; gap: 8px; margin-top: 10px; }
body #viewWorkspace .brief-q-answer-wrap input { flex: 1; min-width: 0; }
body #viewWorkspace .brief-editable-input { min-height: 44px; padding: 0 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface); color: var(--st-ink); font: inherit; }
body #viewWorkspace .ai-intel-section, body #viewWorkspace .brief-struct-section { border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface); overflow: hidden; }
body #viewWorkspace .ai-intel-header, body #viewWorkspace .brief-struct-header { padding: 14px 18px; color: var(--st-ink); font-weight: 800; background: var(--st-surface-2); cursor: pointer; }
body #viewWorkspace .rtb-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border: 1px solid color-mix(in srgb, var(--st-primary) 35%, var(--st-line)); border-radius: 16px; background: linear-gradient(135deg, var(--st-soft), color-mix(in srgb, var(--st-primary-2) 10%, var(--st-surface))); }
body #viewWorkspace .rtb-card.cbir-status-issues { border-color: color-mix(in srgb, #d29922 45%, var(--st-line)); background: color-mix(in srgb, #d29922 7%, var(--st-surface)); }
body #viewWorkspace .rtb-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--st-surface); color: #b7791f; }
body #viewWorkspace .rtb-icon-check { color: var(--st-teal); }
body #viewWorkspace .rtb-copy { flex: 1; min-width: 200px; display: grid; gap: 2px; }
body #viewWorkspace .rtb-title { color: var(--st-ink); font-size: 15px; font-weight: 800; }
body #viewWorkspace .rtb-subtitle { color: var(--st-muted); font-size: 13px; }
body #viewWorkspace .rtb-cta-group { display: grid; gap: 6px; justify-items: center; }
body #viewWorkspace .rtb-continue-btn, body #viewWorkspace .brief-approve-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)); color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px color-mix(in srgb, var(--st-primary) 28%, transparent); }
body #viewWorkspace .rtb-continue-btn:hover { filter: brightness(1.06); }
body #viewWorkspace .rtb-cta-note { color: var(--st-muted); font-size: 12px; text-align: center; }
body #viewWorkspace .rtb-card .rtb-icon-check { display: none; }
body #viewWorkspace .rtb-card:not(.cbir-status-issues) .rtb-icon-check { display: grid; }
body #viewWorkspace .rtb-card:not(.cbir-status-issues) .rtb-icon-warn { display: none; }
body #viewWorkspace .rtb-icon svg { width: 22px; height: 22px; }
body #viewWorkspace .rtb-card { padding-left: 20px; }

/* header: Claude usage strip removed from the project header */
body #viewWorkspace .claude-usage-topbar, body #viewWorkspace #claudeUsageTopbarRoot { display: none !important; }
body #viewWorkspace .workspace-header.page-header { padding: 16px 20px; }
body #viewWorkspace .ws-header-row { min-height: 56px; }
body #viewWorkspace .ws-header-right { gap: 10px; }
body #viewWorkspace .runner-status-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
body #viewWorkspace .ws-header-right .pv5-wsbtn, body #viewWorkspace #wsOpenWorkingWorkspaceBtn { height: 40px; }

/* header v2: reference layout — identity left, two controls right; runner state as a dot */
body #viewWorkspace #wsHeaderPhase, body #viewWorkspace .ws-id-dot { display: none !important; }
body #viewWorkspace .workspace-header.page-header { padding: 16px 20px; min-height: 0; }
body #viewWorkspace .ws-header-row { min-height: 58px; }
body #viewWorkspace .ws-project-name { font-size: 22px; line-height: 25px; }
body #viewWorkspace .ws-project-sub { gap: 10px; }
body #viewWorkspace #wsHeaderStack { height: 24px; }
body #viewWorkspace .ws-header-right > * { margin: 0; }
body #viewWorkspace #wsOpenWorkingWorkspaceBtn { gap: 8px; padding: 0 14px; border-radius: 11px; font-size: 13px; font-weight: 600; }
body #viewWorkspace .ws-header-right .pv5-wsbtn { min-width: 190px; }
body #viewWorkspace #runnerStatusBadge:not(.runner-status-fake) { font-size: 0 !important; gap: 0; width: 26px; height: 26px; padding: 0; justify-content: center; border-radius: 50%; }
body #viewWorkspace #runnerStatusBadge:not(.runner-status-fake)::before { margin: 0; width: 9px; height: 9px; }

/* header v3: no version chip, reference back arrow */
body #viewWorkspace #wsHeaderVersion { display: none !important; }
body #viewWorkspace .breadcrumb-root-link::before { content: ""; width: 20px; height: 20px; font-size: 0; background-color: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5m7-7-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5m7-7-7 7 7 7'/%3E%3C/svg%3E") center / contain no-repeat; }
body #viewWorkspace #runnerStatusBadge:not(.runner-status-fake) { order: 5; align-self: center; margin-left: 2px; }

/* header v4: stack tag and runner dot hidden per owner request (markup/JS untouched) */
body #viewWorkspace #wsHeaderStack { display: none !important; }
body #viewWorkspace #runnerStatusBadge:not(.runner-status-fake) { display: none !important; }

/* header v5: project code + platform tag (real values), empty chips hidden; centred back arrow */
body #viewWorkspace .ws-chip-empty { display: none !important; }
body #viewWorkspace #wsHeaderCode { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border: 1px solid var(--st-line); border-radius: 7px; background: var(--st-surface-2); color: var(--st-ink); font-size: 11.5px; font-weight: 700; }
body #viewWorkspace #wsHeaderStack:not(.ws-chip-empty) { display: inline-flex !important; }
body #viewWorkspace .breadcrumb-root-link { display: flex; align-items: center; justify-content: center; padding: 0; line-height: 0; }
body #viewWorkspace .breadcrumb-root-link::before { flex: none; margin: 0; display: block; }

body #viewWorkspace #wsCopyLinkBtn { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border: 1px solid var(--st-line); border-radius: 11px; background: var(--st-surface); color: var(--st-ink); font-size: 13px; font-weight: 600; }
body #viewWorkspace #wsCopyLinkBtn:hover { border-color: color-mix(in srgb, var(--st-primary) 50%, var(--st-line)); color: var(--st-primary); }

/* right panel (Activity/Queue/AI/Logs/Analysis/Telemetry) hidden per owner request — markup and JS untouched */
body #viewWorkspace #rightPanel, body #viewWorkspace .right-panel, body #viewWorkspace #rpMobileTrigger { display: none !important; }
body #viewWorkspace { --right-w: 0px; }

/* header fit: identity keeps a minimum width; actions wrap below only when they do not fit */
body #viewWorkspace .ws-header-row { flex-wrap: wrap; }
body #viewWorkspace .ws-header-left { flex: 1 1 360px; min-width: 360px; }
body #viewWorkspace .ws-header-right { flex-wrap: wrap; }
body #viewWorkspace .ws-project-name { max-width: 100%; }

/* QA and Deliver tabs hidden per owner request — panels, handlers and gating untouched */
body #viewWorkspace #tabBtnQa, body #viewWorkspace #tabBtnDeliver { display: none !important; }

/* tab strip: reference sizing (6 tabs fit at full size) */
body #viewWorkspace .workspace-tabs .tab-btn { gap: 11px; padding: 0 16px; font-size: 12.5px; font-weight: 700; }
body #viewWorkspace .workspace-tabs .tab-btn::before { width: 28px; height: 28px; font-size: 11px; }
body #viewWorkspace .workspace-tabs .tab-btn.active::after { left: 12px; right: 12px; height: 4px; }
body #viewWorkspace .workspace-tabs .tab-audit-badge { margin-left: 4px; padding: 0 7px; font-size: 10.5px; }

/* Brief tab: Developer Tools hidden (owner request, markup untouched); paste area as V5 card; tighter top spacing */
body #viewWorkspace #briefAdvWrap { display: none !important; }
body #viewWorkspace #tab-brief .tab-panel-inner { padding-top: 0; }
body #viewWorkspace #tab-brief .brief-main > .section-header { margin: 0 0 18px; padding: 0 0 16px; }
body #viewWorkspace #tab-brief .brief-field-group:has(#briefPasteArea) { padding: 18px 20px; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-surface); box-shadow: var(--st-shadow); margin-bottom: 18px; gap: 12px; }
body #viewWorkspace #briefPasteArea { min-height: 240px; padding: 16px 18px; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface-2); resize: vertical; box-sizing: border-box; width: 100%; }
body #viewWorkspace #briefPasteArea:focus { background: var(--st-surface); }
body #viewWorkspace #tab-brief .brief-sidebar .info-card { border: 1px solid var(--st-line); border-radius: 16px; background: var(--st-surface); padding: 16px 18px; margin-bottom: 14px; }
body #viewWorkspace #briefMdPreview { border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); color: var(--st-ink); padding: 14px; }

/* Analysis Summary hero hidden (owner request) — markup and renderers untouched */
body #viewWorkspace #briefHero { display: none !important; }

/* Brief, reference layout: plain paste area with counter; awareness card; icon step rail; step header with icon + badge */
body #viewWorkspace #tab-brief .brief-field-group:has(#briefPasteArea) { padding: 0; border: 0; background: none; box-shadow: none; margin-bottom: 8px; }
body #viewWorkspace #briefPasteArea { min-height: 300px; background: var(--st-surface-2); }
body #viewWorkspace .brief-paste-count { margin: 0 0 18px; color: var(--st-muted); font-size: 12.5px; font-weight: 600; }
body #viewWorkspace .rbi-awareness { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 0 0 20px; padding: 22px 24px; border: 1px solid var(--st-line); border-radius: 20px; background: radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--st-primary-2) 14%, transparent), transparent 45%), var(--st-surface); box-shadow: var(--st-shadow); }
body #viewWorkspace .rbi-aw-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 999px; background: var(--st-primary); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .rbi-aw-main h3 { margin: 10px 0 4px; color: var(--st-ink); font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
body #viewWorkspace .rbi-aw-main p { margin: 0; color: var(--st-muted); font-size: 14px; }
body #viewWorkspace .rbi-aw-prog { display: grid; gap: 8px; min-width: 240px; }
body #viewWorkspace .rbi-aw-prog strong { color: var(--st-ink); font-size: 24px; font-weight: 800; }
body #viewWorkspace .rbi-aw-prog span { color: var(--st-muted); font-size: 13px; font-weight: 600; margin-top: -6px; }
body #viewWorkspace .rbi-aw-prog i { display: block; height: 8px; border-radius: 999px; background: var(--st-surface-2); overflow: hidden; }
body #viewWorkspace .rbi-aw-prog b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--st-primary), var(--st-primary-2)); }
body #viewWorkspace .rbi-step-num svg { width: 18px; height: 18px; }
body #viewWorkspace .rbi-step-num { width: 36px; height: 36px; border-radius: 11px; }
body #viewWorkspace .rbi-step-badge { background: none !important; border: 0 !important; padding: 0 !important; height: auto; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--st-muted) !important; }
body #viewWorkspace .rbi-step-btn.rbi-step-active .rbi-step-badge { color: var(--st-muted) !important; }
body #viewWorkspace .rbi-step-status-line { position: relative; padding-left: 68px; min-height: 52px; margin-bottom: 14px; }
body #viewWorkspace .rbi-step-headicon { position: absolute; left: 0; top: 2px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: color-mix(in srgb, var(--st-primary) 10%, var(--st-surface)); color: var(--st-primary); }
body #viewWorkspace .rbi-step-headicon svg { width: 24px; height: 24px; }
body #viewWorkspace .rbi-step-headbadge { position: absolute; right: 0; top: 4px; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid color-mix(in srgb, #d29922 45%, var(--st-line)); border-radius: 11px; background: color-mix(in srgb, #d29922 9%, var(--st-surface)); color: #b7791f; font-size: 12.5px; font-weight: 700; }
body #viewWorkspace .rbi-step-headbadge.rbi-step-badge-ready { border-color: color-mix(in srgb, var(--st-teal) 45%, var(--st-line)); background: color-mix(in srgb, var(--st-teal) 9%, var(--st-surface)); color: var(--st-teal); }
body #viewWorkspace .rbi-step-headbadge.rbi-step-badge-conflict, body #viewWorkspace .rbi-step-headbadge.rbi-step-badge-missing { border-color: color-mix(in srgb, #e5534b 40%, var(--st-line)); background: color-mix(in srgb, #e5534b 8%, var(--st-surface)); color: #d1453d; }

/* Brief flow: paste only before Read Brief; review only after; Edit brief toggles the paste area back */
body #viewWorkspace #tab-brief.wb-read:not(.wb-edit) .brief-field-group:has(#briefPasteArea), body #viewWorkspace #tab-brief.wb-read:not(.wb-edit) #briefPasteCount, body #viewWorkspace #tab-brief.wb-read:not(.wb-edit) #briefReadBtn { display: none !important; }
body #viewWorkspace #tab-brief.wb-read:not(.wb-edit) #briefEditBtn { display: inline-flex !important; height: 40px; padding: 0 16px; }
body #viewWorkspace #tab-brief.wb-read:not(.wb-edit) .brief-sidebar { display: none; }
body #viewWorkspace #tab-brief.wb-read.wb-edit .brief-field-group:has(#briefPasteArea) { display: grid !important; }
body #viewWorkspace #tab-brief.wb-read.wb-edit #briefPasteCount { display: block !important; }
body #viewWorkspace #tab-brief.wb-read.wb-edit #briefReadBtn { display: inline-flex !important; }

/* Steps 1-7, reference feel: white field cards with a leading icon tile, calm headers, white inputs */
body #viewWorkspace .rbi-content { padding: 22px 24px; }
body #viewWorkspace .cbir-col-header { background: var(--st-surface); border-bottom: 1px solid var(--st-line); }
body #viewWorkspace .cbir-col, body #viewWorkspace .cbir-intel-card, body #viewWorkspace .bbd-group, body #viewWorkspace .cbir-detect-group { background: var(--st-surface); border-radius: 18px; box-shadow: 0 6px 18px color-mix(in srgb, var(--st-primary) 6%, transparent); }
body #viewWorkspace .bbd-row, body #viewWorkspace .bbd-row-wide, body #viewWorkspace .bbd-row-full, body #viewWorkspace .cbir-intel-field, body #viewWorkspace .cbir-page-row, body #viewWorkspace .cbir-color-role-row, body #viewWorkspace .cbir-font-slot-panel { position: relative; background: var(--st-surface); border-radius: 14px; padding: 14px 16px 14px 62px; min-height: 64px; }
body #viewWorkspace .bbd-row::before, body #viewWorkspace .bbd-row-wide::before, body #viewWorkspace .bbd-row-full::before, body #viewWorkspace .cbir-intel-field::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--st-primary) 11%, var(--st-surface));
  -webkit-mask: none; mask: none;
}
body #viewWorkspace .bbd-row::after, body #viewWorkspace .bbd-row-wide::after, body #viewWorkspace .bbd-row-full::after, body #viewWorkspace .cbir-intel-field::after {
  content: ""; position: absolute; left: 25px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--st-primary);
}
body #viewWorkspace .cbir-color-role-row, body #viewWorkspace .cbir-page-row, body #viewWorkspace .cbir-font-slot-panel { padding-left: 16px; }
body #viewWorkspace .rbi-content input[type="text"], body #viewWorkspace .rbi-content input[type="url"], body #viewWorkspace .rbi-content select, body #viewWorkspace .rbi-content textarea, body #viewWorkspace .bdr-select, body #viewWorkspace .bdr-other-input, body #viewWorkspace .cbir-text-input { background-color: var(--st-surface); }
body #viewWorkspace .rbi-content .bbd-grid-2col { grid-template-columns: minmax(0, 1fr); gap: 10px; }
body #viewWorkspace .rbi-step-footer { display: flex; justify-content: space-between; gap: 12px; }
body #viewWorkspace .rbi-footer-continue, body #viewWorkspace .rbi-footer-back { height: 44px; padding: 0 20px; border-radius: 12px; font-weight: 700; }
body #viewWorkspace .rbi-footer-continue { border: 0; background: linear-gradient(135deg, var(--st-primary), var(--st-primary-2)); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--st-primary) 26%, transparent); }
body #viewWorkspace .cbir-intel-grid, body #viewWorkspace .bbd-grid-2col, body #viewWorkspace .bbd-rows-wide, body #viewWorkspace .bbd-rows-full { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px; width: 100%; }
body #viewWorkspace .cbir-intel-field, body #viewWorkspace .bbd-row, body #viewWorkspace .bbd-row-wide, body #viewWorkspace .bbd-row-full { width: 100%; box-sizing: border-box; min-width: 0; }
body #viewWorkspace .cbir-intel-field .cbir-intel-label, body #viewWorkspace .bbd-row-label { white-space: normal; }
body #viewWorkspace .cbir-intel-field .cbir-intel-value { word-break: normal; overflow-wrap: anywhere; }
body #viewWorkspace .rbi-content .cbir-detect-group:not(.bbd-group) { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
body #viewWorkspace .rbi-content .cbir-detect-group > * { min-width: 0; }
body #viewWorkspace .exec-details:not([open]) .bbd-group { display: none !important; }
body #viewWorkspace .exec-details[open] .bbd-group { display: block; }
body #viewWorkspace details:not([open]) .bbd-group, body #viewWorkspace details:not([open]) .bbd-rows-wide, body #viewWorkspace details:not([open]) .bbd-rows-full { display: none !important; }
/* Edit brief: the review section (awareness card + steps) is hidden while the paste area is shown */
body #viewWorkspace #tab-brief.wb-read.wb-edit #briefAutoDetect { display: none !important; }
/* Read Brief eyebrow + helper line hidden (owner request) — markup untouched */
body #viewWorkspace .rbi-workspace-header { display: none !important; }
/* wider step rail; labels stay on one line */
body #viewWorkspace .rbi-workspace-body { grid-template-columns: 310px minmax(0, 1fr); }
body #viewWorkspace .rbi-step-label { white-space: nowrap; }
body #viewWorkspace .rbi-step-text { min-width: 0; }
@media (max-width: 1100px) { body #viewWorkspace .rbi-workspace-body { grid-template-columns: minmax(0, 1fr); } }

/* Step 6 Design Intelligence: reference-style brand colour cards */
body #viewWorkspace .cbir-design-intel-colors { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 14px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-row { flex-direction: column; align-items: stretch; text-align: center; padding: 14px; gap: 12px; border-radius: 16px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-swatch { width: 100%; height: 88px; border-radius: 12px; box-shadow: none; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-main { justify-items: center; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-toprow { justify-content: center; flex-direction: column; gap: 2px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-label { font-size: 15px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-hexvalue { display: inline-flex; padding: 2px 10px; border-radius: 999px; background: var(--st-surface-2); font-size: 11.5px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-actions { justify-content: center; }
body #viewWorkspace .cbir-color-role-editrow { display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; }
body #viewWorkspace .cbir-design-intel-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body #viewWorkspace .cbir-font-slot-preview-lg { font-size: 26px; font-weight: 800; line-height: 1.2; }
body #viewWorkspace .rbi-step6-workspace .cbir-detect-group-title { font-size: 12px; }
@media (max-width: 900px) { body #viewWorkspace .cbir-design-intel-colors, body #viewWorkspace .cbir-design-intel-fonts { grid-template-columns: minmax(0, 1fr) !important; } }
body #viewWorkspace .cbir-color-role-editrow[hidden] { display: none !important; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-meta { justify-content: center; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-row { gap: 8px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-plan-btn-subtle { height: 28px; padding: 0 8px; font-size: 12px; }

/* steps polish: full-width page rows, aligned footer note, approval icon */
body #viewWorkspace .cbir-page-row, body #viewWorkspace .rbi-step5-pages > *, body #viewWorkspace #rbiStep5Container .cbir-intel-card > div[class*="page"] { width: 100%; box-sizing: border-box; }
body #viewWorkspace #rbiStep5Container .cbir-intel-card > div:not(.cbir-intel-card-header) { max-width: none; }
body #viewWorkspace .rtb-icon { width: 44px; height: 44px; flex: none; border: 1px solid color-mix(in srgb, #d29922 35%, var(--st-line)); }
body #viewWorkspace .rtb-icon svg { width: 22px; height: 22px; }
body #viewWorkspace .rbi-workspace-body + *, body #viewWorkspace #briefCompactStatusNote { margin-top: 12px; }
body #viewWorkspace #briefDecisionsCounts { display: block; margin: 14px 0 0; padding: 12px 16px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface); color: var(--st-muted); font-size: 13px; font-weight: 600; }
body #viewWorkspace #briefDecisionsCounts:empty { display: none; }
body #viewWorkspace .rbi-tooltip-popover { background: var(--st-surface); color: var(--st-ink); border: 1px solid var(--st-line); border-radius: 12px; box-shadow: 0 18px 40px rgba(6, 25, 32, .2); padding: 10px 12px; font-size: 12.5px; line-height: 1.5; white-space: normal; z-index: 60; }
body #viewWorkspace .rbi-content, body #viewWorkspace #tab-brief { overflow-x: clip; }

/* Website Intelligence: nested groups become plain full-width sections */
body #viewWorkspace .cbir-intel-card .cbir-detect-group { width: 100%; box-sizing: border-box; box-shadow: none; border: 0; border-top: 1px solid var(--st-line); border-radius: 0; background: none; padding: 16px 0; margin: 0; }
body #viewWorkspace .cbir-intel-card .cbir-detect-group:first-of-type { border-top: 0; }
body #viewWorkspace .cbir-intel-card .cbir-detect-group .cbir-detect-group { padding: 14px 0; }
body #viewWorkspace .cbir-nav-intent-editable, body #viewWorkspace .cbir-nav-intent-editable .cbir-text-input, body #viewWorkspace .cbir-labeled-row, body #viewWorkspace .cbir-page-table, body #viewWorkspace .cbir-page-row { width: 100%; max-width: none; box-sizing: border-box; }
body #viewWorkspace .cbir-labeled-row { border-bottom: 0; padding: 4px 0; }

/* Website Intelligence: values fill the card (an inherited max-width was leaving a dead strip on the right) */
body #viewWorkspace .cbir-intel-card .cbir-intel-value, body #viewWorkspace .cbir-detect-group .cbir-intel-value { max-width: none !important; width: 100%; }

/* Exact colour palette: attractive cards */
body #viewWorkspace .cbir-design-intel-colors { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important; gap: 16px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-row { padding: 12px 12px 16px; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-surface); box-shadow: 0 8px 22px color-mix(in srgb, var(--st-primary) 7%, transparent); gap: 10px; transition: transform .15s ease, box-shadow .15s ease; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-row:hover { transform: translateY(-2px); box-shadow: 0 14px 30px color-mix(in srgb, var(--st-primary) 14%, transparent); }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-swatch { height: 96px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--st-ink) 8%, transparent); box-shadow: inset 0 -26px 30px -26px rgba(0, 0, 0, .18); }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-swatch[style*="background:;"], body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-swatch:not([style*="#"]) { background-image: repeating-linear-gradient(45deg, var(--st-surface-2) 0 8px, var(--st-surface) 8px 16px) !important; border-style: dashed; border-color: var(--st-line); }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-label { font-size: 14.5px; font-weight: 800; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-hexvalue { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-actions { display: grid; gap: 8px; justify-items: center; width: 100%; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-actions > .cbir-plan-btn { width: 100%; height: 34px; border-radius: 10px; justify-content: center; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-meta { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-plan-btn-subtle { border: 0; background: none; color: var(--st-muted); height: 24px; padding: 0 6px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-plan-btn-subtle:hover { color: var(--st-primary); }
body #viewWorkspace .cbir-color-role-editrow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
body #viewWorkspace .cbir-color-role-picker { width: 44px; height: 44px; padding: 3px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface); cursor: pointer; }
body #viewWorkspace .cbir-font-slot-preview-bodyFont, body #viewWorkspace .cbir-font-slot-preview:not(.cbir-font-slot-preview-lg) { font-size: 15px !important; font-weight: 500; line-height: 1.55; }
body #viewWorkspace .cbir-font-slot-preview-headingFont { font-size: 24px !important; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-meta > span:not(.cbir-badge) { flex-basis: 100%; text-align: center; }

/* audit fixes: empty title-only groups hidden; Asset Manager toolbar on one row */
body #viewWorkspace .bbd-group:not(:has(.bbd-row, .bbd-row-wide, .bbd-row-full, input, select, textarea, p, ul)) { display: none !important; }
body #viewWorkspace #tab-assets .am-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
body #viewWorkspace #tab-assets .am-header-actions { width: auto; flex: 1 1 420px; justify-content: flex-end; flex-wrap: wrap; }
body #viewWorkspace #tab-assets .am-header-actions input { flex: 1 1 160px; max-width: 260px; }
body #viewWorkspace #tab-assets .am-header-actions .v5sel-btn { width: auto; min-width: 130px; min-height: 36px; border-radius: 10px; font-size: 13px; }
body #viewWorkspace .cbir-detect-group:not(:has(> :not(.cbir-detect-group-label):not(.cbir-detect-group-title))) { display: none !important; }

/* synthesized reference observations: compact grouped chips */
body #viewWorkspace .syn-wrap { display: grid; gap: 14px; }
body #viewWorkspace .syn-group { display: grid; gap: 8px; }
body #viewWorkspace .syn-title { color: var(--st-muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
body #viewWorkspace .syn-title em { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--st-surface-2); font-style: normal; letter-spacing: 0; }
body #viewWorkspace .syn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body #viewWorkspace .syn-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; height: 26px; padding: 0 10px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body #viewWorkspace .syn-swatch { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--st-ink) 20%, transparent); }
body #viewWorkspace .syn-more summary { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border: 1px dashed var(--st-line); border-radius: 999px; color: var(--st-primary); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
body #viewWorkspace .syn-more[open] summary { margin-bottom: 8px; }

/* ── Brief steps: compact layouts (long page lists scroll inside their card) ── */
body #viewWorkspace .reference-row { flex-wrap: wrap; gap: 8px; }
body #viewWorkspace .reference-row-url, body #viewWorkspace .reference-row-pending-url { flex: 1 1 260px !important; min-width: 200px; }
body #viewWorkspace .reference-row .inline-btn { height: 34px; }

/* step 3: page structure preview as a 2-column compact list */
body #viewWorkspace .cbir-page-table { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
body #viewWorkspace .cbir-page-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 14px; min-height: 0; }
body #viewWorkspace .cbir-page-row-name { font-size: 13.5px; }
body #viewWorkspace .cbir-page-row-purpose { font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 900px) { body #viewWorkspace .cbir-page-table { grid-template-columns: minmax(0, 1fr); } }

/* step 5: inner pages as single-line rows inside a scrolling list */
body #viewWorkspace #rbiStep5Container div:has(> .cbir-inner-page-row-editable) { display: grid; gap: 8px; max-height: 520px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
body #viewWorkspace .cbir-inner-page-row-editable { display: grid; grid-template-columns: minmax(140px, 1.2fr) auto minmax(0, 1.4fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); min-width: 0; }
body #viewWorkspace .cbir-inner-page-row-editable .cbir-section-tag { justify-self: start; background: none; border: 0; padding: 0; color: var(--st-ink); font-size: 13.5px; font-weight: 800; }
body #viewWorkspace .cbir-inner-page-row-editable > span[style] { color: var(--st-muted); font-size: 11.5px !important; opacity: 1 !important; }
body #viewWorkspace .cbir-inner-page-purpose-missing { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 26px; padding: 0 10px; border: 1px solid color-mix(in srgb, #d29922 40%, var(--st-line)); border-radius: 999px; background: color-mix(in srgb, #d29922 9%, var(--st-surface)); color: #b7791f; font-size: 11.5px; font-weight: 700; cursor: pointer; }
body #viewWorkspace .cbir-inner-page-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
body #viewWorkspace .cbir-inner-page-actions .cbir-plan-btn { height: 28px; padding: 0 10px; font-size: 12px; }
body #viewWorkspace .cbir-plan-btn-danger { color: #d1453d; }
@media (max-width: 1100px) { body #viewWorkspace .cbir-inner-page-row-editable { grid-template-columns: minmax(0, 1fr) auto; } body #viewWorkspace .cbir-inner-page-row-editable > span[style] { display: none; } }

/* step 4: homepage sections as compact rows in a scrolling list (full text stays in the row tooltip and the Edit view) */
body #viewWorkspace #rbiStep4Container div:has(> .cbir-hp-section-row-editable) { display: grid; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
body #viewWorkspace .cbir-hp-section-row-editable { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface-2); min-width: 0; }
body #viewWorkspace .cbir-hp-section-main { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--st-ink); }
body #viewWorkspace .cbir-hp-section-order { color: var(--st-muted); font-weight: 800; }
body #viewWorkspace .cbir-hp-section-row-editable .cbir-drag-handle { color: var(--st-muted); cursor: grab; flex: none; }
body #viewWorkspace .cbir-hp-section-row-editable .cbir-plan-btn { height: 28px; padding: 0 10px; font-size: 12px; }

/* step 2 / 6: form groups in two columns to keep the step short */
body #viewWorkspace #rbiStep2Container .cbir-detect-group:not(.bbd-group), body #viewWorkspace #rbiStep6Container .rbi-step6-workspace > .cbir-detect-group:not(.bbd-group) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px 18px !important; align-items: start; }
body #viewWorkspace #rbiStep2Container .cbir-detect-group > .cbir-detect-group-label, body #viewWorkspace #rbiStep2Container .cbir-detect-group > .cbir-detect-group-title, body #viewWorkspace #rbiStep2Container .cbir-detect-group > .bdr-field-help, body #viewWorkspace #rbiStep2Container .cbir-detect-group > .cbir-intel-field, body #viewWorkspace #rbiStep2Container .cbir-detect-group > :first-child { grid-column: 1 / -1; }
body #viewWorkspace #rbiStep2Container .cbir-detect-group > .brief-field-group { margin: 0; }
body #viewWorkspace #rbiStep2Container .cbir-detect-group > .brief-field-group:first-of-type:last-of-type { grid-column: 1 / -1; }
@media (max-width: 900px) { body #viewWorkspace #rbiStep2Container .cbir-detect-group:not(.bbd-group) { grid-template-columns: minmax(0, 1fr) !important; } }
body #viewWorkspace #rbiStep2Container .cbir-detect-group > :not(.brief-field-group) { grid-column: 1 / -1; }
body #viewWorkspace #rbiStep2Container .cbir-detect-group .cbir-intel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
body #viewWorkspace #rbiStep2Container .cbir-detect-group .cbir-intel-grid:has(> :only-child) { grid-template-columns: minmax(0, 1fr) !important; }
body #viewWorkspace #rbiStep2Container .cbir-detect-group { padding: 14px 18px; margin-bottom: 12px; }
/* step 6: tighter colour cards (all 7 roles fit in two rows) */
body #viewWorkspace .cbir-design-intel-colors { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-swatch { height: 52px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-row { padding: 10px; gap: 6px; border-radius: 14px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-label { font-size: 13px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-actions > .cbir-plan-btn { height: 30px; }
body #viewWorkspace .cbir-design-intel-colors .cbir-color-role-meta > span:not(.cbir-badge) { font-size: 10.5px; }
@media (max-width: 1100px) { body #viewWorkspace .cbir-design-intel-colors { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }


/* ═════ Read Brief polish following the reference: label rows, questions, recommended, page sections ═════ */
/* label row: label left, confidence badge next to it, help (?) pinned right — one aligned line */
body #viewWorkspace .bdr-label-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: nowrap; min-height: 24px; }
body #viewWorkspace .bdr-label-row .field-label { flex: 0 1 auto; margin: 0; white-space: nowrap; }
body #viewWorkspace .bdr-label-row .rbi-info-trigger-wrap { margin-left: auto; flex: none; }
body #viewWorkspace .bdr-source-badge { flex: none; height: 22px; line-height: 1; margin: 0; padding: 0 9px; font-size: 10.5px; }
body #viewWorkspace .bdr-source-badge:empty { display: none; }

/* Clarifying questions card */
body #viewWorkspace .cbir-questions-wrap { padding: 20px 22px; border-radius: 18px; }
body #viewWorkspace .cbir-questions-header { padding-bottom: 14px; margin-bottom: 16px; }
body #viewWorkspace .cbir-questions-title { font-size: 13px; }
body #viewWorkspace .brief-q-tier-group { margin: 0 0 16px; padding: 0; border: 0; }
body #viewWorkspace .brief-q-tier-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--st-ink); font-size: 14px; font-weight: 800; letter-spacing: 0; text-transform: none; cursor: default; list-style: none; }
body #viewWorkspace .brief-q-tier-heading::before { content: ""; flex: none; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--st-primary) 11%, var(--st-surface)); -webkit-mask: none; mask: none; }
body #viewWorkspace .brief-q-tier-heading-required::before { background: color-mix(in srgb, #e5534b 13%, var(--st-surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, #e5534b 40%, transparent); }
body #viewWorkspace .brief-q-tier-heading-recommended::before { background: color-mix(in srgb, #d29922 16%, var(--st-surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, #d29922 45%, transparent); }
body #viewWorkspace .brief-q-tier-heading-optional::before { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--st-primary) 35%, transparent); }
body #viewWorkspace details.brief-q-tier-group-optional > summary { padding: 8px 0; color: var(--st-primary); }
body #viewWorkspace details.brief-q-tier-group-optional > summary::after { content: "Show / hide"; margin-left: auto; color: var(--st-muted); font-size: 12px; font-weight: 600; }
body #viewWorkspace .brief-no-questions { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--st-teal) 35%, var(--st-line)); border-radius: 14px; background: color-mix(in srgb, var(--st-teal) 8%, var(--st-surface)); color: var(--st-ink); font-size: 14px; font-weight: 700; }
body #viewWorkspace .brief-question-item { margin: 0 0 12px; padding: 16px 18px; border: 1px solid color-mix(in srgb, #d29922 38%, var(--st-line)); border-left: 1px solid color-mix(in srgb, #d29922 38%, var(--st-line)); border-radius: 14px; background: color-mix(in srgb, #d29922 7%, var(--st-surface)); }
body #viewWorkspace .brief-question-item-required { border-color: color-mix(in srgb, #e5534b 40%, var(--st-line)); background: color-mix(in srgb, #e5534b 6%, var(--st-surface)); }
body #viewWorkspace .brief-q-header { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
body #viewWorkspace .brief-q-text { font-size: 15px; font-weight: 800; line-height: 1.35; color: var(--st-ink); }
body #viewWorkspace .brief-q-reason { margin: 2px 0 12px; color: var(--st-muted); font-size: 13px; line-height: 1.5; }
body #viewWorkspace .brief-q-answer-wrap > div { display: flex; gap: 8px; margin-top: 0 !important; }
body #viewWorkspace .brief-q-answer-wrap input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-surface); color: var(--st-ink); font: inherit; font-size: 14px; }
body #viewWorkspace .brief-q-answer-wrap input:focus { outline: none; border-color: var(--st-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-primary) 13%, transparent); }
body #viewWorkspace .brief-q-answer-wrap .inline-btn.primary { height: 44px; padding: 0 22px; border-radius: 12px; font-size: 14px; }

/* Page Sections (Inner Pages step) — page pills + reference-style cards */
body #viewWorkspace #bInnerPageSectionsWorkspace { margin-top: 18px !important; padding: 18px 20px !important; border: 1px solid var(--st-line) !important; border-radius: 18px; background: var(--st-surface); }
body #viewWorkspace #bInnerPageSectionsWorkspace > .cbir-detect-group-title { margin: 0 0 4px !important; }
body #viewWorkspace .cbir-ips-tabs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 118px; overflow-y: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
body #viewWorkspace .cbir-ips-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--st-line); border-radius: 999px; background: var(--st-surface); color: var(--st-ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
body #viewWorkspace .cbir-ips-tab:hover { border-color: var(--st-primary); }
body #viewWorkspace .cbir-ips-tab-active { border-color: var(--st-primary); background: color-mix(in srgb, var(--st-primary) 11%, var(--st-surface)); color: var(--st-primary); }
body #viewWorkspace .cbir-ips-tab-status { padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--st-ink) 7%, var(--st-surface)); color: var(--st-muted); font-size: 10px; font-weight: 800; letter-spacing: .02em; }
body #viewWorkspace .cbir-ips-body { display: grid; gap: 12px; margin-top: 8px; max-height: 620px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
body #viewWorkspace .cbir-ips-page-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0 12px; border-bottom: 1px solid var(--st-line); background: var(--st-surface); }
body #viewWorkspace .cbir-ips-page-title { display: inline-flex; align-items: center; gap: 8px; color: var(--st-ink); font-size: 16px; font-weight: 800; }
body #viewWorkspace .cbir-ips-page-actions { display: flex; align-items: center; gap: 8px; }
body #viewWorkspace .cbir-ips-section-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "role actions" "main main"; align-items: center; gap: 8px 12px; padding: 14px 16px; border: 1px solid var(--st-line); border-radius: 14px; background: var(--st-surface-2); }
body #viewWorkspace .cbir-ips-section-role { grid-area: role; justify-self: start; display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--st-primary) 11%, var(--st-surface)); color: var(--st-primary); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
body #viewWorkspace .cbir-ips-section-main { grid-area: main; display: grid; gap: 10px; min-width: 0; }
body #viewWorkspace .cbir-ips-section-purpose { color: var(--st-ink); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
body #viewWorkspace .cbir-ips-section-meta { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--st-line); color: var(--st-muted); font-size: 12px; }
body #viewWorkspace .cbir-ips-section-actions { grid-area: actions; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn { height: 30px; min-width: 30px; padding: 0 10px; border-radius: 9px; font-size: 12px; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[title="Move up"], body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[title="Move down"] { padding: 0; width: 30px; }
body #viewWorkspace .cbir-ips-add, body #viewWorkspace .cbir-ips-body > .cbir-plan-btn { justify-self: start; }

/* tier heading icon tiles (reference-style icon in a soft tile) */
body #viewWorkspace .brief-q-tier-heading::before { background-repeat: no-repeat; background-position: center; background-size: 18px; }
body #viewWorkspace .brief-q-tier-heading-required::before { background-color: color-mix(in srgb, #e5534b 13%, var(--st-surface)); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d1453d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6M12 16.5h.01'/%3E%3C/svg%3E"); }
body #viewWorkspace .brief-q-tier-heading-recommended::before { background-color: color-mix(in srgb, #d29922 16%, var(--st-surface)); box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b7791f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 3 20h18z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E"); }
body #viewWorkspace .brief-q-tier-heading-optional::before { box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23167da0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01'/%3E%3C/svg%3E"); }
body #viewWorkspace details.brief-q-tier-group-optional > summary::after { content: ""; width: 16px; height: 16px; background: var(--st-muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
body #viewWorkspace details.brief-q-tier-group-optional[open] > summary::after { transform: rotate(180deg); }
body #viewWorkspace .rtb-icon svg { width: 20px; height: 20px; }
body #viewWorkspace .rtb-icon { width: 40px; height: 40px; border-radius: 12px; }
body #viewWorkspace .cbir-ips-section-role { width: fit-content; min-width: 0; max-width: max-content; border: 0; box-shadow: none; }

/* ── Page Sections: roomy single-row tabs with arrows ── */
body #viewWorkspace .ips-nav { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
body #viewWorkspace .ips-nav .cbir-ips-tabs { flex: 1; min-width: 0; flex-wrap: nowrap; max-height: none; overflow-x: auto; overflow-y: hidden; gap: 8px; padding: 6px 2px; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0; }
body #viewWorkspace .ips-nav .cbir-ips-tabs::-webkit-scrollbar { display: none; }
body #viewWorkspace .ips-nav .cbir-ips-tab { flex: none; height: 36px; padding: 0 16px; gap: 8px; font-size: 13px; scroll-snap-align: center; white-space: nowrap; }
body #viewWorkspace .ips-nav .cbir-ips-tab-status { width: 7px; height: 7px; padding: 0; font-size: 0; border-radius: 50%; background: var(--st-muted); opacity: .6; }
body #viewWorkspace .ips-nav .cbir-ips-tab-active .cbir-ips-tab-status { background: var(--st-primary); opacity: 1; }
body #viewWorkspace .ips-arrow { display: none; flex: none; place-items: center; width: 34px; height: 34px; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface); color: var(--st-ink); cursor: pointer; }
body #viewWorkspace .ips-nav.ips-overflow .ips-arrow { display: grid; }
body #viewWorkspace .ips-arrow:hover:not(:disabled) { border-color: var(--st-primary); color: var(--st-primary); }
body #viewWorkspace .ips-arrow:disabled { opacity: .35; cursor: default; }
body #viewWorkspace .cbir-ips-body { margin-top: 12px; }

/* ── Clarifying Questions: one card per tier, reference "Worth answering" layout ── */
body #viewWorkspace .cbir-questions-wrap { padding: 0; border: 0; background: none; display: grid; gap: 14px; }
body #viewWorkspace .cbir-questions-header { padding: 0 4px; margin: 0; border: 0; }
body #viewWorkspace .cbir-questions-title { font-size: 12px; letter-spacing: .12em; }
body #viewWorkspace #bss-questions-body { display: grid; gap: 14px; }
body #viewWorkspace #bss-questions .brief-q-tier-group { margin: 0; padding: 18px 20px; border: 1px solid var(--st-line); border-radius: 18px; background: var(--st-surface); box-shadow: 0 6px 18px color-mix(in srgb, var(--st-primary) 6%, transparent); }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-q-tier-heading-required) { border-color: color-mix(in srgb, #e5534b 30%, var(--st-line)); }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-q-tier-heading-required):has(.brief-no-questions) { border-color: color-mix(in srgb, var(--st-teal) 35%, var(--st-line)); background: color-mix(in srgb, var(--st-teal) 6%, var(--st-surface)); }
body #viewWorkspace #bss-questions .brief-q-tier-heading { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; margin: 0 0 14px; font-size: 16px; line-height: 1.2; }
body #viewWorkspace #bss-questions .brief-q-tier-heading::before { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 12px; background-size: 20px; }
body #viewWorkspace #bss-questions .brief-q-tier-heading::after { content: attr(data-sub); grid-column: 2; color: var(--st-muted); font-size: 13px; font-weight: 500; }
body #viewWorkspace #bss-questions .brief-q-tier-heading-required { color: var(--st-ink); }
body #viewWorkspace #bss-questions .brief-q-tier-heading-recommended, body #viewWorkspace #bss-questions .brief-q-tier-heading-optional { color: var(--st-ink); }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional > summary { margin: 0; padding: 0; color: var(--st-ink); }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional:not([open]) > summary { margin: 0; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional[open] > summary { margin-bottom: 14px; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional > summary::after { content: attr(data-sub); position: static; width: auto; height: auto; background: none; -webkit-mask: none; mask: none; transform: none; color: var(--st-muted); font-size: 13px; font-weight: 500; }
body #viewWorkspace #bss-questions .brief-no-questions { padding: 0; border: 0; background: none; color: var(--st-teal); font-size: 14px; font-weight: 700; }
body #viewWorkspace #bss-questions .brief-question-item { padding: 16px 18px; margin: 0 0 12px; }
body #viewWorkspace #bss-questions .brief-question-item:last-child { margin-bottom: 0; }
body #viewWorkspace #bss-questions .brief-q-tier-badge { display: none; }
body #viewWorkspace #bss-questions .brief-q-count { min-width: 28px; height: 28px; font-size: 13px; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional > summary { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; cursor: pointer; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional > summary::before { grid-row: 1 / span 2; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional > summary::after { grid-column: 2; margin: 0; }

/* Page Sections cards — white surface, role pill, icon actions, tidy meta row */
body #viewWorkspace .cbir-ips-section-row { background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 16px; padding: 16px 18px; gap: 12px 16px; box-shadow: 0 6px 18px color-mix(in srgb, var(--st-primary) 7%, transparent); transition: border-color .15s ease, box-shadow .15s ease; }
body #viewWorkspace .cbir-ips-section-row:hover { border-color: color-mix(in srgb, var(--st-primary) 40%, var(--st-line)); box-shadow: 0 10px 26px color-mix(in srgb, var(--st-primary) 12%, transparent); }
body #viewWorkspace .cbir-ips-section-role { height: 26px; padding: 0 14px; background: color-mix(in srgb, var(--st-primary) 13%, var(--st-surface)); color: color-mix(in srgb, var(--st-primary) 80%, var(--st-ink)); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; }
body #viewWorkspace .cbir-ips-section-purpose { color: var(--st-ink); font-size: 14px; line-height: 1.6; -webkit-line-clamp: 4; }
body #viewWorkspace .cbir-ips-section-meta { gap: 10px; padding-top: 12px; color: var(--st-muted); font-size: 12.5px; font-weight: 600; }
body #viewWorkspace .cbir-ips-section-meta .cbir-badge { height: 24px; padding: 0 11px; border-color: color-mix(in srgb, var(--st-teal) 35%, var(--st-line)); background: color-mix(in srgb, var(--st-teal) 11%, var(--st-surface)); color: var(--st-teal); font-size: 11.5px; font-weight: 800; }
body #viewWorkspace .cbir-ips-section-actions { gap: 6px; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn { position: relative; width: 34px; height: 34px; min-width: 0; padding: 0; border: 1px solid var(--st-line); border-radius: 10px; background: var(--st-surface); color: var(--st-muted); font-size: 0; line-height: 0; display: inline-grid; place-items: center; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn::before { content: ""; width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn:hover:not(:disabled) { border-color: var(--st-primary); background: color-mix(in srgb, var(--st-primary) 11%, var(--st-surface)); color: var(--st-primary); }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[onclick*="_ipsMoveSection"][onclick*=",-1)"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5m-6 6 6-6 6 6'/%3E%3C/svg%3E"); }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[onclick*="_ipsMoveSection"][onclick*=",1)"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14m-6-6 6 6 6-6'/%3E%3C/svg%3E"); }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[onclick*="_ipsEditStart"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3Cpath d='m13.5 6.5 4 4'/%3E%3C/svg%3E"); }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[onclick*="_ipsResetSection"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E"); }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[onclick*="_ipsDeleteSection"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3'/%3E%3C/svg%3E"); color: #d1453d; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn[onclick*="_ipsDeleteSection"]:hover { border-color: #d1453d; background: color-mix(in srgb, #d1453d 11%, var(--st-surface)); color: #d1453d; }
body #viewWorkspace .cbir-ips-section-actions .cbir-plan-btn:disabled { opacity: .4; }

/* Clarifying Questions v3 — satisfied Required card shows a green check, full-width answer fields, right-hand chevron on Optional */
body #viewWorkspace #bss-questions .brief-q-answer-wrap { display: block; width: 100%; }
body #viewWorkspace #bss-questions .brief-q-answer-wrap > div { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%; }
body #viewWorkspace #bss-questions .brief-q-answer-wrap input { width: 100%; height: 46px; }
body #viewWorkspace #bss-questions .brief-q-answer-wrap .inline-btn.primary { height: 46px; padding: 0 28px; }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-no-questions) .brief-q-tier-heading-required::before { background-color: color-mix(in srgb, var(--st-teal) 14%, var(--st-surface)); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2308796f' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E"); }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-no-questions) .brief-q-tier-heading-required::after { content: "Nothing here is blocking you — no required decisions are outstanding."; }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-no-questions) .brief-no-questions { display: none; }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-no-questions) .brief-q-tier-heading { margin-bottom: 0; }
body #viewWorkspace #bss-questions .brief-q-tier-group:has(.brief-no-questions) { padding: 16px 20px; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional > summary { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667b84' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 4px center / 18px; padding-right: 32px; }
body #viewWorkspace #bss-questions details.brief-q-tier-group-optional[open] > summary { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667b84' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E"); }
body #viewWorkspace #bss-questions .brief-question-item { display: grid; gap: 4px; }
body #viewWorkspace #bss-questions .brief-q-header { margin: 0; }
body #viewWorkspace #bss-questions .brief-q-reason { margin: 0 0 10px; }

/* hidden per owner request (markup and renderers untouched): build-awareness card, unanswered-questions bar */
body #viewWorkspace .rbi-awareness, body #viewWorkspace #briefDecisionsCounts { display: none !important; }

/* tighter top spacing under the tab strip on every project tab */
body #viewWorkspace .workspace-tabs.page-toolbar { margin-bottom: 8px; }
body #viewWorkspace .tab-content-area { padding-top: 0; }
body #viewWorkspace .tab-panel-inner, body #viewWorkspace #tab-homepage .hp5, body #viewWorkspace #tab-pages .hp5, body #viewWorkspace #pageDetailView .hp5 { padding-top: 0 !important; }

/* project header: the Working Workspace action sits beside Copy link (restored 2026-10-21 at the owner's request) */

/* Tablet (641-900px): like the reference process rail, the six steps share the row and their labels wrap
   (the generic mobile rule made the strip scroll with a native, unthemed scrollbar). */
@media (min-width: 641px) and (max-width: 900px) {
  body #viewWorkspace .workspace-tabs.page-toolbar { overflow: hidden !important; height: 66px; }
  body #viewWorkspace .workspace-tabs .tab-btn { flex: 1 1 0; min-width: 0; padding: 0 8px; gap: 7px; font-size: 12px; line-height: 1.2; white-space: normal; text-align: left; }
  body #viewWorkspace .workspace-tabs .tab-btn::before { width: 24px; height: 24px; }
  body #viewWorkspace .workspace-tabs .tab-btn .tab-badge, body #viewWorkspace .workspace-tabs .tab-btn [class*="badge"] { display: none; }
}
/* Phone (<=640px): the strip scrolls sideways — keep its scrollbar thin and themed instead of the native white one. */
@media (max-width: 640px) {
  body #viewWorkspace .workspace-tabs.page-toolbar { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--wv-a) 45%, transparent) transparent; }
  body #viewWorkspace .workspace-tabs.page-toolbar::-webkit-scrollbar { height: 5px; }
  body #viewWorkspace .workspace-tabs.page-toolbar::-webkit-scrollbar-track { background: transparent; }
  body #viewWorkspace .workspace-tabs.page-toolbar::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--wv-a) 45%, transparent); border-radius: 4px; }
}

/* Brief → AI Review Notes: the "nothing to show" lines used the legacy --text-faint (#30363d in dark, #9ca3af in light) — unreadable. */
body #viewWorkspace .ai-intel-empty { color: var(--st-muted); font-size: 13px; line-height: 1.5; }
