/* ==========================================================================
   AI-native Evaluator · Design System & Stylesheet
   Executive Research Cockpit · Modern Academic & Corporate Aesthetics
   ========================================================================== */

:root {
  color-scheme: light;
  /* Urban Community AI - Core Design Tokens */
  --bg: #EDF0EE;
  --bg2: #E6EAE8;
  --panel: #FFFFFF;
  --panel2: #F4F6F5;
  --line: #D3DAD8;
  --line2: #BCC6C3;
  --tx: #152024;
  --mut: #53646A;
  --dim: #8A989C;
  --acc: #B6700F;
  --acc2: #8E560A;
  --native: #0E8676;
  --warn: #C04A30;
  --ai: #6B45B8;

  --c-MV: #B07E12;
  --c-DL: #2D6FB0;
  --c-OP: #1B8A6C;
  --c-GC: #6E7A22;
  --c-FI: #BC5526;
  --c-PE: #A34F95;
  --c-ST: #5358C0;

  --grid: rgba(21, 32, 36, 0.07);
  --shadow: 0 18px 50px rgba(20, 30, 34, 0.10);

  /* Cockpit Layout Mappings */
  --bg-page: var(--bg);
  --bg-sidebar: var(--panel);
  --sidebar-line: var(--line);
  --bg-card: var(--panel);
  --bg-elevated: var(--panel2);
  --bg-subtle: var(--bg2);
  --bg-surface: var(--panel2);
  --bg-accent: color-mix(in srgb, var(--acc) 10%, var(--panel));

  --ink-primary: var(--tx);
  --ink-secondary: var(--mut);
  --ink-muted: var(--dim);
  --ink-inverse: #E3EAE7;

  --border-light: var(--line);
  --border-focus: var(--native);
  --border-strong: var(--line2);

  --green-primary: var(--native);
  --green-hover: #0a6b5e;
  --green-light: #45A898;
  --green-subtle: color-mix(in srgb, var(--native) 12%, var(--bg));

  --gold-accent: var(--acc);
  --gold-subtle: color-mix(in srgb, var(--acc) 12%, var(--bg));
  --gold-line: color-mix(in srgb, var(--acc) 30%, var(--line));

  --blue-accent: #2D6FB0;
  --blue-subtle: #E6F0FA;
  --red-accent: var(--warn);
  --red-subtle: color-mix(in srgb, var(--warn) 12%, var(--bg));

  --sidebar-width: 260px;
  --topbar-height: 70px;

  --font-sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --shadow-sm: 0 1px 3px rgba(21, 32, 36, 0.05);
  --shadow-md: 0 4px 12px rgba(21, 32, 36, 0.08);
  --shadow-lg: 0 18px 40px rgba(21, 32, 36, 0.10);
  --shadow-glow: 0 0 20px rgba(14, 134, 118, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

:root[data-theme="dark"],
html[data-theme="dark"],
body[data-theme="dark"],
[data-theme="dark"] {
  color-scheme: dark;
  /* Urban Community AI - Dark Mode Tokens */
  --bg: #0C1215;
  --bg2: #0F171B;
  --panel: #131C21;
  --panel2: #18232A;
  --line: #233139;
  --line2: #2F414B;
  --tx: #E3EAE7;
  --mut: #8C9DA1;
  --dim: #5D6E74;
  --acc: #E9A43B;
  --acc2: #F3C375;
  --native: #58D5C1;
  --warn: #E26A4F;
  --ai: #B69CFF;

  --c-MV: #E3B34E;
  --c-DL: #62A2DE;
  --c-OP: #4CBF9F;
  --c-GC: #A9B55E;
  --c-FI: #E07F52;
  --c-PE: #CD86C0;
  --c-ST: #9195E6;

  --grid: rgba(140, 157, 161, 0.10);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.40);

  /* Cockpit Layout Mappings - Dark */
  --bg-page: var(--bg);
  --bg-sidebar: #070B0D;
  --sidebar-line: var(--line);
  --bg-card: var(--panel);
  --bg-elevated: var(--panel2);
  --bg-subtle: var(--bg2);
  --bg-surface: var(--panel2);
  --bg-accent: color-mix(in srgb, var(--acc) 12%, var(--panel));

  --ink-primary: var(--tx);
  --ink-secondary: var(--mut);
  --ink-muted: var(--dim);
  --ink-inverse: #0C1215;

  --border-light: var(--line);
  --border-focus: var(--native);
  --border-strong: var(--line2);

  --green-primary: var(--native);
  --green-hover: #75ded0;
  --green-light: #58D5C1;
  --green-subtle: rgba(88, 213, 193, 0.12);

  --gold-accent: var(--acc);
  --gold-subtle: rgba(233, 164, 59, 0.12);
  --gold-line: rgba(233, 164, 59, 0.35);

  --blue-accent: #62A2DE;
  --blue-subtle: rgba(98, 162, 222, 0.15);
  --red-accent: var(--warn);
  --red-subtle: rgba(226, 106, 79, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 24px rgba(88, 213, 193, 0.25);
}

:root[data-theme="dark"] body {
  background-color: var(--bg-page);
  color: var(--ink-primary);
}

:root[data-theme="dark"] .topbar {
  background: rgba(19, 28, 33, 0.85);
  border-bottom-color: var(--border-light);
}


:root[data-theme="dark"] .connection-badge {
  background: var(--bg-card);
  color: var(--ink-secondary);
  border-color: var(--border-light);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

:root[data-theme="dark"] dialog {
  background-color: var(--bg-card);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

:root[data-theme="dark"] .run-form {
  background: linear-gradient(180deg, #111827, #162032);
  border-color: var(--border-light);
}

:root[data-theme="dark"] .demo-banner {
  background: var(--bg-card);
  border-color: var(--border-light);
}

:root[data-theme="dark"] pre,
:root[data-theme="dark"] code {
  background: #060910;
  border-color: var(--border-light);
}

:root[data-theme="dark"] .data-table th {
  background: var(--bg-elevated);
  color: var(--ink-primary);
}

:root[data-theme="dark"] .data-table td {
  border-color: var(--border-light);
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .dim-card,
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .metric-box {
  background: var(--bg-card);
  border-color: var(--border-light);
}

:root[data-theme="dark"] .tab-btn {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--ink-secondary);
}

:root[data-theme="dark"] .tab-btn.active {
  background: var(--bg-elevated);
  color: var(--blue-accent);
  border-color: var(--blue-accent);
}

:root[data-theme="dark"] .markdown-rendered {
  color: var(--ink-primary);
}

:root[data-theme="dark"] .markdown-rendered h1,
:root[data-theme="dark"] .markdown-rendered h2,
:root[data-theme="dark"] .markdown-rendered h3,
:root[data-theme="dark"] .markdown-rendered h4 {
  color: #f8fafc;
  border-bottom-color: var(--border-light);
}

:root[data-theme="dark"] .markdown-rendered blockquote {
  background: var(--bg-subtle);
  border-left-color: var(--blue-accent);
  color: var(--ink-secondary);
}

:root[data-theme="dark"] .markdown-rendered table th {
  background: var(--bg-elevated);
  color: #f8fafc;
}

:root[data-theme="dark"] .markdown-rendered table td {
  border-color: var(--border-light);
}

:root[data-theme="dark"] .markdown-rendered table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

:root[data-theme="dark"] .event-log,
:root[data-theme="dark"] .log-terminal-stream,
[data-theme="dark"] .event-log,
[data-theme="dark"] .log-terminal-stream {
  background: #060910;
  border-color: var(--border-light);
}

:root[data-theme="dark"] .dossier-paper,
[data-theme="dark"] .dossier-paper {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--ink-primary);
}

:root[data-theme="dark"] .button.secondary,
[data-theme="dark"] .button.secondary {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--ink-primary);
}

:root[data-theme="dark"] .diff-add,
[data-theme="dark"] .diff-add { background: #064e3b; color: #a7f3d0; border-left: 3px solid #10b981; }

:root[data-theme="dark"] .diff-del,
[data-theme="dark"] .diff-del { background: #450a0a; color: #fecaca; border-left: 3px solid #ef4444; }

:root[data-theme="dark"] .diff-mod,
[data-theme="dark"] .diff-mod { background: #451a03; color: #fde68a; border-left: 3px solid #f59e0b; }

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-primary);
  background:
    radial-gradient(circle at 1px 1px, var(--grid) 1.2px, transparent 0) 0 0/28px 28px,
    radial-gradient(ellipse at 85% 8%, color-mix(in srgb, var(--native) 7%, transparent), transparent 45%),
    radial-gradient(ellipse at 5% 40%, color-mix(in srgb, var(--acc) 5%, transparent), transparent 40%),
    var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--green-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--green-hover);
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--sidebar-line);
  color: var(--ink-primary);
  padding: 28px 18px 20px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(21, 32, 36, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--tx);
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--native), #1B8A6C);
  border: 1px solid color-mix(in srgb, var(--native) 30%, transparent);
  border-radius: var(--radius-md);
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  position: relative;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--native) 25%, transparent);
}

