:root {
  --bg-page: #0b1120;
  --bg-surface: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263449;
  --bg-input: #0f172a;
  --border: #334155;
  --border-accent: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;
  --radius: 10px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(17, 24, 39, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 6px;
}

.topbar-brand h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ver-tag {
  font-size: 12px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 5px;
  vertical-align: middle;
}

.subtitle {
  color: var(--text-muted);
  font-size: 12.5px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

.pill-safe {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.pill-safe .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.pill-budget {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.35);
}

/* Pipeline Bar */
.pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  gap: 6px;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 155px;
}

.pipeline-step:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.step-num {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.step-info {
  display: flex;
  flex-direction: column;
}

.step-info strong {
  font-size: 12.5px;
  color: var(--text-main);
}

.step-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.pipeline-arrow {
  color: var(--text-dim);
  font-weight: 700;
}

/* Workbench Layout */
.workbench {
  display: grid;
  grid-template-columns: 330px 1fr;
  min-height: calc(100vh - 115px);
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 700;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-item {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.project-item:hover {
  border-color: #64748b;
}

.project-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: rgba(14, 165, 233, 0.08);
}

.project-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.project-item h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.project-item p {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.project-metrics {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.principles-box {
  margin-top: auto;
  padding: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px;
}

.principles-box h4 {
  font-size: 12.5px;
  color: #38bdf8;
  margin-bottom: 6px;
}

.principles-box ul {
  padding-left: 16px;
  color: var(--text-muted);
}

.principles-box li {
  margin-bottom: 3px;
}

/* Main Canvas */
.main-canvas {
  padding: 20px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.project-banner {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border-color: rgba(56, 189, 248, 0.35);
}

.banner-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.meta-tag {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

.banner-stats {
  display: flex;
  gap: 12px;
  font-size: 12.5px;
  font-family: var(--font-mono);
}

.stat-chip {
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 10px;
  border-radius: 6px;
}

.project-banner h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.proj-question {
  color: #cbd5e1;
  font-size: 13.5px;
  margin-bottom: 12px;
}

.proj-meta-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
}

.keywords-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-tag {
  background: rgba(14, 165, 233, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px;
}

/* Module Tabs */
.module-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.tab-btn {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: #64748b;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Section Styling */
.module-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h3 {
  font-size: 16.5px;
  color: #38bdf8;
  margin-bottom: 3px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 12.5px;
  max-width: 900px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
}

@media (max-width: 1200px) {
  .workbench {
    grid-template-columns: 1fr;
  }
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Vanovax OS Module Navigation & Logout */
.os-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.os-nav-item {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
}

.os-nav-item.active {
  background: rgba(14, 165, 233, 0.22);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.os-nav-item.muted {
  opacity: 0.55;
  cursor: default;
}

.btn-logout {
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.14);
  border-color: var(--rose);
  color: #fff;
}

.score-card-title {
  font-size: 16px;
  margin-top: 6px;
  color: #f8fafc;
}

.score-total-box {
  text-align: right;
}

.big-score-denom {
  font-size: 15px;
  color: #94a3b8;
}

.score-total-label {
  font-size: 11.5px;
  color: #94a3b8;
}

.dim-progress {
  width: 100%;
  height: 10px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

.dim-progress::-webkit-progress-bar {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
}

.dim-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 999px;
}

.dim-progress.clamped::-webkit-progress-value {
  background: linear-gradient(90deg, #be123c, #f43f5e);
}

.bar-val {
  font-family: var(--font-mono);
  text-align: right;
  color: #38bdf8;
}

.bar-val.clamped {
  color: #fda4af;
}

.bar-rationale {
  font-size: 11.5px;
  color: #94a3b8;
  margin-left: 195px;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }
  .topbar-brand {
    flex-wrap: wrap;
    gap: 8px;
  }
  .topbar-brand .subtitle {
    display: none;
  }
  .topbar-status {
    flex-wrap: wrap;
    width: 100%;
    gap: 6px;
  }
  .pipeline-bar {
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .workbench {
    padding: 12px;
    gap: 12px;
  }
  .form-row-2,
  .form-row-3,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .score-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .modal-card {
    width: 96vw;
    max-height: 90vh;
    padding: 16px;
  }
}

/* Forms */
form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 500;
  margin-bottom: 10px;
}

input,
textarea,
select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.full-width {
  grid-column: 1 / -1;
}

.inline-dates {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
  grid-column: 1 / -1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 12.5px;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11.5px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--emerald);
  color: #fff;
}

.btn-warning {
  background: var(--amber);
  color: #0f172a;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.4);
}

.btn-outline {
  background: transparent;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

/* Lists & Cards */
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hint-tag {
  font-size: 11px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 4px;
}

.scrollable-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.sub-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.sub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.channel-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}

.corroboration-badge {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

/* M3 10-Dimension Demand Grid */
.demand-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 14px;
}

.demand-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demand-card.status-APPROVED,
.demand-card.status-EDITED_APPROVED {
  border-left: 4px solid var(--emerald);
}

.demand-card.status-PENDING_REVIEW {
  border-left: 4px solid var(--amber);
}

.demand-card.status-REJECTED {
  border-left: 4px solid var(--rose);
  opacity: 0.7;
}

.dim-grid-10 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  padding: 10px;
  border-radius: 8px;
  font-size: 12.5px;
}

.dim-item {
  display: flex;
  flex-direction: column;
}

.dim-item.full {
  grid-column: 1 / -1;
}

.dim-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.dim-val {
  color: var(--text-main);
}

.quote-box {
  background: rgba(14, 165, 233, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 8px 10px;
  font-size: 12px;
  color: #bae6fd;
  border-radius: 0 6px 6px 0;
}

/* M4 Clusters */
.cluster-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cluster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.cluster-card.CONFIRMED {
  border-color: rgba(16, 185, 129, 0.55);
}

.cluster-card.PROPOSED {
  border-color: rgba(245, 158, 11, 0.55);
}

.linked-demands-box {
  margin-top: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 8px;
}

/* M5 Competitor Coverage Alert */
.alert-box {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.alert-warn {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}

.alert-ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

/* M6 7-Dimension Scoring Card */
.assessment-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.big-score {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.big-score.high {
  color: #34d399;
}

.big-score.warn {
  color: #fbbf24;
}

.dim-bars-7 {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 185px 1fr 75px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.bar-track {
  height: 9px;
  background: #0f172a;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: 999px;
}

.bar-fill.clamped {
  background: linear-gradient(90deg, #f59e0b, #f43f5e);
}

.clamp-alert {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(244, 63, 94, 0.13);
  border: 1px solid rgba(244, 63, 94, 0.4);
  border-radius: 8px;
  color: #fecdd3;
  font-size: 12.5px;
}

/* Decision Badges */
.decision-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-mono);
}

.decision-BUILD {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid #10b981;
}

.decision-VALIDATE {
  background: rgba(14, 165, 233, 0.22);
  color: #38bdf8;
  border: 1px solid #0ea5e9;
}

.decision-CONTINUE {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid #f59e0b;
}

.decision-HOLD {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid #64748b;
}

.decision-REJECT {
  background: rgba(244, 63, 94, 0.22);
  color: #fda4af;
  border: 1px solid #f43f5e;
}

/* Toast & Modals */
.toast-banner {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
  font-weight: 500;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-wide {
  max-width: 1060px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 10px;
}

.ledger-table th,
.ledger-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

.ledger-table th {
  background: var(--bg-card);
  color: #38bdf8;
}

.mt-16 {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

/* AUD-001 / AUD-002 Safe DOM & Auth Modal Styles (Zero inline styles) */
.safe-ext-link {
  color: #38bdf8;
  text-decoration: none;
  font-size: 11.5px;
}

.safe-ext-link:hover {
  text-decoration: underline;
}

.blocked-url-badge {
  color: #fda4af;
  font-size: 11px;
  font-family: var(--font-mono);
}

.signal-platform {
  margin-left: 6px;
}

.signal-author-meta {
  font-size: 11.5px;
  color: #94a3b8;
  margin-left: 8px;
}

.signal-title {
  font-size: 13.5px;
  margin-bottom: 5px;
  color: #f8fafc;
}

.signal-raw-content {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.signal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono);
}

.evidence-signal-card {
  margin-bottom: 14px;
  border-color: #0ea5e9;
}

.evidence-signal-title {
  font-size: 15px;
  margin-bottom: 6px;
}

.evidence-signal-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.evidence-raw-box {
  background: #0b1120;
  padding: 12px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.evidence-quote-mark {
  background: #0284c7;
  color: #ffffff;
  padding: 2px 4px;
  border-radius: 4px;
}

.evidence-verify-ok {
  margin-top: 8px;
  font-size: 12px;
  color: #34d399;
}

.evidence-verify-warn {
  margin-top: 8px;
  font-size: 12px;
  color: #fbbf24;
}

.evidence-demand-title {
  color: #38bdf8;
  margin-bottom: 8px;
}

.toast-warn {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.toast-ok {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}

.auth-hint {
  font-size: 13px;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-error {
  color: #fda4af;
  font-size: 12px;
}

.modal-xl {
  max-width: 1180px;
  width: 96vw;
}

.dr-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dr-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.dr-composer textarea,
.dr-composer input,
.dr-composer select,
.ai-settings-grid input,
.ai-settings-grid select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 13px;
}

.dr-options-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dr-options-row label,
.settings-section label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #cbd5e1;
}

.dr-actions-row,
.dr-steering-row,
.settings-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dr-steering-row input {
  flex: 1;
  min-width: 240px;
}

.dr-status-banner {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  font-size: 12.5px;
}

.dr-workspace-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  min-height: 360px;
}

.dr-history-panel,
.dr-output-panel,
.settings-section {
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dr-panel-title {
  font-weight: 700;
  font-size: 13px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding-bottom: 6px;
}

.dr-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow-y: auto;
}

.dr-history-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(30, 41, 59, 0.65);
  cursor: pointer;
  text-align: left;
  color: #e2e8f0;
  font-size: 12px;
}

.dr-history-item.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.dr-progress-summary {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}

.dr-report-output {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #f1f5f9;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow-y: auto;
}

.ai-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-check-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.checkbox-inline input {
  width: auto;
}

.settings-hint {
  font-size: 11.5px;
  color: #94a3b8;
}

.settings-usage-box,
.ai-test-result {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.settings-footer-full {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 768px) {
  .dr-options-row,
  .dr-workspace-grid,
  .ai-settings-grid,
  .settings-two-col {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
 * DemandOS V0.2 — Primary AI Research Workbench (Free Chat / Research / Compare)
 * ============================================================================ */
.ai-workbench {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
  max-width: 1680px;
  margin: 0 auto;
  gap: 0;
}

.wb-sidebar {
  background: rgba(15, 23, 42, 0.92);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 68px);
}

.wb-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wb-new-chat-btn {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  font-weight: 600;
}

.wb-conn-card {
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.wb-conn-card.warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

.wb-select-compact {
  max-width: 175px;
  font-size: 12px;
}

.wb-composer-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.wb-reasoning-box {
  margin: 6px 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  font-size: 12px;
  color: var(--text-muted);
}

.wb-reasoning-box summary {
  cursor: pointer;
  font-weight: 600;
  color: #a5b4fc;
}

.wb-reasoning-pre {
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
}

.wb-tool-trace {
  margin: 6px 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wb-tool-chip {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-family: var(--font-mono);
}

.wb-side-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wb-list-item {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.12);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wb-list-item:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.95);
}

.wb-list-item.active {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
}

.wb-list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wb-list-item-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.wb-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: calc(100vh - 68px);
  background: rgba(2, 6, 23, 0.6);
}

.wb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.8);
}

.wb-mode-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wb-tab {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.wb-tab.active {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 600;
}

.wb-model-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wb-model-label {
  font-size: 12px;
  color: #94a3b8;
}

.wb-model-select {
  min-width: 220px;
  max-width: 310px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.wb-token-pill {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

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

.wb-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wb-welcome {
  max-width: 820px;
  margin: 24px auto;
  padding: 24px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.wb-welcome h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #f8fafc;
}

.wb-welcome p {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

.wb-starter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.wb-starter-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.wb-starter-btn:hover {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.14);
}

.wb-msg {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 12px;
  line-height: 1.75;
  font-size: 14.5px;
}

.wb-msg-user {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #f8fafc;
}

.wb-msg-assistant {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.wb-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.wb-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.wb-msg-sources {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wb-composer {
  padding: 14px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wb-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 68px;
  max-height: 220px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
}

.wb-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.wb-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
}

.wb-composer-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wb-research-setup,
.wb-compare-setup {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-research-setup textarea,
.wb-compare-setup textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  font-size: 14px;
  font-family: inherit;
}

.wb-research-opts,
.wb-compare-models {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.wb-research-opts label,
.wb-compare-models label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #94a3b8;
}

.wb-research-opts select,
.wb-research-opts input,
.wb-compare-models select {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}

.wb-compare-prompt-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.wb-research-live,
.wb-compare-grid {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

.wb-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  align-content: start;
}

.wb-compare-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wb-compare-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.wb-compare-card-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
  line-height: 1.7;
  color: #e2e8f0;
}

@media (max-width: 900px) {
  .ai-workbench {
    grid-template-columns: 1fr;
  }
  .wb-sidebar {
    max-height: 280px;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }
  .wb-main {
    height: auto;
    min-height: 70vh;
  }
}

/* ============================================================================
   DemandOS 2.0 — Dark-Tech 7-Tab Top Navigation & Daily Opportunity Hub
   ============================================================================ */
.topbar-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 20px;
  background: linear-gradient(90deg, #070d1c 0%, #0d1730 50%, #070d1c 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-v2 .topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-v2 .topbar-brand h1 {
  font-size: 17px;
  margin: 0;
  white-space: nowrap;
}

.main-nav-v2 {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
}

.nav-tab-v2 {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-tab-v2:hover {
  color: #f8fafc;
  background: rgba(56, 189, 248, 0.1);
}

.nav-tab-v2.active {
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(99, 102, 241, 0.3));
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.topbar-status-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pill-compact {
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-view {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 22px 48px;
}

.hub-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(14, 30, 58, 0.88));
  border: 1px solid rgba(56, 189, 248, 0.22);
  margin-bottom: 18px;
}

.hub-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #f8fafc;
}

.hub-subtitle {
  margin: 0;
  font-size: 13.5px;
  color: #94a3b8;
  max-width: 760px;
  line-height: 1.6;
}

.hub-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-pill {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
}

.filter-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  color: #f8fafc;
}

.daily-settings-details {
  font-size: 12.5px;
  color: #94a3b8;
}

.daily-settings-details summary {
  cursor: pointer;
  color: #38bdf8;
  user-select: none;
}

.daily-settings-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.daily-settings-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #cbd5e1;
}

.status-banner-v2 {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: #cbd5e1;
  font-size: 13px;
  margin-bottom: 18px;
}

.opp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(410px, 1fr));
  gap: 16px;
}

.opp-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.opp-card-v2 {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(11, 18, 34, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.opp-card-v2:hover {
  border-color: rgba(56, 189, 248, 0.5);
}

.opp-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.opp-card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: #f8fafc;
}

.opp-score-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.score-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.score-chip-biz {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.score-chip-fit {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.opp-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #94a3b8;
}

.opp-field {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.opp-field strong {
  color: #e2e8f0;
}

.opp-risk-box {
  font-size: 12.5px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  padding: 8px 10px;
}

.opp-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.hub-two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.hub-panel {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 16px 18px;
}

.hub-panel-head h3 {
  margin: 0 0 14px;
  font-size: 15.5px;
  color: #f8fafc;
}

.job-stage-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.stage-pill {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.stage-pill.done {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.stage-pill.active {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  border-color: #38bdf8;
}

/* ============================================================================
   DemandOS 2.0 — Research Experience Redesign (L1/L2/L3, AI Inspiration, Prose)
   ============================================================================ */

.pd-header {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.pd-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pd-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pd-title {
  margin: 0 0 10px 0;
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.pd-conclusion {
  margin: 0 0 14px 0;
  font-size: 15.5px;
  line-height: 1.7;
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
}

.pd-meta-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #94a3b8;
}

.pd-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pd-l1-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pd-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  padding: 18px 20px;
}

.pd-card h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #f1f5f9;
  font-weight: 600;
}

.pd-card ul {
  margin: 0;
  padding-left: 18px;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.75;
}

.pd-card li {
  margin-bottom: 6px;
}

.pd-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 12px 0;
}

.pd-section-head h3 {
  margin: 0;
  font-size: 17px;
  color: #f8fafc;
}

.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.inspiration-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insp-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 600;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.16);
  padding: 3px 10px;
  border-radius: 999px;
}

.insp-title {
  font-size: 15.5px;
  font-weight: 650;
  color: #f8fafc;
  line-height: 1.5;
}

.insp-meta {
  font-size: 13.5px;
  line-height: 1.68;
  color: #cbd5e1;
}

.insp-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.pd-followup-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 12px;
}

.pd-followup-box h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  color: #f8fafc;
}

.pd-quick-prompts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 12px 0;
}

.pd-followup-input-row {
  display: flex;
  gap: 8px;
}

.pd-followup-input-row input {
  flex: 1;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  color: #f1f5f9;
  padding: 10px 14px;
  font-size: 14px;
}

.pd-followup-result {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.l2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.l2-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 16px 18px;
}

.l2-card-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 6px;
}

.l2-card-body {
  font-size: 14px;
  line-height: 1.72;
  color: #e2e8f0;
}

/* L3 Full Report Editorial Reader */
.modal-reader {
  width: min(940px, 95vw);
  max-height: 90vh;
}

.modal-reader-body {
  padding: 24px 32px;
  overflow-y: auto;
}

.l3-reader-article {
  max-width: 780px;
  margin: 0 auto;
}

.l3-raw-details {
  max-width: 780px;
  margin: 28px auto 0 auto;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 13px;
  color: #94a3b8;
}

/* Safe Markdown Prose Typography */
.md-prose {
  font-size: 14.8px;
  line-height: 1.82;
  color: #e2e8f0;
  word-break: break-word;
}

.md-prose .md-h1 {
  font-size: 22px;
  font-weight: 700;
  color: #f8fafc;
  margin: 22px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.md-prose .md-h2 {
  font-size: 18px;
  font-weight: 650;
  color: #f1f5f9;
  margin: 20px 0 10px 0;
}

.md-prose .md-h3 {
  font-size: 15.5px;
  font-weight: 650;
  color: #bae6fd;
  margin: 16px 0 8px 0;
}

.md-prose .md-h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin: 14px 0 6px 0;
}

.md-prose .md-p {
  margin: 0 0 12px 0;
}

.md-prose .md-list {
  margin: 0 0 14px 0;
  padding-left: 22px;
}

.md-prose .md-list li {
  margin-bottom: 6px;
}

.md-prose .md-blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid #6366f1;
  background: rgba(99, 102, 241, 0.08);
  color: #cbd5e1;
  border-radius: 0 8px 8px 0;
}

.md-prose .md-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

.md-prose .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.md-prose .md-table th,
.md-prose .md-table td {
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 8px 12px;
  text-align: left;
}

.md-prose .md-table th {
  background: rgba(30, 41, 59, 0.85);
  color: #f8fafc;
  font-weight: 600;
}

.md-prose .md-code-block {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}

.md-prose .md-inline-code {
  background: rgba(30, 41, 59, 0.9);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #7dd3fc;
}

.md-prose .md-math-block {
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  text-align: center;
  margin: 12px 0;
}

.md-prose .md-math-inline {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  color: #fde68a;
}

.md-prose .md-link {
  color: #38bdf8;
  text-decoration: underline;
}

.md-prose .md-hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  margin: 18px 0;
}

.opp-details-fold {
  margin-top: 6px;
  font-size: 13px;
  color: #94a3b8;
}

.opp-details-fold summary {
  cursor: pointer;
  color: #7dd3fc;
}

@media (max-width: 960px) {
  .topbar-v2 {
    flex-wrap: wrap;
  }
  .hub-two-col,
  .opp-cards-grid,
  .briefing-cards-grid,
  .pd-l1-layout,
  .inspiration-grid,
  .l2-grid {
    grid-template-columns: 1fr;
  }
  .modal-reader-body {
    padding: 16px;
  }
}

/* ==========================================================================
   Personal Business Intelligence Briefing Panel (Autonomous Learning)
   ========================================================================== */
.briefing-panel {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.72));
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
}

