/* Extracted from dashboard/templates/index.html on 2026-05-28. */
/* Tiny flag-icons override stays inline in <head>; trifecta-shell */
/* theme bootstrap stays inline (uses Jinja for shell_mode flag). */

    /* SDR++ preset card animations */
    @keyframes sdrpp-live-pulse {
      0%, 100% { opacity: 1; }
      50%      { opacity: 0.4; }
    }
    .sdrpp-live-pulse {
      animation: sdrpp-live-pulse 1.6s ease-in-out infinite;
    }
    .sdrpp-preset-live {
      animation: sdrpp-live-glow 2s ease-in-out infinite;
    }
    @keyframes sdrpp-live-glow {
      0%, 100% { box-shadow: 0 0 0 1px #22c55e44, 0 0 12px #22c55e33; }
      50%      { box-shadow: 0 0 0 1px #22c55e88, 0 0 18px #22c55e66; }
    }
    @keyframes sdrpp-preset-flash {
      0%   { background: #1f2937; border-color: #fbbf24; transform: scale(1); }
      25%  { background: #422006; border-color: #fbbf24; transform: scale(1.04); }
      100% { background: #0d0d0d; border-color: #1f2937; transform: scale(1); }
    }
    .sdrpp-preset-flash {
      animation: sdrpp-preset-flash 0.9s ease-out;
    }

    /* Preset cards pulse when the most-recent band scan measured them as
       listenable. Tier is set by floor-delta-dB (3/8/15 thresholds). */
    @keyframes sdrpp-listenable-strong {
      0%, 100% { box-shadow: 0 0 0 1px #22c55ecc, 0 0 18px #22c55e88; border-color: #22c55e; }
      50%      { box-shadow: 0 0 0 1px #22c55eff, 0 0 28px #22c55ebb; border-color: #4ade80; }
    }
    @keyframes sdrpp-listenable-mid {
      0%, 100% { box-shadow: 0 0 0 1px #84cc1699, 0 0 14px #84cc1655; border-color: #84cc16; }
      50%      { box-shadow: 0 0 0 1px #84cc16cc, 0 0 22px #84cc1688; border-color: #a3e635; }
    }
    @keyframes sdrpp-listenable-weak {
      0%, 100% { box-shadow: 0 0 0 1px #f59e0b66, 0 0 10px #f59e0b33; border-color: #f59e0b88; }
      50%      { box-shadow: 0 0 0 1px #f59e0b99, 0 0 16px #f59e0b66; border-color: #f59e0b; }
    }
    .sdrpp-preset-listenable-strong { animation: sdrpp-listenable-strong 2.4s ease-in-out infinite; }
    .sdrpp-preset-listenable-mid    { animation: sdrpp-listenable-mid    2.8s ease-in-out infinite; }
    .sdrpp-preset-listenable-weak   { animation: sdrpp-listenable-weak   3.2s ease-in-out infinite; }

    /* Scanning banner — animated while a band scan is in flight. */
    @keyframes sdrpp-scan-sweep {
      0%   { transform: translateX(-100%); }
      100% { transform: translateX(100%); }
    }
    @keyframes sdrpp-scan-breathe {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%      { opacity: 0.5; transform: scale(0.78); }
    }
    @keyframes sdrpp-scan-fill {
      0%   { background-position: 0% 50%; }
      100% { background-position: 200% 50%; }
    }
    .sdrpp-scanning-banner {
      position: relative;
      overflow: hidden;
      background: linear-gradient(135deg, #0a1f12 0%, #0e0e0e 55%, #0a1f12 100%);
      border: 1px solid #22c55e55;
      border-radius: 10px;
      padding: 14px 16px;
      box-shadow: 0 0 0 1px #22c55e22, 0 0 22px #22c55e22;
    }
    .sdrpp-scanning-banner::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: linear-gradient(90deg, transparent 0%, #22c55e33 50%, transparent 100%);
      animation: sdrpp-scan-sweep 2.2s linear infinite;
      pointer-events: none;
    }
    .sdrpp-scanning-banner > * { position: relative; z-index: 1; }
    .sdrpp-scan-dot {
      display: inline-block;
      width: 9px; height: 9px;
      border-radius: 50%;
      background: #22c55e;
      box-shadow: 0 0 10px #22c55ecc, 0 0 4px #22c55e;
      animation: sdrpp-scan-breathe 0.9s ease-in-out infinite;
      vertical-align: middle;
      margin-right: 8px;
    }
    .sdrpp-scan-progress-bar {
      height: 5px; margin-top: 10px;
      background: #0a0a0a;
      border-radius: 3px;
      overflow: hidden;
      border: 1px solid #1a1a1a;
    }
    .sdrpp-scan-progress-fill {
      height: 100%; width: 0%;
      background: linear-gradient(90deg, #22c55e, #84cc16, #22c55e);
      background-size: 200% 100%;
      animation: sdrpp-scan-fill 2.5s linear infinite;
      transition: width 0.45s linear;
    }

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

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
      background: #0f0f0f;
      color: #e8e8e8;
      min-height: 100vh;
    }
    body.shell-trifecta-headless {
      --shell-bg: #513824;
      --shell-surface: #f4f5e8;
      --shell-surface-alt: #f0f2e2;
      --shell-surface-soft: #e6e8d2;
      --shell-surface-strong: #ffffff;
      --shell-border: rgba(23,26,19,0.10);
      --shell-border-strong: rgba(23,26,19,0.16);
      --shell-text: #171a13;
      --shell-muted: rgba(23,26,19,0.62);
      --shell-subtle: rgba(23,26,19,0.44);
      --shell-accent: #e05026;
      --shell-accent-alt: #0a7d73;
      --shell-input-bg: rgba(255,255,255,0.72);
      background: #513824;
      color: #171a13;
      transition: background 0.22s ease, color 0.22s ease;
    }
    html.trifecta-theme-dark body.shell-trifecta-headless {
      --shell-bg: #283d2e;
      --shell-surface: #171a13;
      --shell-surface-alt: #1d2118;
      --shell-surface-soft: #24291f;
      --shell-surface-strong: #2b3126;
      --shell-border: rgba(244,245,232,0.08);
      --shell-border-strong: rgba(244,245,232,0.14);
      --shell-text: #f4f5e8;
      --shell-muted: rgba(244,245,232,0.72);
      --shell-subtle: rgba(244,245,232,0.48);
      --shell-accent: #48e090;
      --shell-accent-alt: #dea851;
      --shell-input-bg: rgba(255,255,255,0.04);
      background: #283d2e;
      color: #f4f5e8;
    }

    /* ── Header ── */
    header {
      background: #1a1a1a;
      border-bottom: 1px solid #f97316;
      padding: 16px 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .header-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
    header h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: center; gap: 10px; }
    .logo-dog { height: 38px; width: auto; flex-shrink: 0; overflow: visible; display: block; }
    .logo-tail-accent { fill: #f97316; }
    header h1 span { color: #3b82f6; }
    .header-domains {
      display: flex; align-items: center; gap: 8px;
      padding: 6px; border: 1px solid #2a2a2a; border-radius: 999px; background: #141414;
    }
    .header-domain {
      border: none; background: transparent; color: #777; cursor: pointer;
      padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 700;
      letter-spacing: 0.2px; transition: all 0.16s ease;
    }
    .header-domain:hover { color: #e8e8e8; }
    .header-domain.active {
      background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(249,115,22,0.16));
      color: #f5f5f5;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
    }
    .header-domain-dropdown {
      position: relative;
    }
    .header-domain-dropdown-menu {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      min-width: 200px;
      padding: 8px;
      border-radius: 14px;
      border: 1px solid #2a2a2a;
      background: #141414;
      box-shadow: 0 18px 40px rgba(0,0,0,0.42);
      z-index: 240;
    }
    .header-domain-dropdown.open .header-domain-dropdown-menu {
      display: block;
    }
    .header-other-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: 100%;
      padding: 10px 12px;
      border: none;
      background: transparent;
      color: #aaa;
      font-size: 12px;
      font-weight: 600;
      border-radius: 10px;
      cursor: pointer;
      text-align: left;
    }
    .header-other-item:hover {
      background: #1d1d1d;
      color: #f0f0f0;
    }
    .header-other-item.active {
      background: rgba(59,130,246,0.14);
      color: #93c5fd;
    }
    .header-other-item-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .header-other-item-check {
      color: #3b82f6;
      font-size: 11px;
      visibility: hidden;
    }
    .header-other-item.active .header-other-item-check {
      visibility: visible;
    }
    .header-right { display: flex; align-items: center; gap: 16px; font-size: 12px; color: #666; }
    .regime-badge {
      padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: 11px;
    }
    .regime-BULL  { background: #052e16; color: #22c55e; }
    .regime-CHOP  { background: #2d2000; color: #eab308; }
    .regime-BEAR  { background: #2d0000; color: #ef4444; }
    .regime-UNKNOWN { background: #2d1800; color: #f97316; }
    body.shell-trifecta-headless header {
      background: transparent;
      border-bottom: none;
      padding: 24px 24px 18px;
      position: relative;
      top: auto;
    }
    body.shell-trifecta-headless .header-left {
      gap: 14px;
    }
    body.shell-trifecta-headless header h1 {
      gap: 14px;
    }
    body.shell-trifecta-headless .header-right {
      gap: 12px;
      color: rgba(23,26,19,0.72);
    }
    html.trifecta-theme-dark body.shell-trifecta-headless .header-right {
      color: rgba(244,245,232,0.72);
    }
    body.shell-trifecta-headless .logo-dog {
      display: block;
      width: 106px;
      height: 55px;
      object-fit: contain;
    }
    .trifecta-shell-logo-mark {
      width: 106px;
      height: 55px;
      flex: 0 0 auto;
      display: block;
      background-color: #E05026;
      -webkit-mask: url("/static/trifecta-headless-logo.svg") center / contain no-repeat;
      mask: url("/static/trifecta-headless-logo.svg") center / contain no-repeat;
    }
    html.trifecta-theme-dark .trifecta-shell-logo-mark {
      background-color: #49E090;
    }
    body.shell-trifecta-headless .trifecta-shell-logo-mark {
      display: none;
    }
    .trifecta-shell-logo-home {
      cursor: pointer;
      border-radius: 18px;
      transition: transform 0.16s ease, opacity 0.16s ease;
    }
    .trifecta-shell-logo-home:hover {
      transform: translateY(-1px);
      opacity: 0.88;
    }
    body.shell-trifecta-headless #regime-badge {
      display: none;
    }
    .trifecta-shell-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .trifecta-shell-menu-toggle {
      display: none !important;
    }
    .trifecta-shell-icon-btn {
      width: 46px;
      height: 46px;
      border-radius: 999px;
      border: 1px solid rgba(23,26,19,0.14);
      background: rgba(240,242,226,0.82);
      color: #171a13;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
      backdrop-filter: blur(8px);
    }
    .trifecta-shell-icon-btn:hover {
      transform: translateY(-1px);
      background: rgba(240,242,226,0.96);
    }
    html.trifecta-theme-dark .trifecta-shell-icon-btn {
      border-color: rgba(244,245,232,0.14);
      background: rgba(23,26,19,0.78);
      color: #f4f5e8;
    }
    html.trifecta-theme-dark .trifecta-shell-icon-btn:hover {
      background: rgba(23,26,19,0.92);
    }
    .trifecta-shell-icon {
      width: 21px;
      height: 21px;
      display: block;
    }
    .trifecta-theme-icon-light,
    .trifecta-theme-icon-dark {
      width: 21px;
      height: 21px;
      display: none;
      flex: 0 0 auto;
    }
    .trifecta-theme-icon-light {
      color: #E05026;
    }
    .trifecta-theme-icon-dark {
      color: #49E090;
    }
    .trifecta-shell-menu-toggle {
      display: none !important;
    }
    html.trifecta-theme-light .trifecta-theme-icon-light,
    html:not(.trifecta-theme-dark) .trifecta-theme-icon-light {
      display: block;
    }
    html.trifecta-theme-dark .trifecta-theme-icon-dark {
      display: block;
    }
    .trifecta-shell-menu-overlay {
      position: fixed;
      inset: 0;
      background: rgba(23,26,19,0.32);
      backdrop-filter: blur(8px);
      z-index: 260;
      display: none;
      padding: 24px;
    }
    .trifecta-shell-menu-overlay.open {
      display: block;
    }
    .trifecta-qb-gate-overlay {
      position: fixed;
      inset: 0;
      z-index: 420;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(23,26,19,0.56);
      backdrop-filter: blur(10px);
    }
    .trifecta-qb-gate-overlay.open {
      display: flex;
    }
    .trifecta-qb-gate-card {
      width: min(480px, 100%);
      border-radius: 28px;
      border: 1px solid rgba(23,26,19,0.10);
      background: #f0f2e2;
      box-shadow: 0 32px 92px rgba(0,0,0,0.26);
      padding: 28px;
      color: #171a13;
    }
    html.trifecta-theme-dark .trifecta-qb-gate-card {
      border-color: rgba(244,245,232,0.12);
      background: #171a13;
      color: #f4f5e8;
    }
    .trifecta-qb-gate-card h2 {
      margin: 8px 0 8px;
      font-size: clamp(2rem, 5vw, 3rem);
      letter-spacing: -0.06em;
      line-height: 0.92;
    }
    .trifecta-qb-gate-card p {
      margin: 0 0 20px;
      color: rgba(23,26,19,0.68);
      font-size: 1rem;
      line-height: 1.5;
    }
    html.trifecta-theme-dark .trifecta-qb-gate-card p {
      color: rgba(244,245,232,0.70);
    }
    .trifecta-qb-gate-input {
      width: 100%;
      box-sizing: border-box;
      border-radius: 16px;
      border: 1px solid rgba(23,26,19,0.16);
      background: rgba(255,255,255,0.76);
      padding: 14px 16px;
      font: inherit;
      color: inherit;
      outline: none;
    }
    .trifecta-qb-gate-input:focus {
      border-color: rgba(224,80,38,0.66);
      box-shadow: 0 0 0 4px rgba(224,80,38,0.14);
    }
    html.trifecta-theme-dark .trifecta-qb-gate-input {
      border-color: rgba(244,245,232,0.16);
      background: rgba(244,245,232,0.08);
    }
    .trifecta-qb-gate-error {
      min-height: 20px;
      margin-top: 10px;
      color: #b23119;
      font-weight: 800;
      font-size: 0.88rem;
    }
    .trifecta-qb-gate-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 16px;
      flex-wrap: wrap;
    }
    .trifecta-shell-menu {
      margin-left: auto;
      width: min(420px, 100%);
      min-height: 100%;
      background: #f0f2e2;
      border-radius: 28px;
      border: 1px solid rgba(23,26,19,0.08);
      box-shadow: 0 24px 64px rgba(0,0,0,0.18);
      padding: 26px 24px 24px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    html.trifecta-theme-dark .trifecta-shell-menu {
      background: #171a13;
      border-color: rgba(244,245,232,0.08);
      box-shadow: 0 24px 72px rgba(0,0,0,0.34);
    }
    .trifecta-shell-menu-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .trifecta-shell-menu-title {
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: rgba(23,26,19,0.54);
    }
    html.trifecta-theme-dark .trifecta-shell-menu-title {
      color: rgba(244,245,232,0.54);
    }
    .trifecta-shell-menu-list {
      display: grid;
      gap: 12px;
    }
    .trifecta-shell-menu-item {
      width: 100%;
      border: 1px solid rgba(23,26,19,0.08);
      border-radius: 18px;
      background: rgba(255,255,255,0.48);
      padding: 16px 18px;
      text-align: left;
      cursor: pointer;
      transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
      color: #171a13;
    }
    .trifecta-shell-menu-item:hover {
      transform: translateY(-1px);
      border-color: rgba(224,80,38,0.36);
    }
    .trifecta-shell-menu-item.active {
      background: #171a13;
      color: #f4f5e8;
      border-color: #171a13;
    }
    .trifecta-shell-menu-item-label {
      display: block;
      font-size: 16px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-bottom: 4px;
    }
    .trifecta-shell-menu-item-copy {
      display: block;
      font-size: 12px;
      line-height: 1.5;
      color: rgba(23,26,19,0.62);
    }
    .trifecta-shell-menu-item.active .trifecta-shell-menu-item-copy {
      color: rgba(244,245,232,0.7);
    }
    html.trifecta-theme-dark .trifecta-shell-menu-item {
      background: rgba(255,255,255,0.03);
      border-color: rgba(244,245,232,0.08);
      color: #f4f5e8;
    }
    html.trifecta-theme-dark .trifecta-shell-menu-item-copy {
      color: rgba(244,245,232,0.62);
    }
    html.trifecta-theme-dark .trifecta-shell-menu-item.active {
      background: #f0f2e2;
      color: #171a13;
      border-color: #f0f2e2;
    }
    html.trifecta-theme-dark .trifecta-shell-menu-item.active .trifecta-shell-menu-item-copy {
      color: rgba(23,26,19,0.72);
    }
    .trifecta-shell-status {
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(23,26,19,0.52);
    }
    html.trifecta-theme-dark .trifecta-shell-status {
      color: rgba(244,245,232,0.5);
    }

    /* ── Layout ── */
    .container { max-width: 1400px; margin: 0 auto; padding: 24px 28px; }
    body.shell-trifecta-headless .container {
      max-width: 1520px;
      padding: 0 24px 32px;
      margin-bottom: 32px;
      background: #f4f5e8;
      border-radius: 32px 32px 0 0;
      box-shadow: 0 -1px 0 rgba(255,255,255,0.32), 0 18px 56px rgba(0,0,0,0.12);
    }
    html.trifecta-theme-dark body.shell-trifecta-headless .container {
      background: #171a13;
      box-shadow: 0 -1px 0 rgba(255,255,255,0.06), 0 18px 56px rgba(0,0,0,0.28);
    }
    body.shell-trifecta-headless #tab-client_intelligence > .section-header:first-child {
      margin-top: 0;
      padding-top: 15px;
    }
    body.shell-trifecta-headless #tab-client_intelligence > .section-header:first-child,
    body.shell-trifecta-headless #tab-opportunity_bot > .section-header:first-child,
    body.shell-trifecta-headless #tab-quickbooks > .section-header:first-child,
    body.shell-trifecta-headless #tab-delegation > .section-header:first-child {
      margin-top: 0;
      padding-top: 15px;
    }
    body.shell-trifecta-headless #tab-client_intelligence > .section-header:first-child {
      position: sticky;
      top: 0;
      z-index: 35;
      padding: 15px 0 12px;
      margin-bottom: 6px;
      background: linear-gradient(180deg, var(--shell-surface-alt) 0%, var(--shell-surface-alt) 78%, rgba(0,0,0,0) 100%);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--shell-border);
    }
    body.shell-trifecta-headless #tab-opportunity_bot > .section-header:first-child {
      position: sticky;
      top: 0;
      z-index: 35;
      padding: 15px 0 12px;
      margin-bottom: 18px;
      background: linear-gradient(180deg, var(--shell-surface-alt) 0%, var(--shell-surface-alt) 78%, rgba(0,0,0,0) 100%);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--shell-border);
    }
    body.shell-trifecta-headless .client-intel-search-sticky {
      position: sticky;
      top: 74px;
      z-index: 24;
      margin-bottom: 0;
      background: var(--shell-surface-alt);
      border-color: var(--shell-border);
      box-shadow: 0 10px 26px rgba(0,0,0,0.12);
    }
    body.shell-trifecta-headless .client-intel-top-row {
      position: relative;
      top: auto;
      z-index: auto;
      padding-bottom: 8px;
      margin-bottom: 0;
      background: transparent;
      backdrop-filter: none;
    }
    body.shell-trifecta-headless #client-intel-insights-card {
      background: var(--shell-surface-alt);
      border-color: var(--shell-border);
      box-shadow: 0 10px 26px rgba(0,0,0,0.10);
    }
    body.shell-trifecta-headless #client-intel-insights-card.client-intel-insights-sticky-active {
      position: sticky;
      top: 74px;
      z-index: 23;
    }
    body.shell-trifecta-headless #client-intel-insights {
      display: grid;
      gap: 16px;
    }
    body.shell-trifecta-headless .client-intel-opportunity-sticky {
      position: relative;
      top: auto;
      z-index: auto;
      background: var(--shell-surface-alt);
      border-color: var(--shell-border);
      box-shadow: 0 10px 26px rgba(0,0,0,0.10);
    }
    body.shell-trifecta-headless .client-intel-opportunity-toggle {
      cursor: pointer;
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    body.shell-trifecta-headless .client-intel-opportunity-toggle::-webkit-details-marker {
      display: none;
    }
    body.shell-trifecta-headless .client-intel-opportunity-caret {
      color: var(--shell-muted);
      transition: transform 0.18s ease;
      font-size: 12px;
    }
    body.shell-trifecta-headless details[open] > .client-intel-opportunity-toggle .client-intel-opportunity-caret {
      transform: rotate(180deg);
    }
    body.shell-trifecta-headless .opportunity-bot-search-sticky {
      position: sticky;
      top: 74px;
      z-index: 30;
      margin-bottom: 18px;
      background: var(--shell-surface-alt);
      border-color: var(--shell-border);
      box-shadow: 0 10px 26px rgba(0,0,0,0.12);
      padding: 14px 16px;
    }
    body.shell-trifecta-headless .opportunity-bot-hero-sticky {
      position: sticky;
      top: 194px;
      z-index: 26;
      margin-bottom: 18px;
      background: var(--shell-surface-alt);
      border-color: var(--shell-border);
      box-shadow: 0 10px 26px rgba(0,0,0,0.10);
      padding: 12px 16px 14px;
    }
    body.shell-trifecta-headless .opportunity-bot-hero-toggle {
      cursor: pointer;
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin: 0;
      padding: 0;
    }
    body.shell-trifecta-headless .opportunity-bot-hero-toggle::-webkit-details-marker {
      display: none;
    }
    body.shell-trifecta-headless .opportunity-bot-hero-caret {
      color: var(--shell-muted);
      transition: transform 0.18s ease;
      font-size: 12px;
    }
    body.shell-trifecta-headless details[open] > .opportunity-bot-hero-toggle .opportunity-bot-hero-caret {
      transform: rotate(180deg);
    }
    body.shell-trifecta-headless .opportunity-bot-fixed-controls {
      position: sticky;
      top: 0;
      z-index: 36;
      padding: 15px 0 12px;
      margin-bottom: 16px;
      background: var(--shell-bg);
      box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    }
    body.shell-trifecta-headless .opportunity-bot-workspace {
      display: grid;
      grid-template-columns: minmax(0,1.25fr) minmax(340px,0.75fr);
      gap: 16px;
      align-items: start;
    }
    body.shell-trifecta-headless .opportunity-bot-queue-column {
      min-width: 0;
    }
    body.shell-trifecta-headless .opportunity-bot-queue-scroll {
      max-height: none;
      overflow-y: visible;
      overscroll-behavior: contain;
      padding-right: 8px;
    }
    body.shell-trifecta-headless #opportunity-bot-pagination-top-slot {
      position: sticky;
      top: 76px;
      z-index: 32;
      margin-bottom: 12px;
    }
    body.shell-trifecta-headless .opportunity-bot-pagination-top {
      position: static;
      padding: 12px 14px;
      margin: 0;
      border: 1px solid var(--shell-border);
      border-radius: 14px;
      background: linear-gradient(180deg, var(--shell-surface-alt), rgba(16,18,21,0.94));
      backdrop-filter: blur(10px);
      box-shadow: 0 10px 24px rgba(0,0,0,0.14);
    }
    body.shell-trifecta-headless .opportunity-bot-pagination-bottom {
      position: static !important;
      top: auto !important;
      bottom: auto !important;
      z-index: auto;
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      margin-top: 12px;
    }
    body.shell-trifecta-headless .opportunity-bot-selected-sticky {
      position: sticky;
      top: 92px;
      max-height: calc(100vh - 112px);
      overflow-y: auto;
    }
    body.shell-trifecta-headless #tab-delegation > .section-header:first-child {
      position: sticky;
      top: 0;
      z-index: 35;
      padding: 15px 0 12px;
      margin-bottom: 18px;
      background: linear-gradient(180deg, var(--shell-surface-alt) 0%, var(--shell-surface-alt) 78%, rgba(0,0,0,0) 100%);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--shell-border);
    }
    body.shell-trifecta-headless .section-title,
    body.shell-trifecta-headless .qb-panel-title,
    body.shell-trifecta-headless .qb-block-title,
    body.shell-trifecta-headless .delegation-headline,
    body.shell-trifecta-headless .delegation-option-name,
    body.shell-trifecta-headless .client-intel-task-title,
    body.shell-trifecta-headless .client-intel-selection-title,
    body.shell-trifecta-headless .client-intel-stat-value,
    body.shell-trifecta-headless .client-intel-offer-name,
    body.shell-trifecta-headless .client-intel-finding,
    body.shell-trifecta-headless .merrill-desc,
    body.shell-trifecta-headless .opp-symbol,
    body.shell-trifecta-headless .qb-hero-status-text,
    body.shell-trifecta-headless .qb-gap-hero,
    body.shell-trifecta-headless .qb-mini-value,
    body.shell-trifecta-headless .qb-subtotal-card .value,
    body.shell-trifecta-headless .qb-panel-stat .value,
    body.shell-trifecta-headless .summary-card .value,
    body.shell-trifecta-headless .metric .m-value,
    body.shell-trifecta-headless .trade-summary-value,
    body.shell-trifecta-headless .trade-symbol {
      color: var(--shell-text) !important;
    }
    body.shell-trifecta-headless .section-sub,
    body.shell-trifecta-headless .qb-hero-kicker,
    body.shell-trifecta-headless .qb-hero-title-main,
    body.shell-trifecta-headless .qb-hero-status-label,
    body.shell-trifecta-headless .qb-mini-label,
    body.shell-trifecta-headless .qb-mini-sub,
    body.shell-trifecta-headless .qb-panel-stat .label,
    body.shell-trifecta-headless .qb-panel-stat .sub,
    body.shell-trifecta-headless .qb-block-sub,
    body.shell-trifecta-headless .delegation-copy,
    body.shell-trifecta-headless .delegation-kicker,
    body.shell-trifecta-headless .delegation-option-meta,
    body.shell-trifecta-headless .client-intel-kicker,
    body.shell-trifecta-headless .client-intel-stat-label,
    body.shell-trifecta-headless .client-intel-stat-sub,
    body.shell-trifecta-headless .client-intel-task-detail,
    body.shell-trifecta-headless .client-intel-copy,
    body.shell-trifecta-headless .client-intel-action,
    body.shell-trifecta-headless .client-intel-note,
    body.shell-trifecta-headless .merrill-portfolio,
    body.shell-trifecta-headless .opp-desc,
    body.shell-trifecta-headless .opp-meta,
    body.shell-trifecta-headless .qb-gap-chip,
    body.shell-trifecta-headless .client-intel-empty,
    body.shell-trifecta-headless .trades-empty-sub,
    body.shell-trifecta-headless .trade-time,
    body.shell-trifecta-headless .summary-card .label,
    body.shell-trifecta-headless .summary-card .sub,
    body.shell-trifecta-headless .metric .m-label {
      color: var(--shell-muted) !important;
    }
    body.shell-trifecta-headless .summary-card,
    body.shell-trifecta-headless .qb-panel-card,
    body.shell-trifecta-headless .qb-scenario-card,
    body.shell-trifecta-headless .qb-settings-card,
    body.shell-trifecta-headless .qb-hourly-card,
    body.shell-trifecta-headless .qb-advanced-card,
    body.shell-trifecta-headless .delegation-hero-card,
    body.shell-trifecta-headless .delegation-list-card,
    body.shell-trifecta-headless .delegation-dev-card,
    body.shell-trifecta-headless .delegation-settings-card,
    body.shell-trifecta-headless .client-intel-card,
    body.shell-trifecta-headless .client-intel-source-card,
    body.shell-trifecta-headless .client-intel-task-card,
    body.shell-trifecta-headless .client-intel-open-task,
    body.shell-trifecta-headless .client-intel-offer-item,
    body.shell-trifecta-headless .client-intel-mini-stat,
    body.shell-trifecta-headless .client-intel-insight,
    body.shell-trifecta-headless .merrill-card,
    body.shell-trifecta-headless .opp-card,
    body.shell-trifecta-headless .trade-card,
    body.shell-trifecta-headless .trade-summary-card {
      background: var(--shell-surface-alt) !important;
      border-color: var(--shell-border) !important;
      color: var(--shell-text) !important;
      box-shadow: none !important;
    }
    body.shell-trifecta-headless .qb-hero,
    body.shell-trifecta-headless .delegation-settings-panel,
    body.shell-trifecta-headless .qb-block,
    body.shell-trifecta-headless .client-intel-selection-preview,
    body.shell-trifecta-headless #client-intel-email-modal,
    body.shell-trifecta-headless #client-intel-asana-modal,
    body.shell-trifecta-headless #client-intel-piggyback-modal,
    body.shell-trifecta-headless #client-intel-add-task-modal {
      background: var(--shell-surface-alt) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
      box-shadow: 0 18px 44px rgba(0,0,0,0.12) !important;
    }
    body.shell-trifecta-headless .qb-hero {
      background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--shell-accent-alt) 26%, transparent), transparent 34%),
        radial-gradient(circle at bottom left, color-mix(in srgb, var(--shell-accent) 18%, transparent), transparent 30%),
        linear-gradient(145deg, var(--shell-surface-strong) 0%, var(--shell-surface-alt) 62%, var(--shell-surface) 100%) !important;
    }
    body.shell-trifecta-headless .qb-hero-status,
    body.shell-trifecta-headless .sleeve-note,
    body.shell-trifecta-headless .client-intel-contact-pill,
    body.shell-trifecta-headless .client-intel-pill,
    body.shell-trifecta-headless .delegation-option {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border) !important;
      color: var(--shell-text) !important;
    }
    body.shell-trifecta-headless .client-intel-field input,
    body.shell-trifecta-headless .client-intel-field textarea,
    body.shell-trifecta-headless .client-intel-field select,
    body.shell-trifecta-headless .client-intel-email-field input,
    body.shell-trifecta-headless .client-intel-email-field textarea,
    body.shell-trifecta-headless .client-intel-email-field select,
    body.shell-trifecta-headless .client-intel-hubspot-note textarea,
    body.shell-trifecta-headless .client-intel-hubspot-compose input,
    body.shell-trifecta-headless .client-intel-hubspot-compose textarea,
    body.shell-trifecta-headless .client-intel-hubspot-compose select,
    body.shell-trifecta-headless .client-intel-table input,
    body.shell-trifecta-headless .client-intel-table select,
    body.shell-trifecta-headless .client-intel-table textarea,
    body.shell-trifecta-headless .qb-period-select,
    body.shell-trifecta-headless .qb-setting-field input,
    body.shell-trifecta-headless .delegation-hours-input,
    body.shell-trifecta-headless .alloc-input {
      background: var(--shell-input-bg) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    /* Style the native <option> popup explicitly. The select rule above only
       sets color on the <select>; the popup falls back to a white system
       background, so in dark theme the light --shell-text rendered white-on-white
       and options looked blank (only the highlighted row was readable). Use the
       opaque --shell-surface (not the translucent --shell-input-bg) so the popup
       is readable in both themes. */
    body.shell-trifecta-headless .client-intel-field select option,
    body.shell-trifecta-headless .client-intel-email-field select option,
    body.shell-trifecta-headless .client-intel-hubspot-compose select option,
    body.shell-trifecta-headless .client-intel-table select option {
      background: var(--shell-surface) !important;
      color: var(--shell-text) !important;
    }
    body.shell-trifecta-headless .client-intel-field input:focus,
    body.shell-trifecta-headless .client-intel-field textarea:focus,
    body.shell-trifecta-headless .client-intel-field select:focus,
    body.shell-trifecta-headless .client-intel-email-field input:focus,
    body.shell-trifecta-headless .client-intel-email-field textarea:focus,
    body.shell-trifecta-headless .client-intel-email-field select:focus,
    body.shell-trifecta-headless .client-intel-hubspot-note textarea:focus,
    body.shell-trifecta-headless .client-intel-hubspot-compose input:focus,
    body.shell-trifecta-headless .client-intel-hubspot-compose textarea:focus,
    body.shell-trifecta-headless .client-intel-hubspot-compose select:focus,
    body.shell-trifecta-headless .qb-period-select:focus,
    body.shell-trifecta-headless .qb-setting-field input:focus,
    body.shell-trifecta-headless .alloc-input:focus {
      border-color: var(--shell-accent-alt) !important;
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--shell-accent-alt) 18%, transparent) !important;
      outline: none !important;
    }
    body.shell-trifecta-headless .client-intel-field input:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-field textarea:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-field select:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-email-field input:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-email-field textarea:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-email-field select:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-hubspot-note textarea:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-hubspot-compose input:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-hubspot-compose textarea:-webkit-autofill,
    body.shell-trifecta-headless .client-intel-hubspot-compose select:-webkit-autofill {
      -webkit-text-fill-color: var(--shell-text) !important;
      -webkit-box-shadow: 0 0 0 1000px var(--shell-input-bg) inset !important;
      box-shadow: 0 0 0 1000px var(--shell-input-bg) inset !important;
      transition: background-color 9999s ease-in-out 0s;
    }
    body.shell-trifecta-headless .refresh-btn,
    body.shell-trifecta-headless .btn-mode,
    body.shell-trifecta-headless .btn-toggle {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    body.shell-trifecta-headless .refresh-btn:hover,
    body.shell-trifecta-headless .btn-mode:hover,
    body.shell-trifecta-headless .btn-toggle:hover {
      border-color: var(--shell-accent) !important;
      color: var(--shell-text) !important;
    }
    body.shell-trifecta-headless .client-intel-save-btn,
    body.shell-trifecta-headless .refresh-btn.client-intel-save-btn,
    body.shell-trifecta-headless .client-intel-task-add,
    body.shell-trifecta-headless .refresh-btn.client-intel-task-add,
    body.shell-trifecta-headless .client-intel-email-open,
    body.shell-trifecta-headless .btn-primary {
      background: #166534 !important;
      border-color: #15803d !important;
      color: #fff !important;
    }
    body.shell-trifecta-headless .client-intel-save-btn:hover,
    body.shell-trifecta-headless .refresh-btn.client-intel-save-btn:hover,
    body.shell-trifecta-headless .client-intel-task-add:hover,
    body.shell-trifecta-headless .refresh-btn.client-intel-task-add:hover {
      background: #14532d !important;
      border-color: #166534 !important;
      color: #fff !important;
    }
    body.shell-trifecta-headless .client-intel-task-piggyback {
      background: #ef6aa8 !important;
      border-color: #ef6aa8 !important;
      color: #fff !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless {
      --shell-surface: #f7f7ee;
      --shell-surface-alt: #f3f4e8;
      --shell-surface-soft: #ebe9db;
      --shell-surface-strong: #ffffff;
      --shell-border: rgba(23,26,19,0.10);
      --shell-border-strong: rgba(23,26,19,0.16);
      --shell-text: #171a13;
      --shell-muted: rgba(23,26,19,0.74);
      --shell-subtle: rgba(23,26,19,0.58);
      --shell-input-bg: rgba(255,255,255,0.92);
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-asana-footer,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-asana-footer,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-asana-comment,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-asana-comment,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-task-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-task-card,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-task-description,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-task-description,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-mini-stat,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-mini-stat,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-phase-item,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-phase-item,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-offer-item,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-offer-item,
    html.trifecta-theme-light body.shell-trifecta-headless #client-intel-piggyback-modal,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless #client-intel-piggyback-modal,
    html.trifecta-theme-light body.shell-trifecta-headless #client-intel-add-task-modal,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless #client-intel-add-task-modal {
      background: var(--shell-surface-alt) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-asana-comment-meta,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-asana-comment-meta,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-mini-stat span,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-mini-stat span,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-phase-meta,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-phase-meta,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-note,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-note,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-target-label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-target-label,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-email-status,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-email-status {
      color: var(--shell-muted) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-asana-comment-text,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-asana-comment-text,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-task-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-task-title,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-phase-name,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-phase-name,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-offer-name,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-offer-name,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-phase-goal,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-phase-goal,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-offer-copy,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-offer-copy {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-inline-input,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-inline-input,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-piggyback-close,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-piggyback-close {
      background: var(--shell-input-bg) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-table-wrap,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-table-wrap {
      border-color: var(--shell-border-strong) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-table,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-table {
      background: var(--shell-surface-alt) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-table th,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-table th {
      background: var(--shell-surface-soft) !important;
      color: var(--shell-muted) !important;
      border-bottom-color: var(--shell-border) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless details summary,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless details summary {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-pill,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-list,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-list,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-stat,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-stat,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-insight,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-insight,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-search-results,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-search-results {
      background: var(--shell-surface-alt) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
      box-shadow: 0 10px 28px rgba(0,0,0,0.08) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-field label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-field label,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-email-field label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-email-field label {
      color: rgba(23,26,19,0.78) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless #client-intel-company-search,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless #client-intel-company-search {
      background: var(--shell-input-bg) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
      box-shadow: none !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-search-option,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-search-option {
      background: var(--shell-surface-alt) !important;
      border-bottom-color: var(--shell-border) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-search-option:hover,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-search-option:hover {
      background: var(--shell-surface-soft) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-search-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-search-title {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-search-sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-search-sub {
      color: var(--shell-muted) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill span,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-pill span,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-source-row span,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-source-row span,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-task-detail,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-task-detail,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-copy,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-copy,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-category,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-category,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-inline-status,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-inline-status,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-status,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-status,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-empty,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-empty {
      color: var(--shell-muted) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill a,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-pill a,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-email-link,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-email-link,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-source-row strong,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-source-row strong,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-open-task strong,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-open-task strong,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-stat-value,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-stat-value,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-finding,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-finding {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-pill {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border-strong) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-list,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-list {
      background: var(--shell-surface-strong) !important;
      border-color: var(--shell-border-strong) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill {
      font-size: 13px !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill span:first-child,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-pill span:first-child {
      font-weight: 600 !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-contact-pill span:last-child,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-contact-pill span:last-child {
      color: var(--shell-muted) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-source-row,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-source-row,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-open-task,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-open-task {
      border-color: var(--shell-border) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-open-task a,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-open-task a,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-source-row a,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-source-row a {
      color: #0f766e !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-panel-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-panel-card,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-block,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-block,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-line-item,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-line-item,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-subtotal-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-subtotal-card,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-stat,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-stat,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-client,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-client,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-advanced-reco,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-advanced-reco,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-progress-wrap,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-progress-wrap,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-period-select,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-period-select,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-setting-field input,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-setting-field input {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .section-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .section-title,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-panel-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-panel-title,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-block-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-block-title,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-setting-field label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-setting-field label {
      color: rgba(23,26,19,0.9) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hero-status,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hero-status,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-gap-chip,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-gap-chip,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-mini-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-mini-card {
      background: rgba(255,255,255,0.72) !important;
      border-color: var(--shell-border) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-line-label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-line-label,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hero-status-label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hero-status-label,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-panel-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-panel-title,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-block-sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-block-sub,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-panel-stat .label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-panel-stat .label,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-panel-stat .sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-panel-stat .sub,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-mini-sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-mini-sub,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-stat-label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-stat-label,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-legend,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-legend,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-subtotal-card .label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-subtotal-card .label,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-subtotal-card .sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-subtotal-card .sub,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-advanced-summary,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-advanced-summary,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-advanced-detail,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-advanced-detail,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-sub,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-client-meta,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-client-meta,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-settings-status,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-settings-status,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-advanced-reco span,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-advanced-reco span,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-empty,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-empty {
      color: rgba(23,26,19,0.84) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hero-title-main,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hero-title-main,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hero-status-text,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hero-status-text,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-mini-value,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-mini-value,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-line-value,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-line-value,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-panel-stat .value,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-panel-stat .value,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-advanced-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-advanced-title,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-stat-value,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-stat-value,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-advanced-reco strong,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-advanced-reco strong,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-title,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-client-name,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-client-name {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-card .qb-mini-sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-card .qb-mini-sub,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-card .qb-scenario-legend,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-card .qb-scenario-legend,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-card .qb-line-label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-card .qb-line-label {
      color: rgba(23,26,19,0.88) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-scenario-card .qb-scenario-stat-label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-scenario-card .qb-scenario-stat-label {
      color: rgba(23,26,19,0.72) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-popover,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-popover,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-hover-popover::before,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-hover-popover::before {
      background: var(--shell-surface-strong) !important;
      border-color: var(--shell-border-strong) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-memo-line,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-memo-line {
      background: rgba(224,80,38,0.08) !important;
      border-color: rgba(224,80,38,0.18) !important;
      color: rgba(23,26,19,0.82) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-memo-line strong,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-memo-line strong {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-list-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-list-card,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-dev-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-dev-card,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-item,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-item,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-settings-panel,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-settings-panel,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-settings-card,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-settings-card,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-option,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-option,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-skills,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-skills,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-hours-input,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-hours-input,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-rate-input,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-rate-input,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-skill-select,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-skill-select,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-speed-input,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-speed-input,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-pref-input,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-pref-input {
      background: var(--shell-surface-alt) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-dev-stat,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-dev-stat {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-dev-stat strong,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-dev-stat strong {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-dev-name,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-dev-name,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-item strong,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-item strong,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-settings-title,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-settings-title,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-option-name,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-option-name {
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-dev-stat span,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-dev-stat span,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-item span,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-item span,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-settings-sub,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-settings-sub,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-settings-card p,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-settings-card p,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-option-meta,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-option-meta,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-settings-status,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-settings-status,
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-skill-cell label,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .delegation-skill-cell label {
      color: var(--shell-muted) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .delegation-approve-btn {
      background: rgba(22,101,52,0.10) !important;
      border-color: rgba(22,101,52,0.24) !important;
      color: #166534 !important;
    }

    /* ── Light mode: Opportunity Bot pagination gradient ── */
    html.trifecta-theme-light body.shell-trifecta-headless .opportunity-bot-pagination-top,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .opportunity-bot-pagination-top {
      background: linear-gradient(180deg, var(--shell-surface-alt), var(--shell-surface-soft)) !important;
      box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    }

    /* ── Light mode: Selected Client Card underlying opportunities ── */
    html.trifecta-theme-light body.shell-trifecta-headless .ob-underlay-wrap,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .ob-underlay-wrap,
    html.trifecta-theme-light body.shell-trifecta-headless .ob-underlay-inner,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .ob-underlay-inner {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border-strong) !important;
    }

    /* ── Light mode: Client Intelligence HubSpot context ── */
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-hubspot-tab,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-hubspot-tab {
      background: var(--shell-surface-alt) !important;
      border-color: var(--shell-border-strong) !important;
      color: var(--shell-text) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-hubspot-tab.active,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-hubspot-tab.active {
      background: rgba(29,78,216,0.12) !important;
      border-color: rgba(29,78,216,0.4) !important;
      color: #1d4ed8 !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-hubspot-note,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-hubspot-note,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-hubspot-compose,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-hubspot-compose {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border-strong) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-hubspot-note-body,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-hubspot-note-body,
    html.trifecta-theme-light body.shell-trifecta-headless .client-intel-hubspot-note-time,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .client-intel-hubspot-note-time {
      color: var(--shell-text) !important;
    }

    /* ── Light mode: QuickBooks snapshot card ── */
    html.trifecta-theme-light body.shell-trifecta-headless .qb-visual-summary-wrap,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-visual-summary-wrap {
      background: var(--shell-surface-soft) !important;
      border-color: var(--shell-border-strong) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-snap-top,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-snap-top {
      border-bottom-color: var(--shell-border) !important;
    }
    html.trifecta-theme-light body.shell-trifecta-headless .qb-snap-hero-row,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-snap-hero-row,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-snap-meta,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-snap-meta,
    html.trifecta-theme-light body.shell-trifecta-headless .qb-snap-bars,
    html:not(.trifecta-theme-dark) body.shell-trifecta-headless .qb-snap-bars {
      color: var(--shell-text) !important;
    }

    /* ── Tabs ── */
    .tabs {
      display: flex; gap: 4px; margin-bottom: 24px;
      border-bottom: 1px solid #2a2a2a; padding-bottom: 0;
      overflow-x: auto; overflow-y: visible;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    #primary-tabs {
      overflow: visible;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
      padding: 10px 18px; font-size: 13px; font-weight: 500;
      color: #666; cursor: pointer; border-bottom: 2px solid transparent;
      transition: all 0.15s; margin-bottom: -1px;
      white-space: nowrap; flex: 0 0 auto;
    }
    .tab:hover { color: #f97316; }
    .tab.active { color: #3b82f6; border-bottom-color: #3b82f6; }
    body.shell-trifecta-headless #finance-tabs {
      display: flex !important;
      position: sticky;
      top: 0;
      z-index: 34;
      margin-bottom: 18px;
      padding: 15px 0 0;
      background: linear-gradient(180deg, var(--shell-surface-alt) 0%, var(--shell-surface-alt) 78%, rgba(0,0,0,0) 100%);
      backdrop-filter: blur(10px);
      border-bottom-color: var(--shell-border);
    }
    body.shell-trifecta-headless #finance-tabs .tab {
      color: var(--shell-muted);
      border-bottom-color: transparent;
    }
    body.shell-trifecta-headless #finance-tabs .tab:hover,
    body.shell-trifecta-headless #finance-tabs .tab.active {
      color: var(--shell-accent);
    }
    body.shell-trifecta-headless #finance-tabs .tab.active {
      border-bottom-color: var(--shell-accent);
    }

    .tab-content { display: none; }
    .tab-content.active { display: block; }

    /* ── Summary Cards ── */
    .summary-grid {
      display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px;
    }
    .summary-card {
      background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px;
      padding: 16px 20px;
    }
    .summary-card .label { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
    .summary-card .value { font-size: 24px; font-weight: 700; }
    .summary-card .sub   { font-size: 11px; color: #666; margin-top: 4px; }
    .green { color: #22c55e; }
    .red   { color: #ef4444; }
    .blue  { color: #3b82f6; }
    .yellow { color: #eab308; }

    /* ── Sleeve Grid ── */
    .sleeve-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px;
    }
    .sleeve-card {
      background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 12px;
      padding: 20px; transition: border-color 0.2s;
    }
    .sleeve-card:hover { border-color: #3a3a3a; }
    .sleeve-card.disabled { opacity: 0.5; }

    .sleeve-header {
      display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px;
    }
    .sleeve-name { font-size: 15px; font-weight: 700; }
    .sleeve-desc { font-size: 11px; color: #666; margin-top: 3px; }
    .sleeve-note {
      margin: 0 0 14px;
      padding: 10px 12px;
      border-radius: 10px;
      background: #151515;
      border: 1px solid #262626;
      color: #bdbdbd;
      font-size: 11px;
      line-height: 1.45;
    }
    .sleeve-note strong {
      color: #f0f0f0;
      font-weight: 700;
    }

    .sleeve-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
    .badge {
      padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 700;
    }
    .badge-paper  { background: #1c2a1c; color: #eab308; }
    .badge-live   { background: #052e16; color: #22c55e; }
    .badge-both   { background: #1e3a5f; color: #60a5fa; }
    .badge-running { background: #052e16; color: #22c55e; }
    .badge-idle    { background: #1a1a1a; color: #666; border: 1px solid #333; }
    .badge-error   { background: #2d0000; color: #ef4444; }
    .badge-unknown { background: #1a1a1a; color: #666; border: 1px solid #333; }

    .sleeve-metrics {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px;
    }
    .metric { }
    .metric .m-label { font-size: 10px; color: #555; margin-bottom: 3px; }
    .metric .m-value { font-size: 16px; font-weight: 600; }


    .sleeve-actions {
      display: grid;
      gap: 10px;
      margin-top: 8px;
      padding-top: 14px;
      border-top: 1px solid #262626;
    }
    .sleeve-actions-main,
    .sleeve-actions-bottom,
    .sleeve-actions-utility {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .sleeve-actions-main {
      justify-content: flex-start;
    }
    .sleeve-actions-bottom {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
    }
    .sleeve-actions-utility {
      justify-content: flex-end;
      gap: 12px;
    }

    .btn {
      height: 36px;
      padding: 0 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
      cursor: pointer; border: none; transition: all 0.15s;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      white-space: nowrap;
    }
    .btn-mode {
      background: #222; color: #e8e8e8; border: 1px solid #333;
    }
    .btn-mode:hover { background: #2a2a2a; border-color: #444; }
    .btn-toggle {
      background: #222; color: #e8e8e8; border: 1px solid #333;
    }
    .btn-toggle.enabled  { border-color: #22c55e; color: #22c55e; }
    .btn-toggle.disabled { border-color: #ef4444; color: #ef4444; }
    .btn-primary { background: #3b82f6; color: #fff; }
    .btn-primary:hover { background: #2563eb; }

    /* Mode selector popup */
    .mode-select {
      position: relative; display: inline-block;
    }
    .mode-dropdown {
      display: none; position: absolute; bottom: 110%; left: 0;
      background: #1e1e1e; border: 1px solid #333; border-radius: 8px;
      overflow: hidden; z-index: 50; min-width: 120px;
    }
    .mode-dropdown.open { display: block; }
    .mode-option {
      padding: 10px 16px; font-size: 12px; cursor: pointer;
      transition: background 0.1s;
    }
    .mode-option:hover { background: #2a2a2a; }

    /* Alloc editor */
    .alloc-editor {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      min-width: 0;
      padding: 10px 12px;
      border-radius: 10px;
      background: #151515;
      border: 1px solid #262626;
    }
    .alloc-editor-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
    }
    .alloc-editor-label {
      font-size: 10px;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .alloc-editor-field {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
    }
    .alloc-currency {
      font-size: 13px;
      font-weight: 700;
      color: #7d7d7d;
    }
    .alloc-input {
      background: transparent; border: none;
      color: #e8e8e8; padding: 0; font-size: 18px; width: 100%; height: auto;
      text-align: left;
      font-weight: 700;
    }
    .alloc-input:focus { outline: none; border-color: #3b82f6; }
    .sleeve-link-btn {
      background: none;
      border: none;
      color: #8fa8d8;
      font-size: 12px;
      font-weight: 600;
      padding: 0;
      height: auto;
      cursor: pointer;
    }
    .sleeve-link-btn:hover { color: #b3c7ee; }
    .sleeve-link-btn.danger { color: #d98282; }
    .sleeve-link-btn.danger:hover { color: #f0a0a0; }
    .seed-router-accordion {
      margin-top: 12px;
      margin-bottom: 14px;
      border-radius: 10px;
      background: #151515;
      border: 1px solid #262626;
    }
    .seed-router-summary-toggle {
      list-style: none;
      cursor: pointer;
      padding: 9px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      font-size: 12px;
      font-weight: 600;
      color: #cbd5e1;
      user-select: none;
    }
    .seed-router-summary-toggle::-webkit-details-marker { display: none; }
    .seed-router-summary-toggle::before {
      content: '▸';
      display: inline-block;
      width: 12px;
      color: #6b7280;
      font-size: 10px;
      transition: transform 0.15s ease;
    }
    details[open] > .seed-router-summary-toggle::before { transform: rotate(90deg); }
    .seed-router-summary-toggle > span:first-of-type { flex: 1; }
    .seed-router-summary-meta {
      font-size: 11px;
      color: #6b7280;
      font-weight: 400;
      letter-spacing: 0.2px;
    }
    .seed-router-panel {
      padding: 0 14px 12px 14px;
      display: grid;
      gap: 12px;
      border-top: 1px solid #1f1f1f;
      padding-top: 12px;
      margin-top: 0;
      margin-bottom: 0;
    }
    .seed-router-top {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }
    .seed-router-label {
      font-size: 10px;
      color: #555;
      text-transform: uppercase;
      letter-spacing: 0.7px;
      margin-bottom: 4px;
    }
    .seed-router-value {
      font-size: 15px;
      font-weight: 700;
      color: #e8e8e8;
    }
    .seed-router-value-sub {
      font-size: 10px;
      color: #666;
      margin-top: 3px;
      line-height: 1.4;
    }
    .seed-router-summary {
      font-size: 11px;
      color: #a8a8a8;
      line-height: 1.5;
      padding-top: 10px;
      border-top: 1px solid #222;
    }
    .seed-router-summary strong {
      color: #f0f0f0;
      font-weight: 700;
    }

    /* ── Risk Section ── */
    .risk-signals { margin-bottom: 20px; }
    .signal-row {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 14px; border-radius: 8px; margin-bottom: 8px;
      font-size: 13px;
    }
    .signal-GREEN  { background: #052e16; }
    .signal-YELLOW { background: #2d2000; }
    .signal-ORANGE { background: #2d1500; }
    .signal-RED    { background: #2d0000; }
    .signal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .dot-GREEN  { background: #22c55e; }
    .dot-YELLOW { background: #eab308; }
    .dot-ORANGE { background: #f97316; }
    .dot-RED    { background: #ef4444; }

    /* ── Volatility Rank Table ── */
    .vol-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .vol-table th {
      text-align: left; padding: 10px 12px; font-size: 10px; color: #555;
      text-transform: uppercase; letter-spacing: 0.8px;
      border-bottom: 1px solid #2a2a2a;
    }
    .vol-table td { padding: 10px 12px; border-bottom: 1px solid #1e1e1e; }
    .vol-table tr:hover td { background: #1e1e1e; }
    .rank-num { color: #666; font-size: 12px; }
    .score-bar-wrap { width: 80px; display: inline-block; }
    .score-bar {
      height: 4px; border-radius: 2px; background: #3b82f6;
    }

    /* ── Dropdown Tab ── */
    .dropdown-tab { position: relative; user-select: none; }
    .tab-dropdown {
      display: none; position: absolute; top: calc(100% + 4px); left: 0;
      background: #1e1e1e; border: 1px solid #333; border-radius: 8px;
      overflow: hidden; z-index: 200; min-width: 210px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    }
    .dropdown-tab.open .tab-dropdown { display: block; }
    .tab-dropdown-item {
      padding: 11px 16px; font-size: 13px; color: #aaa;
      cursor: pointer; transition: background 0.1s, color 0.1s; white-space: nowrap;
    }
    .tab-dropdown-item:hover { background: #2a2a2a; color: #f97316; }
    .tab-dropdown-item.active { color: #3b82f6; }
    /* ── Merrill ── */
    .merrill-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
      margin-bottom: 24px;
    }
    .merrill-card {
      background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px;
      padding: 16px; border-left-width: 4px;
    }
    .merrill-card.positive { border-left-color: #22c55e; }
    .merrill-card.negative { border-left-color: #ef4444; }
    .merrill-portfolio { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: #555; margin-bottom: 6px; }
    .merrill-desc { font-size: 14px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
    .merrill-pct  { font-size: 24px; font-weight: 700; }
    .merrill-type { font-size: 10px; padding: 2px 7px; border-radius: 10px; font-weight: 700; margin-left: 8px; vertical-align: middle; }
    .merrill-type.option { background: #2d1a4a; color: #c084fc; }
    .merrill-type.stock  { background: #1a2d4a; color: #60a5fa; }
    .merrill-ai {
      background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px; padding: 20px;
    }
    .merrill-ai-title {
      font-size: 10px; font-weight: 700; color: #555;
      text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 14px;
    }
    .merrill-ai-body {
      font-size: 13px; color: #bbb; line-height: 1.8;
      font-family: 'SF Mono', 'Fira Code', monospace; white-space: pre-wrap;
    }

    /* ── Opportunities ── */
    .opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
    .opp-card {
      background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px;
      padding: 16px; border-left-width: 4px;
      min-width: 0;
    }
    .opp-BREAKOUT     { border-left-color: #22c55e; }
    .opp-REVERSAL     { border-left-color: #3b82f6; }
    .opp-MOMENTUM     { border-left-color: #a855f7; }
    .opp-BIG_MOVE     { border-left-color: #f97316; }
    .opp-SHORT_FADE   { border-left-color: #ef4444; }
    .opp-NEWS_MISMATCH{ border-left-color: #06b6d4; }

    .opp-header {
      display: flex; justify-content: space-between; align-items: flex-start;
      gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
    }
    .opp-header > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .opp-symbol { font-size: 18px; font-weight: 700; }
    .opp-move   { font-size: 18px; font-weight: 700; white-space: nowrap; }
    .opp-type   { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
    .opp-desc   { font-size: 12px; color: #888; margin-bottom: 10px; line-height: 1.5; word-wrap: break-word; }
    .opp-meta   { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: #555; }
    .opp-meta b { color: #e8e8e8; }

    /* ── Section Header ── */
    .section-header {
      display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
    }
    .section-title { font-size: 14px; font-weight: 700; color: #e8e8e8; }
    .section-sub   { font-size: 11px; color: #555; margin-top: 2px; }
    .refresh-btn {
      background: none; border: 1px solid #333; color: #666; padding: 5px 12px;
      border-radius: 6px; font-size: 11px; cursor: pointer; transition: all 0.15s;
    }
    .refresh-btn:hover { border-color: #555; color: #e8e8e8; }
    .section-controls {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .listener-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .listener-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .listener-band-pills {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      padding: 8px;
      border: 1px solid #2a2a2a;
      border-radius: 22px;
      background: #111111;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    }
    .listener-chip-btn {
      background: #141414;
      border: 1px solid #2a2a2a;
      color: #888;
      padding: 6px 11px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
    }
    .listener-chip-btn:hover {
      border-color: #555;
      color: #f0f0f0;
    }
    .listener-chip-btn.active {
      background: rgba(59,130,246,0.12);
      border-color: rgba(59,130,246,0.38);
      color: #f5f5f5;
    }
    .listener-chip-btn.listener-chip-fm.active {
      background: rgba(6,182,212,0.14);
      border-color: rgba(6,182,212,0.44);
      color: #67e8f9;
    }
    .listener-chip-btn.listener-chip-am.active {
      background: rgba(245,158,11,0.14);
      border-color: rgba(245,158,11,0.44);
      color: #fcd34d;
    }
    .listener-chip-btn.listener-chip-sw.active {
      background: rgba(139,92,246,0.14);
      border-color: rgba(139,92,246,0.44);
      color: #c4b5fd;
    }
    .listener-chip-btn.listener-chip-listen {
      border-color: rgba(34,197,94,0.34);
      color: #86efac;
    }
    .listener-chip-btn.listener-chip-listen:hover {
      border-color: rgba(34,197,94,0.56);
      color: #dcfce7;
    }
    .listener-band-pills .listener-chip-btn {
      min-width: 116px;
      min-height: 62px;
      padding: 14px 24px;
      font-size: 22px;
      font-weight: 800;
      letter-spacing: 0.04em;
      border-radius: 16px;
      background: linear-gradient(180deg, #171717 0%, #101010 100%);
      border-color: #303030;
      color: #6f6f6f;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    }
    .listener-band-pills-wrap {
      position: sticky;
      top: 0;
      z-index: 16;
      padding: 0 0 12px;
      margin-bottom: 6px;
      background: linear-gradient(180deg, #0f0f0f 0%, #0f0f0f 78%, rgba(15,15,15,0) 100%);
    }
    .listener-band-pills .listener-chip-btn:hover {
      border-color: #4a4a4a;
      color: #f0f0f0;
      background: linear-gradient(180deg, #1d1d1d 0%, #141414 100%);
    }
    .listener-band-pills .listener-chip-btn.active {
      background: linear-gradient(180deg, #1e3a52 0%, #0f2536 100%);
      border-color: #06b6d4;
      color: #ffffff;
      box-shadow: 0 0 0 2px rgba(6,182,212,0.35), inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 14px rgba(6,182,212,0.18);
    }
    .listener-band-pills .listener-chip-btn.active:hover {
      background: linear-gradient(180deg, #234a68 0%, #0f2536 100%);
      border-color: #22d3ee;
      color: #ffffff;
    }
    /* Band-specific active accents override the cyan default with their existing color. */
    .listener-band-pills .listener-chip-btn.listener-chip-fm.active {
      border-color: #06b6d4;
      box-shadow: 0 0 0 2px rgba(6,182,212,0.35), 0 4px 14px rgba(6,182,212,0.18);
    }
    .listener-band-pills .listener-chip-btn.listener-chip-am.active {
      background: linear-gradient(180deg, #3a2a10 0%, #1f1808 100%);
      border-color: #f59e0b;
      color: #fde68a;
      box-shadow: 0 0 0 2px rgba(245,158,11,0.35), 0 4px 14px rgba(245,158,11,0.18);
    }
    .listener-band-pills .listener-chip-btn.listener-chip-sw.active {
      background: linear-gradient(180deg, #2a1e44 0%, #18102a 100%);
      border-color: #8b5cf6;
      color: #ddd6fe;
      box-shadow: 0 0 0 2px rgba(139,92,246,0.35), 0 4px 14px rgba(139,92,246,0.18);
    }
    .qb-period-select {
      background: #111315;
      border: 1px solid #2a2f37;
      color: #e8e8e8;
      padding: 7px 10px;
      border-radius: 8px;
      font-size: 12px;
    }
    .qb-period-select:focus {
      outline: none;
      border-color: #3b82f6;
    }

    /* ── QuickBooks / Trifecta ── */
    .qb-hero {
      position: relative;
      overflow: hidden;
      margin-bottom: 18px;
      border: 1px solid #2b2f36;
      border-radius: 18px;
      background:
        radial-gradient(circle at top right, rgba(59,130,246,0.2), transparent 32%),
        radial-gradient(circle at bottom left, rgba(249,115,22,0.12), transparent 30%),
        linear-gradient(145deg, #15181d 0%, #111315 62%, #0d0f10 100%);
      box-shadow: 0 20px 60px rgba(0,0,0,0.28);
    }
    .qb-hero-inner {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
      gap: 18px;
      padding: 22px;
    }
    .qb-hero-kicker {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: #6c7381;
      margin-bottom: 10px;
    }
    .qb-hero-title {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 18px;
      margin-bottom: 16px;
    }
    .qb-hero-status {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px 16px;
      border-radius: 16px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      min-width: 220px;
      justify-content: flex-end;
    }
    .qb-hero-status-icon {
      width: 54px;
      height: 54px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 30px;
      font-weight: 800;
      line-height: 1;
      flex: 0 0 auto;
    }
    .qb-hero-status-copy {
      text-align: right;
    }
    .qb-hero-status-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #70798a;
      margin-bottom: 4px;
    }
    .qb-hero-status-text {
      font-size: 14px;
      font-weight: 700;
      color: #eef2f7;
    }
    .qb-hero-title-main {
      font-size: 13px;
      color: #8e97a8;
      line-height: 1.6;
      max-width: 560px;
    }
    .qb-gap-hero {
      font-size: clamp(38px, 5vw, 66px);
      line-height: 0.95;
      font-weight: 800;
      letter-spacing: -2px;
      margin-bottom: 10px;
    }
    .qb-gap-sub {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      font-size: 12px;
      color: #9aa3b2;
    }
    .qb-gap-chip {
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
    }
    .qb-hero-metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 18px;
    }
    .qb-mini-card {
      padding: 14px 15px;
      border-radius: 14px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.06);
      min-height: 92px;
    }
    .qb-mini-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #717885;
      margin-bottom: 8px;
    }
    .qb-mini-value {
      font-size: 24px;
      font-weight: 700;
      color: #f4f7fb;
      letter-spacing: -0.6px;
    }
    .qb-mini-sub {
      margin-top: 6px;
      font-size: 11px;
      color: #7b8595;
      line-height: 1.55;
    }
    .qb-side-panel {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .qb-visual-summary-wrap {
      margin-top: 16px;
      padding: 22px 22px 20px;
      border-radius: 18px;
      background: linear-gradient(180deg, #14181d 0%, #101317 100%);
      border: 1px solid #222833;
    }
    .qb-snap-top {
      padding-bottom: 20px;
      border-bottom: 1px solid rgba(255,255,255,0.07);
      margin-bottom: 20px;
    }
    .qb-snap-hero-row {
      display: flex;
      align-items: baseline;
      gap: 18px;
      flex-wrap: wrap;
      margin-top: 6px;
    }
    .qb-snap-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      padding-bottom: 3px;
    }
    .qb-snap-bars {
      display: grid;
      gap: 14px;
    }
    .qb-visual-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #727b89;
    }
    .qb-visual-profit {
      font-size: clamp(34px, 4vw, 52px);
      line-height: 0.95;
      font-weight: 800;
      letter-spacing: -1.6px;
      color: #f4f7fb;
    }
    .qb-visual-profit-trend {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 700;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      color: #d8e0ea;
      white-space: nowrap;
    }
    .qb-visual-profit-trend.up { color: #4ade80; background: rgba(74,222,128,0.08); border-color: rgba(74,222,128,0.2); }
    .qb-visual-profit-trend.down { color: #f87171; background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }
    .qb-snap-margin {
      display: inline-flex;
      align-items: center;
      padding: 5px 10px;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 600;
      color: #a3b0c0;
      background: rgba(255,255,255,0.04);
      border: 1px solid rgba(255,255,255,0.06);
      white-space: nowrap;
    }
    .qb-snap-bar-row {
      display: grid;
      grid-template-columns: 160px 1fr;
      align-items: center;
      gap: 16px;
    }
    .qb-snap-bar-info {}
    .qb-visual-bar-label {
      font-size: 11px;
      font-weight: 600;
      color: #8d97a6;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }
    .qb-visual-bar-value {
      font-size: 18px;
      font-weight: 700;
      color: #eef2f7;
      letter-spacing: -0.4px;
      margin-top: 2px;
    }
    .qb-visual-bar-track {
      height: 8px;
      border-radius: 4px;
      overflow: hidden;
      background: rgba(255,255,255,0.06);
    }
    .qb-visual-bar-fill {
      height: 100%;
      border-radius: 4px;
      transition: width 0.4s ease;
    }
    .qb-visual-bar-fill.income {
      background: #22c55e;
    }
    .qb-visual-bar-fill.expenses {
      background: #475569;
    }
    .qb-key-stats {
      margin-top: 14px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 10px;
    }
    .qb-key-stat {
      padding: 12px 13px;
      border-radius: 14px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
      min-width: 0;
    }
    .qb-key-stat-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #6f7785;
      margin-bottom: 7px;
    }
    .qb-key-stat-value {
      font-size: 15px;
      font-weight: 700;
      line-height: 1.3;
      color: #eef2f7;
    }
    .qb-tip {
      position: relative;
      cursor: help;
      text-decoration: underline dotted;
      text-underline-offset: 2px;
    }
    .qb-tip::after {
      content: attr(data-tip);
      position: absolute;
      bottom: calc(100% + 6px);
      left: 50%;
      transform: translateX(-50%);
      background: #1e2330;
      color: #c8d0dc;
      border: 1px solid #3a3f50;
      border-radius: 7px;
      padding: 8px 11px;
      font-size: 11px;
      font-weight: 400;
      line-height: 1.55;
      text-transform: none;
      letter-spacing: 0;
      white-space: pre-line;
      width: 240px;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.1s;
      z-index: 999;
    }
    .qb-tip:hover::after { opacity: 1; }
    .qb-payroll-note {
      margin-top: 10px;
      font-size: 11px;
      color: #7f8a9b;
      line-height: 1.5;
    }
    .qb-panel-card {
      padding: 16px;
      border-radius: 14px;
      background: rgba(11,14,18,0.72);
      border: 1px solid rgba(255,255,255,0.06);
      backdrop-filter: blur(6px);
    }
    .qb-panel-title {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #737a88;
      margin-bottom: 10px;
    }
    .qb-panel-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .qb-panel-stat {
      padding: 12px;
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
    }
    .qb-panel-stat .value {
      font-size: 19px;
      font-weight: 700;
      color: #eef2f7;
      margin-bottom: 4px;
    }
    .qb-panel-stat .label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #69717e;
      margin-bottom: 0;
    }
    .qb-panel-stat .sub {
      font-size: 11px;
      color: #7b8595;
      margin-top: 4px;
    }
    .qb-block {
      margin-bottom: 14px;
      border: 1px solid #262a31;
      border-radius: 16px;
      background: linear-gradient(180deg, #16191d 0%, #121416 100%);
      overflow: hidden;
    }
    .qb-block > summary {
      list-style: none;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      cursor: pointer;
      padding: 16px 18px;
      border-bottom: 1px solid transparent;
    }
    .qb-block[open] > summary {
      border-bottom-color: #22272f;
    }
    .qb-block > summary::-webkit-details-marker { display: none; }
    .qb-block-title {
      font-size: 13px;
      font-weight: 700;
      color: #f1f4f8;
    }
    .qb-block-sub {
      font-size: 11px;
      color: #70798a;
      margin-top: 3px;
    }
    .qb-summary-caret {
      color: #7c8492;
      font-size: 16px;
      transition: transform 0.16s ease;
    }
    .qb-block[open] .qb-summary-caret {
      transform: rotate(90deg);
    }
    .qb-block-body {
      padding: 18px;
    }
    .qb-financial-overview {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      align-items: start;
      margin-bottom: 12px;
    }
    .qb-compact-block {
      margin-bottom: 0;
    }
    .qb-compact-block > summary {
      padding: 12px 14px;
    }
    .qb-compact-block .qb-block-body {
      padding: 12px 14px 14px;
    }
    .qb-line-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px 16px;
    }
    .qb-compact-lines {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .qb-line-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      padding: 10px 12px;
      border-radius: 12px;
      background: #111315;
      border: 1px solid #20242a;
    }
    .qb-line-item.qb-line-total {
      background: rgba(255,255,255,0.04);
      border-color: rgba(255,255,255,0.09);
      margin-bottom: 6px;
    }
    .qb-line-item.qb-line-total .qb-line-label {
      font-size: 12px;
      font-weight: 600;
      color: #e2e8f0;
    }
    .qb-line-item.qb-line-total .qb-line-value {
      font-size: 16px;
    }
    .qb-line-item.qb-line-indented {
      padding-left: 28px;
      border-top-color: rgba(148,163,184,0.06);
    }
    .qb-line-item.qb-line-indented .qb-line-label {
      color: var(--shell-muted);
      font-size: 11px;
    }
    .qb-line-item.qb-line-indented .qb-line-value {
      font-size: 12px;
      font-weight: 500;
      color: var(--shell-subtle);
    }
    .qb-line-label {
      font-size: 11px;
      color: #c6cbd3;
    }
    .qb-line-value {
      font-size: 14px;
      font-weight: 700;
      color: #f3f5f7;
      white-space: nowrap;
    }
    .qb-subtotals-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }
    .qb-revenue-subtotals {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .qb-subtotal-card {
      padding: 10px 11px;
      border-radius: 10px;
      background: #101215;
      border: 1px solid #22262d;
      min-width: 0;
    }
    .qb-subtotal-card .label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #6f7785;
      margin-bottom: 4px;
    }
    .qb-subtotal-card .value {
      font-size: 17px;
      font-weight: 700;
      letter-spacing: -0.4px;
      line-height: 1.1;
      word-break: break-word;
    }
    .qb-subtotal-card .sub {
      margin-top: 4px;
      font-size: 10px;
      color: #7a8391;
      line-height: 1.35;
    }
    .qb-memo-line {
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 12px;
      background: rgba(234,179,8,0.08);
      border: 1px solid rgba(234,179,8,0.18);
      color: #e8d28e;
      font-size: 11px;
      line-height: 1.45;
    }
    .qb-bottom-grid,
    .qb-scenarios-grid,
    .qb-advanced-grid,
    .qb-settings-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }
    .qb-scenario-card,
    .qb-settings-card,
    .qb-hourly-card {
      padding: 16px;
      border-radius: 14px;
      background: #101215;
      border: 1px solid #20242a;
    }
    .qb-scenario-card.hero {
      background:
        radial-gradient(circle at top right, rgba(59,130,246,0.18), transparent 42%),
        linear-gradient(145deg, #10161f, #0d1013 62%);
      border-color: rgba(59,130,246,0.26);
    }
    .qb-scenario-stat-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-top: 14px;
    }
    .qb-scenario-stat {
      padding: 12px;
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
    }
    .qb-scenario-stat-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #7a8391;
      margin-bottom: 6px;
    }
    .qb-scenario-stat-value {
      font-size: 18px;
      font-weight: 700;
      color: #eef2f7;
    }
    .qb-scenario-bar {
      margin-top: 16px;
      height: 14px;
      border-radius: 999px;
      overflow: hidden;
      background: #1a212b;
      border: 1px solid #222c37;
      display: flex;
    }
    .qb-scenario-bar-fill.actual {
      background: linear-gradient(90deg, #22c55e, #16a34a);
    }
    .qb-scenario-bar-fill.gap {
      background: linear-gradient(90deg, #f59e0b, #f97316);
    }
    .qb-scenario-legend {
      display: flex;
      gap: 14px;
      flex-wrap: wrap;
      margin-top: 10px;
      font-size: 11px;
      color: #8d97a6;
    }
    .qb-scenario-legend span::before {
      content: "";
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 999px;
      margin-right: 7px;
      vertical-align: -1px;
    }
    .qb-scenario-legend .actual::before { background: #22c55e; }
    .qb-scenario-legend .gap::before { background: #f59e0b; }
    .qb-hover-wrap {
      position: relative;
      width: 100%;
      min-width: 0;
    }
    .qb-hero-metrics > .qb-hover-wrap,
    .qb-panel-grid > .qb-hover-wrap,
    .qb-subtotals-grid > .qb-hover-wrap {
      height: 100%;
    }
    .qb-hover-wrap > .qb-subtotal-card {
      height: 100%;
    }
    .qb-hover-wrap.qb-open .qb-hover-popover {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }
    .qb-hover-wrap { cursor: pointer; }
    .qb-hover-wrap.qb-open > :not(.qb-hover-popover) {
      opacity: 0.75;
    }
    @media (max-width: 1120px) {
      .qb-snap-bar-row {
        grid-template-columns: 130px 1fr;
      }
      .qb-key-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }
    @media (max-width: 720px) {
      .qb-key-stats {
        grid-template-columns: 1fr;
      }
    }
    .qb-hover-popover {
      position: fixed;
      left: -9999px;
      top: -9999px;
      z-index: 9900;
      width: min(460px, calc(100vw - 32px));
      max-height: calc(100vh - 48px);
      padding: 14px;
      border-radius: 14px;
      background: rgba(11, 14, 18, 0.98);
      border: 1px solid #2b3440;
      box-shadow: 0 24px 60px rgba(0,0,0,0.45);
      opacity: 0;
      transform: translateY(6px);
      transition: opacity 140ms ease, transform 140ms ease;
      pointer-events: none;
      overflow: hidden;
    }
    .qb-hover-popover::before {
      content: "";
      position: absolute;
      left: 22px;
      top: -7px;
      width: 12px;
      height: 12px;
      transform: rotate(45deg);
      background: rgba(11, 14, 18, 0.98);
      border-left: 1px solid #2b3440;
      border-top: 1px solid #2b3440;
    }
    .qb-hover-popover.qb-popover-flip::before {
      top: auto;
      bottom: -7px;
      border-left: none;
      border-top: none;
      border-right: 1px solid #2b3440;
      border-bottom: 1px solid #2b3440;
    }
    .qb-hover-title {
      font-size: 11px;
      font-weight: 700;
      color: #e8ecf2;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .qb-hover-sub {
      margin-top: 4px;
      font-size: 11px;
      color: #8d97a6;
      line-height: 1.45;
    }
    .qb-hover-list {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 0;
      max-height: 420px;
      overflow-y: auto;
      padding-right: 2px;
    }
    .qb-hover-client {
      display: grid;
      grid-template-columns: minmax(0,1fr) 72px 52px;
      align-items: center;
      gap: 8px;
      padding: 4px 2px;
      border-bottom: 1px solid rgba(255,255,255,0.04);
    }
    .qb-hover-client:last-child { border-bottom: none; }
    .qb-hover-client-name {
      font-size: 11px;
      font-weight: 500;
      color: #c8d3de;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .qb-hover-client-meta { display: none; }
    .qb-hover-bar-track {
      height: 4px;
      background: rgba(255,255,255,0.07);
      border-radius: 2px;
      overflow: hidden;
    }
    .qb-hover-bar-fill {
      height: 100%;
      background: rgba(99,179,237,0.65);
      border-radius: 2px;
      min-width: 2px;
    }
    .qb-hover-client-amount {
      font-size: 11px;
      font-weight: 600;
      color: #dbe2ea;
      white-space: nowrap;
      text-align: right;
    }
    .qb-hover-empty {
      margin-top: 12px;
      font-size: 11px;
      color: #8d97a6;
      line-height: 1.5;
    }
    .qb-advanced-card {
      padding: 16px;
      border-radius: 14px;
      background: #101215;
      border: 1px solid #20242a;
    }
    .qb-advanced-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }
    .qb-advanced-title {
      font-size: 13px;
      font-weight: 700;
      color: #eef2f7;
    }
    .qb-advanced-pill {
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 10px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      border: 1px solid #2a3440;
      color: #9fb2c8;
      background: rgba(59,130,246,0.08);
    }
    .qb-advanced-pill.good {
      color: #86efac;
      border-color: rgba(34,197,94,0.24);
      background: rgba(34,197,94,0.08);
    }
    .qb-advanced-pill.warn {
      color: #fcd34d;
      border-color: rgba(245,158,11,0.24);
      background: rgba(245,158,11,0.08);
    }
    .qb-advanced-pill.risk {
      color: #fca5a5;
      border-color: rgba(239,68,68,0.24);
      background: rgba(239,68,68,0.08);
    }
    .qb-advanced-pill.unavailable {
      color: #94a3b8;
      border-color: rgba(148,163,184,0.2);
      background: rgba(148,163,184,0.08);
    }
    .qb-advanced-summary {
      font-size: 13px;
      color: #d9e0e8;
      line-height: 1.55;
    }
    .qb-advanced-detail {
      margin-top: 8px;
      font-size: 11px;
      color: #8d97a6;
      line-height: 1.55;
    }
    .qb-advanced-recos {
      margin-top: 14px;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }
    .qb-advanced-reco {
      padding: 14px;
      border-radius: 12px;
      background: #0f1317;
      border: 1px solid #1e252d;
    }
    .qb-advanced-reco strong {
      display: block;
      margin-bottom: 5px;
      color: #e8ecf2;
      font-size: 12px;
    }
    .qb-advanced-reco span {
      color: #8d97a6;
      font-size: 11px;
      line-height: 1.5;
    }
    .delegation-hero {
      display: block;
      margin-top: 6px;
    }
    .delegation-hero-card,
    .delegation-list-card {
      padding: 18px;
      border-radius: 16px;
      background: #101215;
      border: 1px solid #20242a;
    }
    .delegation-hero-card {
      padding: 0;
      border: none;
      border-radius: 0;
      background: transparent;
    }
    .delegation-kicker {
      display: none;
    }
    .delegation-headline {
      font-size: 11px;
      font-weight: 500;
      color: #aeb8c6;
      line-height: 1.45;
      margin-bottom: 0;
    }
    .delegation-copy {
      display: none;
    }
    .delegation-pill {
      display: none;
    }
    .delegation-metric-grid {
      display: none;
    }
    .delegation-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }
    .delegation-dev-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
    }
    .delegation-dev-card {
      padding: 16px;
      border-radius: 14px;
      background: #0f1317;
      border: 1px solid #1e252d;
    }
    .delegation-totals-card {
      padding: 14px 16px;
      border-radius: 14px;
      background: #0b0f12;
      border: 1px solid #2a3340;
    }
    .delegation-totals-head {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: #4a5568;
      margin-bottom: 10px;
    }
    .delegation-dev-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
      cursor: pointer;
      user-select: none;
    }
    .delegation-dev-head:hover .delegation-dev-name { color: #fff; }
    .delegation-collapse-chevron {
      font-size: 9px;
      color: #4a5568;
      transition: transform 0.18s, color 0.15s;
      flex-shrink: 0;
    }
    .delegation-dev-head:hover .delegation-collapse-chevron { color: #7d8a9b; }
    .delegation-dev-card.collapsed .delegation-collapse-chevron { transform: rotate(-90deg); }
    .delegation-dev-body { }
    .delegation-dev-card.collapsed .delegation-dev-body { display: none; }
    .delegation-dev-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .delegation-task-row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: flex-start;
    }
    .delegation-approve-btn {
      border: 1px solid rgba(245,158,11,0.35);
      background: rgba(245,158,11,0.12);
      color: #fcd34d;
      border-radius: 10px;
      padding: 6px 12px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      transition: background 0.12s, opacity 0.12s;
    }
    .delegation-approve-btn:hover { background: rgba(245,158,11,0.22); }
    .delegation-approve-btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .delegation-item.suggested {
      background: rgba(245,158,11,0.05);
      border-color: rgba(245,158,11,0.2);
    }
    .delegation-item.suggested strong { color: #fde68a; }
    .delegation-item.stale {
      border-left: 2px solid rgba(251,146,60,0.5);
    }
    .delegation-stale-badge {
      display: inline-block;
      font-size: 10px;
      font-weight: 500;
      color: #fb923c;
      background: rgba(251,146,60,0.12);
      border: 1px solid rgba(251,146,60,0.25);
      border-radius: 3px;
      padding: 0 4px;
      margin-left: 5px;
      vertical-align: middle;
      cursor: default;
    }
    .delegation-due { color: #64748b; }
    .delegation-due.overdue { color: #f87171; font-weight: 500; }
    /* Clickable estimated hours — subtle affordance */
    .estimation-hours-link {
      cursor: pointer;
      border-bottom: 1px dashed rgba(148,163,184,0.4);
      transition: color 0.15s, border-color 0.15s;
    }
    .estimation-hours-link:hover {
      color: #93c5fd;
      border-bottom-color: #93c5fd;
    }
    .estimation-hours-link.low-confidence {
      color: #fbbf24;
      border-bottom-color: rgba(251,191,36,0.4);
    }
    .estimation-hours-link.low-confidence:hover {
      color: #fcd34d;
      border-bottom-color: #fcd34d;
    }
    /* #1 Match reason on suggestion cards */
    .delegation-match-reason {
      display: block;
      font-size: 10px;
      color: #fbbf24;
      opacity: 0.8;
      margin-top: 2px;
      letter-spacing: 0.02em;
    }
    /* #2 Feedback loop badge in dev header */
    .delegation-feedback-badge {
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.02em;
    }
    /* #3 Bottleneck badge next to queue header */
    .delegation-bottleneck-badge {
      font-size: 10px;
      color: #ef4444;
      font-weight: 500;
      cursor: default;
    }
    .delegation-queue-btn {
      border: 1px solid rgba(148,163,184,0.2);
      background: rgba(148,163,184,0.08);
      color: #dbe2ea;
      border-radius: 10px;
      padding: 8px 10px;
      min-width: 84px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }
    .delegation-queue-btn.promote {
      color: #22c55e;
      border-color: rgba(34,197,94,0.24);
      background: rgba(34,197,94,0.10);
    }
    .delegation-queue-btn.demote {
      color: #ef4444;
      border-color: rgba(239,68,68,0.24);
      background: rgba(239,68,68,0.10);
    }
    .delegation-task-controls {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    .delegation-reassign-popover {
      display: none;
      margin-top: 8px;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }
    .delegation-reassign-popover.open {
      display: flex;
    }
    .delegation-reassign-select {
      min-width: 180px;
      border-radius: 10px;
      border: 1px solid #27303a;
      background: #0c0f13;
      color: #dbe2ea;
      padding: 8px 10px;
      font-size: 11px;
    }
    .delegation-dev-name {
      font-size: 13px;
      font-weight: 700;
      color: #eef2f7;
    }
    .delegation-dev-target {
      font-size: 12px;
      color: #9fb2c8;
      font-weight: 700;
    }
    .delegation-dev-stats {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 10px;
    }
    .delegation-dev-stat {
      padding: 10px 12px;
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 0 5px;
    }
    .delegation-dev-stat span {
      font-size: 10px;
      color: #7d8a9b;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .delegation-dev-stat strong {
      font-size: 13px;
      font-weight: 600;
      color: #eef2f7;
    }
    .dstat-ind {
      font-style: normal;
      font-size: 11px;
      font-weight: 700;
      margin-left: auto;
    }
    .dstat-ind.met { color: #22c55e; }
    .dstat-ind.unmet { color: #ef4444; }
    .dstat-sub {
      width: 100%;
      font-size: 10px;
      color: #4a5568;
      margin-top: 3px;
      letter-spacing: 0.02em;
    }
    .delegation-stats-note {
      font-size: 10px;
      color: #5a6a7d;
      line-height: 1.55;
      margin-bottom: 10px;
    }
    .delegation-dev-focus {
      font-size: 11px;
      color: #8d97a6;
      line-height: 1.55;
    }
    .delegation-list {
      display: grid;
      gap: 10px;
      margin-top: 12px;
    }
    .delegation-item {
      padding: 12px 14px;
      border-radius: 12px;
      background: #0f1317;
      border: 1px solid #1e252d;
    }
    .delegation-item strong {
      display: block;
      color: #eef2f7;
      font-size: 12px;
      margin-bottom: 5px;
    }
    .delegation-item span {
      color: #8d97a6;
      font-size: 11px;
      line-height: 1.55;
    }
    .delegation-empty {
      padding: 14px;
      border-radius: 12px;
      background: rgba(148,163,184,0.06);
      border: 1px solid rgba(148,163,184,0.12);
      color: #94a3b8;
      font-size: 12px;
      line-height: 1.55;
    }
    .delegation-header-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .delegation-settings-gear {
      min-width: 42px;
      padding-inline: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      line-height: 1;
    }
    .portfolio-globe-btn {
      min-width: 42px;
      padding-inline: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      line-height: 1;
    }
    .portfolio-globe-btn.active {
      background: rgba(99,179,237,0.12);
      border-color: rgba(99,179,237,0.45);
      color: #63b3ed;
    }
    #portfolio-view-overlay {
      position: fixed;
      inset: 0;
      background: rgba(5,8,12,0.58);
      z-index: 120;
      display: none;
      align-items: stretch;
      justify-content: center;
      padding: 0 20px;
    }
    #portfolio-view-overlay.open {
      display: flex;
    }
    .portfolio-view-panel {
      margin-top: 0;
      border-radius: 22px 22px 0 0;
      background: #101215;
      border: 1px solid #20242a;
      box-shadow: 0 28px 90px rgba(0,0,0,0.45);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      width: min(1320px, 100%);
      height: 100%;
    }
    .portfolio-pattern-card {
      padding: 16px 18px;
      border-radius: 14px;
      background: #0f1317;
      border: 1px solid #1a1f26;
    }
    .portfolio-pattern-card.priority-high {
      border-color: rgba(251,191,36,0.22);
    }
    .portfolio-pattern-card-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 8px;
    }
    .portfolio-pattern-badge {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 20px;
      white-space: nowrap;
    }
    .portfolio-pattern-badge.high {
      background: rgba(251,191,36,0.15);
      color: #fbbf24;
    }
    .portfolio-pattern-badge.medium {
      background: rgba(99,179,237,0.12);
      color: #63b3ed;
    }
    .portfolio-client-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }
    .portfolio-client-chip {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 20px;
      background: rgba(255,255,255,0.05);
      color: #8d97a6;
      border: 1px solid #1d2228;
    }
    .delegation-settings-overlay {
      position: fixed;
      inset: 0;
      background: rgba(5,8,12,0.58);
      z-index: 120;
      display: none;
      align-items: stretch;
      justify-content: center;
      padding: 0 20px;
    }
    .delegation-settings-overlay.open {
      display: flex;
    }
    .delegation-settings-panel {
      margin-top: 0;
      border-radius: 22px 22px 0 0;
      background: #101215;
      border: 1px solid #20242a;
      box-shadow: 0 28px 90px rgba(0,0,0,0.45);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      width: min(1320px, 100%);
      height: 100%;
    }
    .delegation-settings-header {
      padding: 20px 24px;
      border-bottom: 1px solid #1d2228;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
    }
    .delegation-settings-header-main {
      min-width: 0;
    }
    .delegation-settings-close {
      min-width: 42px;
      padding-inline: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      line-height: 1;
    }
    .delegation-settings-title {
      font-size: 13px;
      font-weight: 700;
      color: #eef2f7;
    }
    .delegation-settings-sub {
      font-size: 11px;
      color: #8d97a6;
      margin-top: 4px;
    }
    .delegation-settings-body {
      padding: 0 24px 24px;
      overflow: auto;
      flex: 1 1 auto;
    }
    .delegation-settings-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }
    .delegation-settings-card {
      padding: 14px;
      border-radius: 14px;
      background: #0f1317;
      border: 1px solid #1e252d;
    }
    .delegation-settings-grid {
      min-height: 0;
      align-items: start;
    }
    .delegation-settings-card {
      min-height: 0;
      padding: 18px;
    }
    .delegation-settings-card h4 {
      margin: 0 0 6px;
      font-size: 12px;
      color: #eef2f7;
    }
    .delegation-settings-card p {
      margin: 0 0 12px;
      font-size: 11px;
      color: #8d97a6;
      line-height: 1.5;
    }
    .delegation-option-list {
      display: grid;
      gap: 10px;
      max-height: 340px;
      overflow: auto;
      padding-right: 4px;
    }
    .delegation-option-list {
      max-height: calc(100vh - 280px);
    }
    .delegation-option {
      padding: 11px 12px;
      border-radius: 12px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
    }
    .delegation-option.active {
      background: rgba(59,130,246,0.08);
      border-color: rgba(59,130,246,0.18);
    }
    .delegation-option-top {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
    }
    .delegation-option-name {
      font-size: 12px;
      font-weight: 700;
      color: #eef2f7;
    }
    .delegation-option-meta {
      font-size: 10px;
      color: #7d8a9b;
      margin-top: 4px;
      line-height: 1.45;
    }
    .delegation-option input[type="checkbox"] {
      width: 15px;
      height: 15px;
      accent-color: #3b82f6;
      cursor: pointer;
      flex-shrink: 0;
    }
    .delegation-option-btn {
      border: 1px solid rgba(148,163,184,0.2);
      background: rgba(148,163,184,0.08);
      color: #dbe2ea;
      border-radius: 10px;
      padding: 8px 10px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .delegation-option-btn.add {
      border-color: rgba(34,197,94,0.24);
      background: rgba(34,197,94,0.12);
      color: #86efac;
    }
    .delegation-hidden-group {
      margin-top: 12px;
      border-top: 1px solid rgba(255,255,255,0.06);
      padding-top: 12px;
    }
    .delegation-hidden-group summary {
      cursor: pointer;
      list-style: none;
      color: #94a3b8;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }
    .delegation-hidden-group summary::-webkit-details-marker {
      display: none;
    }
    .delegation-skills {
      width: 100%;
      margin-top: 10px;
      min-height: 58px;
      border-radius: 10px;
      border: 1px solid #27303a;
      background: #0c0f13;
      color: #dbe2ea;
      padding: 9px 10px;
      font-size: 11px;
      line-height: 1.45;
      resize: vertical;
    }
    .delegation-hours-input {
      width: 100%;
      margin-top: 10px;
      border-radius: 10px;
      border: 1px solid #27303a;
      background: #0c0f13;
      color: #dbe2ea;
      padding: 9px 10px;
      font-size: 11px;
    }
    .delegation-rate-input {
      width: 100%;
      margin-top: 10px;
      border-radius: 10px;
      border: 1px solid #27303a;
      background: #0c0f13;
      color: #dbe2ea;
      padding: 9px 10px;
      font-size: 11px;
    }
    .delegation-skill-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }
    .delegation-skill-cell {
      display: grid;
      gap: 4px;
    }
    .delegation-skill-cell label {
      font-size: 10px;
      color: #8d97a6;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .delegation-label-row {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 10px;
    }
    .delegation-label-row .delegation-option-meta {
      margin-top: 0 !important;
    }
    .delegation-help-tip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 1px solid rgba(148,163,184,0.28);
      background: rgba(148,163,184,0.08);
      color: #9fb2c8;
      font-size: 10px;
      font-weight: 700;
      cursor: help;
      flex: 0 0 auto;
    }
    .delegation-skill-select,
    .delegation-speed-input,
    .delegation-pref-input {
      width: 100%;
      border-radius: 10px;
      border: 1px solid #27303a;
      background: #0c0f13;
      color: #dbe2ea;
      padding: 8px 10px;
      font-size: 11px;
    }
    .delegation-settings-actions {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      margin-top: 14px;
    }
    .delegation-settings-actions {
      position: sticky;
      bottom: 0;
      margin-top: 18px;
      padding-top: 14px;
      background: linear-gradient(180deg, rgba(16,18,21,0.86), #101215 28%);
    }
    .delegation-settings-status {
      font-size: 11px;
      color: #8d97a6;
      line-height: 1.45;
    }
    .qb-hourly-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
      gap: 14px;
    }
    @media (max-width: 900px) {
      .delegation-settings-overlay {
        padding: 0 10px;
      }
      .delegation-settings-grid {
        grid-template-columns: 1fr;
      }
      body.shell-trifecta-headless .opportunity-bot-workspace {
        grid-template-columns: 1fr;
      }
      body.shell-trifecta-headless .opportunity-bot-selected-sticky,
      body.shell-trifecta-headless .opportunity-bot-queue-scroll {
        position: static;
        max-height: none;
        overflow: visible;
      }
    }
    .qb-progress-wrap {
      margin-top: 16px;
      padding: 14px;
      border-radius: 12px;
      background: #0d1013;
      border: 1px solid #1d2228;
    }
    .qb-progress-track {
      position: relative;
      height: 12px;
      border-radius: 999px;
      overflow: hidden;
      background: #1d2228;
      margin-bottom: 10px;
    }
    .qb-progress-fill-primary,
    .qb-progress-fill-secondary {
      position: absolute;
      inset: 0 auto 0 0;
      border-radius: 999px;
    }
    .qb-progress-fill-primary {
      background: linear-gradient(90deg, #f97316, #fb923c);
    }
    .qb-progress-fill-secondary {
      background: linear-gradient(90deg, #3b82f6, #60a5fa);
      opacity: 0.85;
    }
    .qb-progress-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      font-size: 11px;
      color: #7b8595;
    }
    .qb-progress-legend span::before {
      content: '';
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 6px;
      vertical-align: middle;
    }
    .qb-progress-legend .incl::before { background: #3b82f6; }
    .qb-progress-legend .excl::before { background: #f97316; }
    .qb-settings-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin-bottom: 14px;
    }
    .qb-setting-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .qb-setting-field label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      color: #6f7785;
    }
    .qb-setting-field input {
      background: #0d1013;
      border: 1px solid #252a31;
      border-radius: 10px;
      color: #eef1f4;
      padding: 11px 12px;
      font-size: 13px;
    }
    .qb-setting-field input:focus {
      outline: none;
      border-color: #3b82f6;
    }
    .qb-settings-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
    }
    .qb-settings-status {
      font-size: 11px;
      color: #737b88;
    }
    .qb-empty {
      padding: 24px 18px;
      text-align: center;
      font-size: 13px;
      color: #636c79;
    }
    .client-intel-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
      gap: 16px;
      align-items: start;
    }
    .client-intel-workspace {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
      gap: 16px;
      align-items: start;
    }
    .client-intel-top-row {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
      gap: 16px;
      align-items: start;
      margin-bottom: 0;
    }
    .client-intel-top-row .client-intel-search-sticky {
      margin-bottom: 0;
    }
    .client-intel-main-stack,
    .client-intel-side-stack {
      display: grid;
      gap: 16px;
      align-content: start;
    }
    .client-intel-card {
      background: #1a1a1a;
      border: 1px solid #2a2a2a;
      border-radius: 14px;
      padding: 18px;
    }
    .client-intel-form {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .client-intel-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .client-intel-field.full {
      grid-column: 1 / -1;
    }
    .client-intel-field label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #7c8593;
    }
    .client-intel-field input,
    .client-intel-field textarea,
    .client-intel-field select {
      width: 100%;
      border-radius: 10px;
      border: 1px solid #2a3440;
      background: #0d1013;
      color: #eef1f4;
      padding: 11px 12px;
      font-size: 13px;
    }
    .client-intel-field textarea {
      min-height: 86px;
      resize: vertical;
      line-height: 1.45;
    }
    .client-intel-field input:focus,
    .client-intel-field textarea:focus,
    .client-intel-field select:focus {
      outline: none;
      border-color: #3b82f6;
    }
    .client-intel-domain-input-wrap {
      position: relative;
    }
    .client-intel-domain-input-wrap input {
      padding-left: 42px;
    }
    .client-intel-domain-favicon {
      position: absolute;
      left: 13px;
      top: 50%;
      width: 18px;
      height: 18px;
      transform: translateY(-50%);
      border-radius: 5px;
      background: rgba(255,255,255,0.08);
      object-fit: contain;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.16s ease;
    }
    .client-intel-domain-favicon.visible {
      opacity: 1;
    }
    .client-intel-field small {
      color: #748094;
      font-size: 11px;
      line-height: 1.4;
    }
    .client-intel-actions {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-top: 14px;
    }
    .client-intel-source-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
      align-items: center;
    }
    .client-intel-toolbar-cluster {
      display: grid;
      gap: 6px;
    }
    .client-intel-toolbar-sub {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      justify-content: flex-end;
    }
    .client-intel-toolbar-note {
      font-size: 11px;
      color: #8d98a8;
      line-height: 1.45;
    }
    .client-intel-toolbar-debug {
      border-style: dashed;
      opacity: 0.88;
    }
    .client-intel-audit-source-bar {
      display: none;
      margin-bottom: 12px;
      padding: 10px 12px;
      border: 1px solid rgba(71, 85, 105, 0.5);
      border-radius: 12px;
      background: rgba(15, 23, 42, 0.36);
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .client-intel-audit-source-bar.visible {
      display: flex;
    }
    .client-intel-audit-source-label {
      font-size: 11px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #94a3b8;
      margin-right: 4px;
    }
    .client-intel-audit-source-btn {
      background: rgba(30, 41, 59, 0.78);
      border-color: rgba(100, 116, 139, 0.62);
      color: #dbe7f5;
      box-shadow: none;
    }
    .client-intel-audit-source-btn:hover {
      border-color: rgba(125, 211, 252, 0.58);
      color: #f8fafc;
    }
    .client-intel-audit-source-btn.is-active {
      background: rgba(8, 47, 73, 0.88);
      border-color: rgba(56, 189, 248, 0.72);
      color: #f8fafc;
    }
    .client-intel-run-audit-flourish {
      display: none;
      align-items: center;
      gap: 8px;
      margin-left: 4px;
      min-width: 0;
    }
    .client-intel-run-audit-flourish.visible {
      display: inline-flex;
    }
    .client-intel-run-audit-activity {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      max-width: min(44vw, 360px);
      padding: 6px 10px;
      border: 1px solid rgba(100, 116, 139, 0.44);
      border-radius: 999px;
      background: rgba(15, 23, 42, 0.54);
      color: #dbe7f5;
      white-space: nowrap;
      overflow: hidden;
    }
    .client-intel-run-audit-pulse {
      width: 7px;
      height: 7px;
      border-radius: 999px;
      flex: 0 0 auto;
      background: #38bdf8;
      box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.42);
      animation: client-intel-audit-pulse 1.4s ease-out infinite;
    }
    .client-intel-run-audit-activity-text {
      display: block;
      font-size: 11px;
      line-height: 1.1;
      letter-spacing: 0.01em;
      text-overflow: ellipsis;
      overflow: hidden;
    }
    @keyframes client-intel-audit-pulse {
      0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.42);
      }
      70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(56, 189, 248, 0);
      }
      100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
      }
    }
    .client-intel-run-audit-btn.is-loading {
      opacity: 0.92;
      cursor: progress;
    }
    .client-intel-save-btn {
      margin-left: auto;
      background: #14532d;
      border-color: #166534;
      color: #dcfce7;
    }
    .client-intel-task-add {
      background: #14532d;
      border-color: #166534;
      color: #dcfce7;
    }
    .client-intel-source-buttons .refresh-btn[disabled] {
      opacity: 0.55;
      cursor: not-allowed;
    }
    .client-intel-status {
      font-size: 12px;
      color: #9aa4b2;
      line-height: 1.5;
    }
    .client-intel-inline-status {
      font-size: 11px;
      color: #748094;
      line-height: 1.5;
      margin-top: 8px;
    }
    .client-intel-inline-status + .client-intel-inline-status {
      margin-top: 4px;
    }
    .client-intel-kicker {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #7c8593;
      margin-bottom: 10px;
    }
    .client-intel-summary-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
      gap: 12px;
      margin-top: 14px;
    }
    .client-intel-stat {
      background: #0f1318;
      border: 1px solid #242b33;
      border-radius: 12px;
      padding: 14px;
    }
    .client-intel-stat-label {
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #768093;
      margin-bottom: 7px;
    }
    .client-intel-stat-value {
      font-size: 24px;
      font-weight: 700;
      color: #f2f5f7;
      line-height: 1.15;
      overflow-wrap: anywhere;
      word-break: break-word;
      hyphens: auto;
    }
    .client-intel-stat-sub {
      margin-top: 5px;
      color: #8d98a8;
      font-size: 12px;
      line-height: 1.45;
    }
    .client-intel-list {
      display: grid;
      gap: 10px;
    }
    .client-intel-insight {
      background: #10151b;
      border: 1px solid #202731;
      border-left-width: 4px;
      border-radius: 12px;
      padding: 14px 15px;
    }
    .client-intel-insight-head {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-bottom: 8px;
      flex-wrap: wrap;
    }
    .client-intel-badge {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      border-radius: 999px;
      padding: 4px 8px;
      color: #fff;
    }
    .client-intel-category {
      font-size: 11px;
      color: #92a0b3;
    }
    .client-intel-finding {
      font-size: 14px;
      font-weight: 600;
      line-height: 1.5;
      margin-bottom: 6px;
    }
    .client-intel-copy,
    .client-intel-action {
      font-size: 12px;
      color: #a8b3c2;
      line-height: 1.55;
    }
    .client-intel-action {
      margin-top: 6px;
      color: #7dd3fc;
      font-weight: 600;
    }
    .client-intel-decision-insight {
      --decision-bg: linear-gradient(135deg, #fff9e8 0%, #f2f0dc 52%, #edf7ea 100%);
      --decision-border: rgba(23,26,19,0.14);
      --decision-index-bg: rgba(37,55,40,0.78);
      --decision-index-fg: #f6f4e8;
      --decision-money-bg: rgba(255,255,255,0.62);
      --decision-money-border: rgba(23,26,19,0.13);
      --decision-money-text: #172015;
      --decision-money-label: rgba(23,26,19,0.55);
      --decision-evidence-bg: rgba(255,255,255,0.48);
      --decision-evidence-border: rgba(23,26,19,0.11);
      --decision-evidence-text: rgba(23,26,19,0.72);
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr);
      overflow: hidden;
      padding: 0;
      border-left-width: 1px;
      background: var(--decision-bg);
      border-color: var(--decision-border);
      box-shadow: 0 16px 38px rgba(23,26,19,0.10);
    }
    .client-intel-decision-index {
      display: grid;
      place-items: center;
      background: var(--decision-index-bg);
      color: var(--decision-index-fg);
      font-size: 14px;
      font-weight: 800;
      letter-spacing: -0.04em;
    }
    .client-intel-decision-body {
      padding: 18px 18px 17px;
    }
    .client-intel-decision-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
      margin-bottom: 14px;
      align-items: start;
    }
    .client-intel-decision-title-stack {
      display: grid;
      gap: 8px;
      min-width: 0;
    }
    .client-intel-decision-title {
      font-size: 18px;
      line-height: 1.2;
      letter-spacing: -0.02em;
      margin: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .client-intel-decision-money {
      justify-self: start;
      min-width: 0;
      max-width: 320px;
      color: var(--decision-money-text);
      background: var(--decision-money-bg);
      border: 1px solid var(--decision-money-border);
      border-radius: 14px;
      padding: 10px 12px;
      line-height: 1.15;
      text-align: left;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
    }
    .client-intel-decision-money-label {
      display: block;
      color: var(--decision-money-label);
      font-size: 9px;
      font-weight: 850;
      letter-spacing: 0.10em;
      line-height: 1;
      margin-bottom: 6px;
      text-transform: uppercase;
    }
    .client-intel-decision-money-value {
      display: block;
      font-size: 16px;
      font-weight: 900;
      letter-spacing: -0.03em;
      overflow-wrap: anywhere;
    }
    .client-intel-evidence-block {
      margin-top: 14px;
      padding: 12px 13px;
      border: 1px solid var(--decision-evidence-border);
      border-radius: 14px;
      background: var(--decision-evidence-bg);
      display: grid;
      gap: 7px;
    }
    .client-intel-evidence-label {
      color: var(--decision-money-label);
      font-size: 10px;
      font-weight: 850;
      letter-spacing: 0.09em;
      line-height: 1;
      text-transform: uppercase;
    }
    .client-intel-evidence-block .client-intel-task-detail {
      color: var(--decision-evidence-text);
      font-size: 12px;
      line-height: 1.45;
    }
    .client-intel-decision-score-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 0;
    }
    .client-intel-decision-title-stack .client-intel-decision-score-row {
      margin-top: 0;
    }
    body.shell-trifecta-headless .client-intel-decision-insight {
      background: var(--decision-bg) !important;
      border-color: var(--decision-border) !important;
      box-shadow: 0 16px 38px rgba(23,26,19,0.10) !important;
    }
    html.trifecta-theme-dark body.shell-trifecta-headless .client-intel-decision-insight {
      --decision-bg: linear-gradient(135deg, rgba(244,245,232,0.07) 0%, rgba(23,26,19,0.96) 50%, rgba(72,224,144,0.07) 100%);
      --decision-border: rgba(244,245,232,0.13);
      --decision-index-bg: rgba(73,224,144,0.24);
      --decision-index-fg: #d8fce8;
      --decision-money-bg: rgba(244,245,232,0.08);
      --decision-money-border: rgba(244,245,232,0.14);
      --decision-money-text: #f4f5e8;
      --decision-money-label: rgba(244,245,232,0.56);
      --decision-evidence-bg: rgba(244,245,232,0.06);
      --decision-evidence-border: rgba(244,245,232,0.12);
      --decision-evidence-text: rgba(244,245,232,0.72);
      box-shadow: none !important;
    }
    @media (max-width: 820px) {
      .client-intel-toolbar-sub {
        justify-content: flex-start;
      }
      .client-intel-decision-money {
        justify-self: stretch;
        max-width: none;
        text-align: left;
      }
    }
    .client-intel-history-item {
      padding: 12px 0;
      border-top: 1px solid #232a33;
    }
    .client-intel-history-item:first-child {
      border-top: none;
      padding-top: 0;
    }
    .client-intel-history-item a {
      color: #7dd3fc;
      text-decoration: none;
    }
    .client-intel-history-item a:hover {
      text-decoration: underline;
    }
    .client-intel-empty {
      padding: 20px 0;
      color: #768093;
      font-size: 13px;
      line-height: 1.55;
    }
    .client-intel-google-nomatch {
      margin-bottom: 14px;
      padding: 14px 16px;
      background: #2a1f0e;
      border: 1px solid #4a3a1d;
      border-radius: 12px;
      color: #fde68a;
    }
    .client-intel-google-nomatch-head {
      font-size: 13px;
      font-weight: 600;
    }
    .client-intel-google-nomatch code {
      background: #0f1318;
      padding: 1px 5px;
      border-radius: 4px;
      font-size: 12px;
      color: #cbd5e1;
    }
    .client-intel-search-results {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      z-index: 20;
      display: none;
      background: #0f1318;
      border: 1px solid #273240;
      border-radius: 12px;
      box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
      overflow: hidden;
    }
    .client-intel-search-results.open {
      display: block;
    }
    .client-intel-search-option {
      padding: 12px 14px;
      border-top: 1px solid #1c2430;
      cursor: pointer;
    }
    .client-intel-search-option:first-child {
      border-top: none;
    }
    .client-intel-search-option:hover {
      background: #131b25;
    }
    .client-intel-search-title {
      color: #eef1f4;
      font-size: 13px;
      font-weight: 600;
    }
    .client-intel-search-sub {
      color: #8d98a8;
      font-size: 12px;
      margin-top: 4px;
    }
    .client-intel-selection-preview {
      margin-top: 14px;
      background: #0f1318;
      border: 1px solid #242b33;
      border-radius: 12px;
      padding: 14px;
    }
    .client-intel-selection-title {
      color: #eef1f4;
      font-size: 16px;
      font-weight: 700;
    }
    .client-intel-selection-sub {
      color: #8d98a8;
      font-size: 12px;
      margin-top: 6px;
      line-height: 1.5;
    }
    .client-intel-source-card {
      background: #10151d;
      border: 1px solid #1f2937;
      border-radius: 12px;
      padding: 14px;
      margin-top: 12px;
    }
    .client-intel-source-card:first-child {
      margin-top: 0;
    }
    .client-intel-source-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 0;
      border-top: 1px solid #202833;
      font-size: 12px;
      color: #a8b3c2;
    }
    .client-intel-source-row:first-child {
      border-top: none;
      padding-top: 0;
    }
    .client-intel-source-row strong {
      color: #eef1f4;
      font-size: 13px;
    }
    .client-intel-hubspot-shell {
      display: grid;
      gap: 12px;
    }
    .client-intel-hubspot-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .client-intel-hubspot-tab {
      border: 1px solid #2a3440;
      background: #0f1318;
      color: #a8b3c2;
      border-radius: 999px;
      padding: 7px 12px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
    }
    .client-intel-hubspot-tab.active {
      border-color: #1d4ed8;
      background: #10233f;
      color: #bfdbfe;
    }
    .client-intel-hubspot-note {
      padding: 12px 14px;
      border-radius: 12px;
      background: #10151d;
      border: 1px solid #1f2937;
    }
    .client-intel-hubspot-note-head {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      margin-bottom: 8px;
    }
    .client-intel-hubspot-note-time {
      color: #8d98a8;
      font-size: 11px;
    }
    .client-intel-hubspot-note-body {
      color: #dbe2ea;
      font-size: 12px;
      line-height: 1.55;
      white-space: pre-line;
    }
    .client-intel-hubspot-compose {
      display: grid;
      gap: 10px;
      padding: 12px 14px;
      border-radius: 12px;
      background: #10151d;
      border: 1px solid #1f2937;
      margin-top: 12px;
    }
    .client-intel-hubspot-compose textarea {
      min-height: 120px;
    }
    .client-intel-grid.three {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .client-intel-actions-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }
    .client-intel-contact-list {
      display: grid;
      gap: 8px;
      min-height: 44px;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid #2a3440;
      background: #0d1013;
    }
    .client-intel-contact-pill {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      font-size: 12px;
      color: #d9e2ec;
    }
    .client-intel-contact-pill a,
    .client-intel-email-link {
      color: #7dd3fc;
      text-decoration: none;
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
      font: inherit;
    }
    .client-intel-contact-pill a:hover,
    .client-intel-email-link:hover {
      text-decoration: underline;
    }
    #client-intel-email-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(3, 7, 12, 0.52);
      z-index: 130;
      display: none;
      align-items: stretch;
      justify-content: flex-end;
      padding: 0;
    }
    #client-intel-email-modal-overlay.open { display: flex; }
    #client-intel-email-modal {
      width: min(560px, 100vw);
      height: 100vh;
      background: #0f1318;
      border-left: 1px solid #273240;
      box-shadow: -18px 0 40px rgba(0, 0, 0, 0.38);
      display: flex;
      flex-direction: column;
    }
    .client-intel-email-head {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      padding: 20px 22px 16px;
      border-bottom: 1px solid #202833;
    }
    .client-intel-email-title {
      color: #eef1f4;
      font-size: 19px;
      font-weight: 700;
    }
    .client-intel-email-sub {
      color: #8d98a8;
      font-size: 12px;
      margin-top: 6px;
      line-height: 1.5;
    }
    .client-intel-email-close {
      border: 1px solid #2a3440;
      background: #10151d;
      color: #9fb0c3;
      border-radius: 10px;
      width: 38px;
      height: 38px;
      cursor: pointer;
      font-size: 20px;
    }
    .client-intel-email-close:hover {
      border-color: #3a4a5d;
      color: #eef1f4;
    }
    .client-intel-email-body {
      padding: 18px 22px 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: 0;
      flex: 1;
    }
    .client-intel-email-field {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .client-intel-email-field label {
      color: #8d98a8;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: 700;
    }
    .client-intel-email-field input,
    .client-intel-email-field textarea,
    .client-intel-email-field select {
      width: 100%;
      border: 1px solid #2a3440;
      border-radius: 12px;
      background: #0b0f14;
      color: #eef1f4;
      padding: 12px 14px;
      font-size: 13px;
    }
    .client-intel-email-field textarea {
      min-height: 280px;
      resize: vertical;
      flex: 1;
      line-height: 1.6;
    }
    .client-intel-email-controls {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .client-intel-email-status {
      color: #9fb0c3;
      font-size: 12px;
      min-height: 18px;
    }
    .client-intel-email-actions {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      margin-top: auto;
    }
    .client-intel-email-actions-left,
    .client-intel-email-actions-right {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .client-intel-email-open {
      background: #14532d;
      border-color: #166534;
      color: #dcfce7;
    }
    #client-intel-asana-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(3, 7, 12, 0.52);
      z-index: 131;
      display: none;
      align-items: stretch;
      justify-content: flex-end;
      padding: 0;
    }
    #client-intel-asana-modal-overlay.open { display: flex; }
    #client-intel-asana-modal {
      width: min(680px, 100vw);
      height: 100vh;
      background: #0f1318;
      border-left: 1px solid #273240;
      box-shadow: -18px 0 40px rgba(0, 0, 0, 0.38);
      display: flex;
      flex-direction: column;
    }
    .client-intel-asana-head {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      padding: 20px 22px 16px;
      border-bottom: 1px solid #202833;
    }
    .client-intel-asana-title {
      color: #eef1f4;
      font-size: 19px;
      font-weight: 700;
    }
    .client-intel-asana-sub {
      color: #8d98a8;
      font-size: 12px;
      margin-top: 6px;
      line-height: 1.5;
    }
    .client-intel-asana-close {
      border: 1px solid #2a3440;
      background: #10151d;
      color: #9fb0c3;
      border-radius: 10px;
      width: 38px;
      height: 38px;
      cursor: pointer;
      font-size: 20px;
    }
    .client-intel-asana-body {
      padding: 18px 22px 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: 0;
      flex: 1;
      overflow: hidden;
    }
    .client-intel-asana-meta {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }
    .client-intel-asana-scroll {
      flex: 1;
      min-height: 0;
      overflow: auto;
      display: flex;
      flex-direction: column;
      gap: 14px;
      padding-right: 4px;
    }
    .client-intel-asana-comment-thread {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 0;
    }
    .client-intel-asana-description-field,
    .client-intel-asana-thread-field {
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    .client-intel-asana-description-field {
      flex: 0 0 210px;
    }
    .client-intel-asana-thread-field {
      flex: 0 0 auto;
    }
    #client-intel-asana-task-notes {
      min-height: 180px;
      resize: vertical;
    }
    .client-intel-asana-footer {
      display: flex;
      flex-direction: column;
      gap: 14px;
      border-top: 1px solid #202833;
      padding-top: 14px;
      margin-top: auto;
      background: #0f1318;
    }
    .client-intel-asana-comment {
      background: #10151d;
      border: 1px solid #1f2937;
      border-radius: 12px;
      padding: 12px 14px;
    }
    .client-intel-asana-comment-meta {
      color: #8d98a8;
      font-size: 11px;
      margin-bottom: 8px;
    }
    .client-intel-asana-comment-text {
      color: #eef1f4;
      font-size: 13px;
      line-height: 1.6;
      white-space: pre-line;
    }
    .client-intel-task-card {
      background: #10151d;
      border: 1px solid #1f2937;
      border-radius: 14px;
      padding: 14px 16px;
      margin-top: 12px;
    }
    .client-intel-task-card:first-child {
      margin-top: 0;
    }
    .client-intel-task-head {
      display: flex;
      justify-content: space-between;
      gap: 14px;
      align-items: flex-start;
    }
    .client-intel-task-title {
      color: #eef1f4;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.45;
    }
    .client-intel-task-detail {
      color: #94a3b8;
      font-size: 12px;
      margin-top: 6px;
      line-height: 1.6;
    }
    .client-intel-query-card {
      padding: 12px 14px;
    }
    .client-intel-query-title {
      color: #eef1f4;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.35;
    }
    .client-intel-query-metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-top: 10px;
    }
    .client-intel-query-metric {
      min-width: 0;
    }
    .client-intel-query-metric-label {
      color: #7f8a9b;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      line-height: 1.2;
    }
    .client-intel-query-metric-value {
      color: #eef1f4;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.25;
      margin-top: 4px;
      white-space: nowrap;
    }
    @media (max-width: 720px) {
      .client-intel-query-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }
    .client-intel-task-description {
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 12px;
      background: #0b0f14;
      border: 1px solid #202833;
      color: #d8e1eb;
      font-size: 12px;
      line-height: 1.65;
      white-space: pre-line;
    }
    .client-intel-task-add {
      background: #166534;
      border: 1px solid #15803d;
      color: #dcfce7;
      font-weight: 700;
      white-space: nowrap;
    }
    .client-intel-task-piggyback {
      background: #831843;
      border: 1px solid #be185d;
      color: #fce7f3;
      font-weight: 700;
      white-space: nowrap;
      margin-top: 8px;
      width: 100%;
    }
    .client-intel-task-add[disabled] {
      opacity: 0.6;
      cursor: wait;
    }
    .client-intel-open-task {
      padding: 12px 0;
      border-top: 1px solid #202833;
    }
    .client-intel-open-task:first-child {
      border-top: none;
      padding-top: 0;
    }
    .client-intel-open-task:last-child {
      padding-bottom: 0;
    }
    .client-intel-asana-select-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .client-intel-task-action-stack {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      min-width: 132px;
    }
    #client-intel-piggyback-modal-overlay,
    #client-intel-add-task-modal-overlay,
    #mantra-chat-modal-overlay,
    #google-oauth-paste-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(3, 7, 12, 0.52);
      z-index: 132;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    #client-intel-piggyback-modal-overlay.open,
    #client-intel-add-task-modal-overlay.open,
    #mantra-chat-modal-overlay.open,
    #google-oauth-paste-modal-overlay.open { display: flex; }
    #google-oauth-paste-modal {
      width: min(640px, 100%);
      background: #0f1318;
      border: 1px solid #273240;
      border-radius: 18px;
      box-shadow: 0 24px 60px rgba(0,0,0,0.44);
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .google-oauth-paste-steps {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .google-oauth-paste-steps code {
      background: #080b10;
      padding: 1px 6px;
      border-radius: 4px;
      font-size: 11px;
      color: #cbd5e1;
    }
    .google-oauth-paste-step-label {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      color: #93c5fd;
      margin-bottom: 6px;
    }
    .google-oauth-paste-step-body {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 6px;
    }
    #client-intel-piggyback-modal,
    #client-intel-add-task-modal {
      width: min(560px, 100%);
      background: #0f1318;
      border: 1px solid #273240;
      border-radius: 18px;
      box-shadow: 0 24px 60px rgba(0,0,0,0.44);
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    #mantra-chat-modal {
      width: min(680px, 100%);
      background: #0f1318;
      border: 1px solid #273240;
      border-radius: 18px;
      box-shadow: 0 24px 60px rgba(0,0,0,0.44);
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .client-intel-piggyback-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
    }
    #mantra-chat-transcript {
      max-height: 50vh;
      min-height: 80px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 8px;
      background: #080b10;
      border: 1px solid #1a232e;
      border-radius: 12px;
    }
    #mantra-chat-transcript:empty::before {
      content: "Ask anything below — the model has the item record, evidence summaries, and the last few values of each cited observation.";
      color: #64748b;
      font-size: 12px;
      font-style: italic;
      padding: 12px 6px;
    }
    .mantra-chat-msg {
      max-width: 90%;
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 13px;
      line-height: 1.5;
      white-space: pre-wrap;
      word-wrap: break-word;
    }
    .mantra-chat-msg.user {
      align-self: flex-end;
      background: #1f2937;
      color: #e5e7eb;
      border: 1px solid #334155;
    }
    .mantra-chat-msg.assistant {
      align-self: flex-start;
      background: #0e2a1a;
      color: #d1fae5;
      border: 1px solid #1d3a2a;
    }
    .mantra-chat-msg.thinking {
      align-self: flex-start;
      background: #1a1a1f;
      color: #94a3b8;
      font-style: italic;
      border: 1px dashed #2a3440;
    }
    .mantra-chat-tools {
      align-self: flex-start;
      max-width: 90%;
      display: flex;
      flex-direction: column;
      gap: 3px;
      padding: 6px 10px;
      font-size: 11px;
      color: #93c5fd;
      background: #0b1422;
      border: 1px solid #1e2f46;
      border-radius: 8px;
    }
    .mantra-chat-tool-row {
      display: flex;
      gap: 6px;
      align-items: baseline;
      font-family: ui-monospace, Menlo, monospace;
      word-break: break-all;
    }
    .mantra-chat-tool-row.error { color: #fca5a5; }
    .client-intel-piggyback-close {
      border: 1px solid #2a3440;
      background: #10151d;
      color: #9fb0c3;
      border-radius: 10px;
      width: 38px;
      height: 38px;
      cursor: pointer;
      font-size: 20px;
    }
    .client-intel-section-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
      gap: 16px;
    }
    .client-intel-mini-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .client-intel-mini-stat {
      background: #10151d;
      border: 1px solid #1f2937;
      border-radius: 12px;
      padding: 12px 14px;
    }
    .client-intel-mini-stat span {
      color: #7f8ba0;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .client-intel-mini-stat strong {
      display: block;
      color: #eef1f4;
      font-size: 20px;
      margin-top: 5px;
    }
    .client-intel-pill {
      display: inline-flex;
      align-items: center;
      padding: 4px 9px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      border: 1px solid #2a3647;
      background: #0f1722;
      color: #93c5fd;
      white-space: nowrap;
    }
    .client-intel-pill.good {
      color: #86efac;
      background: #052e16;
      border-color: #14532d;
    }
    .client-intel-pill.warn {
      color: #fcd34d;
      background: #2d2000;
      border-color: #713f12;
    }
    .client-intel-pill.bad {
      color: #fca5a5;
      background: #2d0000;
      border-color: #7f1d1d;
    }
    .client-intel-phase-list,
    .client-intel-offer-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .client-intel-phase-item,
    .client-intel-offer-item {
      background: #10151d;
      border: 1px solid #1f2937;
      border-radius: 12px;
      padding: 14px 16px;
    }
    .client-intel-phase-top,
    .client-intel-offer-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 8px;
    }
    .client-intel-phase-name,
    .client-intel-offer-name {
      color: #eef1f4;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.45;
    }
    .client-intel-phase-meta,
    .client-intel-note {
      color: #8b96a6;
      font-size: 12px;
      line-height: 1.6;
    }
    .client-intel-phase-goal,
    .client-intel-offer-copy {
      color: #c5cfdb;
      font-size: 12px;
      line-height: 1.65;
    }
    .client-intel-target-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
      margin-top: 12px;
    }
    .client-intel-target-label {
      color: #8b96a6;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 6px;
    }
    .client-intel-inline-input {
      width: 100%;
      background: #0f131a;
      border: 1px solid #263042;
      border-radius: 8px;
      color: #e8edf5;
      padding: 9px 10px;
      font-size: 12px;
    }
    .client-intel-inline-input:focus {
      outline: none;
      border-color: #3b82f6;
    }
    .client-intel-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .client-intel-table-wrap {
      overflow: auto;
      border: 1px solid #1f2937;
      border-radius: 12px;
    }
    .client-intel-table {
      width: 100%;
      min-width: 1120px;
      border-collapse: collapse;
      background: #0f141b;
    }
    .client-intel-table th {
      text-align: left;
      padding: 10px 12px;
      font-size: 10px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #748093;
      background: #121923;
      border-bottom: 1px solid #1f2937;
    }
    .client-intel-table td {
      padding: 10px 12px;
      border-bottom: 1px solid #18202c;
      vertical-align: top;
    }
    .client-intel-table tr:last-child td {
      border-bottom: none;
    }
    .client-intel-table input,
    .client-intel-table select,
    .client-intel-table textarea {
      width: 100%;
      background: #0c1117;
      border: 1px solid #253044;
      border-radius: 8px;
      color: #e5e7eb;
      padding: 8px 9px;
      font-size: 12px;
    }
    .client-intel-table textarea {
      min-height: 74px;
      resize: vertical;
    }
    .client-intel-table input[type="checkbox"] {
      width: 16px;
      height: 16px;
      accent-color: #3b82f6;
    }
    .client-intel-danger-btn {
      background: #2a1111;
      color: #fecaca;
      border: 1px solid #7f1d1d;
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
    }
    .client-intel-danger-btn:hover {
      background: #3a1616;
    }
    .client-intel-muted-link {
      color: #7dd3fc;
      text-decoration: none;
    }
    .client-intel-muted-link:hover {
      text-decoration: underline;
    }

    /* ── Empty states ── */
    .empty { text-align: center; color: #444; padding: 40px; font-size: 13px; }

    /* ── Short card ── */
    .short-card { border-left-color: #ef4444 !important; }
    .short-badge {
      background: #ef444422; color: #ef4444;
      padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700;
    }
    .auto-badge {
      background: #f97316; color: #fff;
      padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700;
    }
    .tail-badge {
      background: #ef444433; color: #ef4444;
      padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700;
      animation: pulse 1.5s infinite;
    }

    /* ── Short approval modal ── */
    #short-modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.75); z-index: 500;
      align-items: center; justify-content: center;
    }
    #short-modal-overlay.open { display: flex; }
    #short-modal {
      background: #1a1a1a; border: 1px solid #333; border-left: 4px solid #ef4444;
      border-radius: 12px; padding: 24px; max-width: 460px; width: 90%;
    }
    .short-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; color: #ef4444; }
    .short-modal-sub   { font-size: 11px; color: #555; margin-bottom: 18px; }
    .short-modal-row   { display: flex; gap: 10px; margin-bottom: 10px; }
    .short-modal-cell  { flex: 1; background: #222; border-radius: 6px; padding: 10px 12px; }
    .short-modal-label { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.6px; }
    .short-modal-value { font-size: 16px; font-weight: 700; margin-top: 2px; }
    .short-modal-thesis { font-size: 12px; color: #aaa; line-height: 1.6; margin-bottom: 18px; padding: 10px 14px; background: #222; border-radius: 6px; }
    .short-modal-actions { display: flex; gap: 10px; }
    .btn-cancel  { flex: 1; background: #222; border: 1px solid #333; color: #888; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: 600; }
    .btn-execute { flex: 2; background: #ef4444; border: none; color: #fff; padding: 10px; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 13px; }
    .btn-execute:hover { background: #dc2626; }

    /* ── Trades modal ── */
    #trades-modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.78); z-index: 520;
      align-items: center; justify-content: center; padding: 24px;
    }
    #trades-modal-overlay.open { display: flex; }
    #trades-modal {
      width: min(1180px, 100%); max-height: min(88vh, 920px); overflow: hidden;
      background: #121212; border: 1px solid #2e2e2e; border-radius: 16px;
      box-shadow: 0 24px 80px rgba(0,0,0,0.5);
      display: flex; flex-direction: column;
    }
    .trades-modal-header {
      display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
      padding: 24px 24px 18px; border-bottom: 1px solid #222;
    }
    .trades-modal-title { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
    .trades-modal-subtitle { font-size: 12px; color: #666; margin-top: 6px; }
    .trades-modal-close {
      background: #1d1d1d; border: 1px solid #333; color: #999;
      width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 20px;
    }
    .trades-modal-close:hover { border-color: #555; color: #fff; }
    .trades-modal-controls {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      padding: 16px 24px; border-bottom: 1px solid #1d1d1d; flex-wrap: wrap;
      background: linear-gradient(180deg, rgba(59,130,246,0.08), rgba(59,130,246,0));
    }
    .trades-modal-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
    .trade-tab {
      border: 1px solid #333; background: #171717; color: #999;
      border-radius: 999px; padding: 9px 14px; cursor: pointer;
      font-size: 12px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center;
    }
    .trade-tab.active { color: #fff; border-color: #3b82f6; background: #10233f; }
    .trade-tab-count {
      display: inline-flex; min-width: 20px; height: 20px; border-radius: 999px;
      align-items: center; justify-content: center; font-size: 10px;
      background: rgba(255,255,255,0.08); color: inherit; padding: 0 6px;
    }
    .trades-modal-pill {
      padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
      border: 1px solid #2e2e2e; background: #171717; color: #888;
    }
    .trades-modal-pill.blue { border-color: #1d4ed8; color: #60a5fa; }
    .trades-modal-body {
      overflow: auto; padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 18px;
    }
    .trades-summary-grid {
      display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
    }
    .trade-summary-card {
      background: #171717; border: 1px solid #252525; border-radius: 12px; padding: 14px 16px;
    }
    .trade-summary-label {
      font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
    }
    .trade-summary-value { font-size: 24px; font-weight: 700; }
    .trade-summary-sub { font-size: 11px; color: #666; margin-top: 4px; }
    .trade-list { display: grid; gap: 12px; }
    .trade-card {
      background: #171717; border: 1px solid #252525; border-radius: 14px; padding: 16px;
    }
    .trade-card-head {
      display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px;
    }
    .trade-card-topline {
      display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px;
    }
    .trade-symbol { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
    .trade-instrument { font-size: 11px; color: #666; }
    .trade-side, .trade-status {
      padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase;
    }
    .trade-side.buy { background: rgba(34,197,94,0.15); color: #22c55e; }
    .trade-side.sell { background: rgba(239,68,68,0.15); color: #ef4444; }
    .trade-status.active { background: rgba(59,130,246,0.15); color: #60a5fa; }
    .trade-status.pending { background: rgba(234,179,8,0.15); color: #eab308; }
    .trade-status.executed, .trade-status.closed { background: rgba(34,197,94,0.15); color: #22c55e; }
    .trade-status.cancelled, .trade-status.failed { background: rgba(239,68,68,0.15); color: #ef4444; }
    .trade-time { font-size: 12px; color: #777; line-height: 1.5; }
    .trade-pnl-block { text-align: right; min-width: 120px; }
    .trade-pnl-label { font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; }
    .trade-pnl-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
    .trade-detail-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px;
    }
    .trade-detail {
      background: #121212; border: 1px solid #222; border-radius: 10px; padding: 10px 12px;
    }
    .trade-detail-label {
      font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 5px;
    }
    .trade-detail-value { font-size: 14px; font-weight: 600; }
    .trade-notes {
      display: grid; gap: 8px;
    }
    .trade-note {
      background: #121212; border: 1px solid #222; border-radius: 10px; padding: 12px 14px;
    }
    .trade-note-label {
      font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 5px;
    }
    .trade-note-body { font-size: 12px; color: #bbb; line-height: 1.6; white-space: pre-wrap; }
    .insight-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
    }
    .insight-card {
      background: #171717; border: 1px solid #252525; border-radius: 12px; padding: 12px 14px;
    }
    .insight-label {
      font-size: 10px; color: #666; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px;
    }
    .insight-value {
      font-size: 20px; font-weight: 700;
    }
    .insight-sub {
      font-size: 11px; color: #666; margin-top: 4px; line-height: 1.5;
    }
    .insight-list {
      display: grid; gap: 8px;
    }
    .insight-row {
      display: flex; justify-content: space-between; gap: 12px; align-items: center;
      background: #171717; border: 1px solid #252525; border-radius: 10px; padding: 10px 12px;
    }
    .insight-row-main { font-size: 12px; color: #ddd; }
    .insight-row-sub { font-size: 10px; color: #666; margin-top: 3px; }
    .insight-row-side { font-size: 11px; color: #888; text-align: right; white-space: nowrap; }
    .trades-empty {
      border: 1px dashed #2c2c2c; border-radius: 14px; padding: 44px 20px; text-align: center; color: #666;
    }
    .trades-empty-title { font-size: 15px; font-weight: 700; color: #999; margin-bottom: 6px; }
    .trades-empty-sub { font-size: 12px; }

    /* ── Toast ── */
    #toast {
      position: fixed; bottom: 24px; right: 24px;
      background: #1e1e1e; border: 1px solid #333; border-radius: 8px;
      padding: 12px 18px; font-size: 13px; z-index: 999;
      transform: translateY(80px); opacity: 0; transition: all 0.3s;
      max-width: 320px;
    }
    #toast.show { transform: translateY(0); opacity: 1; }
    #toast.success { border-color: #22c55e; color: #22c55e; }
    #toast.error   { border-color: #ef4444; color: #ef4444; cursor: pointer; }

    /* Spinner */
    .spinner {
      display: inline-block; width: 12px; height: 12px;
      border: 2px solid #333; border-top-color: #3b82f6;
      border-radius: 50%; animation: spin 0.6s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

    /* Client Intelligence source-panel close button is mobile-only — see the
       mobile media query below for the show-when-modal-open rule. */
    .client-intel-source-modal-close { display: none; }

    @media (max-width: 768px) {
      header { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
      .container { padding: 16px; }
      .header-left, .header-right { justify-content: space-between; flex-wrap: wrap; gap: 10px; }
      header h1 { font-size: 16px; min-width: 0; }
      .logo-dog { height: 32px; }
      .header-domains { width: 100%; justify-content: space-between; gap: 6px; padding: 4px; }
      .header-domain { flex: 1 1 0; padding: 9px 10px; font-size: 11px; text-align: center; }
      /* Other-dropdown wrapper needs to flex too, otherwise its button collapses to content width */
      .header-domain-dropdown { flex: 1 1 0; display: flex; }
      .header-domain-dropdown > .header-domain { width: 100%; flex: 1 1 auto; }
      .section-header { flex-direction: column; align-items: stretch; gap: 10px; }
      .section-header .refresh-btn { align-self: flex-start; }
      .section-controls { width: 100%; }
      .summary-grid { grid-template-columns: repeat(2, 1fr); }
      .sleeve-grid  { grid-template-columns: 1fr; }
      .qb-hero-inner,
      .qb-hero-metrics,
      .qb-financial-overview,
      .qb-line-grid,
      .qb-subtotals-grid,
      .qb-bottom-grid,
      .qb-scenarios-grid,
      .qb-settings-grid,
      .qb-hourly-grid,
      .qb-panel-grid,
      .delegation-hero,
      .delegation-grid,
      .delegation-dev-grid,
      .delegation-metric-grid,
      .delegation-settings-grid,
      .opportunity-bot-workspace,
      .client-intel-top-row,
      .client-intel-workspace,
      .client-intel-grid,
      .client-intel-grid.three,
      .client-intel-section-grid,
      .client-intel-form { grid-template-columns: 1fr !important; }
      body.shell-trifecta-headless .client-intel-search-sticky,
      body.shell-trifecta-headless #client-intel-insights-card.client-intel-insights-sticky-active {
        top: 96px;
      }
      .qb-hero-title,
      .qb-hero-status { flex-direction: column; align-items: flex-start; }
      .qb-hero-status-copy { text-align: left; }
      .qb-settings-actions,
      .client-intel-actions { flex-direction: column; align-items: flex-start; }
      #briefing-bar { flex-direction: column; }
      #overview-insights-wrap { grid-template-columns: 1fr !important; }
      #quickbooks-top-row, #alpaca-top-row, #ha-top-row, #ubiquiti-top-row { grid-template-columns: 1fr !important; }
      #quickbooks-finance-row, #quickbooks-revenue-detail-row,
      #alpaca-detail-row-1, #alpaca-detail-row-2,
      #ha-detail-row, #ubiquiti-detail-row-1, #ubiquiti-detail-row-2,
      #risk-settings-grid, #macro-body { grid-template-columns: 1fr !important; }
      #oppsleeve-insight-wrap, #oppsleeve-detail-wrap { grid-template-columns: 1fr !important; }
      .opp-grid, .merrill-grid { grid-template-columns: 1fr; }
      .insight-row { flex-direction: column; align-items: flex-start; }
      .insight-row-side { text-align: left; white-space: normal; }
      .vol-table { display: block; overflow-x: auto; white-space: nowrap; }
      #trades-modal-overlay { padding: 12px; }
      .trades-modal-header, .trades-modal-controls, .trades-modal-body { padding-left: 16px; padding-right: 16px; }
      .trades-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .trade-card-head { flex-direction: column; }
      .trade-pnl-block { text-align: left; min-width: 0; }
      #toast { right: 12px; left: 12px; bottom: 12px; max-width: none; }

      /* ── Mobile shim for 3fecta dashboard ── */
      /* Keep the 3fecta header on one row with the logo left and icon
         buttons (hamburger + theme toggle) anchored to the right. The
         default @media rule above stacks the whole header column. */
      body.shell-trifecta-headless header { flex-direction: row !important; align-items: center !important; justify-content: space-between !important; gap: 10px !important; padding: 14px 16px !important; }
      body.shell-trifecta-headless .header-left { flex: 0 1 auto; justify-content: flex-start; min-width: 0; }
      body.shell-trifecta-headless .header-right { flex: 0 0 auto; justify-content: flex-end; margin-left: auto; }
      body.shell-trifecta-headless .trifecta-shell-actions { display: flex; gap: 8px; }

      /* Tap targets: every action button reaches the 40-44px minimum. */
      .refresh-btn,
      .client-intel-task-add,
      .acct-toggle,
      .trifecta-shell-menu-item,
      button.btn,
      button.refresh-btn { min-height: 40px; padding-top: 9px; padding-bottom: 9px; font-size: 13px; }
      /* Inputs + selects: keep 16px font so iOS doesn't auto-zoom. */
      input[type="text"], input[type="search"], input[type="email"], input[type="number"], input:not([type]),
      select, textarea { font-size: 16px; min-height: 40px; }
      textarea { min-height: 120px; }

      /* Billable Summary: scroll the wrapper, keep the table's native layout intact. */
      #billable-summary-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
      #billable-summary-body table { min-width: 720px; }
      /* Pacing gauges: stack one per row, give each more vertical space. */
      #tab-billable_summary [style*="grid-template-columns:1fr 1fr"],
      #tab-billable_summary [style*="grid-template-columns:1fr 1fr;"] { display: grid !important; grid-template-columns: 1fr !important; }
      /* Work Delegation: the 5-col stat grid crushes labels < 80px each. Drop to 2 cols
         and let labels wrap instead of clipping into each other. */
      .delegation-dev-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
      .delegation-dev-stat span { white-space: normal !important; font-size: 9px !important; line-height: 1.2 !important; }
      .delegation-dev-stat { padding: 8px 10px !important; }
      .delegation-dev-stat strong { font-size: 14px !important; }
      /* Stack task title above its action controls so the title gets the
         full card width on phones. */
      .delegation-task-row { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
      .delegation-task-controls { justify-content: flex-start; }
      .delegation-queue-btn { flex: 1 1 auto; min-width: 0; }
      /* Reduce the nested paddings (container → list-card → dev-card → item)
         that were eating ~60px of horizontal space on phones. */
      body.shell-trifecta-headless .container { padding-left: 10px !important; padding-right: 10px !important; }
      .delegation-list-card { padding: 12px !important; }
      .delegation-dev-card { padding: 12px !important; }
      .delegation-item { padding: 10px 12px !important; }
      .delegation-totals-card { padding: 10px 12px !important; }
      /* Suggested-task header row's right column has its own inline flex; let
         its action buttons wrap below the title block on phones too. */
      .delegation-item.suggested .delegation-task-row > div:last-child { flex-wrap: wrap; }

      /* Accountability tab: the section header sits flush against the card
         edge with no breathing room. Add top padding so the title doesn't
         look glued to the chrome. */
      #tab-accountability > .section-header { padding-top: 14px; }
      #tab-accountability .section-title { padding-top: 4px; }
      /* Tighten Accountability card paddings + give the flag row room to wrap
         long descriptions without squeezing the toggle off-screen. */
      #tab-accountability .acct-card { padding: 14px !important; }
      #tab-accountability .acct-flag-row { gap: 12px; padding: 9px 0; }
      #tab-accountability .acct-flag-row > div:first-child { min-width: 0; flex: 1 1 auto; }
      #tab-accountability .acct-flag-name { font-size: 13px; line-height: 1.3; }
      #tab-accountability .acct-flag-desc { font-size: 11px; line-height: 1.35; margin-top: 2px; word-wrap: break-word; }
      /* Build Progress table: horizontal-scroll inside the card, don't let the
         note column blow the layout. */
      #tab-accountability .acct-card:has(.acct-step-table) { padding: 14px 8px !important; overflow-x: auto; -webkit-overflow-scrolling: touch; }
      #tab-accountability .acct-step-table { min-width: 520px; }
      #tab-accountability .acct-step-table td:last-child { white-space: normal; }

      /* ── Client Intelligence source panel as a modal on phones ──
         Inline expansion of Audit/HubSpot/Asana/QuickBooks/PandaDoc/Email
         Intelligence pushes the layout around and triggers horizontal scroll
         on small screens. On mobile we turn the panel card into a clean
         full-screen modal overlay; desktop is untouched. */
      body.ci-source-modal-open { overflow: hidden; }
      body.ci-source-modal-open #client-intel-source-panel-card {
        position: fixed !important;
        inset: 0 !important;
        z-index: 200 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 56px 14px 24px !important;
        max-height: 100vh !important;
        max-width: 100vw !important;
      }
      .client-intel-source-modal-close {
        display: none;
      }
      body.ci-source-modal-open .client-intel-source-modal-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 8px;
        right: 10px;
        z-index: 201;
        width: 40px;
        height: 40px;
        border-radius: 999px;
        border: 1px solid var(--shell-border);
        background: var(--shell-surface-alt);
        color: var(--shell-text);
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
      }

      /* Opportunity Bot: tighten inner padding so cards aren't squeezed. */
      body.shell-trifecta-headless .opportunity-bot-fixed-controls,
      body.shell-trifecta-headless .opportunity-bot-search-sticky,
      body.shell-trifecta-headless .opportunity-bot-hero-sticky { padding-left: 0; padding-right: 0; }
      body.shell-trifecta-headless #opportunity-bot-table .client-intel-task-card { padding: 14px !important; }
      body.shell-trifecta-headless #opportunity-bot-table .client-intel-task-title,
      body.shell-trifecta-headless #opportunity-bot-top-three .client-intel-task-title { font-size: 20px !important; line-height: 1.2 !important; word-break: normal; overflow-wrap: anywhere; }
      /* Stack the head (title left + money right) into two rows on phones so
         the title gets the full card width instead of wrapping each word. */
      body.shell-trifecta-headless #opportunity-bot-table .client-intel-task-head,
      body.shell-trifecta-headless #opportunity-bot-top-three .client-intel-task-head { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
      body.shell-trifecta-headless #opportunity-bot-table .client-intel-task-head > div:last-child,
      body.shell-trifecta-headless #opportunity-bot-top-three .client-intel-task-head > div:last-child { min-width: 0 !important; text-align: left !important; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
      body.shell-trifecta-headless #opportunity-bot-table .client-intel-stat-value,
      body.shell-trifecta-headless #opportunity-bot-top-three .client-intel-stat-value { font-size: 22px !important; }
      /* Drop sticky pagination on phones: it overlaps the action buttons of the
         lead client and clips "View Opportunities" mid-scroll. */
      body.shell-trifecta-headless #opportunity-bot-pagination-top-slot { position: static !important; top: auto !important; z-index: auto; }
      /* OB detail panel: stack action buttons full-width (avoids orphaned
         Delete on its own row, and keeps every tap target the same shape). */
      body.shell-trifecta-headless .client-intel-email-actions-right { display: flex; flex-direction: column; gap: 8px; width: 100%; }
      body.shell-trifecta-headless .client-intel-email-actions-right > button { flex: 0 0 auto; width: 100%; min-width: 0; }
      body.shell-trifecta-headless .client-intel-email-actions { flex-direction: column; align-items: stretch; }
      body.shell-trifecta-headless .client-intel-email-actions-left { display: none; }
      /* …except the pagination row — keep "Search" + Previous + Next compact on one line. */
      body.shell-trifecta-headless .opportunity-bot-pagination-top,
      body.shell-trifecta-headless .opportunity-bot-pagination-bottom { flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 8px; }
      body.shell-trifecta-headless .opportunity-bot-pagination-top .client-intel-email-actions-left,
      body.shell-trifecta-headless .opportunity-bot-pagination-bottom .client-intel-email-actions-left { display: block !important; flex: 1 1 100%; }
      body.shell-trifecta-headless .opportunity-bot-pagination-top .client-intel-email-actions-right,
      body.shell-trifecta-headless .opportunity-bot-pagination-bottom .client-intel-email-actions-right { flex-direction: row !important; flex-wrap: nowrap; width: 100%; justify-content: space-between; gap: 8px; }
      body.shell-trifecta-headless .opportunity-bot-pagination-top .client-intel-email-actions-right > button,
      body.shell-trifecta-headless .opportunity-bot-pagination-bottom .client-intel-email-actions-right > button { width: auto !important; flex: 1 1 auto; min-width: 0; padding-left: 10px; padding-right: 10px; }

      /* Mantra: keep card hits big and stack their action rows. */
      .mantra-item { padding: 14px !important; }
      .mantra-btn { min-height: 40px; padding: 9px 12px; font-size: 13px; flex: 1 1 calc(50% - 6px); }
      .mantra-dur-btn { min-height: 40px; padding: 9px 12px; font-size: 13px; }

      /* Client Intelligence: full-width form fields, stack metrics. */
      .client-intel-form { gap: 12px; }
      .client-intel-form .client-intel-email-field { width: 100%; }
      .client-intel-form input, .client-intel-form select, .client-intel-form textarea { width: 100%; }
      .client-intel-toolbar-sub { flex-wrap: wrap; }

      /* Asana task modal: full-viewport on phones so the textarea has room. */
      #client-intel-add-task-modal { width: 96vw !important; max-width: 96vw !important; max-height: 90vh; }
      #client-intel-add-task-modal-overlay { padding: 12px; align-items: flex-start; }
      .client-intel-asana-select-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    }

    @media (max-width: 560px) {
      .summary-grid { grid-template-columns: 1fr; }
      .trades-summary-grid { grid-template-columns: 1fr; }
      .summary-card { padding: 14px 16px; }
      .summary-card .value { font-size: 22px; }
      .sleeve-card { padding: 16px; }
      .sleeve-actions-bottom { grid-template-columns: 1fr; align-items: stretch; }
      .sleeve-actions-main, .sleeve-actions-utility { justify-content: flex-start; }
      .sleeve-actions-utility { width: 100%; }
      .alloc-editor { width: 100%; }
      .alloc-editor { grid-template-columns: 1fr; }
      .seed-router-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
      .tabs { gap: 0; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
    }
    @media (max-width: 900px) {
      .trifecta-shell-menu-toggle {
        display: inline-flex !important;
      }
      body.shell-trifecta-headless #finance-tabs {
        display: none !important;
      }
      body.shell-trifecta-headless header {
        padding: 18px 16px 14px;
      }
      body.shell-trifecta-headless .container {
        padding: 0 16px 28px;
        border-radius: 24px 24px 0 0;
      }
      body.shell-trifecta-headless .header-right #last-updated {
        display: none;
      }
      .trifecta-shell-logo-mark {
        width: 90px;
        height: 47px;
      }
      .trifecta-shell-menu-overlay {
        padding: 12px;
      }
      .trifecta-shell-menu {
        width: 100%;
        border-radius: 22px;
        padding: 18px 16px 16px;
      }
    }

    /* ── Sleeve AI Intelligence ────────────────────────────────── */
    .ai-status-badge {
      display: inline;
      margin-left: 10px;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.2px;
      cursor: pointer;
      user-select: none;
      transition: filter 0.15s ease;
    }
    .ai-status-badge:hover { filter: brightness(1.25); }
    .ai-status-badge.kill              { color:#ff6b6b; }
    .ai-status-badge.needs_refinement  { color:#ffd166; }
    .ai-status-badge.ready_for_live    { color:#22c55e; }
    .ai-status-badge.scale             { color:#a78bfa; }
    .ai-status-badge.pending           { color:#777; }

    .ai-tooltip {
      position: fixed;
      z-index: 4000;
      background: #181818;
      border: 1px solid #2a2a2a;
      border-radius: 10px;
      padding: 12px 14px;
      min-width: 240px;
      max-width: 320px;
      box-shadow: 0 10px 30px rgba(0,0,0,0.6);
      pointer-events: none;
      font-size: 12px;
      color: #d6d6d6;
      display: none;
    }
    .ai-tooltip.open { display: block; }
    .ai-tooltip .ait-name { font-size: 13px; font-weight: 700; color: #f0f0f0; }
    .ai-tooltip .ait-status { font-size: 10px; margin-top: 2px; margin-bottom: 8px; letter-spacing: 0.4px; text-transform: uppercase; }
    .ai-tooltip .ait-status.kill { color: #ff6b6b; }
    .ai-tooltip .ait-status.needs_refinement { color: #ffd166; }
    .ai-tooltip .ait-status.ready_for_live { color: #22c55e; }
    .ai-tooltip .ait-status.scale { color: #a78bfa; }
    .ai-tooltip .ait-metrics { display: flex; gap: 12px; margin-bottom: 8px; }
    .ai-tooltip .ait-metric { font-size: 11px; }
    .ai-tooltip .ait-metric span { color: #888; }
    .ai-tooltip .ait-metric strong { color: #f0f0f0; }
    .ai-tooltip ul { margin: 0; padding-left: 16px; }
    .ai-tooltip li { margin: 2px 0; }
    .ai-tooltip .ait-hint { margin-top: 8px; font-size: 10px; color: #666; font-style: italic; }

    #ai-modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.65);
      z-index: 5000; display: none; align-items: flex-start; justify-content: center;
      padding: 4vh 16px;
    }
    #ai-modal-overlay.open { display: flex; }
    #ai-modal {
      background: #131313; border: 1px solid #2a2a2a; border-radius: 14px;
      width: min(720px, 100%); max-height: 92vh; overflow-y: auto;
      box-shadow: 0 30px 80px rgba(0,0,0,0.7);
    }
    #ai-modal .aim-head {
      display: flex; justify-content: space-between; align-items: flex-start;
      padding: 18px 22px 12px;
      border-bottom: 1px solid #1f1f1f;
    }
    #ai-modal .aim-title { font-size: 18px; font-weight: 700; color: #f0f0f0; }
    #ai-modal .aim-sub { font-size: 11px; color: #777; margin-top: 2px; }
    #ai-modal .aim-close {
      background: transparent; border: 1px solid #2a2a2a; color: #aaa;
      width: 28px; height: 28px; border-radius: 50%; cursor: pointer; line-height: 1;
    }
    #ai-modal .aim-close:hover { color: #fff; border-color: #3a3a3a; }
    #ai-modal .aim-body { padding: 16px 22px 22px; }
    #ai-modal .aim-readiness {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 16px; border-radius: 12px; margin-bottom: 16px;
      border: 1px solid; font-weight: 600;
    }
    #ai-modal .aim-readiness.kill              { background: #3a1414; color: #ff6b6b; border-color: #5a1f1f; }
    #ai-modal .aim-readiness.needs_refinement  { background: #3a3014; color: #ffd166; border-color: #5a4a1f; }
    #ai-modal .aim-readiness.ready_for_live    { background: #143a1f; color: #22c55e; border-color: #1f5a2c; }
    #ai-modal .aim-readiness.scale             { background: #1a1438; color: #a78bfa; border-color: #3a2f5a; }
    #ai-modal .aim-readiness .aim-r-label { font-size: 13px; letter-spacing: 0.4px; text-transform: uppercase; }
    #ai-modal .aim-readiness .aim-r-value { font-size: 17px; }
    #ai-modal .aim-metrics-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
    #ai-modal .aim-metric {
      flex: 1 1 120px; background: #1a1a1a; border: 1px solid #262626;
      border-radius: 10px; padding: 10px 12px;
    }
    #ai-modal .aim-metric .aim-m-label { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; }
    #ai-modal .aim-metric .aim-m-value { font-size: 17px; font-weight: 600; color: #f0f0f0; margin-top: 4px; }
    #ai-modal .aim-section { margin-top: 16px; }
    #ai-modal .aim-section h4 {
      font-size: 11px; color: #888; text-transform: uppercase;
      letter-spacing: 0.6px; margin: 0 0 8px;
    }
    #ai-modal .aim-section p,
    #ai-modal .aim-section li { font-size: 13px; line-height: 1.55; color: #d6d6d6; margin: 0; }
    #ai-modal .aim-section ul { margin: 0; padding-left: 18px; }
    #ai-modal .aim-section ul li + li { margin-top: 4px; }
    #ai-modal .aim-footer { font-size: 10px; color: #666; margin-top: 18px; text-align: right; }

    /* ── Drilldown modal ── */
    #bs-drilldown-overlay { display:none;position:fixed;inset:0;background:rgba(0,0,0,0.65);z-index:1100;align-items:center;justify-content:center; }
    #bs-drilldown-overlay.open { display:flex; }
    #bs-drilldown-modal { background:#0d1117;border:1px solid #1e293b;border-radius:10px;width:min(680px,94vw);max-height:80vh;display:flex;flex-direction:column;box-shadow:0 24px 60px rgba(0,0,0,0.6); }
    #bs-drilldown-modal .bsd-head { display:flex;align-items:flex-start;justify-content:space-between;padding:16px 20px 14px;border-bottom:1px solid #1e293b; }
    #bs-drilldown-modal .bsd-title { font-size:14px;font-weight:700;color:#e2e8f0; }
    #bs-drilldown-modal .bsd-sub { font-size:11px;color:#475569;margin-top:3px; }
    #bs-drilldown-modal .bsd-close { background:none;border:none;color:#64748b;font-size:20px;cursor:pointer;line-height:1;padding:0 2px; }
    #bs-drilldown-modal .bsd-close:hover { color:#e2e8f0; }
    #bs-drilldown-modal .bsd-body { overflow-y:auto;padding:12px 20px 20px;flex:1; }
    .bsd-table { width:100%;border-collapse:collapse;font-size:12px; }
    .bsd-table th { font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:#475569;padding:4px 6px 8px;text-align:left;font-weight:600; }
    .bsd-table td { padding:6px 6px;border-bottom:1px solid #111827;vertical-align:top; }
    .bsd-table tr:last-child td { border-bottom:none; }
    .bsd-table .bsd-name { color:#e2e8f0;font-weight:500; }
    .bsd-table .bsd-proj { color:#64748b;font-size:11px; }
    .bsd-table .bsd-hours { text-align:right;color:#94a3b8;white-space:nowrap; }
    .bsd-table .bsd-date { color:#64748b;white-space:nowrap; }
    .bsd-badge-matched { color:#22c55e;font-size:10px;font-weight:600; }
    .bsd-badge-unmatched { color:#ef4444;font-size:10px;font-weight:600; }
    .bsd-overdue-flag { color:#ef4444;font-size:10px;font-weight:600;margin-left:4px; }

    /* ── Accountability tab ── */
    .acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 4px; }
    @media (max-width: 900px) { .acct-grid { grid-template-columns: 1fr; } }
    .acct-card { background: #111; border: 1px solid #222; border-radius: 8px; padding: 16px 18px; }
    .acct-card-title { font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 0.7px; color: #64748b; margin-bottom: 14px; }
    .acct-flag-row { display: flex; align-items: center; justify-content: space-between;
      padding: 7px 0; border-bottom: 1px solid #1a1a1a; }
    .acct-flag-row:last-child { border-bottom: none; }
    .acct-flag-name { font-size: 13px; color: #e2e8f0; }
    .acct-flag-desc { font-size: 11px; color: #64748b; margin-top: 1px; }
    .acct-toggle { position: relative; display: inline-block; width: 38px; height: 20px; flex-shrink: 0; }
    .acct-toggle input { opacity: 0; width: 0; height: 0; }
    .acct-toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #2d2d2d;
      border-radius: 20px; transition: background 0.2s; }
    .acct-toggle-slider:before { content: ''; position: absolute; width: 14px; height: 14px;
      left: 3px; top: 3px; background: #555; border-radius: 50%; transition: transform 0.2s, background 0.2s; }
    .acct-toggle input:checked + .acct-toggle-slider { background: #1e3a5f; }
    .acct-toggle input:checked + .acct-toggle-slider:before { transform: translateX(18px); background: #3b82f6; }
    .acct-toggle input:disabled + .acct-toggle-slider { opacity: 0.4; cursor: not-allowed; }
    .acct-step-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .acct-step-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
      color: #64748b; padding: 0 6px 8px; text-align: left; }
    .acct-step-table td { padding: 5px 6px; border-bottom: 1px solid #1a1a1a; vertical-align: top; }
    .acct-step-table tr:last-child td { border-bottom: none; }
    .acct-step-table .step-done { color: #22c55e; }
    .acct-step-table .step-todo { color: #64748b; }
    .acct-phase-header td { background: #0d0d0d; color: #475569; font-size: 10px;
      text-transform: uppercase; letter-spacing: 0.6px; padding: 8px 6px 4px; }
    .acct-prereq { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0;
      border-bottom: 1px solid #1a1a1a; font-size: 12px; }
    .acct-prereq:last-child { border-bottom: none; }
    .acct-prereq-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
    .acct-prereq-dot.done { background: #22c55e; }
    .acct-prereq-dot.todo { background: #374151; border: 1px solid #4b5563; }

    /* === Mantra tab === */
    .mantra-item { background:#161616;border:1px solid #262626;border-radius:10px;padding:16px 18px;margin-bottom:12px;display:flex;gap:16px;align-items:flex-start; }
    .mantra-item.category-foundation { border-left:3px solid #3b82f6; }
    .mantra-item.category-harvest { border-left:3px solid #10b981; }
    .mantra-item.category-growth { border-left:3px solid #f59e0b; }
    .mantra-item.completed { opacity:0.65; }
    .mantra-rank { font-size:22px;font-weight:700;color:#444;width:32px;flex-shrink:0;text-align:center;line-height:1; }
    .mantra-body { flex:1;min-width:0; }
    .mantra-title { font-size:14px;font-weight:600;color:#e8e8e8;margin-bottom:4px;line-height:1.4; }
    .mantra-desc { font-size:12.5px;color:#a3a3a3;line-height:1.55;margin-bottom:10px; }
    .mantra-chips { display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px;font-size:10.5px; }
    .mantra-chip { background:#222;color:#bbb;padding:3px 8px;border-radius:4px;border:1px solid #2d2d2d;text-transform:uppercase;letter-spacing:0.4px;font-weight:500; }
    .mantra-chip.impact { background:#1e3a5f;color:#93c5fd;border-color:#2a4a73; }
    .mantra-chip.effort { background:#3a2a1e;color:#fbbf24;border-color:#4a3a2a; }
    .mantra-chip.confidence-high { background:#0f3a26;color:#6ee7b7;border-color:#15532f; }
    .mantra-chip.confidence-medium { background:#3a2f0f;color:#fbbf24;border-color:#4a3f1a; }
    .mantra-chip.confidence-low { background:#3a1a1a;color:#fca5a5;border-color:#4a2222; }
    .mantra-chip.ai-action { background:#2a1f3a;color:#c4b5fd;border-color:#3a2a4a;cursor:pointer; }
    .mantra-chip.ai-action:hover { background:#3a2a4a; }
    .mantra-chip.efficacy { background:#0f3a26;color:#6ee7b7; }
    .mantra-chip.efficacy.low { background:#3a1a1a;color:#fca5a5; }
    .mantra-actions { display:flex;flex-wrap:wrap;gap:6px;margin-top:8px; }
    .mantra-btn { font-size:11px;padding:5px 10px;background:#222;border:1px solid #333;color:#bbb;border-radius:5px;cursor:pointer;transition:background 0.15s; }
    .mantra-btn:hover { background:#2d2d2d;color:#e8e8e8; }
    .mantra-btn.primary { background:#1e3a5f;color:#93c5fd;border-color:#2a4a73; }
    .mantra-btn.primary:hover { background:#2a4a73;color:#dbeafe; }
    .mantra-btn.danger:hover { background:#3a1a1a;color:#fca5a5;border-color:#4a2222; }
    .mantra-evidence { margin-top:10px;padding:10px 12px;background:#0e0e0e;border-radius:6px;font-size:11px;color:#888;display:none; }
    .mantra-evidence.open { display:block; }
    .mantra-evidence-item { padding:4px 0;border-bottom:1px solid #1a1a1a; }
    .mantra-evidence-item:last-child { border-bottom:none; }
    .mantra-evidence-item code { color:#a3a3a3;font-size:10px; }
    .mantra-toggle-ev { font-size:11px;color:#666;cursor:pointer;margin-top:6px;display:inline-block; }
    .mantra-toggle-ev:hover { color:#999; }
    .mantra-dur-btn { background:#222;border:1px solid #333;color:#bbb;padding:8px 12px;border-radius:6px;cursor:pointer;font-size:12px;flex:1; }
    .mantra-dur-btn.active { background:#3b82f6;color:white;border-color:#3b82f6; }
    .mantra-status-snoozed { background:#3a2f0f;color:#fbbf24;padding:2px 8px;border-radius:4px;font-size:10px;text-transform:uppercase;letter-spacing:0.5px; }
    .mantra-completion-meta { margin-top:8px;padding-top:8px;border-top:1px solid #222;font-size:11px;color:#666; }
    .mantra-chip.difficulty-1 { background:#0f3a26;color:#6ee7b7; }
    .mantra-chip.difficulty-2 { background:#0f3a26;color:#6ee7b7; }
    .mantra-chip.difficulty-3 { background:#3a2f0f;color:#fbbf24; }
    .mantra-chip.difficulty-4 { background:#3a2a1e;color:#fbbf24; }
    .mantra-chip.difficulty-5 { background:#3a1a1a;color:#fca5a5; }
    .mantra-chip.time { background:#1f2a3a;color:#93c5fd;border-color:#2a3a4a; }
    .mantra-chip.enriched { background:#1a3a2a;color:#6ee7b7;border-color:#2a4a3a; }
    .mantra-chip.verified { background:#0e2a1a;color:#6ee7b7; }
    .mantra-enrichment-panel { margin-top:10px;padding:12px 14px;background:#0e1a14;border:1px solid #1a3a2a;border-left:3px solid #10b981;border-radius:6px;font-size:12px; }
    .mantra-enrichment-panel h4 { margin:0 0 6px 0;font-size:11px;text-transform:uppercase;letter-spacing:0.6px;color:#6ee7b7;font-weight:600; }
    .mantra-diff-block { background:#0a0a0a;border-radius:4px;padding:8px 10px;margin:6px 0;font-family:ui-monospace,Menlo,monospace;font-size:11.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word; }
    .mantra-diff-block.before { color:#a0a0a0;border-left:2px solid #555; }
    .mantra-diff-block.after { color:#dcfce7;border-left:2px solid #10b981; }
    .mantra-rationale { color:#a3a3a3;font-size:11.5px;line-height:1.55;margin-top:6px; }
    .mantra-alternates { margin-top:8px;padding-top:8px;border-top:1px solid #1a2a1a; }
    .mantra-alternate { padding:4px 0;color:#888;font-size:11px; }
    .mantra-alternate code { color:#bbb;font-size:11px; }

    /* === Mobile fixes — Listen page (and general touch-target polish) === */
    @media (max-width: 768px) {
      /* Stack the Listen page's two columns instead of fighting a 450px fixed rail */
      #tab-listener > div {
        flex-direction: column !important;
        height: auto !important;
        min-height: 0 !important;
        gap: 12px !important;
      }
      #radio-right-rail {
        width: 100% !important;
        flex-shrink: 1 !important;
        height: auto !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
      }
      #radio-cards-col {
        height: auto !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
      }
      /* Band-pill row: 5 buttons across is too tight on phones; use 3-col grid */
      .listener-band-pills {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
      }
      .listener-chip-btn {
        min-width: 0 !important;
        padding: 12px 8px !important;
        font-size: 15px !important;
        min-height: 48px !important;
      }
      /* Album art responsive — cap height so a phone doesn't get a full-screen square */
      .nh-rail-art {
        aspect-ratio: auto !important;
        max-height: 280px !important;
      }
      #radio-right-rail img,
      .nh-rail-card img,
      .nh-station-card img {
        max-width: 100% !important;
        max-height: 280px !important;
        height: auto !important;
        object-fit: cover !important;
      }
      /* Tighter padding inside rail cards on phone */
      .nh-rail-body    { padding: 14px 16px 16px !important; }
      .nh-rail-summary { padding: 14px 16px !important; }
      .nh-station-card { padding: 14px 16px !important; }
      /* Range slider — bigger thumb area */
      #radio-right-rail input[type="range"],
      input[type="range"] {
        height: 36px !important;
      }
      /* General touch target floor for buttons */
      .refresh-btn, button.refresh-btn {
        padding: 8px 14px !important;
        min-height: 40px !important;
        font-size: 13px !important;
      }
      /* Mantra modals — full-width on phone */
      #mantra-snooze-modal > div,
      #mantra-complete-modal > div,
      #mantra-action-modal > div {
        width: 95vw !important;
        max-height: 90vh !important;
      }
      .mantra-item { flex-direction: column; }
      .mantra-rank { width: auto; text-align: left; font-size: 18px; }

      /* === Other tab: Flights table === */
      .flights-table th,
      .flights-table td {
        padding: 8px 10px !important;
        font-size: 11px !important;
      }
      .flights-table-wrap {
        /* Hint that the table can scroll horizontally */
        background-image: linear-gradient(to left, rgba(255,255,255,0.04), transparent 24px) !important;
      }
      /* Flights/Grants philosophy/tiers banner — tighter padding on mobile */
      #tab-flights > div[style*="grid-template-columns:repeat(auto-fit"],
      #tab-grants > div[style*="grid-template-columns:repeat(auto-fit"] {
        padding: 12px 14px !important;
        gap: 12px !important;
      }
      /* Grants filter row — bigger touch targets */
      #grants-filter-bar .refresh-btn {
        padding: 8px 14px !important;
        font-size: 12px !important;
        min-height: 36px !important;
      }
      /* Grant cards — title and badge cluster stack rather than fight */
      #grants-grid > div > div:first-child {
        flex-wrap: wrap !important;
      }

      /* === Trading Opportunities: card touch targets + banner === */
      .opp-card { padding: 14px; }
      .opp-symbol { font-size: 16px; }
      .opp-move   { font-size: 16px; }
      .opp-card button {
        min-height: 36px;
        font-size: 12px !important;
      }
      /* Opportunity tab philosophy/signal-types banner — tighter on phones */
      #tab-opportunities > div[style*="grid-template-columns:repeat(auto-fit"],
      #tab-anomaly > div[style*="grid-template-columns:repeat(auto-fit"] {
        padding: 12px 14px !important;
        gap: 12px !important;
      }

      /* === Trading primary-tabs: contain the scroll to the row, not the page === */
      body { overflow-x: hidden; }
      #primary-tabs {
        overflow-x: auto !important;
        overflow-y: visible !important;
        scroll-snap-type: x proximity;
        scroll-padding-left: 16px;
        scroll-behavior: smooth;
        /* Fade affordance so user can see there's more to the right */
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
                mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
      }
      #primary-tabs .tab { scroll-snap-align: start; }
    }