.brand-mark span {
  position: absolute;
  color: var(--acc);
  right: 6px;
  bottom: 4px;
  font-size: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--tx);
  font-family: var(--font-sans);
}

.brand-sub {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--mut);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.workspace-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--sidebar-line);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 10.5px;
  letter-spacing: 0.8px;
}

.pill-label {
  color: var(--mut);
  font-weight: 600;
  font-family: var(--font-mono);
}

.pill-badge {
  background: color-mix(in srgb, var(--native) 15%, transparent);
  color: var(--native);
  border: 1px solid color-mix(in srgb, var(--native) 30%, transparent);
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 10px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--mut);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  text-align: left;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg2);
  color: var(--tx);
}

.nav-item.active {
  background: color-mix(in srgb, var(--native) 12%, var(--panel));
  color: var(--native);
  border-left: 3px solid var(--native);
  font-weight: 700;
}

.nav-icon {
  font-size: 16px;
  width: 18px;
  text-align: center;
  color: var(--dim);
}

.nav-item.active .nav-icon {
  color: var(--native);
}

.nav-arrow, .nav-tag, .nav-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
}

.nav-tag {
  background: color-mix(in srgb, var(--acc) 15%, transparent);
  color: var(--acc2);
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-count {
  background: var(--line);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--tx);
  font-weight: 700;
}

.history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  border-top: 1px solid var(--sidebar-line);
  padding-top: 18px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--dim);
  font-family: var(--font-mono);
  margin-bottom: 12px;
  padding: 0 4px;
}

.history-tools button {
  color: var(--dim);
  font-size: 16px;
  transition: transform 0.2s ease, color 0.15s ease;
}

.history-tools button:hover {
  color: var(--tx);
  transform: rotate(90deg);
}

.run-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-right: -6px;
  padding-right: 6px;
}

.side-empty {
  font-size: 11.5px;
  color: var(--mut);
  line-height: 1.6;
  padding: 8px 4px;
}

.history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--tx);
  text-align: left;
  transition: all 0.15s ease;
  background: transparent;
  border: 1px solid transparent;
}

.history-item:hover {
  background: var(--bg2);
  color: var(--tx);
}

.history-item.selected {
  background: color-mix(in srgb, var(--native) 10%, var(--panel));
  border-color: color-mix(in srgb, var(--native) 35%, transparent);
  color: var(--tx);
}

.history-dot {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.dot-done { color: var(--native); }
.dot-active { color: var(--acc); animation: pulse 1.5s infinite; }
.dot-warn { color: var(--warn); }

.history-info strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--tx);
}

.history-info small {
  display: block;
  font-size: 10px;
  color: var(--mut);
  margin-top: 3px;
  font-family: var(--font-mono);
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-line);
}

.avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--native), #1B8A6C);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--native) 30%, transparent);
}

.company-info {
  flex: 1;
  overflow: hidden;
}

.company-info strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.company-info small {
  display: block;
  font-size: 9.5px;
  color: var(--mut);
  font-family: var(--font-mono);
}

.icon-btn {
  color: var(--mut);
  font-size: 18px;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: var(--tx);
  background: var(--bg2);
}

/* ==========================================================================
   Top Bar & App Shell
   ========================================================================== */

.app-shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}

.crumb-root {
  color: var(--ink-secondary);
  font-weight: 500;
}

.crumb-sep {
  color: var(--border-strong);
}

.breadcrumbs strong {
  color: var(--ink-primary);
  font-weight: 600;
}

.crumb-run {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green-light);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--ink-secondary);
  transition: all 0.2s ease;
}

.connection-badge:hover {
  border-color: var(--border-focus);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-accent);
}

.connection-badge.ready .status-dot {
  background: #38a169;
  box-shadow: 0 0 8px rgba(56, 161, 105, 0.6);
}

.connection-badge.offline .status-dot {
  background: #e53e3e;
}

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

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--ink-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.theme-toggle-btn:hover {
  border-color: var(--border-focus);
  color: var(--ink-primary);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn .sun-icon {
  display: none;
  color: #f59e0b;
  font-size: 14px;
}

.theme-toggle-btn .moon-icon {
  display: inline-block;
  color: #6366f1;
  font-size: 14px;
}

:root[data-theme="dark"] .theme-toggle-btn .sun-icon,
[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: inline-block;
}

:root[data-theme="dark"] .theme-toggle-btn .moon-icon,
[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

main {
  flex: 1;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 40px 60px;
}

.view {
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--green-light);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiny-line {
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--green-light);
}

.edition {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink-muted);
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 24px 0 36px;
}

.hero-content {
  flex: 1;
  max-width: 780px;
}

h1 {
  font-size: 46px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -1.8px;
  color: var(--ink-primary);
  margin-bottom: 18px;
}

h1 span {
  color: var(--green-light);
}

.hero-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 22px;
}

.definition-quote {
  border-left: 3px solid var(--gold-accent);
  background: var(--gold-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #594211;
  font-style: italic;
}

.quote-source {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 11px;
  color: #8c6c24;
  margin-top: 8px;
}

/* Orbit Graphic */
.orbit {
  width: 220px;
  height: 200px;
  position: relative;
  flex-shrink: 0;
}

.orbit-center {
  position: absolute;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #1b3d31, #255744);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  left: 70px;
  top: 60px;
  color: #fff;
  box-shadow: 0 10px 25px rgba(27, 61, 49, 0.35);
  border: 2px solid #5fb38f;
}

.orbit-num {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.orbit-sub {
  font-size: 8px;
  letter-spacing: 1px;
  color: #9fe0c4;
}

.orbit-ring {
  position: absolute;
  border: 1px dashed #b9cdb6;
  border-radius: 50%;
}

.ring-1 {
  width: 140px;
  height: 140px;
  left: 40px;
  top: 30px;
  animation: spin 30s linear infinite;
}

.ring-2 {
  width: 190px;
  height: 190px;
  left: 15px;
  top: 5px;
  animation: spin 45s linear infinite reverse;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.point {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-light);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.p1 { left: 42px; top: 40px; background: var(--gold-accent); }
.p2 { left: 168px; top: 140px; }
.p3 { left: 175px; top: 50px; background: #3182ce; }
.p4 { left: 55px; top: 150px; }

.orbit-tag {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* 3 Deliverables Metric Cards */
.output-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.stat-number {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--green-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.stat-number span {
  font-size: 20px;
  color: var(--gold-accent);
}

.metric-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 6px;
}

.metric-card p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* Dimensions Section (Plan §1.4) */
.dimensions-section, .profiles-section {
  margin-bottom: 40px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
}

.section-heading h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink-primary);
}

.section-heading span {
  font-size: 12px;
  color: var(--ink-muted);
}

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

.dim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s ease;
}

.dim-card:hover {
  border-color: var(--green-light);
  box-shadow: var(--shadow-sm);
}

.dim-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dim-id {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--green-primary);
  padding: 2px 6px;
  border-radius: 4px;
}

.dim-header strong {
  font-size: 13px;
  font-weight: 600;
}

.dim-card p {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

/* Profiles Expansion Path (Plan §1.3) */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.profile-card.active {
  border: 2px solid var(--green-light);
  background: linear-gradient(180deg, #ffffff, #f7faf6);
  box-shadow: 0 4px 14px rgba(25, 72, 56, 0.08);
}

.profile-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--green-light);
  margin-bottom: 8px;
}

.profile-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-card p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-secondary);
  flex: 1;
  margin-bottom: 16px;
}