.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.briefing-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.briefing-header h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  color: #f8fafc;
}

.briefing-sub {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
}

.briefing-rep-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.briefing-rep-chip {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  white-space: nowrap;
}

.briefing-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.briefing-tab {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.briefing-tab.active,
.briefing-tab:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #f8fafc;
}

.briefing-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.briefing-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.briefing-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.briefing-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

.briefing-badge.badge-innovation { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
.briefing-badge.badge-product { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.briefing-badge.badge-success { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.briefing-badge.badge-warn { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
.briefing-badge.badge-discovery { background: rgba(14, 165, 233, 0.18); color: #38bdf8; }
.briefing-badge.badge-tech { background: rgba(34, 197, 94, 0.16); color: #86efac; }

.briefing-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #f8fafc;
  line-height: 1.45;
}

.briefing-card-line {
  font-size: 13px;
  line-height: 1.62;
  color: #cbd5e1;
}

.briefing-card-line.fact-line {
  border-left: 3px solid #10b981;
  padding-left: 8px;
}

.briefing-card-line.hypo-line {
  border-left: 3px solid #a855f7;
  padding-left: 8px;
}

.briefing-card-foot {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 12.5px;
}

.briefing-section-label {
  font-size: 14px;
  font-weight: 650;
  color: #94a3b8;
  margin: 6px 0 12px 2px;
}

.opp-tier-row {
  margin-bottom: 6px;
}

.tier-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.tier-badge-a {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.42);
}

.tier-badge-b {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.42);
}

.tier-badge-c {
  background: rgba(168, 85, 247, 0.16);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.42);
}

.tier-badge-d {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

/* DemandOS 2.0 Cloud Release — Mobile & iPhone PWA Responsive Polish */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .topbar-v2 {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    height: auto;
  }
  .main-nav-v2 {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .main-nav-v2::-webkit-scrollbar {
    display: none;
  }
  .nav-tab-v2 {
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 12.5px;
    padding: 6px 10px;
  }
  .topbar-status-v2 {
    margin-left: auto;
    gap: 6px;
  }
  .pill-compact {
    display: none;
  }
  .hub-view {
    padding: 12px;
  }
  .hub-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hub-hero-actions,
  .hub-toolbar,
  .filter-pills,
  .daily-settings-bar,
  .opp-card-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }
  .opp-cards-grid,
  .hub-two-col,
  .l2-grid,
  .briefing-grid {
    grid-template-columns: 1fr !important;
  }
  .opp-card-v2,
  .hub-panel,
  .briefing-panel,
  .modal-card {
    max-width: 100%;
    min-width: 0;
    word-break: break-word;
  }
  .modal-card {
    width: 96vw !important;
    max-height: 92vh;
  }
}
