﻿/* Portal analysis and status pill styles */
    .analysis-stats {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }
    .analysis-stat {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 11px;
    }
    .analysis-stat .k {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 6px;
    }
    .analysis-stat .v {
      color: var(--ink);
      font-size: 20px;
      font-weight: 700;
    }
    .analysis-stat .sub {
      color: var(--muted);
      font-size: 11px;
      margin-top: 6px;
    }
    .analysis-filters {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }
    .analysis-filter {
      width: auto;
      padding: 8px 12px;
      border-radius: 999px;
      background: var(--surface);
      color: var(--text);
      border: 1px solid var(--line);
      font-size: 12px;
      font-weight: 700;
      margin-top: 0;
    }
    .analysis-filter.active {
      background: rgba(28,143,132,0.14);
      border-color: rgba(28,143,132,0.3);
      color: #c8fff6;
    }
    .analysis-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
      gap: 14px;
      align-items: start;
    }
    .analysis-table-wrap {
      border: 1px solid var(--line);
      border-radius: 14px;
      overflow: hidden;
      background: var(--surface);
    }
    .analysis-table {
      width: 100%;
      border-collapse: collapse;
    }
    .analysis-table tbody tr {
      cursor: pointer;
      transition: background 0.15s ease;
    }
    .analysis-table tbody tr:hover td {
      background: rgba(255,255,255,0.02);
    }
    .analysis-table tbody tr.active td {
      background: rgba(28,143,132,0.12);
    }
    .analysis-account-link {
      background: transparent;
      border: 0;
      color: inherit;
      text-align: left;
      padding: 0;
      margin: 0;
      display: inline-block;
      cursor: pointer;
      font: inherit;
    }
    .analysis-account-link:hover strong {
      text-decoration: underline;
      text-decoration-color: rgba(143, 216, 200, 0.55);
      text-underline-offset: 2px;
    }
    .analysis-detail {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--surface);
      padding: 14px;
      position: sticky;
      top: 14px;
    }
    .analysis-detail h4 {
      margin: 0 0 6px;
      color: var(--ink);
      font-size: 20px;
    }
    .analysis-detail-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 12px;
      margin-bottom: 12px;
    }
    .analysis-detail-card {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: var(--panel);
      padding: 10px;
    }
    .analysis-detail-card .k {
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 6px;
    }
    .analysis-detail-card .v {
      color: var(--ink);
      font-size: 16px;
      font-weight: 700;
    }
    .analysis-meta-list {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }
    .analysis-meta-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      border-bottom: 1px solid var(--line);
      padding-bottom: 8px;
    }
    .analysis-meta-row:last-child {
      border-bottom: 0;
      padding-bottom: 0;
    }
    .analysis-meta-row .k {
      color: var(--muted);
      font-size: 12px;
    }
    .analysis-meta-row .v {
      color: var(--text);
      font-size: 13px;
      text-align: right;
    }
    .value-good { color: var(--good) !important; }
    .value-bad { color: var(--bad) !important; }
    .value-warn { color: var(--warn) !important; }
    .health-pill-live,
    .health-pill-connected,
    .health-pill-connecting,
    .health-pill-delayed,
    .health-pill-offline,
    .health-pill-needs-approval {
      display: inline-block;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      border: 1px solid transparent;
    }
    .health-pill-live {
      color: var(--good);
      background: rgba(17,122,101,0.08);
      border-color: rgba(17,122,101,0.2);
    }
    .health-pill-connected {
      color: #5dade2;
      background: rgba(52, 152, 219, 0.10);
      border-color: rgba(52, 152, 219, 0.24);
    }
    .health-pill-connecting {
      color: #7fb3d5;
      background: rgba(127, 179, 213, 0.10);
      border-color: rgba(127, 179, 213, 0.24);
    }
    .health-pill-delayed {
      color: var(--warn);
      background: rgba(185,119,14,0.08);
      border-color: rgba(185,119,14,0.2);
    }
    .health-pill-offline,
    .health-pill-needs-approval {
      color: var(--bad);
      background: rgba(176,58,46,0.08);
      border-color: rgba(176,58,46,0.2);
    }
    .trading-pill-on,
    .trading-pill-off,
    .trading-pill-unknown {
      display: inline-block;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 700;
      border: 1px solid transparent;
      white-space: nowrap;
    }
    .trading-pill-on {
      color: var(--good);
      background: rgba(17,122,101,0.08);
      border-color: rgba(17,122,101,0.2);
    }
    .trading-pill-off {
      color: var(--warn);
      background: rgba(185,119,14,0.08);
      border-color: rgba(185,119,14,0.2);
    }
    .trading-pill-unknown {
      color: var(--muted);
      background: rgba(255,255,255,0.05);
      border-color: rgba(255,255,255,0.08);
    }

/* Light theme overrides */
    body.light-theme .analysis-filter.active {
      color: #0d3b66;
      background: rgba(13,59,102,0.08);
      border-color: rgba(13,59,102,0.18);
    }

@media (max-width: 860px) {
      .analysis-stats { grid-template-columns: 1fr 1fr; }
      .analysis-layout { grid-template-columns: 1fr; }
      .analysis-detail {
        position: static;
      }
}