.profile-status {
  font-size: 11px;
  font-weight: 600;
  color: #276749;
  background: #e6fffa;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  align-self: flex-start;
}

.profile-status.secondary {
  color: var(--ink-muted);
  background: var(--bg-subtle);
}

/* Run Trigger Form */
.run-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 32px 0;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.form-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.form-icon {
  width: 44px;
  height: 44px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--green-primary);
}

.form-top h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 2px;
}

.form-top p {
  font-size: 12px;
  color: var(--ink-muted);
}

.badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--green-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 4px 8px;
}

.field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  padding: 11px 14px;
  font-size: 13px;
  transition: all 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--border-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(46, 122, 96, 0.15);
}

textarea {
  resize: vertical;
  min-height: 70px;
  line-height: 1.5;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 20px;
  margin: 18px 0 24px;
  align-items: flex-end;
}

.form-details {
  font-size: 11px;
  line-height: 1.9;
  color: var(--ink-secondary);
  padding-bottom: 6px;
}

.small-check {
  color: var(--green-light);
  font-weight: 700;
  margin-right: 6px;
}

.form-footer {
  margin: 0 -32px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  padding: 18px 32px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
}

.mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-accent);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.button.primary {
  background: var(--green-primary);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--green-hover);
  box-shadow: var(--shadow-sm);
}

.button.secondary {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--ink-primary);
}

.button.secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

/* Demo Banner */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  background: linear-gradient(90deg, #edf5e8, #f5faf1);
  border: 1px solid #d4e3cd;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  text-align: left;
  transition: all 0.2s ease;
  margin-bottom: 30px;
}

.demo-banner:hover {
  background: linear-gradient(90deg, #e4eedf, #edf5e8);
  border-color: #b7cead;
  transform: translateY(-1px);
}

.demo-icon {
  font-size: 26px;
  color: var(--green-light);
}

.demo-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 2px;
}

.demo-text span {
  font-size: 12px;
  color: var(--ink-secondary);
}

.demo-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--green-light);
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding: 24px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
}

/* ==========================================================================
   Method View Styles
   ========================================================================== */

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.panel h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--ink-primary);
  margin-bottom: 14px;
}

.method-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.knowledge-spaces {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.k-space {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.k-space strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-primary);
  margin-bottom: 4px;
}

.k-space p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.weights-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.weight-row {
  display: grid;
  grid-template-columns: 1fr 100px 45px;
  gap: 12px;
  align-items: center;
  font-size: 12px;
}

.weight-label {
  color: var(--ink-secondary);
  font-weight: 500;
}

progress {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  border: none;
  background: var(--bg-subtle);
}

progress::-webkit-progress-bar {
  background: var(--bg-subtle);
}

progress::-webkit-progress-value {
  background: var(--green-light);
}

.weight-pct {
  font-weight: 700;
  color: var(--ink-primary);
  text-align: right;
  font-family: var(--font-mono);
}

.rubric-note {
  font-size: 11px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  margin-top: 12px;
}

.method-list, .method-list-numbered {
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-secondary);
  margin: 14px 0;
}

.quality-grid-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.q-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-item span {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-light);
  background: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

/* ==========================================================================
   Context View Styles (L1-L6 & Tensions H01-H14)
   ========================================================================== */

.context-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}

.file-row:last-child {
  border-bottom: none;
}

.file-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-subtle);
  color: var(--green-light);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

.file-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.file-info small {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
}

.file-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.status-ok {
  color: #22543d;
  background: #c6f6d5;
}

.status-missing {
  color: #742a2a;
  background: #fed7d7;
}

.tensions-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}

.tension-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.tension-item summary {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tension-item summary strong {
  font-family: var(--font-mono);
  color: var(--gold-accent);
  background: var(--gold-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
}

.tension-item p {
  padding: 0 14px 14px;
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Consolidated Strategy View: our_position.md Styles (Direct on Page)
   ========================================================================== */

.our-position-panel {
  margin-bottom: 32px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  overflow: visible !important;
  transition: all 0.2s ease;
}

.op-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 32px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  gap: 20px;
  flex-wrap: wrap;
}

.op-title-block {
  flex: 1;
  min-width: 280px;
}

.op-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.op-panel-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}

.op-meta-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.file-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--green-light);
  background: rgba(14, 134, 118, 0.12);
  border: 1px solid rgba(14, 134, 118, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

.op-doc-source {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.op-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Sticky Section Navigation */
.op-quick-nav {
  position: sticky;
  top: var(--topbar-height, 70px);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--panel2);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  white-space: nowrap;
}

.op-quick-nav .nav-label {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-right: 6px;
}

.op-nav-pill {
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.op-nav-pill:hover {
  border-color: var(--gold-accent);
  color: var(--ink-primary);
  background: var(--bg-elevated);
}

.op-nav-pill.active {
  background: var(--green-light);
  color: #0b1216;
  border-color: var(--green-light);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(14, 134, 118, 0.25);
}

/* Document Body - Renders directly on page, full height, no inner scroll trap! */
.op-document-body {
  max-height: none !important;
  overflow: visible !important;
  padding: 36px 44px 60px;
  background: var(--bg-card);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.op-section-anchor {
  scroll-margin-top: calc(var(--topbar-height, 70px) + 68px);
}

.op-loading {
  padding: 50px 20px;
  text-align: center;
  color: var(--ink-muted);
  font-style: italic;
  font-size: 14px;
}

.op-loading.error {
  color: var(--warn);
  font-style: normal;
}

/* Document Header Hero inside markdown container */
.op-doc-hero {
  padding: 24px 28px;
  margin-bottom: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(14, 134, 118, 0.08) 0%, rgba(182, 112, 15, 0.06) 100%);
  border: 1px solid var(--border-light);
}

.op-doc-hero-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.4px;
}

.op-doc-hero-meta {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Markdown Rendering Inside App */
.markdown-rendered h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-primary);
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 10px;
  margin: 28px 0 20px 0;
  letter-spacing: -0.4px;
}

.markdown-rendered h2 {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--green-light);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
  margin: 36px 0 18px 0;
  letter-spacing: -0.2px;
}

.markdown-rendered h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gold-accent);
  margin: 24px 0 10px 0;
}

.markdown-rendered h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 18px 0 8px 0;
}

.markdown-rendered p {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-secondary);
  margin: 0 0 16px 0;
}

.markdown-rendered ul,
.markdown-rendered ol {
  margin: 0 0 18px 24px;
  padding: 0;
  color: var(--ink-secondary);
  font-size: 13.5px;
  line-height: 1.7;
}

.markdown-rendered li {
  margin-bottom: 8px;
}

