/* Copied visual CSS from Joseph's Axis Cockpit source. Demo-only; no source JS/data copied. */
:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface2: #1a1a26;
    --border: #2a2a3a;
    --accent: #ff5040;
    --accent-dim: #8a2a1f;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --muted: #555570;
    --text: #e2e2f0;
    --text-dim: #888899;
    --text-bright: #fff;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Consolas", monospace;
  }

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

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

  /* ── Auth overlay ─────────────────────────────────────────── */
  #auth-overlay {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    flex-direction: column; gap: 16px;
  }
  #auth-overlay h1 { font-size: 20px; letter-spacing: 0.05em; color: var(--text-bright); }
  #auth-overlay p { color: var(--text-dim); font-size: 13px; }
  #auth-overlay input {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    width: 280px;
    text-align: center;
    outline: none;
  }
  #auth-overlay input:focus { border-color: var(--accent); }
  #auth-error { color: var(--red); font-size: 13px; min-height: 18px; }

  /* ── Layout ───────────────────────────────────────────────── */
  #app { display: none; }

  header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    position: sticky; top: 0; z-index: 10;
  }
  .header-left { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
  .header-logo {
    font-size: 15px; font-weight: 600; letter-spacing: 0.06em;
    color: var(--text-bright);
  }
  .header-logo span { color: var(--accent); }
  .header-entity {
    font-size: 11px; color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px; padding: 2px 7px;
  }
  .header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }
  .header-state { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
  .header-ts { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); flex-shrink: 0; }
  .state-mode {
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 6px;
    color: var(--text-dim);
  }
  .state-mode.current { color: var(--green); border-color: rgba(34,197,94,0.35); }
  .state-mode.archive { color: var(--yellow); border-color: rgba(234,179,8,0.35); }
  .state-mode.unknown { color: var(--muted); }

  /* Manual refresh button — top-right, square, rotating-arrows icon */
  .refresh-btn {
    width: 36px; height: 36px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(8,12,22,0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s, transform .1s;
  }
  .refresh-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(8,12,22,0.95); }
  .refresh-btn:active { transform: scale(0.93); }
  .refresh-btn svg { display: block; }
  .refresh-btn.spinning { color: var(--accent); border-color: var(--accent); }
  .refresh-btn.spinning svg { animation: refreshSpin .8s linear infinite; }
  @keyframes refreshSpin { to { transform: rotate(360deg); } }

  /* Mobile header — stack into two rows so tabs aren't squished */
  @media (max-width: 760px) {
    header {
      flex-wrap: wrap;
      padding: 10px 12px;
      gap: 8px;
    }
    .header-left { flex: 1 1 auto; min-width: 0; }
    .header-logo { font-size: 13px; }
    .header-entity { display: none; }
    .header-state {
      flex: 0 0 auto;
      max-width: 110px;
    }
    .header-ts {
      font-size: 10px;
      text-align: right;
      line-height: 1.25;
    }
    .state-mode { font-size: 9px; }
    .tab-bar {
      order: 3;
      flex: 1 1 100%;
      justify-content: stretch;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .tab-bar::-webkit-scrollbar { display: none; }
    .tab-btn {
      padding: 8px 14px !important;
      font-size: 12.5px !important;
      white-space: nowrap;
      flex: 1 1 0;
      min-width: max-content;
    }
  }

  main { padding: 16px; max-width: 1100px; margin: 0 auto; }

  /* ── Financial Header (3 tiles) ──────────────────────────── */
  .fin-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }
  @media (max-width: 700px) {
    .fin-header { grid-template-columns: 1fr; }
  }
  .fin-tile {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    display: flex; flex-direction: column; gap: 6px;
    min-height: 132px;
  }
  .fin-tile.passive { border-color: var(--accent-dim); }
  .fin-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }
  .fin-amount { font-size: 30px; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; line-height: 1.1; }
  .fin-secondary { font-size: 12px; color: var(--text-dim); }
  .fin-meta { font-size: 11px; color: var(--text-dim); margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
  .fin-verify { font-size: 10px; color: var(--accent); cursor: pointer; text-decoration: underline; user-select: none; }
  .fin-warn { font-size: 11px; color: var(--yellow); }
  .fin-bar-wrap { margin-top: 4px; }
  .fin-bar-bg { background: var(--border); border-radius: 99px; height: 6px; overflow: hidden; }
  .fin-bar-fill { background: var(--accent); border-radius: 99px; height: 100%; transition: width 0.6s ease; }

  /* ── Grid ─────────────────────────────────────────────────── */
  .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  @media (min-width: 700px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .grid .full { grid-column: 1 / -1; }
  }

  /* ── Cards ────────────────────────────────────────────────── */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  .card-header {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-dim); display: flex; align-items: center; justify-content: space-between;
  }
  .card-header strong { color: var(--text); font-size: 12px; letter-spacing: 0.04em; }
  .card-body { padding: 12px 16px; }

  /* ── Table ────────────────────────────────────────────────── */
  table { width: 100%; border-collapse: collapse; }
  th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: left; padding: 0 8px 8px 0; }
  td { padding: 7px 8px 7px 0; border-top: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
  tr:first-child td { border-top: none; }

  /* ── Badges ───────────────────────────────────────────────── */
  .badge {
    display: inline-block;
    padding: 2px 7px; border-radius: 4px;
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  }
  .badge-active   { background: #1a3a1a; color: var(--green); border: 1px solid #2a5a2a; }
  .badge-running  { background: #3a2a0a; color: #ffa500; border: 1px solid #6a4a1a; }
  .badge-idle     { background: #1a2a3a; color: var(--accent); border: 1px solid #2a3a5a; }
  .badge-notbuilt { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
  .codex-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid var(--border);
  }
  .codex-ready { color: var(--green); border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.08); }
  .codex-partial { color: var(--yellow); border-color: rgba(234,179,8,0.35); background: rgba(234,179,8,0.08); }
  .codex-claude { color: var(--red); border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.08); }
  .codex-unknown { color: var(--muted); border-color: var(--border); background: rgba(255,255,255,0.03); }

  .trust {
    font-family: var(--font-mono); font-size: 11px; font-weight: 700;
    color: var(--text-dim);
  }
  .trust-na { color: var(--accent); }

  /* ── Token bar (legacy axis-cb rows) ─────────────────────── */
  .token-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .token-row:last-child { margin-bottom: 0; }
  .token-agent { width: 70px; font-size: 12px; font-family: var(--font-mono); color: var(--text-dim); }
  .token-bar-wrap { flex: 1; }
  .token-bar-bg { background: var(--surface2); border-radius: 4px; height: 5px; }
  .token-bar-fill { background: var(--accent); border-radius: 4px; height: 100%; }
  .token-val { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); width: 70px; text-align: right; }

  /* ── CodeBurn section ─────────────────────────────────────── */
  .cb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 700px) { .cb-grid { grid-template-columns: 1fr; } }
  .cb-subhead { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
  .cb-stat { font-size: 28px; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; }
  .cb-stat-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
  .cb-warn { color: var(--yellow); font-size: 12px; font-weight: 600; margin-top: 6px; }
  .cb-ok { color: var(--green); font-size: 12px; margin-top: 6px; }
  /* Per-agent table */
  .cb-agent-table { width: 100%; border-collapse: collapse; }
  .cb-agent-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: right; padding: 0 0 6px 12px; }
  .cb-agent-table th:first-child { text-align: left; padding-left: 0; }
  .cb-agent-table td { font-size: 12px; font-family: var(--font-mono); text-align: right; padding: 5px 0 5px 12px; border-top: 1px solid var(--border); color: var(--text-dim); }
  .cb-agent-table td:first-child { text-align: left; padding-left: 0; color: var(--text); }
  .cb-agent-table tr:first-child td { border-top: none; }
  /* 7-day bar chart */
  .cb-chart { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
  .cb-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; }
  .cb-bar-outer { width: 100%; background: var(--surface2); border-radius: 3px 3px 0 0; position: relative; height: 48px; display: flex; align-items: flex-end; cursor: default; }
  .cb-bar-inner { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
  .cb-bar-today .cb-bar-inner { background: var(--green); }
  .cb-bar-label { font-size: 9px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }
  .cb-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%; transform: translateX(-50%);
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 6px; padding: 7px 10px;
    font-size: 11px; font-family: var(--font-mono); color: var(--text);
    white-space: nowrap; z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    pointer-events: none;
  }
  .cb-tooltip .cb-tt-date { color: var(--text-dim); font-size: 10px; margin-bottom: 4px; }
  .cb-tooltip .cb-tt-row { display: flex; justify-content: space-between; gap: 16px; }
  .cb-tooltip .cb-tt-row span:first-child { color: var(--text-dim); }
  .cb-tooltip .cb-tt-total { color: var(--text-bright); font-weight: 700; margin-top: 3px; border-top: 1px solid var(--border); padding-top: 3px; }
  .cb-bar-col:hover .cb-tooltip { display: block; }

  /* ── Audit log ────────────────────────────────────────────── */
  .audit-list { list-style: none; max-height: 260px; overflow-y: auto; }
  .audit-list li {
    font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
    padding: 4px 0; border-bottom: 1px solid var(--border); line-height: 1.4;
    word-break: break-all;
  }
  .audit-list li:last-child { border-bottom: none; }
  .audit-list li .ts { color: var(--muted); }

  /* ── Manual controls ──────────────────────────────────────── */
  .controls { display: flex; gap: 10px; flex-wrap: wrap; }
  .btn {
    padding: 8px 16px; border-radius: 7px; font-size: 13px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface2); color: var(--text);
    font-family: var(--font); transition: background 0.15s;
  }
  .btn:hover { background: var(--border); }
  .btn-danger { border-color: #5a2a2a; color: var(--red); background: #1a0a0a; }
  .btn-danger:hover { background: #2a1010; }

  /* ── PaperClip iframe panel ───────────────────────────────── */
  #paperclip-panel { overflow: visible; }
  #paperclip-panel iframe {
    width: 100%; height: 720px; border: none; display: block;
    border-radius: 0 0 10px 10px;
  }

  /* ── Retrofit banner ──────────────────────────────────────── */
  #retrofit-banner {
    display: none;
    background: #2a2000;
    border: 1px solid #7a5c00;
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap;
  }
  #retrofit-banner.hidden { display: none !important; }
  .retrofit-icon { font-size: 18px; }
  .retrofit-text { flex: 1; min-width: 200px; }
  .retrofit-text strong { color: var(--yellow); font-size: 13px; display: block; margin-bottom: 3px; }
  .retrofit-text span { color: #b8960a; font-size: 12px; line-height: 1.5; }
  .retrofit-cmd { font-family: var(--font-mono); font-size: 11px; color: #e8c040; background: #1a1400; padding: 6px 10px; border-radius: 6px; border: 1px solid #5a4400; white-space: nowrap; }

  /* ── Forge tile ────────────────────────────────────────────── */
  .forge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .forge-stat { }
  .forge-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 2px; }
  .forge-stat-val { font-size: 20px; font-weight: 700; color: var(--text-bright); }
  .forge-stat-sub { font-size: 11px; color: var(--text-dim); }
  .forge-readiness-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 5px; vertical-align: middle; }
  .forge-readiness-dot.amber { background: var(--yellow); }

  /* ── Sentinel tile ───────────────────────────────────────── */
  .sentinel-trust-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
  .sentinel-trust-item { display: flex; flex-direction: column; gap: 2px; }
  .sentinel-trust-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
  .sentinel-trust-val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--text); }
  .sentinel-alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
  .alert-badge { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border-radius: 8px; min-width: 60px; text-align: center; }
  .alert-badge-count { font-size: 24px; font-weight: 700; line-height: 1; }
  .alert-badge-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
  .alert-crit  { background: #2a0a0a; border: 1px solid #5a1a1a; color: var(--red); }
  .alert-warn  { background: #2a1a00; border: 1px solid #5a3a00; color: var(--yellow); }
  .alert-info  { background: #1a1a2a; border: 1px solid #2a2a5a; color: var(--text-dim); }
  .alert-clear { background: var(--surface2); border: 1px solid #2a5a2a; color: var(--green); }
  .sentinel-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 20px; flex-wrap: wrap; }
  .s-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; flex-shrink: 0; }
  .s-dot-green { background: var(--green); }
  .s-dot-red   { background: var(--red); }
  .s-dot-amber { background: var(--yellow); }
  .s-dot-muted { background: var(--muted); }

  /* ── Empty states ─────────────────────────────────────────── */
  .empty { color: var(--muted); font-size: 12px; padding: 8px 0; }

  /* ── Refresh indicator ────────────────────────────────────── */
  .refresh-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green); display: inline-block; margin-right: 6px;
    animation: pulse 2s infinite;
  }
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

  /* ── Roadmap (Rose-style) ────────────────────────────────────────────────── */
  .rm-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
  .rm-header-left { display: flex; align-items: center; gap: 12px; }
  .rm-header h2 { font-size: 22px; font-weight: 600; color: var(--text-bright); letter-spacing: 0.01em; }
  .rm-date-chip {
    font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
    padding: 3px 10px; background: rgba(8,12,22,0.7);
    border: 1px solid var(--border); border-radius: 999px;
  }
  .rm-subtitle { color: var(--text-dim); font-size: 13px; max-width: 720px; }

  .rm-legend {
    display: flex; gap: 22px; align-items: center;
    padding: 10px 16px; margin-bottom: 16px;
    background: rgba(8,12,22,0.55);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12px;
  }
  .rm-legend-item { display: flex; gap: 8px; align-items: center; color: var(--text-dim); }
  /* .rm-legend-hint retired — far-right slot in legend is now the Recenter button. */
  .rm-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .rm-dot-done    { background: rgba(170,180,200,0.45); }
  .rm-dot-active  { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.6); }
  .rm-dot-queued  { background: #60a5fa; }
  .rm-dot-urgent  { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.55); }
  .rm-dot-blocked { background: #fbbf24; }

  .rm-canvas {
    background:
      radial-gradient(ellipse at 18% 50%, rgba(160,28,28,0.20) 0%, transparent 55%),
      radial-gradient(ellipse at 82% 18%, rgba(140,20,20,0.18) 0%, transparent 50%),
      radial-gradient(ellipse at 50% 92%, rgba(140,28,50,0.16) 0%, transparent 58%),
      #030408;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 0;
    position: relative;
    overflow: hidden;
    cursor: grab;
    touch-action: pan-x;
    overscroll-behavior: contain;
  }
  .rm-canvas.panning { cursor: grabbing; }
  .rm-canvas.panning .rm-rail { cursor: grabbing; }

  /* Roadmap zoom toolbar — sibling to the snapshot button */
  .rm-zoom-group {
    display: inline-flex; align-items: center; gap: 0;
    background: rgba(8,12,22,0.7); border: 1px solid var(--border); border-radius: 7px;
    overflow: hidden;
    margin-left: 8px;
  }
  .rm-zoom-group button {
    background: transparent; color: var(--text-dim);
    border: 0; padding: 6px 10px;
    font-size: 14px; line-height: 1; min-width: 28px;
    cursor: pointer; transition: all 0.12s; font-family: var(--font);
  }
  .rm-zoom-group button:hover { color: var(--text-bright); background: rgba(255,80,60,0.10); }
  .rm-zoom-group button + button { border-left: 1px solid var(--border); }
  .rm-zoom-chip {
    font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
    padding: 0 8px; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    min-width: 48px; text-align: center;
  }
  /* Filter pills — toggle swimlane visibility by completion state */
  .rm-filter-group { display: inline-flex; gap: 6px; align-items: center; }
  .rm-filter-btn {
    background: rgba(8,12,22,0.7); color: var(--text-dim);
    border: 1px solid var(--border); border-radius: 7px;
    padding: 6px 12px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    font-family: var(--font);
    user-select: none;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .rm-filter-btn:hover { color: var(--text-bright); border-color: rgba(255,80,60,0.45); }
  .rm-filter-btn.active {
    color: var(--text-bright);
    border-color: rgba(255,80,60,0.55);
    background: rgba(255,80,60,0.14);
  }
  .rm-filter-check { font-family: var(--font-mono); font-size: 12px; line-height: 1; }

  /* View toggle pills (Hana / Unbound) — same look as filters but bigger, leftmost */
  .rm-view-group {
    display: inline-flex; align-items: center; gap: 0;
    background: rgba(8,12,22,0.7); border: 1px solid var(--border); border-radius: 7px;
    overflow: hidden;
    margin-right: 8px;
  }
  .rm-view-btn {
    background: transparent; color: var(--text-dim);
    border: 0; padding: 6px 14px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer; transition: all 0.12s; font-family: var(--font);
    user-select: none;
  }
  .rm-view-btn:hover { color: var(--text-bright); background: rgba(255,80,60,0.10); }
  .rm-view-btn + .rm-view-btn { border-left: 1px solid var(--border); }
  .rm-view-btn.active {
    color: var(--text-bright);
    background: rgba(255,80,60,0.18);
    box-shadow: inset 0 -2px 0 rgba(255,140,120,0.7);
  }

  /* WIP cap warning on lane header */
  .rm-track.rm-wip-over .rm-track-label {
    background: linear-gradient(90deg, rgba(245,158,11,0.18) 0%, rgba(6,8,16,0.85) 70%);
    box-shadow: inset 3px 0 0 #f59e0b;
  }
  .rm-wip-chip {
    display: inline-flex; align-items: center; justify-content: center;
    margin-top: 6px; padding: 2px 7px;
    background: rgba(245,158,11,0.18);
    border: 1px solid rgba(245,158,11,0.55);
    color: #fcd34d;
    border-radius: 999px;
    font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
    white-space: nowrap;
  }

  /* Owner avatars — circular profile photos, top-right of every card. The
     title row reserves padding-right so multi-owner stacks never collide
     with the label. */
  .rm-item-avatars {
    position: absolute; top: 7px; right: 7px;
    display: flex; flex-direction: row-reverse;
    align-items: center;
    z-index: 2;
    pointer-events: none;
  }
  .rm-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(8,12,22,0.85);
    border: 1.5px solid rgba(255,255,255,0.32);
    box-shadow: 0 1px 4px rgba(0,0,0,0.55);
    display: block;
  }
  /* When two avatars stack, the second (rightmost in DOM, leftmost on
     screen because of row-reverse) tucks behind the first by ~7px. */
  .rm-item-avatars .rm-avatar + .rm-avatar { margin-right: -7px; }
  .rm-avatar.rm-avatar-j     { border-color: rgba(74,222,128,0.90);  } /* Joseph — green */
  .rm-avatar.rm-avatar-a     { border-color: rgba(168,85,247,0.90);  } /* Axis — purple */
  .rm-avatar.rm-avatar-rose  { border-color: rgba(248,113,113,0.90); } /* Rose — red */
  .rm-avatar.rm-avatar-maca  { border-color: rgba(216,180,254,0.90); } /* Maca — light purple */

  /* Money field — bone/cream, under the label */
  .rm-item-money {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
    color: #f5e6c8;
    font-family: var(--font-mono);
    margin: 2px 0 4px;
  }

  /* Stale flag — small orange dot, top-left of card */
  .rm-item-stale {
    position: absolute; top: 8px; left: 9px;
    width: 6px; height: 6px; border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245,158,11,0.7);
  }
  .rm-item.has-stale .rm-item-head { padding-left: 12px; }

  /* Right-edge North Star anchor */
  .rm-anchor {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 168px;
    background:
      linear-gradient(180deg, rgba(60,8,8,0.92) 0%, rgba(20,4,16,0.96) 100%);
    border-left: 1.5px solid rgba(255,140,120,0.4);
    box-shadow: -12px 0 28px rgba(0,0,0,0.4);
    padding: 22px 16px;
    display: flex; flex-direction: column; gap: 14px;
    z-index: 3;
    pointer-events: auto;
  }
  .rm-anchor.placeholder { background: linear-gradient(180deg, rgba(30,30,40,0.85) 0%, rgba(10,10,16,0.95) 100%); border-left-color: rgba(170,180,200,0.35); }
  .rm-anchor-tag {
    font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
    text-transform: uppercase; color: rgba(255,200,195,0.92);
  }
  .rm-anchor.placeholder .rm-anchor-tag { color: rgba(200,210,225,0.7); }
  .rm-anchor-label {
    font-size: 14px; font-weight: 700; line-height: 1.25;
    color: var(--text-bright);
  }
  .rm-anchor-target {
    font-size: 11px; color: rgba(255,200,195,0.78); line-height: 1.4;
    font-family: var(--font-mono);
  }
  .rm-anchor-current {
    font-size: 26px; font-weight: 800; letter-spacing: 0.01em;
    color: #f5e6c8;
    font-family: var(--font-mono);
    line-height: 1;
  }
  .rm-anchor-arrow { color: rgba(255,200,195,0.45); font-size: 14px; }
  .rm-anchor-desc { font-size: 10.5px; color: var(--text-dim); line-height: 1.45; margin-top: auto; }

  /* Constrain every lane row so the rail ends at the anchor's left edge.
     Anchor is 168px wide on the canvas's right; tracks reserve that space so
     the rightmost card stays fully visible when scrolled to the end. */
  .rm-track { margin-right: 168px; }

  /* Recenter button — lives at far right of the legend bar (replacing the old
     "Click any item for details" hint). Matches the toolbar-button visual:
     slightly-rounded rectangle, not a pill. Hidden until user pans/zooms. */
  .rm-recenter-btn {
    margin-left: auto;
    background: rgba(8,12,22,0.85);
    border: 1px solid rgba(255,140,120,0.55);
    border-radius: 7px;
    padding: 6px 12px;
    color: rgba(255,210,200,0.95);
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .rm-recenter-btn:hover { background: rgba(40,10,10,0.9); border-color: rgba(255,140,120,0.85); color: var(--text-bright); }
  .rm-recenter-btn.hidden { display: none; }

  /* Unbound view: dim + dashed-border treatment to match Specced agents on the
     Agent Roster ("exists but not active" signal). Anchor stays full saturation. */
  .rm-canvas.rm-view-unbound .rm-track .rm-item {
    opacity: 0.78;
    border-style: dashed;
    border-color: rgba(120,130,150,0.45);
    box-shadow: none;
    transition: opacity 0.18s, border-color 0.18s;
  }
  .rm-canvas.rm-view-unbound .rm-track .rm-item:hover {
    opacity: 1;
    border-color: rgba(170,180,210,0.65);
  }
  .rm-canvas.rm-view-unbound .rm-track .rm-track-label { opacity: 0.82; }
  .rm-canvas.rm-view-unbound .rm-track .rm-now { opacity: 0.78; }
  .rm-canvas::before {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,140,120,0.09) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none; opacity: 0.6;
  }
  .rm-loading { color: var(--text-dim); padding: 60px; text-align: center; font-size: 13px; }

  .rm-track {
    display: flex; align-items: stretch;
    position: relative;
    min-height: 96px;
  }
  .rm-track + .rm-track { border-top: 1px solid rgba(255,255,255,0.04); }

  .rm-track-label {
    width: 124px; min-width: 124px;
    position: sticky; left: 0;
    background: rgba(6,8,16,0.85);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 18px 14px 18px 18px;
    display: flex; align-items: center;
    z-index: 2;
    border-right: 1px solid rgba(255,255,255,0.04);
  }
  .rm-track-label h3 {
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: rgba(216,236,255,0.88);
    line-height: 1.35;
  }
  .rm-child .rm-track-label { padding-left: 30px; background: rgba(4,6,14,0.78); }
  .rm-child .rm-track-label h3 { font-size: 9.5px; font-weight: 600; opacity: 0.82; letter-spacing: 0.12em; }
  .rm-track-label.rm-collapsible { cursor: pointer; }
  .rm-track-label.rm-collapsible:hover { background: rgba(20,32,52,0.9); }
  .rm-chevron {
    display: inline-block; width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,160,140,0.7);
    transition: transform 0.18s; margin-right: 5px; flex-shrink: 0;
  }
  .rm-track-label.rm-collapsed .rm-chevron { transform: rotate(-90deg); }

  /* v4: sublane CSS removed — no sublanes in v4 schema */

  /* Done treatment: washed out + desaturated */
  .rm-item.done {
    opacity: 0.28;
    filter: grayscale(0.6);
  }
  .rm-item.done:hover { opacity: 0.52; filter: grayscale(0.3); }

  /* Deferred cards: dim */
  .rm-item.deferred { opacity: 0.4; }
  .rm-item.deferred:hover { opacity: 0.7; }

  /* Archived track — read-only, faded italic */
  .rm-track.rm-archived-track .rm-item {
    opacity: 0.5;
    border-style: dashed;
    cursor: default;
    pointer-events: none;
  }
  .rm-track.rm-archived-track .rm-item-label { font-style: italic; }
  .rm-track.rm-archived-track .rm-track-label h3 { opacity: 0.6; }

  /* Track visibility (eye-icon toggle) */
  .rm-track.rm-track-hidden { display: none; }
  .rm-track-empty { color: var(--text-dim); font-size: 12px; font-style: italic; padding: 14px 10px; opacity: .7; }

  /* Eye-icon button in track label */
  .rm-track-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; color: rgba(255,255,255,0.22);
    font-size: 13px; line-height: 1;
    cursor: pointer; padding: 3px; border-radius: 4px;
    min-width: 18px; min-height: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.12s;
    z-index: 3;
  }
  .rm-track-eye:hover { color: rgba(255,255,255,0.7); }
  .rm-track-label { position: relative; }

  /* Hidden-tracks pill in legend */
  .rm-hidden-pill {
    margin-left: 0;
    background: rgba(60,20,10,0.7);
    border: 1px solid rgba(255,80,60,0.45);
    border-radius: 999px;
    padding: 4px 11px;
    color: rgba(255,200,195,0.92);
    font-size: 11px; font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    white-space: nowrap;
    display: none;
  }
  .rm-hidden-pill.show { display: inline-block; }
  .rm-hidden-pill:hover { background: rgba(80,25,10,0.9); border-color: rgba(255,100,80,0.7); }

  /* Drag-to-reorder ghost card */
  .rm-drag-ghost {
    position: fixed;
    width: 188px;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.7;
    transform: rotate(2deg) scale(1.04);
    box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 16px rgba(255,80,60,0.25);
    transition: none;
  }

  /* Drop placeholder between cards */
  .rm-drop-placeholder {
    width: 4px; min-width: 4px; flex-shrink: 0;
    background: rgba(255,80,60,0.7);
    border-radius: 2px;
    align-self: stretch;
    margin: 4px 0;
    transition: width 0.1s;
  }
  .rm-drop-placeholder.wide {
    width: 188px; min-width: 188px;
    background: rgba(255,80,60,0.12);
    border: 2px dashed rgba(255,80,60,0.55);
    border-radius: 9px;
  }

  .rm-rail {
    flex: 1; position: relative;
    overflow-x: auto; overflow-y: visible;
    scrollbar-width: thin; scrollbar-color: rgba(255,80,60,0.4) transparent;
  }
  .rm-rail::-webkit-scrollbar { height: 6px; }
  .rm-rail::-webkit-scrollbar-thumb { background: rgba(255,80,60,0.3); border-radius: 3px; }
  .rm-rail::-webkit-scrollbar-track { background: transparent; }

  .rm-rail-line {
    position: absolute; left: 14px; right: 14px; top: 50%;
    height: 1px; transform: translateY(-50%);
    background: linear-gradient(90deg,
      transparent 0%,
      rgba(255,140,120,0.25) 14%,
      rgba(255,140,120,0.55) 50%,
      rgba(255,140,120,0.25) 86%,
      transparent 100%);
    pointer-events: none;
  }
  .rm-rail-items {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px;
    min-height: 96px;
  }

  .rm-item {
    width: 188px; min-width: 188px;
    padding: 11px 13px 10px;
    border-radius: 9px;
    border: 1px solid;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
    position: relative;
    background: rgba(8,12,22,0.78);
  }
  .rm-item:hover { transform: translateY(-2px); }
  .rm-item-head {
    display: flex; align-items: center; gap: 7px;
    margin-bottom: 4px;
    /* Reserve right space so the title never crowds or overlaps the
       avatar circles. 44px clears a two-avatar stack (22 + 22 - 7 overlap
       + 7 gap). Single-avatar cards just get a bit more breathing room. */
    padding-right: 44px;
  }
  .rm-item-dot {
    width: 7px; height: 7px; border-radius: 50%;
    flex-shrink: 0;
  }
  .rm-item-label {
    font-size: 12.5px; font-weight: 600; line-height: 1.25;
    flex: 1;
    color: var(--text-bright);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rm-item-desc {
    font-size: 11px; line-height: 1.4;
    color: var(--text-dim);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* .rm-item.done — see top of section (opacity+grayscale treatment) */
  .rm-item.done .rm-item-label { color: rgba(170,185,210,0.72); font-weight: 500; }
  .rm-item.done .rm-item-dot { background: rgba(170,180,200,0.45); }

  .rm-item.active {
    background: rgba(6,16,12,0.85);
    border-color: rgba(74,222,128,0.55);
    box-shadow: 0 0 22px rgba(74,222,128,0.18);
  }
  .rm-item.active .rm-item-dot { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.7); }

  .rm-item.queued {
    background: rgba(6,12,24,0.85);
    border-color: rgba(255,80,60,0.45);
    box-shadow: 0 0 18px rgba(255,80,60,0.12);
  }
  .rm-item.queued .rm-item-dot { background: #60a5fa; box-shadow: 0 0 6px rgba(96,165,250,0.6); }

  .rm-item.urgent {
    background: rgba(20,6,8,0.92);
    border-color: rgba(248,113,113,0.75);
    box-shadow: 0 0 22px rgba(248,113,113,0.22);
    animation: rmUrgent 2.2s ease-in-out infinite;
  }
  .rm-item.urgent .rm-item-dot { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.7); }
  @keyframes rmUrgent {
    0%,100% { box-shadow: 0 0 22px rgba(248,113,113,0.22); }
    50%     { box-shadow: 0 0 32px rgba(248,113,113,0.42); }
  }

  .rm-item.blocked {
    background: rgba(20,14,4,0.92);
    border-color: rgba(251,191,36,0.55);
  }
  .rm-item.blocked .rm-item-dot { background: #fbbf24; }

  /* NOW pill — bold red, high contrast */
  .rm-now {
    display: flex; align-items: center; justify-content: center;
    padding: 5px 14px;
    background: rgba(255,60,40,0.85);
    border: 1.5px solid rgba(255,140,130,0.8);
    border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
    color: #fff;
    white-space: nowrap;
    align-self: center;
    min-height: 24px;
    box-shadow: 0 0 12px rgba(255,60,40,0.45);
  }

  /* Popover */
  .rm-popover {
    position: fixed;
    width: 340px;
    background: rgba(8,12,22,0.97);
    border: 1px solid rgba(255,140,120,0.3);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 16px 56px rgba(0,0,0,0.65), 0 0 24px rgba(255,80,60,0.16);
    z-index: 200;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    font-size: 13px;
    color: var(--text);
  }
  .rm-popover.hidden { display: none; }
  .rm-pop-close {
    position: absolute; top: 12px; right: 12px;
    background: transparent; border: 0; color: var(--text-dim);
    font-size: 18px; cursor: pointer; line-height: 1; padding: 4px;
    font-family: var(--font);
  }
  .rm-pop-close:hover { color: var(--text-bright); }
  .rm-pop-track {
    font-size: 10px; color: var(--text-dim); letter-spacing: 0.16em;
    text-transform: uppercase; font-weight: 600;
  }
  .rm-pop-label {
    font-size: 18px; font-weight: 600; color: var(--text-bright);
    margin: 6px 0 12px; line-height: 1.3; padding-right: 20px;
  }
  .rm-pop-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px 4px 10px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 14px;
  }
  .rm-pop-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
  .rm-pop-badge.done    { background: rgba(170,180,200,0.10); color: rgba(180,195,215,0.85); }
  .rm-pop-badge.done::before    { background: rgba(170,180,200,0.55); }
  .rm-pop-badge.active  { background: rgba(74,222,128,0.14); color: #86efac; }
  .rm-pop-badge.active::before  { background: #4ade80; }
  .rm-pop-badge.queued  { background: rgba(96,165,250,0.14); color: #93c5fd; }
  .rm-pop-badge.queued::before  { background: #60a5fa; }
  .rm-pop-badge.urgent  { background: rgba(248,113,113,0.16); color: #fca5a5; }
  .rm-pop-badge.urgent::before  { background: #f87171; }
  .rm-pop-badge.blocked { background: rgba(251,191,36,0.14); color: #fcd34d; }
  .rm-pop-badge.blocked::before { background: #fbbf24; }

  .rm-pop-desc { color: var(--text); line-height: 1.55; margin-bottom: 12px; font-size: 12.5px; }
  .rm-pop-dates { color: var(--text-dim); font-size: 11px; font-family: var(--font-mono); }
  .rm-pop-actions { display: flex; gap: 8px; margin-top: 14px; }
  .rm-pop-actions button {
    flex: 1; padding: 8px 12px; font-size: 11px; font-weight: 600;
    background: rgba(255,80,60,0.14); color: var(--text);
    border: 1px solid rgba(255,80,60,0.35); border-radius: 7px;
    cursor: pointer; transition: all 0.12s; font-family: var(--font);
  }
  .rm-pop-actions button:hover { background: rgba(255,80,60,0.24); border-color: rgba(255,80,60,0.55); }
  .rm-pop-actions button.rm-danger { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.35); color: #fca5a5; }
  .rm-pop-actions button.rm-danger:hover { background: rgba(248,113,113,0.18); }

  .rm-pop-edit { display: flex; flex-direction: column; gap: 11px; }
  .rm-pop-edit label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
  .rm-pop-edit input, .rm-pop-edit select, .rm-pop-edit textarea {
    background: rgba(4,8,18,0.85); color: var(--text);
    border: 1px solid rgba(255,80,60,0.25); border-radius: 7px;
    padding: 8px 10px; font-size: 12px; font-family: var(--font); width: 100%;
  }
  .rm-pop-edit textarea { resize: vertical; min-height: 72px; font-family: var(--font); }
  .rm-pop-edit input:focus, .rm-pop-edit select:focus, .rm-pop-edit textarea:focus {
    outline: none; border-color: rgba(255,80,60,0.6);
  }
  .rm-pop-readonly-note { color: var(--muted); font-size: 11px; font-style: italic; margin-top: 10px; }

  /* ── Roadmap prompt textarea ─────────────────────────────── */
  .rm-pop-prompt { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
  .rm-pop-prompt-input {
    width: 100%; background: rgba(4,8,18,0.85); color: var(--text);
    border: 1px solid rgba(255,80,60,0.25); border-radius: 7px;
    padding: 8px 10px; font-size: 12px; font-family: var(--font);
    line-height: 1.4; resize: none; overflow: hidden;
    min-height: 28px; transition: border-color 0.15s, height 0.1s;
  }
  .rm-pop-prompt-input:focus { outline: none; border-color: rgba(255,80,60,0.6); }
  .rm-pop-prompt-input::placeholder { color: var(--muted); }
  .rm-pop-prompt-status { font-size: 11px; color: var(--text-dim); min-height: 0; line-height: 1.3; }
  .rm-pop-prompt-status:empty { display: none; }
  .rm-pop-prompt-status.error { color: #fca5a5; }

  /* ── Roadmap snapshot button ─────────────────────────────── */
  .rm-snapshot-btn {
    background: rgba(8,12,22,0.7); color: var(--text-dim);
    border: 1px solid var(--border); border-radius: 7px;
    padding: 6px 13px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s; font-family: var(--font);
    margin-left: auto;
  }
  .rm-snapshot-btn:hover { background: rgba(30,40,70,0.8); color: var(--text); border-color: rgba(255,80,60,0.5); }
  .rm-snapshot-btn:disabled { opacity: 0.45; cursor: default; }

  .rm-toast {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    background: rgba(8,12,22,0.96); border: 1px solid rgba(255,80,60,0.45);
    color: var(--text); padding: 10px 18px; border-radius: 9px;
    font-size: 12px; z-index: 300;
    opacity: 0; pointer-events: none; transition: opacity 0.18s;
  }
  .rm-toast.show { opacity: 1; }
  .rm-toast.error { border-color: rgba(248,113,113,0.6); color: #fca5a5; }

  @media (max-width: 720px) {
    .rm-track-label { width: 96px; min-width: 96px; padding: 14px 10px 14px 14px; }
    .rm-track-label h3 { font-size: 9.5px; }
    .rm-item { width: 168px; min-width: 168px; }
  }

  /* ── Agent Roster ────────────────────────────────────────────────────────── */
  .ar-header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
  .ar-header-left { display: flex; align-items: center; gap: 12px; }
  .ar-header h2 { font-size: 22px; font-weight: 600; color: var(--text-bright); letter-spacing: 0.01em; }
  .ar-date-chip {
    font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
    padding: 3px 10px; background: rgba(8,12,22,0.7);
    border: 1px solid var(--border); border-radius: 999px;
  }
  .ar-counter {
    font-size: 11px; color: rgba(255,180,160,0.95); font-family: var(--font-mono);
    padding: 3px 10px; background: rgba(80,20,15,0.5);
    border: 1px solid rgba(255,80,60,0.35); border-radius: 999px;
  }
  .ar-header-right { display: flex; gap: 8px; margin-left: auto; }
  .ar-toolbtn {
    background: rgba(8,12,22,0.7); color: var(--text-dim);
    border: 1px solid var(--border); border-radius: 7px;
    padding: 6px 12px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
    font-family: var(--font);
  }
  .ar-toolbtn:hover { color: var(--text-bright); border-color: rgba(255,80,60,0.45); background: rgba(255,80,60,0.10); }
  .ar-toolbtn.active { color: var(--text-bright); border-color: rgba(255,80,60,0.55); background: rgba(255,80,60,0.18); }

  .ar-zoom-group {
    display: inline-flex; align-items: center; gap: 0;
    background: rgba(8,12,22,0.7); border: 1px solid var(--border); border-radius: 7px;
    overflow: hidden;
  }
  .ar-zoom-group .ar-toolbtn { border: 0; border-radius: 0; padding: 6px 10px; }
  .ar-zoom-group .ar-toolbtn + .ar-toolbtn { border-left: 1px solid var(--border); }
  .ar-zoom-btn { font-size: 14px; line-height: 1; min-width: 28px; }
  .ar-zoom-chip {
    font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
    padding: 0 8px; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    min-width: 48px; text-align: center;
  }
  .ar-subtitle { color: var(--text-dim); font-size: 12px; flex-basis: 100%; line-height: 1.5; }

  .ar-legend {
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
    padding: 10px 16px; margin-bottom: 14px;
    background: rgba(8,12,22,0.55);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 12px;
  }
  .ar-legend-item { display: flex; gap: 8px; align-items: center; color: var(--text-dim); }
  .ar-legend-hint { color: var(--muted); font-style: italic; margin-left: auto; font-size: 11px; }

  /* Ecosystem show/hide — Hana vs Unbound agents on the roster canvas */
  .ar-ecofilter {
    display: flex; align-items: center; gap: 18px;
    padding: 10px 4px 2px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-dim);
  }
  .ar-ecofilter-label {
    text-transform: uppercase; letter-spacing: 0.08em;
    font-size: 10px; font-weight: 700; color: var(--muted);
  }
  .ar-eco-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
  .ar-eco-check input { accent-color: #ff6b3d; width: 14px; height: 14px; cursor: pointer; }
  .ar-eco-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
  .ar-eco-dot.eco-hana { background: #ff6b3d; box-shadow: 0 0 8px rgba(255,107,61,0.5); }
  .ar-eco-dot.eco-unbound { background: #ffffff; box-shadow: 0 0 8px rgba(255,255,255,0.55); }
  .ar-box.ar-eco-hidden { display: none !important; }
  .ar-tier {
    width: 14px; height: 14px; border-radius: 4px;
    display: inline-block;
    border: 1.5px solid;
  }
  .ar-tier-l3      { border-color: #ff4444; background: rgba(255,68,68,0.18); box-shadow: 0 0 8px rgba(255,68,68,0.4); }
  .ar-tier-l2      { border-color: #ff6b3d; background: rgba(255,107,61,0.16); box-shadow: 0 0 6px rgba(255,107,61,0.35); }
  .ar-tier-l1      { border-color: #4f8ef7; background: rgba(79,142,247,0.16); box-shadow: 0 0 6px rgba(79,142,247,0.35); }
  .ar-tier-l0      { border-color: rgba(150,170,200,0.55); background: rgba(150,170,200,0.10); }
  .ar-tier-dormant { border-color: rgba(120,130,150,0.40); background: transparent; border-style: dashed; }

  .ar-canvas-wrap {
    background:
      radial-gradient(ellipse at 18% 30%, rgba(80,30,30,0.18) 0%, transparent 55%),
      radial-gradient(ellipse at 82% 70%, rgba(20,40,90,0.20) 0%, transparent 55%),
      #050709;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    position: relative;
    overflow: auto;
    max-height: 78vh;
    cursor: grab;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }
  .ar-canvas-wrap.panning { cursor: grabbing; }
  .ar-canvas-wrap.panning * { cursor: grabbing !important; }
  .ar-canvas {
    position: relative;
    width: 1740px;
    min-height: 1240px;
    background-image:
      linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px),
      radial-gradient(circle at 50% 30%, rgba(120,40,40,0.10) 0%, transparent 60%);
    background-size: 32px 32px, 32px 32px, 100% 100%;
    transform-origin: 0 0;
    will-change: transform;
  }
  .ar-loading { color: var(--text-dim); padding: 60px; text-align: center; font-size: 13px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

  .ar-connectors {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
  }
  .ar-connectors.hidden { display: none; }
  .ar-connectors path {
    fill: none;
    stroke: rgba(255,80,60,0.55);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .ar-connectors path.peer { stroke: rgba(250,180,80,0.6); stroke-dasharray: 4 3; }

  /* Agent box — compact card */
  .ar-box {
    position: absolute;
    width: 148px;
    background: rgba(10,5,5,0.92);
    border: 1.5px solid;
    border-radius: 7px;
    padding: 5px 9px 5px;
    cursor: grab;
    transition: box-shadow 0.18s, transform 0.12s;
    z-index: 2;
    user-select: none;
    -webkit-user-select: none;
    font-family: var(--font);
    touch-action: none;
  }
  .ar-box:hover { transform: translateY(-1px); z-index: 4; }
  .ar-box.dragging { cursor: grabbing; opacity: 0.92; z-index: 10; transition: none; }
  .ar-box.touch-arming { box-shadow: 0 0 0 2px rgba(255,107,61,0.45), 0 0 14px rgba(255,107,61,0.35); }
  .ar-box.drop-target { box-shadow: 0 0 0 2px rgba(74,222,128,0.85), 0 0 26px rgba(74,222,128,0.55); transform: translateY(-2px); }
  .ar-box.ar-box-hl { border: 2px solid #ffffff; box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 0 18px rgba(255,255,255,0.28); }
  .ar-box.ar-box-hl:hover { box-shadow: 0 0 0 2px rgba(255,255,255,0.7), 0 0 24px rgba(255,255,255,0.4); }

  /* Trust-tier colors — match the org chart aesthetic */
  .ar-box.tier-L3 {
    border-color: #ff4444;
    box-shadow: 0 0 16px rgba(255,68,68,0.32), inset 0 0 0 1px rgba(255,68,68,0.15);
    background: rgba(20,4,4,0.94);
  }
  .ar-box.tier-L3:hover { box-shadow: 0 0 26px rgba(255,68,68,0.55), inset 0 0 0 1px rgba(255,68,68,0.25); }
  .ar-box.tier-L2 {
    border-color: #ff6b3d;
    box-shadow: 0 0 14px rgba(255,107,61,0.28);
  }
  .ar-box.tier-L2:hover { box-shadow: 0 0 22px rgba(255,107,61,0.48); }
  .ar-box.tier-L1 {
    border-color: #4f8ef7;
    box-shadow: 0 0 12px rgba(79,142,247,0.28);
    background: rgba(4,8,18,0.92);
  }
  .ar-box.tier-L1:hover { box-shadow: 0 0 20px rgba(79,142,247,0.48); }
  .ar-box.tier-L0 {
    border-color: rgba(170,180,210,0.55);
    box-shadow: 0 0 8px rgba(170,180,210,0.10);
  }
  .ar-box.tier-L0:hover { border-color: rgba(170,180,210,0.85); box-shadow: 0 0 14px rgba(170,180,210,0.22); }
  .ar-box.tier-Dormant, .ar-box.tier-Specced, .ar-box.tier-Scaffolded {
    border-color: rgba(120,130,150,0.45);
    border-style: dashed;
    background: rgba(8,8,12,0.82);
    opacity: 0.78;
  }

  .ar-box.peer { border-color: #fbbf24; box-shadow: 0 0 14px rgba(251,191,36,0.28); }
  .ar-box.peer:hover { box-shadow: 0 0 22px rgba(251,191,36,0.5); }
  .ar-box.paused { opacity: 0.55; filter: saturate(0.5); }
  .ar-box.paused::after {
    content: "PAUSED"; position: absolute; top: 4px; right: 6px;
    font-size: 8.5px; font-weight: 700; letter-spacing: 0.14em;
    color: #fbbf24; background: rgba(40,28,4,0.85);
    padding: 1px 5px; border-radius: 3px;
  }

  .ar-box-name {
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
    color: var(--text-bright); line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ar-box.tier-L3 .ar-box-name { color: #ffaaaa; }
  .ar-box.tier-L2 .ar-box-name { color: #ffc8a8; }
  .ar-box.tier-L1 .ar-box-name { color: #c8dcff; }
  .ar-box.peer    .ar-box-name { color: #fde68a; }

  .ar-box-role {
    font-size: 7.5px; font-weight: 600; letter-spacing: 0.10em;
    text-transform: uppercase; color: var(--text-dim);
    margin-top: 1px; margin-bottom: 3px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  .ar-box-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 2px; gap: 4px;
  }
  .ar-box-trust {
    font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
    padding: 1px 6px; border-radius: 3px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
    font-family: var(--font-mono);
  }
  .ar-box.tier-L3 .ar-box-trust { background: rgba(255,68,68,0.18); color: #ffb3b3; }
  .ar-box.tier-L2 .ar-box-trust { background: rgba(255,107,61,0.18); color: #ffd0b0; }
  .ar-box.tier-L1 .ar-box-trust { background: rgba(79,142,247,0.20); color: #b8d3ff; }
  .ar-box.tier-L0 .ar-box-trust { background: rgba(170,180,210,0.14); color: rgba(220,225,240,0.85); }

  .ar-box-progress {
    font-size: 9px; font-family: var(--font-mono);
    color: rgba(180,200,235,0.85);
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ar-box.tier-L0 .ar-box-progress { color: rgba(220,225,240,0.75); }
  .ar-box.tier-L1 .ar-box-progress { color: rgba(184,211,255,0.90); }
  .ar-box.tier-L2 .ar-box-progress { color: rgba(255,208,176,0.90); }
  .ar-box.tier-L3 .ar-box-progress { color: rgba(255,179,179,0.90); }

  .ar-box-status {
    font-size: 8.5px; color: var(--text-dim); font-family: var(--font-mono);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ar-box-status .ar-status-dot {
    width: 5px; height: 5px; border-radius: 50%; display: inline-block;
    margin-right: 3px; vertical-align: middle;
  }
  .ar-box-status.s-active .ar-status-dot   { background: #4ade80; box-shadow: 0 0 6px rgba(74,222,128,0.6); }
  .ar-box-status.s-running .ar-status-dot  { background: #22ff88; box-shadow: 0 0 10px rgba(34,255,136,0.9); animation: ar-pulse 1.4s ease-in-out infinite; }
  .ar-box-status.s-idle .ar-status-dot     { background: #f87171; box-shadow: 0 0 6px rgba(248,113,113,0.55); }
  .ar-box-status.s-paused .ar-status-dot   { background: #fbbf24; }
  .ar-box-status.s-blocked .ar-status-dot  { background: #f87171; }
  .ar-box-status.s-dormant .ar-status-dot  { background: rgba(140,150,170,0.5); }
  .ar-box-status.s-scaffolded .ar-status-dot { background: rgba(170,180,210,0.5); }
  .ar-box-status.s-staged .ar-status-dot   { background: #a78bfa; }
  .ar-box-status.s-done .ar-status-dot     { background: rgba(170,180,210,0.4); }

  @keyframes ar-pulse {
    0%, 100% { opacity: 1.0; transform: scale(1.0); }
    50%      { opacity: 0.45; transform: scale(1.35); }
  }

  .ar-box-lastrun {
    font-size: 8.5px; color: var(--muted); margin-top: 2px;
    font-family: var(--font-mono);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .ar-box-actions {
    display: flex; gap: 5px; margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .ar-actbtn {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--text-dim);
    padding: 2px 4px;
    border-radius: 5px;
    font-size: 10px; cursor: pointer; transition: all 0.12s;
    font-family: var(--font);
    display: flex; align-items: center; justify-content: center; gap: 3px;
    min-height: 18px;
  }
  .ar-actbtn:hover { background: rgba(255,255,255,0.08); color: var(--text-bright); }
  .ar-actbtn.play  { color: #4ade80; }
  .ar-actbtn.pause { color: #fbbf24; }
  .ar-actbtn.train { font-size: 13px; padding: 1px 4px; }
  .ar-actbtn.train:hover { background: rgba(255,107,61,0.18); border-color: rgba(255,107,61,0.45); }

  /* Connector dot — small circle on the parent→child line that's draggable to reparent */
  .ar-connectors circle.ar-rewire-dot {
    fill: rgba(255,107,61,0.85);
    stroke: rgba(10,5,5,0.95);
    stroke-width: 1.5;
    cursor: grab;
    transition: r 0.12s, fill 0.12s;
    pointer-events: all;
  }
  .ar-connectors circle.ar-rewire-dot:hover { fill: #ff8a5a; }
  .ar-connectors circle.ar-rewire-dot.dragging { cursor: grabbing; fill: #4ade80; }
  .ar-connectors path.rewire-ghost {
    stroke: rgba(74,222,128,0.85);
    stroke-width: 1.8;
    stroke-dasharray: 5 4;
    fill: none;
    pointer-events: none;
  }

  /* Bio popover — wide, dense */
  .ar-popover {
    position: fixed;
    width: 380px;
    background: rgba(8,8,14,0.97);
    border: 1px solid rgba(255,107,61,0.40);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.7), 0 0 32px rgba(255,107,61,0.18);
    z-index: 200;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    font-size: 12.5px;
    color: var(--text);
    pointer-events: auto;
    line-height: 1.5;
  }
  .ar-popover.hidden { display: none; }
  .ar-pop-close {
    position: absolute; top: 10px; right: 12px;
    background: transparent; border: 0; color: var(--text-dim);
    font-size: 18px; cursor: pointer; line-height: 1; padding: 4px;
    font-family: var(--font);
  }
  .ar-pop-close:hover { color: var(--text-bright); }
  .ar-pop-role {
    font-size: 10px; color: var(--text-dim); letter-spacing: 0.16em;
    text-transform: uppercase; font-weight: 600;
  }
  .ar-pop-name {
    font-size: 18px; font-weight: 600; color: var(--text-bright);
    margin: 4px 0 8px; padding-right: 20px;
  }
  .ar-pop-tier-row {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .ar-pop-tier {
    font-size: 10px; font-weight: 700; letter-spacing: 0.10em;
    padding: 3px 10px; border-radius: 999px;
    font-family: var(--font-mono);
  }
  .ar-pop-tier.tier-L3 { background: rgba(255,68,68,0.18); color: #ffaaaa; border: 1px solid rgba(255,68,68,0.35); }
  .ar-pop-tier.tier-L2 { background: rgba(255,107,61,0.18); color: #ffd0b0; border: 1px solid rgba(255,107,61,0.35); }
  .ar-pop-tier.tier-L1 { background: rgba(79,142,247,0.20); color: #b8d3ff; border: 1px solid rgba(79,142,247,0.35); }
  .ar-pop-tier.tier-L0 { background: rgba(170,180,210,0.12); color: rgba(220,225,240,0.85); border: 1px solid rgba(170,180,210,0.35); }
  .ar-pop-tier.tier-Dormant, .ar-pop-tier.tier-Specced, .ar-pop-tier.tier-Scaffolded {
    background: transparent; color: rgba(150,160,180,0.85); border: 1px dashed rgba(150,160,180,0.45);
  }
  .ar-pop-progress { font-size: 10.5px; color: var(--text-dim); font-family: var(--font-mono); }

  /* Graduation progress card — clean replacement for the raw markdown blob */
  .ar-pop-grad {
    margin: 4px 0 14px;
    padding: 10px 12px;
    background: rgba(8,12,22,0.55);
    border: 1px solid rgba(255,80,60,0.18);
    border-radius: 9px;
    display: flex; flex-direction: column; gap: 7px;
  }
  .ar-pop-grad-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--text-dim);
    font-family: var(--font-mono);
  }
  .ar-pop-grad-arrow { color: rgba(255,140,120,0.65); }
  .ar-pop-grad-tier {
    font-size: 10px; font-weight: 700; letter-spacing: 0.10em;
    padding: 2px 8px; border-radius: 999px; font-family: var(--font-mono);
    background: rgba(170,180,210,0.10); color: rgba(220,225,240,0.85);
    border: 1px solid rgba(170,180,210,0.25);
  }
  .ar-pop-grad-tier.tier-L3 { background: rgba(255,68,68,0.18); color: #ffaaaa; border-color: rgba(255,68,68,0.35); }
  .ar-pop-grad-tier.tier-L2 { background: rgba(255,107,61,0.18); color: #ffd0b0; border-color: rgba(255,107,61,0.35); }
  .ar-pop-grad-tier.tier-L1 { background: rgba(79,142,247,0.20); color: #b8d3ff; border-color: rgba(79,142,247,0.35); }
  .ar-pop-grad-tier.tier-L0 { background: rgba(170,180,210,0.12); color: rgba(220,225,240,0.85); border-color: rgba(170,180,210,0.35); }
  .ar-pop-grad-meta {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);
  }
  .ar-pop-grad-count { color: var(--text-bright); font-weight: 700; }
  .ar-pop-grad-bar {
    width: 100%; height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px; overflow: hidden;
  }
  .ar-pop-grad-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,80,60,0.85), rgba(255,140,120,0.95));
    border-radius: 999px;
    transition: width 0.25s ease-out;
  }
  .ar-pop-grad-next {
    font-size: 12px; color: var(--text); font-family: var(--font);
    line-height: 1.4;
  }
  .ar-pop-grad-loading { font-size: 11px; color: var(--muted); font-style: italic; }

  .ar-pop-purpose {
    color: var(--text);
    font-size: 12.5px;
    margin-bottom: 14px;
  }

  .ar-pop-section { margin-top: 12px; }
  .ar-pop-section h4 {
    font-size: 10px; color: rgba(255,180,140,0.85);
    letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
    margin-bottom: 6px;
  }
  .ar-pop-section ul {
    list-style: none; padding: 0; margin: 0;
  }
  .ar-pop-section li {
    color: var(--text-dim); font-size: 11.5px; line-height: 1.45;
    padding: 2px 0 2px 14px;
    position: relative;
  }
  .ar-pop-section li::before {
    content: "›"; position: absolute; left: 0; color: rgba(255,107,61,0.7);
  }
  .ar-pop-section.tools .pill {
    display: inline-block;
    background: rgba(255,80,60,0.12);
    color: #cfe0ff;
    padding: 2px 9px;
    margin: 2px 4px 2px 0;
    border-radius: 999px;
    font-size: 10.5px;
    font-family: var(--font-mono);
    border: 1px solid rgba(255,80,60,0.25);
  }
  .ar-pop-section.skills .pill {
    background: rgba(168,128,255,0.14);
    color: #d8c8ff;
    border-color: rgba(168,128,255,0.30);
  }
  .ar-pop-section.api .pill {
    background: rgba(255,160,80,0.12);
    color: #ffd0a8;
    border-color: rgba(255,160,80,0.30);
  }
  .ar-pop-section .pill.empty {
    background: transparent; color: var(--muted);
    font-style: italic; border-color: transparent;
  }

  .ar-pop-dates { margin-top: 12px; font-size: 10.5px; color: var(--muted); font-family: var(--font-mono); border-top: 1px solid rgba(255,255,255,0.06); padding-top: 8px; }

  .ar-toast {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    background: rgba(8,12,22,0.96); border: 1px solid rgba(255,107,61,0.55);
    color: var(--text); padding: 10px 18px; border-radius: 9px;
    font-size: 12px; z-index: 300;
    opacity: 0; pointer-events: none; transition: opacity 0.18s;
  }
  .ar-toast.show { opacity: 1; }
  .ar-toast.error { border-color: rgba(248,113,113,0.6); color: #fca5a5; }
  .ar-toast.train { border-color: rgba(255,107,61,0.7); color: #ffc8a8; box-shadow: 0 0 24px rgba(255,107,61,0.25); }

  /* ── Auto-refresh indicator ───────────────────────────────── */
  #ar-refresh-indicator {
    position: fixed;
    bottom: 12px;
    right: 14px;
    z-index: 900;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--muted);
    opacity: 0.45;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
    letter-spacing: 0.04em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 3px 7px;
    white-space: nowrap;
  }
  #ar-refresh-indicator:hover { opacity: 0.9; color: var(--accent); border-color: var(--accent-dim); }
  #ar-refresh-indicator.disabled { color: var(--muted); opacity: 0.28; }

.tab-bar { display: flex; gap: 4px; padding: 4px; background: rgba(8,12,22,0.6); border: 1px solid var(--border); border-radius: 10px; }
    .tab-btn {
      background: transparent; color: var(--text-dim); border: 0; border-radius: 7px;
      padding: 7px 16px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
      font-family: var(--font); cursor: pointer; transition: all 0.15s;
    }
    .tab-btn:hover { color: var(--text); }
    .tab-btn.active { background: rgba(255,80,60,0.16); color: var(--text-bright); box-shadow: 0 0 0 1px rgba(255,80,60,0.35); }
    .tab-panel { display: none; }
    .tab-panel.active { display: block; }

/* KPI tile row */
    .mkt-kpi-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }
    @media (max-width: 900px) { .mkt-kpi-row { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 500px) { .mkt-kpi-row { grid-template-columns: 1fr; } }

    .mkt-kpi-tile {
      background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 18px;
      display: flex; flex-direction: column; gap: 5px;
      min-height: 120px;
    }
    .mkt-kpi-tile.warn { border-color: rgba(239,68,68,0.45); }
    .mkt-kpi-label {
      font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--text-dim);
    }
    .mkt-kpi-value {
      font-size: 28px; font-weight: 700; color: var(--text-bright);
      letter-spacing: -0.02em; line-height: 1.1;
    }
    .mkt-kpi-value.warn { color: var(--red); }
    .mkt-kpi-caption { font-size: 11px; color: var(--text-dim); margin-top: auto; }
    .mkt-kpi-bar-wrap { margin-top: 6px; }
    .mkt-kpi-bar-bg { background: var(--border); border-radius: 99px; height: 5px; overflow: hidden; }
    .mkt-kpi-bar-fill { background: var(--accent); border-radius: 99px; height: 100%; transition: width 0.6s ease; }
    .mkt-kpi-bar-fill.green { background: var(--green); }

    /* Campaign board row */
    .mkt-campaign-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }
    @media (max-width: 900px) { .mkt-campaign-row { grid-template-columns: 1fr 1fr; } }
    @media (max-width: 500px) { .mkt-campaign-row { grid-template-columns: 1fr; } }

    .mkt-campaign-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 16px;
      display: flex; flex-direction: column; gap: 8px;
      min-height: 130px;
    }
    .mkt-campaign-header {
      display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    }
    .mkt-campaign-name {
      font-size: 13px; font-weight: 600; color: var(--text);
      line-height: 1.35; flex: 1;
    }
    .mkt-status-pill {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 2px 8px; border-radius: 99px;
      font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
      white-space: nowrap; flex-shrink: 0;
    }
    .mkt-status-pill.live    { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
    .mkt-status-pill.paused  { background: rgba(234,179,8,0.12); color: var(--yellow); border: 1px solid rgba(234,179,8,0.3); }
    .mkt-status-pill.held    { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid var(--border); }
    .mkt-status-pill.not-started { background: rgba(255,255,255,0.03); color: var(--muted); border: 1px solid var(--border); opacity: 0.6; }
    .mkt-status-dot {
      width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
    }
    .mkt-status-pill.live .mkt-status-dot { animation: pulse 2s infinite; }
    .mkt-campaign-note { font-size: 11px; color: var(--text-dim); line-height: 1.4; }
    .mkt-campaign-progress {
      margin-top: auto;
      display: flex; flex-direction: column; gap: 4px;
    }
    .mkt-campaign-progress-label {
      display: flex; justify-content: space-between;
      font-size: 10px; color: var(--text-dim);
    }
    .mkt-countdown {
      font-size: 11px; color: var(--yellow); font-variant-numeric: tabular-nums;
      margin-top: auto;
    }

    /* Bottom two rows: kanban + agent activity */
    .mkt-lower-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 16px;
    }
    @media (max-width: 700px) { .mkt-lower-row { grid-template-columns: 1fr; } }

    /* Kanban strip */
    .mkt-kanban {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }
    .mkt-kanban-body { padding: 12px 16px; display: flex; gap: 10px; }
    .mkt-kanban-col {
      flex: 1; display: flex; flex-direction: column; gap: 6px;
    }
    .mkt-kanban-col-label {
      font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--muted); font-weight: 700; padding-bottom: 4px;
      border-bottom: 1px solid var(--border);
    }
    .mkt-kanban-count {
      font-size: 22px; font-weight: 700; color: var(--text-bright);
      letter-spacing: -0.02em;
    }
    .mkt-kanban-count.dim { color: var(--muted); }
    .mkt-kanban-empty {
      font-size: 10px; color: var(--muted); line-height: 1.4; margin-top: 2px;
    }

    /* Agent activity strip */
    .mkt-agents {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }
    .mkt-agents-list { padding: 6px 0; }
    .mkt-agent-row {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 16px;
      border-bottom: 1px solid var(--border);
      font-size: 12px;
    }
    .mkt-agent-row:last-child { border-bottom: none; }
    .mkt-agent-dot {
      width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    }
    .mkt-agent-dot.green  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
    .mkt-agent-dot.yellow { background: var(--yellow); }
    .mkt-agent-dot.red    { background: var(--red); }
    .mkt-agent-dot.never  { background: var(--muted); }
    .mkt-agent-name { color: var(--text); font-weight: 600; min-width: 110px; }
    .mkt-agent-last { color: var(--text-dim); font-size: 11px; margin-left: auto; font-variant-numeric: tabular-nums; }

    /* ── Workflows panel ── */
    .mkt-wf-section {
      margin-bottom: 16px;
    }
    .mkt-wf-table {
      width: 100%;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
      border-collapse: collapse;
      font-size: 12px;
    }
    .mkt-wf-table thead tr {
      border-bottom: 1px solid var(--border);
    }
    .mkt-wf-table thead th {
      font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--muted); font-weight: 700;
      padding: 8px 14px; text-align: left;
    }
    .mkt-wf-table tbody tr {
      border-bottom: 1px solid var(--border);
    }
    .mkt-wf-table tbody tr:last-child { border-bottom: none; }
    .mkt-wf-table tbody tr:hover { background: rgba(255,255,255,0.02); }
    .mkt-wf-td { padding: 9px 14px; vertical-align: middle; }
    .mkt-wf-name { color: var(--text); font-weight: 600; }
    .mkt-wf-blurb { color: var(--text-dim); font-size: 11px; margin-top: 1px; }
    .mkt-wf-sched { color: var(--text-dim); font-size: 11px; white-space: nowrap; }
    .mkt-wf-trust-pill {
      display: inline-block; padding: 2px 7px; border-radius: 4px;
      font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
      background: rgba(255,255,255,0.06); color: var(--muted);
      border: 1px solid var(--border);
    }
    .mkt-wf-trust-pill.l1 { background: rgba(59,130,246,0.12); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
    .mkt-wf-trust-pill.l2 { background: rgba(34,197,94,0.12); color: var(--green); border-color: rgba(34,197,94,0.3); }
    .mkt-wf-trust-pill.l3 { background: rgba(167,139,250,0.15); color: #a78bfa; border-color: rgba(167,139,250,0.3); }
    .mkt-wf-dot {
      width: 8px; height: 8px; border-radius: 50%; display: inline-block;
      vertical-align: middle; margin-right: 5px; flex-shrink: 0;
    }
    .mkt-wf-dot.active  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
    .mkt-wf-dot.idle    { background: var(--yellow); }
    .mkt-wf-dot.stale   { background: var(--red); }
    .mkt-wf-dot.off     { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
    .mkt-wf-status-word { font-size:11px; font-weight:600; }
    .mkt-wf-status-word.active { color: var(--green); }
    .mkt-wf-status-word.idle   { color: var(--yellow); }
    .mkt-wf-status-word.stale, .mkt-wf-status-word.off { color: var(--red); }
    .mkt-wf-status-cell { white-space: nowrap; }

    /* ── Content Calendar panel ── */
    .mkt-cal-section {
      margin-bottom: 16px;
    }
    .mkt-cal-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }
    .mkt-cal-status-row {
      display: flex; gap: 0;
      border-bottom: 1px solid var(--border);
    }
    .mkt-cal-status-col {
      flex: 1; padding: 14px 12px;
      display: flex; flex-direction: column; gap: 4px;
      border-right: 1px solid var(--border);
    }
    .mkt-cal-status-col:last-child { border-right: none; }
    .mkt-cal-status-label {
      font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--muted); font-weight: 700;
    }
    .mkt-cal-status-count {
      font-size: 26px; font-weight: 700; color: var(--text-bright);
      letter-spacing: -0.02em; line-height: 1.1;
    }
    .mkt-cal-status-count.dim { color: var(--muted); }
    .mkt-cal-upcoming { padding: 10px 14px; }
    .mkt-cal-upcoming-label {
      font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--muted); font-weight: 700; margin-bottom: 8px;
    }
    .mkt-cal-item {
      display: flex; align-items: baseline; gap: 8px;
      padding: 5px 0;
      border-bottom: 1px solid rgba(255,255,255,0.04);
      font-size: 11px;
    }
    .mkt-cal-item:last-child { border-bottom: none; }
    .mkt-cal-item-date {
      color: var(--muted); font-variant-numeric: tabular-nums;
      white-space: nowrap; min-width: 64px;
    }
    .mkt-cal-item-title { color: var(--text); font-weight: 500; flex: 1; }
    .mkt-cal-item-meta { color: var(--text-dim); white-space: nowrap; }
    .mkt-cal-empty {
      padding: 16px 14px; font-size: 12px; color: var(--muted);
      text-align: center;
    }
    @media (max-width: 600px) {
      .mkt-cal-status-row { flex-wrap: wrap; }
      .mkt-cal-status-col { min-width: 33%; }
    }

    /* Footer sources line */
    .mkt-footer {
      display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
      padding: 10px 0 4px;
      font-size: 11px; color: var(--text-dim);
      border-top: 1px solid var(--border);
    }
    .mkt-footer-ts { font-family: var(--font-mono); }
    .mkt-source-chip {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 2px 7px; border-radius: 4px;
      font-size: 10px; font-weight: 600;
      background: rgba(234,179,8,0.12);
      border: 1px solid rgba(234,179,8,0.3);
      color: var(--yellow);
    }
    .mkt-loading { color: var(--muted); font-size: 13px; padding: 32px 0; text-align: center; }

    /* ── Brand-gate violation list ── */
    .mkt-bg-section {
      margin-bottom: 16px;
    }
    .mkt-bg-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 10px 14px;
      background: rgba(234,179,8,0.08);
      border: 1px solid rgba(234,179,8,0.3);
      border-radius: 8px;
      cursor: pointer;
      user-select: none;
    }
    .mkt-bg-header.clean {
      background: rgba(34,197,94,0.06);
      border-color: rgba(34,197,94,0.25);
    }
    .mkt-bg-headline {
      font-size: 12px; color: var(--yellow); font-weight: 600;
    }
    .mkt-bg-header.clean .mkt-bg-headline { color: var(--green); }
    .mkt-bg-toggle {
      font-size: 11px; color: var(--muted); margin-left: 8px; flex-shrink: 0;
    }
    .mkt-bg-list {
      margin-top: 6px;
      border: 1px solid rgba(234,179,8,0.2);
      border-radius: 0 0 8px 8px;
      border-top: none;
      overflow-y: auto;
      max-height: 280px;
      background: rgba(234,179,8,0.03);
    }
    .mkt-bg-row {
      padding: 8px 14px;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      font-size: 11px;
    }
    .mkt-bg-row:last-child { border-bottom: none; }
    .mkt-bg-row-meta {
      display: flex; gap: 8px; align-items: center;
      color: var(--text-dim); margin-bottom: 3px; flex-wrap: wrap;
    }
    .mkt-bg-agent { font-weight: 700; color: var(--text); }
    .mkt-bg-channel {
      display: inline-block; padding: 1px 6px; border-radius: 4px;
      font-size: 10px; font-weight: 600;
      background: rgba(234,179,8,0.12); color: var(--yellow);
      border: 1px solid rgba(234,179,8,0.25);
    }
    .mkt-bg-ago { color: var(--muted); font-size: 10px; margin-left: auto; white-space: nowrap; }
    .mkt-bg-rule { color: var(--text); line-height: 1.4; }
    .mkt-bg-label { color: var(--text-dim); font-style: italic; font-size: 10px; margin-top: 1px; }
    .mkt-bg-truncated {
      padding: 7px 14px; font-size: 10px; color: var(--muted); text-align: center;
      border-top: 1px solid rgba(255,255,255,0.05);
    }