.markdown-rendered blockquote {
  margin: 20px 0;
  padding: 14px 22px;
  background: rgba(14, 134, 118, 0.06);
  border-left: 4px solid var(--green-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-primary);
  font-size: 13.5px;
  line-height: 1.65;
}

.markdown-rendered pre {
  margin: 18px 0;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-primary);
}

.markdown-rendered code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--gold-accent);
}

.markdown-rendered pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.markdown-rendered hr {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 32px 0;
}

/* Math & Arrow formatting */
.op-math {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green-light);
  padding: 1px 4px;
}

/* ASCII Architecture Callout Box */
.op-ascii-box {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-primary);
  overflow-x: auto;
  white-space: pre;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* High-Quality Visual Process & Architecture Diagrams */
.op-diagram-card {
  margin: 28px 0 32px;
  padding: 22px 26px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.op-diagram-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.op-diagram-head strong {
  font-size: 14.5px;
  color: var(--ink-primary);
}

.op-diagram-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(14, 134, 118, 0.12);
  color: var(--green-light);
  border: 1px solid rgba(14, 134, 118, 0.3);
}

/* 5-Step Pipeline Flow Diagram */
.op-pipeline-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.op-flow-step {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
}

.op-flow-step:hover {
  border-color: var(--green-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.op-flow-step .step-idx {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--green-light);
  margin-bottom: 6px;
}

.op-flow-step .step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}

.op-flow-step .step-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.4;
}

/* Swarm Orchestration Architecture Diagram */
.op-swarm-diagram {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.op-swarm-tier {
  width: 100%;
}

.op-tier-node {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 12px;
}

.op-tier-node.ceo-node {
  max-width: 580px;
  margin: 0 auto;
  border-color: var(--gold-accent);
  background: color-mix(in srgb, var(--gold-accent) 6%, var(--bg-card));
}

.op-swarm-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

@media (max-width: 768px) {
  .op-swarm-split {
    grid-template-columns: 1fr;
  }
}

.op-dirigent-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.op-guardrail {
  font-size: 11.5px;
  color: var(--ink-secondary);
  background: var(--bg-elevated);
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 3px solid var(--gold-accent);
}

.op-swarm-connector {
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-light);
  font-size: 13px;
}

.op-bridge-bar {
  width: 100%;
  text-align: center;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green-light);
  background: rgba(14, 134, 118, 0.08);
  border: 1px dashed var(--green-light);
  border-radius: var(--radius-sm);
}

/* Styled Table in our_position */
.op-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 22px 0 28px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
}

.markdown-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 13px;
}

.markdown-rendered th {
  background: var(--bg-elevated);
  color: var(--ink-primary);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border-strong);
  border-right: 1px solid var(--border-light);
}

.markdown-rendered td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  color: var(--ink-secondary);
  line-height: 1.6;
  vertical-align: top;
}

.markdown-rendered tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

:root[data-theme="dark"] .markdown-rendered tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.markdown-rendered tbody tr:hover td {
  background: color-mix(in srgb, var(--green-light) 6%, transparent);
}

.markdown-rendered tr:last-child td {
  border-bottom: none;
}

.markdown-rendered th:last-child,
.markdown-rendered td:last-child {
  border-right: none;
}

.markdown-rendered td strong {
  color: var(--ink-primary);
}

/* Dimension & Hypothesis Badges in Table */
.op-row-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-light);
  display: inline-block;
  min-width: 36px;
}

/* Tab 04 Shortcut Card */
.our-position-shortcut-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--green-light);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.op-shortcut-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.op-shortcut-left .file-icon {
  width: 40px;
  height: 40px;
  background: rgba(88, 213, 193, 0.1);
  color: var(--green-light);
  font-size: 20px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}

.op-shortcut-left strong {
  display: block;
  font-size: 14px;
  color: var(--ink-primary);
  margin-bottom: 2px;
}

.op-shortcut-left p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==========================================================================
   Evaluation Cockpit (Run View) Styles
   ========================================================================== */

.run-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.run-tags-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.run-id-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--green-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.run-title-text h1 {
  font-size: 32px;
  margin-bottom: 6px;
}

.run-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Notice Banner */
.notice {
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.notice-demo {
  background: #edf8f3;
  border: 1px solid #bce4d2;
  color: #1a4f3b;
}

.notice.warning {
  background: #fdf6e7;
  border: 1px solid #f2db9e;
  color: #8c6310;
}

.notice.info {
  background: #ebf4ff;
  border: 1px solid #c3dafe;
  color: #2b6cb0;
}

/* Run Metrics Bar */
.run-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.metric-box span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.metric-box strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-primary);
}

.status-val {
  display: inline-block;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 3px 10px;
  border-radius: 20px;
}

.status-completed { background: #c6f6d5; color: #22543d; }
.status-running { background: #feebc8; color: #7b341e; animation: pulse 1.5s infinite; }
.status-incomplete { background: #feebc8; color: #9c4221; }
.status-failed { background: #fed7d7; color: #742a2a; }

/* 12-Stage Pipeline Tracker */
.progress-panel {
  padding: 22px 28px;
  margin-bottom: 24px;
}

.stage-sub {
  font-size: 11px;
  color: var(--green-light);
  font-weight: 600;
}

.time-elapsed {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 4px;
}

.stage-list {
  display: flex;
  gap: 6px;
  margin: 18px 0;
}

.stage-dot {
  flex: 1;
  height: 8px;
  background: #e2e8df;
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.stage-dot-label {
  display: none;
}

.stage-dot.done {
  background: #52a784;
}

.stage-dot.current {
  background: var(--gold-accent);
  box-shadow: 0 0 10px rgba(196, 150, 44, 0.7);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}

.log-details {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
  margin-top: 14px;
}

.log-details summary {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-secondary);
  cursor: pointer;
}

.event-log {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-secondary);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  gap: 12px;
}

.event-time { color: var(--ink-muted); }
.event-stage { color: var(--green-light); font-weight: 600; width: 140px; flex-shrink: 0; }
.event-msg { flex: 1; }

/* Result Tabs Navigation (9 tabs) */
.result-tabs-container {
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 28px;
  overflow-x: auto;
}

.result-tabs {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.tab-btn {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--ink-primary);
}

.tab-btn.active {
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
}

.tab-lead-box {
  margin-bottom: 24px;
}

.result-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

.scope-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ==========================================================================
   01 · Process View Styles
   ========================================================================== */

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.step-card[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.step-summary {
  list-style: none;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  user-select: none;
}

.step-summary::-webkit-details-marker {
  display: none;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--green-light);
  background: var(--bg-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-primary);
  flex: 1;
}

.step-expand-icon {
  font-size: 20px;
  color: var(--ink-muted);
  transition: transform 0.2s ease;
}

.step-card[open] .step-expand-icon {
  transform: rotate(45deg);
}

.step-body {
  padding: 0 24px 24px 24px;
  border-top: 1px solid var(--border-light);
}

.step-purpose-lead {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin: 16px 0 20px;
}

.step-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.step-col {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.step-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--green-primary);
  margin-bottom: 8px;
}

.step-col ul {
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.feedback-box {
  background: #fbf8f0;
  border-left: 3px solid var(--gold-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 12px;
}

.feedback-box strong {
  color: #7d5e18;
  display: block;
  margin-bottom: 2px;
}

.step-meta-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.mini-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-right: 6px;
}

.principle-chip-btn, .rec-chip-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--green-primary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 4px;
  transition: all 0.15s ease;
}

.principle-chip-btn:hover, .rec-chip-btn:hover {
  background: var(--green-primary);
  color: #ffffff;
}

/* ==========================================================================
   02 · 30 Principles View Styles
   ========================================================================== */

.principles-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-input {
  flex: 1;
  min-width: 250px;
}

.filter-select {
  width: auto;
  min-width: 180px;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.principle-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.principle-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.principle-id-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--green-primary);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 4px;
}

.step-ref-tag {
  font-size: 11px;
  color: var(--ink-muted);
}

.principle-badges {
  display: flex;
  gap: 6px;
}

.badge-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.pill-green { background: #c6f6d5; color: #22543d; }
.pill-blue { background: #bee3f8; color: #2b6cb0; }
.pill-stable { background: #e2e8f0; color: #4a5568; }
.pill-sens { background: #feebc8; color: #9c4221; }

.principle-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink-primary);
}

.principle-meaning {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

.principle-action-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.principle-question-box {
  background: #f7faf5;
  border-left: 3px solid var(--green-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.q-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--green-light);
  margin-bottom: 2px;
}

.q-text {
  font-size: 12px;
  font-weight: 600;
  color: #194030;
}

.principle-scope {
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.principle-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.text-btn {
  font-size: 11px;
  padding: 5px 10px;
}

/* ==========================================================================
   03 · Dossier View Styles (Plan §9.3)
   ========================================================================== */

.dossier-paper {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  max-width: 900px;
  margin: 0 auto;
  padding: 50px 70px;
  box-shadow: var(--shadow-md);
}

.dossier-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 18px;
  margin-bottom: 32px;
}

.dossier-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green-light);
}

.dossier-seal {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: #edf8f3;
  color: #1a4f3b;
  border: 1px solid #bce4d2;
  padding: 3px 10px;
  border-radius: 4px;
}

.dossier-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 30px;
  color: var(--ink-primary);
}

.dossier-para-block {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px dashed #e8efe5;
}

.dossier-text {
  font-size: 15px;
  line-height: 2;
  color: #2b3d34;
  margin-bottom: 10px;
}

.dossier-para-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

.p-num {
  font-weight: 700;
  color: var(--green-primary);
}

.copy-btn {
  margin-top: 20px;
}

/* ==========================================================================
   04 · Comparison View Styles
   ========================================================================== */

.own-strategy-panel {
  margin-bottom: 32px;
}

.own-summary {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-secondary);
  margin-bottom: 20px;
}

.own-seq-list {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 20px 16px 36px;
  margin-bottom: 18px;
}

.conflicts-details {
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.conflicts-details summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-accent);
  cursor: pointer;
}

.conflict-item {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-top: 6px;
}

.comp-sec-heading {
  margin: 36px 0 16px;
}

.comp-filter-row {
  margin-bottom: 18px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.comparison-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.comp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.verdict-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
}

.verdict-aligned { background: #c6f6d5; color: #22543d; }
.verdict-partially { background: #feebc8; color: #7b341e; }
.verdict-conflicting { background: #fed7d7; color: #742a2a; }
.verdict-specific { background: #e9d8fd; color: #553c9a; }
.verdict-missing { background: #feebc8; color: #9c4221; }
.verdict-not-est { background: #edf2f7; color: #4a5568; }
.verdict-conflict { background: #fed7d7; color: #9b2c2c; }

.priority-pill {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-muted);
}

.comp-topic {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.comp-explanation {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

.comp-action-line {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 12px;
}

.comp-refs {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 14px;
}

/* ==========================================================================
   05 · Actors Table Styles
   ========================================================================== */

.actors-toggle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  background: var(--bg-elevated);
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--ink-secondary);
  vertical-align: top;
}

.data-table tr:hover {
  background: #fafcf9;
}

.row-selected {
  background: #fbfdfa;
}

.td-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-light);
}

.td-score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-primary);
}

.td-weight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-primary);
}

.actor-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--green-light);
}

.actor-reason {
  margin-top: 6px;
  font-size: 11px;
}

.scores-mini-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.score-pill {
  background: var(--bg-subtle);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   06 · Decisions & Sensitivity Styles
   ========================================================================== */

.decisions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.decision-card {
  padding: 20px 24px;
}

.decision-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.rec-id-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green-primary);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: 4px;
}

.rec-dim-tag {
  font-size: 12px;
  color: var(--ink-muted);
}

.consensus-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
}

.badge-supported { background: #c6f6d5; color: #22543d; }
.badge-synthesis { background: #bee3f8; color: #2b6cb0; }

.robust-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-stable { background: #e2e8f0; color: #4a5568; }
.badge-sens { background: #feebc8; color: #9c4221; }

.rec-text {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.dec-line {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 14px;
}

/* ==========================================================================
   07 · Evidence & Quality Styles
   ========================================================================== */

.quality-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.q-check-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.check-icon {
  font-weight: 800;
  font-size: 14px;
}

.check-pass .check-icon { color: #38a169; }
.check-fail .check-icon { color: #e53e3e; }

.check-name {
  font-family: var(--font-mono);
  font-weight: 600;
  width: 140px;
  flex-shrink: 0;
}

.check-detail {
  color: var(--ink-secondary);
}

.sources-list, .claims-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  max-height: 400px;
  overflow-y: auto;
}

.source-row, .claim-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}

.source-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.source-link {
  font-weight: 600;
}

.source-meta {
  color: var(--ink-muted);
  font-size: 10px;
}

.claim-text-col {
  flex: 1;
  line-height: 1.5;
}

/* Chips and Buttons */
.chips-container {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.evidence-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: #edf5eb;
  border: 1px solid #c9dec4;
  color: #26593f;
  padding: 2px 7px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.evidence-btn:hover {
  background: #26593f;
  color: #ffffff;
}

/* ==========================================================================
   08 · Diff View Styles
   ========================================================================== */

.diff-header {
  margin-bottom: 24px;
}

.diff-panel h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.diff-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diff-item {
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.diff-add { background: #e6fffa; color: #234e52; border-left: 3px solid #319795; }
.diff-del { background: #fff5f5; color: #742a2a; border-left: 3px solid #e53e3e; }
.diff-mod { background: #fefcbf; color: #744210; border-left: 3px solid #d69e2e; }

/* ==========================================================================
   09 · Downloads View Styles
   ========================================================================== */

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

.artifact-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.artifact-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.artifact-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-primary);
  word-break: break-all;
}

.artifact-size {
  font-size: 11px;
  color: var(--ink-muted);
}

.artifact-actions {
  display: flex;
  gap: 8px;
}

.preview-btn, .dl-btn {
  flex: 1;
  font-size: 11px;
  padding: 8px 12px;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */

dialog {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 90vw;
  padding: 28px 32px;
  margin: auto;
}

dialog::backdrop {
  background: rgba(16, 28, 23, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dialog-heading h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.close-dialog {
  font-size: 24px;
  line-height: 1;
  color: var(--ink-muted);
  padding: 4px;
  transition: color 0.15s ease;
}

.close-dialog:hover {
  color: var(--ink-primary);
}

.dialog-scroll-body {
  max-height: 60vh;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 6px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.evidence-quote {
  border-left: 4px solid var(--green-light);
  background: var(--bg-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  font-size: 14px;
  font-style: italic;
  line-height: 1.7;
  color: #1a4030;
  margin-bottom: 18px;
}

.evidence-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
  font-size: 13px;
}

.evidence-box strong {
  display: block;
  font-size: 11px;
  color: var(--green-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.meta-table {
  margin-bottom: 20px;
}

.meta-table th {
  width: 160px;
  font-size: 11px;
}

.meta-table td {
  font-size: 12px;
}

.consensus-summary-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
}

.c-stat {
  font-size: 12px;
  font-weight: 600;
}

.status-tag {
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
}

.status-tag.supported { background: #c6f6d5; color: #22543d; }
.status-tag.synthesis { background: #bee3f8; color: #2b6cb0; }
.status-tag.stable { background: #e2e8f0; color: #4a5568; }
.status-tag.sensitive { background: #feebc8; color: #9c4221; }

.stance-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.stance-supports { background: #c6f6d5; color: #22543d; }
.stance-opposes { background: #fed7d7; color: #742a2a; }
.stance-cond { background: #feebc8; color: #9c4221; }
.stance-none { background: #edf2f7; color: #718096; }

.code-preview {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  background: #111a15;
  color: #e2ede6;
  padding: 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Global Toast Alert */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e392d;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  max-width: 420px;
  z-index: 1000;
  border-left: 4px solid var(--gold-accent);
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.empty-result {
  text-align: center;
  padding: 48px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  font-size: 13px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1200px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .orbit {
    display: none;
  }
  .output-grid {
    grid-template-columns: 1fr;
  }
  .profiles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .step-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 210px;
  }
  main {
    padding: 24px 20px;
  }
  .topbar {
    padding: 0 20px;
  }
  .context-columns {
    grid-template-columns: 1fr;
  }
  .principles-grid, .comparison-grid {
    grid-template-columns: 1fr;
  }
  .run-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .dossier-paper {
    padding: 30px 24px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .app-shell {
    margin-left: 0;
  }
  .input-row {
    grid-template-columns: 1fr;
  }
  .form-footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .form-footer button {
    width: 100%;
  }
  .step-grid-6 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   LIVE PULSES & ANIMATIONS
   ========================================================================== */
.live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite;
  margin-right: 6px;
  vertical-align: middle;
}

.live-pulse-sm {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-accent);
  box-shadow: 0 0 0 0 rgba(212, 160, 23, 0.7);
  animation: pulse-ring 1.8s infinite;
  margin-right: 5px;
  vertical-align: middle;
}

.status-pulse-green {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.protocol-open-btn {
  background: linear-gradient(135deg, #134e4a, #064e3b) !important;
  border-color: #10b981 !important;
  color: #ecfdf5 !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-protocol-link {
  background: none;
  border: none;
  color: var(--green-light);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: auto;
}

.mini-protocol-link:hover {
  color: #34d399;
}

/* ==========================================================================
   FULLSCREEN PROTOCOL DIALOG & LIVE TERMINAL
   ========================================================================== */
dialog#protocol-dialog {
  width: 95vw;
  max-width: 1560px;
  height: 90vh;
  max-height: 960px;
  border-radius: 12px;
  background: #0b1319;
  color: #e2e8f0;
  border: 1px solid #1e293b;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 0;
  margin: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

dialog#protocol-dialog:not([open]) {
  display: none;
}

dialog#protocol-dialog.is-fullscreen,
dialog#protocol-dialog:fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
}

.protocol-window-header {
  background: #070c10;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  gap: 16px;
  user-select: none;
}

.protocol-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.terminal-traffic-lights {
  display: flex;
  gap: 7px;
}

.t-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.t-light:hover { opacity: 1; }
.t-red { background: #ef4444; }
.t-yellow { background: #f59e0b; }
.t-green { background: #10b981; }

.protocol-headline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.protocol-headline h2 {
  font-family: var(--font-mono, monospace);
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.3px;
}

.protocol-model-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  padding: 2px 7px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  border-radius: 4px;
  font-weight: 600;
}

.live-stream-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.protocol-stats-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.protocol-stats-strip strong {
  color: #cbd5e1;
}

.protocol-window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.protocol-window-actions .close-dialog {
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}

.protocol-window-actions .close-dialog:hover {
  color: #f1f5f9;
}

/* Toolbar */
.protocol-toolbar {
  background: #0f172a;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
}

.protocol-filter-buttons {
  display: flex;
  gap: 4px;
  background: #070c10;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.p-filter-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.p-filter-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.p-filter-btn.active {
  background: #1e293b;
  color: #38bdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.protocol-search-box {
  flex: 1;
  min-width: 220px;
  max-width: 400px;
}

.protocol-search-box input {
  width: 100%;
  background: #070c10;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 6px 12px;
  color: #f1f5f9;
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  outline: none;
}

.protocol-search-box input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.protocol-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Stream area */
.protocol-main-area {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  background: #06090e;
}

.protocol-stream {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
  font-family: var(--font-mono, "SF Mono", Consolas, Menlo, monospace);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.protocol-row {
  display: grid;
  grid-template-columns: 80px 75px 120px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.35);
  border-left: 3px solid transparent;
  transition: background 0.12s ease;
  cursor: pointer;
}

.protocol-row:hover {
  background: rgba(30, 41, 59, 0.7);
}

.protocol-row.is-selected {
  background: rgba(56, 189, 248, 0.12);
  border-left-color: #38bdf8;
}

.protocol-row.row-input { border-left-color: #38bdf8; }
.protocol-row.row-output { border-left-color: #10b981; }
.protocol-row.row-search { border-left-color: #f59e0b; }
.protocol-row.row-audit { border-left-color: #a855f7; }
.protocol-row.row-system { border-left-color: #64748b; }

.p-col-time {
  color: #64748b;
  font-size: 0.75rem;
}

.p-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
}

.p-badge.badge-input { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.p-badge.badge-output { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.p-badge.badge-search { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.p-badge.badge-audit { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.p-badge.badge-system { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.p-col-stage {
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-col-msg {
  color: #cbd5e1;
  word-break: break-word;
}

.p-col-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

.p-meta-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.protocol-empty {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-style: italic;
}

/* Payload Drawer */
.protocol-drawer {
  width: 480px;
  border-left: 1px solid #1e293b;
  background: #0a0f14;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.5);
}

.drawer-header {
  padding: 12px 16px;
  background: #070c10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
}

.drawer-title-group strong {
  font-size: 0.95rem;
  color: #f1f5f9;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.drawer-meta {
  margin-bottom: 12px;
  font-size: 0.78rem;
  font-family: var(--font-mono, monospace);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(15, 23, 42, 0.6);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #1e293b;
}

.drawer-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
  color: #a5f3fc;
  background: #040608;
  padding: 14px;
  border-radius: 6px;
  border: 1px solid #1e293b;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.5;
}

.protocol-window-footer {
  background: #070c10;
  padding: 8px 18px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  font-family: var(--font-mono, monospace);
}

/* ==========================================================================
   THE 15 REALTIME FEEDBACK DASHBOARD WIDGETS
   ========================================================================== */
.cockpit-view-header {
  background: linear-gradient(135deg, #0e1e24 0%, #162a31 100%);
  border: 1px solid #28444e;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cockpit-title-box h2 {
  font-size: 1.35rem;
  color: #f1f5f9;
  margin: 0 0 6px 0;
}

.cockpit-title-box p {
  color: #94a3b8;
  font-size: 0.88rem;
  margin: 0;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

@media (max-width: 1300px) {
  .telemetry-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .telemetry-grid { grid-template-columns: 1fr; }
}

.telemetry-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.telemetry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.t-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
}

.t-card-number {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--green-primary, #15803d);
  letter-spacing: 0.8px;
}

.t-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.t-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Specific widgets */
.meter-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meter-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
}

.meter-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fill-in { background: #38bdf8; }
.fill-out { background: #10b981; }
.fill-cost { background: var(--gold-accent, #d4a017); }

.stat-callout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.stat-callout strong {
  font-size: 1.15rem;
  color: #0f172a;
}

.stat-callout span {
  font-size: 0.78rem;
  color: #64748b;
}

/* Funnel Widget */
.funnel-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-step {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.funnel-idx {
  font-weight: 700;
  color: #64748b;
}

.funnel-val {
  font-weight: 700;
  color: #0f172a;
}

.funnel-rate {
  font-size: 0.74rem;
  color: #15803d;
  font-weight: 600;
}

/* Leaderboard */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.leaderboard-table th {
  text-align: left;
  padding: 4px 6px;
  color: #64748b;
  font-size: 0.72rem;
  border-bottom: 1px solid #e2e8f0;
}

.leaderboard-table td {
  padding: 6px 6px;
  border-bottom: 1px solid #f1f5f9;
}

.lead-name { font-weight: 600; color: #1e293b; }
.lead-score { font-weight: 700; color: var(--green-primary, #15803d); text-align: right; }

/* Dimensions Heatmap */
.dim-heat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.dim-heat-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dim-heat-cell.heat-high { background: #dcfce7; border-color: #86efac; }
.dim-heat-cell.heat-med { background: #ecfdf5; border-color: #a7f3d0; }
.dim-heat-cell.heat-low { background: #fef9c3; border-color: #fde047; }

.dim-heat-id { font-weight: 800; font-size: 0.75rem; color: #0f172a; }
.dim-heat-val { font-size: 0.7rem; color: #475569; }

/* Tensions List */
.tensions-mini-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.tension-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  padding: 4px 8px;
  background: #f8fafc;
  border-radius: 4px;
  border: 1px solid #f1f5f9;
}

.tension-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}

.t-converged { background: #dcfce7; color: #15803d; }
.t-evaluating { background: #fef3c7; color: #b45309; }
.t-pending { background: #f1f5f9; color: #64748b; }

/* Stacked bar */
.stacked-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stacked-bar {
  display: flex;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stack-seg { height: 100%; transition: width 0.3s ease; }
.stack-full { background: #10b981; }
.stack-strong { background: #3b82f6; }
.stack-qual { background: #f59e0b; }
.stack-diss { background: #ef4444; }

.stack-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 0.74rem;
  color: #64748b;
}

.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Audits Mini Grid */
.audit-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.72rem;
}

.audit-mini-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  background: #f8fafc;
  border-radius: 4px;
}

.a-pass { color: #15803d; }
.a-warn { color: #d97706; }

/* ==========================================================================
   Zirkuläre Recherche · Konvergenz-Banner & Live-Erhärtungs-UI
   ========================================================================== */

.convergence-banner {
  background: linear-gradient(135deg, rgba(25, 72, 56, 0.07), rgba(43, 108, 176, 0.07));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

:root[data-theme="dark"] .convergence-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(56, 189, 248, 0.08));
  border-color: rgba(56, 189, 248, 0.2);
}

.convergence-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.convergence-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.convergence-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

:root[data-theme="dark"] .convergence-badge-pulse {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.convergence-cycle-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-primary);
}

.convergence-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.confidence-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--green-primary);
}

:root[data-theme="dark"] .confidence-value {
  color: #38bdf8;
}

/* Meter Bar */
.convergence-meter-wrap {
  margin: 12px 0 10px 0;
}

.convergence-meter-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

:root[data-theme="dark"] .convergence-meter-track {
  background: rgba(255, 255, 255, 0.08);
}

.convergence-meter-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #10b981 0%, #0284c7 60%, #8b5cf6 100%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Info & Stepper Row */
.convergence-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

.convergence-delta-text {
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.convergence-delta-text strong {
  color: var(--ink-primary);
}

.convergence-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--ink-secondary);
  transition: all 0.15s ease;
  cursor: pointer;
}

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

:root[data-theme="dark"] .stepper-btn.active {
  background: #0284c7;
  border-color: #0284c7;
}

.stepper-btn.done {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--green-light);
}

/* Hardening Badges on cards */
.card-hardening-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  margin-left: 8px;
  vertical-align: middle;
}

.card-hardening-badge.badge-hypo {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

:root[data-theme="dark"] .card-hardening-badge.badge-hypo {
  color: #fbbf24;
}

.card-hardening-badge.badge-plaus {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

:root[data-theme="dark"] .card-hardening-badge.badge-plaus {
  color: #38bdf8;
}

.card-hardening-badge.badge-hardened {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

:root[data-theme="dark"] .card-hardening-badge.badge-hardened {
  color: #34d399;
}

/* Editorial research system — visual refresh inspired by the attached reference. */
:root {
  --motion-fast: 180ms;
  --motion-base: 280ms;
  --motion-slow: 620ms;
  --surface-glass: color-mix(in srgb, var(--panel) 86%, transparent);
}

html { scroll-behavior: smooth; }
body {
  font-style: normal;
  background:
    radial-gradient(circle at 1px 1px, var(--grid) 1px, transparent 0) 0 0 / 26px 26px,
    radial-gradient(ellipse at 82% 3%, color-mix(in srgb, var(--native) 9%, transparent), transparent 42%),
    radial-gradient(ellipse at 4% 42%, color-mix(in srgb, var(--acc) 6%, transparent), transparent 38%),
    var(--bg-page);
  font-size: 15px;
}
button, input, select, textarea { font-style: normal; }

.sidebar {
  background: color-mix(in srgb, var(--bg-sidebar) 95%, var(--native));
  box-shadow: 8px 0 28px rgba(21, 32, 36, .035);
}
.brand-mark { border-radius: 13px; }
.nav-item { min-height: 44px; border-radius: 10px; }
.nav-item.active {
  background: color-mix(in srgb, var(--native) 10%, var(--panel));
  color: var(--tx);
  box-shadow: inset 3px 0 var(--native);
}
.nav-item:hover { transform: translateX(2px); }
.history-heading, .label, .field-label, .pill-label, .crumb-root, .edition {
  font-family: var(--font-mono);
}
.app-shell { background: transparent; }
.topbar {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
main { max-width: 1480px; padding-top: clamp(28px, 4vw, 58px); }
.view { animation: none; }
.view.is-entering > * { animation: rise-in 580ms cubic-bezier(.2,.75,.25,1) both; }
.view.is-entering > *:nth-child(2) { animation-delay: 55ms; }
.view.is-entering > *:nth-child(3) { animation-delay: 95ms; }
.view.is-entering > *:nth-child(4) { animation-delay: 135ms; }
.view.is-entering > *:nth-child(n+5) { animation-delay: 175ms; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading { margin-bottom: 16px; }
.eyebrow { color: var(--acc); letter-spacing: 2px; }
.tiny-line { background: var(--acc); }
.edition { letter-spacing: 1px; }
h1 { font-size: clamp(38px, 4.2vw, 62px); line-height: 1.02; letter-spacing: -2px; }
h1 span { color: var(--native); }
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: center;
  gap: clamp(24px, 5vw, 76px);
  margin: 0 0 30px;
  padding: clamp(30px, 4vw, 52px) clamp(24px, 4vw, 54px);
  border: 1px solid color-mix(in srgb, var(--native) 18%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 88% 24%, color-mix(in srgb, var(--native) 10%, transparent), transparent 34%),
    linear-gradient(125deg, var(--panel) 8%, color-mix(in srgb, var(--panel) 92%, var(--native)) 100%);
  box-shadow: var(--shadow-md);
}
.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .34;
  background-image: linear-gradient(90deg, transparent 97%, var(--grid) 100%), linear-gradient(transparent 97%, var(--grid) 100%);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent 36%, #000 100%);
  pointer-events: none;
}
.hero-content { max-width: 790px; }
.hero-desc { max-width: 64ch; font-size: clamp(15px, 1.3vw, 17px); }
.definition-quote {
  color: var(--mut);
  border-left-color: var(--acc);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--acc) 8%, var(--panel));
}
.quote-source { color: var(--acc2); }
.orbit {
  width: min(34vw, 320px);
  height: 300px;
  margin-right: 4px;
  color: var(--native);
  filter: drop-shadow(0 16px 24px color-mix(in srgb, var(--native) 12%, transparent));
}
.orbit-illustration { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orbit-center {
  width: 106px;
  height: 106px;
  left: calc(50% - 53px);
  top: calc(50% - 65px);
  background: linear-gradient(145deg, #164a3d, #0e8676);
  border: 2px solid color-mix(in srgb, var(--native) 75%, white);
  box-shadow: 0 12px 34px color-mix(in srgb, var(--native) 25%, transparent);
}
.orbit-num { font-size: 22px; }
.orbit-sub { font-family: var(--font-mono); color: #bce9d7; }
.orbit-ring { display: none; }
.orbit-tag { bottom: 2px; color: var(--mut); }
.point { display: none; }
.p2 { animation-delay: .6s; }
.p3 { animation-delay: 1.2s; }
.p4 { animation-delay: 1.8s; }
@keyframes point-breathe { 50% { transform: scale(1.35); box-shadow: 0 0 0 7px color-mix(in srgb, var(--native) 14%, transparent); } }
.illustration-ring.ring-a { transform-origin: 160px 145px; animation: orbit-turn 36s linear infinite; }
.illustration-ring.ring-b { transform-origin: 160px 145px; animation: orbit-turn 26s linear infinite reverse; }
@keyframes orbit-turn { to { transform: rotate(360deg); } }

.output-grid { gap: 16px; margin-bottom: 52px; }
.metric-card, .dim-card, .profile-card, .panel, .run-form, .demo-banner {
  border-radius: 16px;
  transition: transform var(--motion-base) cubic-bezier(.2,.7,.2,1), box-shadow var(--motion-base), border-color var(--motion-base), background-color var(--motion-base);
}
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 194px;
  padding: 25px 26px;
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(21, 32, 36, .045);
}
.metric-card::before {
  position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  content: ""; background: linear-gradient(90deg, var(--native), var(--acc)); transform: scaleX(.18); transform-origin: left;
  transition: transform 500ms cubic-bezier(.2,.7,.2,1);
}
.metric-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--native) 32%, var(--line)); }
.metric-card:hover::before { transform: scaleX(1); }
.stat-number { color: var(--native); font-family: var(--font-mono); font-size: clamp(34px, 3vw, 43px); }
.metric-card strong { font-size: 15px; }
.metric-card p, .dim-card p, .profile-card p { font-size: 13px; line-height: 1.65; }
.section-heading { margin-bottom: 20px; align-items: flex-end; }
.section-heading h2, .panel h2, .quality-overview-panel h2 { font-size: clamp(22px, 2vw, 28px); letter-spacing: -.7px; }
.section-heading span { max-width: 52ch; text-align: right; line-height: 1.5; }
.dimensions-section, .profiles-section { margin-bottom: 54px; }
.dimensions-grid { gap: 12px; }
.dim-card { position: relative; overflow: hidden; min-height: 140px; padding: 18px; }
.dim-card::after { position: absolute; right: -17px; bottom: -23px; width: 74px; height: 74px; content: ""; border: 1px solid color-mix(in srgb, var(--native) 18%, transparent); border-radius: 50%; box-shadow: 0 0 0 9px color-mix(in srgb, var(--native) 4%, transparent), 0 0 0 20px color-mix(in srgb, var(--native) 3%, transparent); }
.dim-card:hover, .profile-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--native) 45%, var(--line)); box-shadow: var(--shadow-sm); }
.dim-id { color: var(--native); background: color-mix(in srgb, var(--native) 9%, var(--panel)); }
.profiles-grid { gap: 12px; }
.profile-card { min-height: 250px; padding: 20px; border-color: var(--line); }
.profile-card.active { border-color: var(--native); background: linear-gradient(155deg, color-mix(in srgb, var(--native) 8%, var(--panel)), var(--panel) 62%); box-shadow: inset 0 3px var(--native), var(--shadow-sm); }
.profile-card h3 { font-size: 16px; }
.profile-status { color: var(--native); background: color-mix(in srgb, var(--native) 10%, var(--panel)); }

.run-form { padding: 30px clamp(22px, 3vw, 36px) 0; border-color: color-mix(in srgb, var(--native) 22%, var(--line)); box-shadow: var(--shadow-md); }
.form-icon { flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid color-mix(in srgb, var(--native) 24%, var(--line)); background: color-mix(in srgb, var(--native) 9%, var(--panel)); border-radius: 14px; }
.form-top h3 { font-size: 19px; }
.form-top p { font-size: 13px; }
.field-label { font-size: 10px; letter-spacing: 1.15px; }
input, textarea, select { border-radius: 10px; transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background-color var(--motion-fast); }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--native) 13%, transparent); }
.button { border-radius: 10px; transition: transform var(--motion-fast), box-shadow var(--motion-fast), background-color var(--motion-fast); }
.button.primary { background: var(--native); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--native) 24%, transparent); }
.button.primary:hover { transform: translateY(-2px); background: var(--green-hover); box-shadow: 0 10px 22px color-mix(in srgb, var(--native) 28%, transparent); }
.button.secondary:hover { transform: translateY(-1px); border-color: var(--native); }
.demo-banner { position: relative; min-height: 92px; padding: 20px 24px; border-radius: 16px; border-color: color-mix(in srgb, var(--acc) 28%, var(--line)); background: color-mix(in srgb, var(--acc) 6%, var(--panel)); }
.demo-banner:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: var(--shadow-md); }
.demo-icon { border-radius: 13px; }
.page-footer { border-top-color: var(--line); }

/* Methodology, context and live cockpit inherit the same surface language. */
.panel { border-color: var(--line); box-shadow: 0 8px 24px rgba(21, 32, 36, .04); }
.panel:hover { border-color: color-mix(in srgb, var(--native) 26%, var(--line)); }
.run-title-row h1 { font-size: clamp(32px, 3.2vw, 48px); }
.run-metrics { gap: 12px; }
.metric-box { border-radius: 12px; transition: border-color var(--motion-base), transform var(--motion-base); }
.metric-box:hover { transform: translateY(-2px); border-color: var(--native); }
.progress-panel { border-radius: 18px; }
.result-tabs { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.tab-btn { transition: color var(--motion-fast), background-color var(--motion-fast), border-color var(--motion-fast); }
.tab-btn:hover { color: var(--native); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--native) 76%, white); outline-offset: 3px; border-radius: 5px; }

@media (max-width: 1200px) {
  .hero { flex-direction: row; align-items: center; }
  .orbit { display: block; width: min(30vw, 280px); height: 260px; }
  .orbit-center { width: 92px; height: 92px; left: calc(50% - 46px); top: calc(50% - 57px); }
}
@media (max-width: 900px) {
  .hero { gap: 20px; padding: 30px 26px; }
  .orbit { width: 220px; height: 220px; }
  .orbit-center { width: 78px; height: 78px; left: calc(50% - 39px); top: calc(50% - 48px); }
  .orbit-num { font-size: 19px; }
  .orbit-sub { font-size: 7px; }
}
@media (max-width: 640px) {
  .sidebar { padding: 14px 16px; }
  .brand { margin-bottom: 14px; }
  .workspace-pill { margin-bottom: 12px; }
  .side-nav { flex-direction: row; overflow-x: auto; margin-bottom: 10px; padding-bottom: 3px; }
  .nav-item { flex: 0 0 auto; padding: 9px 12px; }
  .history-section { max-height: 180px; overflow: auto; }
  .sidebar-bottom { margin-top: 10px; }
  main { padding: 22px 16px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 26px 21px; border-radius: 18px; }
  h1 { font-size: clamp(35px, 10vw, 46px); }
  .orbit { align-self: center; width: min(76vw, 270px); height: min(71vw, 250px); margin: 4px 0 0; }
  .orbit-center { width: 84px; height: 84px; left: calc(50% - 42px); top: calc(50% - 52px); }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading span { text-align: left; }
  .metric-card { min-height: 0; }
  .profile-card { min-height: 0; }
  .form-top { align-items: flex-start; }
  .form-top .badge { display: none; }
  .form-footer { align-items: stretch; }
  .demo-banner { align-items: flex-start; }
  .demo-arrow { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

