/* AgentRow — compact list row + expandable drawer */
.agent-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.agent-row:hover { border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.03); }
.agent-row[open] { border-color: rgba(59, 130, 246, 0.35); background: rgba(255, 255, 255, 0.035); }

/* Compact head row */
.agent-row__head {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) 90px 90px 70px 110px 130px 20px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    min-height: 58px;
    user-select: none;
}
.agent-row__head::-webkit-details-marker { display: none; }

.agent-row__identity { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agent-row__name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text-primary, #f3f4f6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-row__ticker {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.68rem;
    color: var(--color-text-muted, #9ca3af);
    letter-spacing: 0.03em;
}

.agent-row__metric { display: flex; flex-direction: column; gap: 1px; }
.agent-row__metric-value {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--color-text-primary, #f3f4f6);
}
.agent-row__metric-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted, #9ca3af);
}

.agent-row__quality { display: flex; align-items: center; }

.agent-row__signal-wrap { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.agent-row__score {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; padding: 3px 6px;
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem; font-weight: 700;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.agent-row__score--positive { color: #22c55e; border-color: rgba(34, 197, 94, 0.35); }
.agent-row__score--neutral { color: #94a3b8; }
.agent-row__score--negative { color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.agent-row__score--muted { color: #6b7280; }

.agent-row__signal {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.agent-row__chevron {
    font-size: 0.9rem;
    color: var(--color-text-muted, #9ca3af);
    transition: transform 0.2s ease;
}
.agent-row[open] .agent-row__chevron { transform: rotate(180deg); }

/* Drawer */
.agent-row__drawer {
    padding: 0 14px 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    margin-top: 2px;
}
.agent-row__desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary, #d1d5db);
    margin: 10px 0;
    line-height: 1.5;
}

.agent-row__stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 16px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}
.agent-row__stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agent-row__stat-label {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted, #9ca3af);
}
.agent-row__stat-value {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary, #f3f4f6);
}
.agent-row__stat-sub {
    font-size: 0.66rem;
    color: var(--color-text-muted, #9ca3af);
}

.agent-row__delta--positive { color: #22c55e; }
.agent-row__delta--negative { color: #ef4444; }
.agent-row__delta--muted { color: #9ca3af; }

.agent-row__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0;
}
.agent-row__block {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}
.agent-row__block-title {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted, #9ca3af);
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px;
}
.agent-row__count {
    font-size: 0.55rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted, #9ca3af);
    padding: 1px 5px;
    border-radius: 3px;
}
.agent-row__block-body { font-size: 0.78rem; color: var(--color-text-secondary, #d1d5db); }

.agent-row__catalysts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.agent-row__catalyst { display: flex; gap: 8px; padding: 4px 0; font-size: 0.74rem; line-height: 1.4; }
.agent-row__catalyst--upcoming { color: #fbbf24; }
.agent-row__catalyst-type {
    flex-shrink: 0;
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #9ca3af);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    height: fit-content;
    margin-top: 1px;
}
.agent-row__catalyst a { color: var(--color-text-primary, #f3f4f6); }
.agent-row__catalyst a:hover { color: #60a5fa; }

.agent-row__metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-row__braid-metric {
    display: inline-flex; flex-direction: column; gap: 1px;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 5px;
}
.agent-row__braid-metric-value {
    font-family: var(--font-mono, monospace);
    font-weight: 600; font-size: 0.78rem;
    color: #93c5fd;
}
.agent-row__braid-metric-type {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #9ca3af);
}

.agent-row__fee-summary {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
    font-size: 0.8rem; color: var(--color-text-secondary, #d1d5db);
    margin-bottom: 6px;
}
.agent-row__fee-summary strong { color: #fbbf24; font-family: var(--font-mono, monospace); }

.agent-row__spark {
    display: inline-flex; align-items: flex-end; gap: 2px;
    height: 24px; padding: 2px 4px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    margin: 4px 0;
}
.agent-row__spark-bar {
    display: inline-block;
    width: 4px; background: #fbbf24; border-radius: 1px;
    opacity: 0.85;
}

.agent-row__dev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.agent-row__dev-risk { font-family: var(--font-mono, monospace); font-size: 0.6rem; }
.agent-row__dev-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.agent-row__dev-flag {
    font-size: 0.62rem;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 3px;
}

.agent-row__divergences {
    display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0;
}
.agent-row__divergence {
    font-size: 0.62rem;
    padding: 2px 7px;
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.22);
    border-radius: 999px;
}

.agent-row__links {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
}
.agent-row__links a { color: #60a5fa; text-decoration: none; }
.agent-row__links a:hover { text-decoration: underline; }
.agent-row__smartflow {
    display: flex;
    align-items: center;
    /* Sits between quality badge + signal score in the row head. */
}

@media (max-width: 720px) {
    .agent-row__smartflow { display: none; }
}

.agent-row__block--onchain {
    margin-top: 12px;
    grid-column: 1 / -1; /* full-width inside the drawer's existing grid */
}

.agent-row__onchain-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
}

@media (max-width: 720px) {
    .agent-row__onchain-grid { grid-template-columns: 1fr; }
}

.agent-row__launched {
    font-size: 0.66rem;
    color: var(--color-text-muted, #9ca3af);
    margin-top: 6px;
}

.agent-row__empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-text-muted, #9ca3af);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Mobile: collapse head grid to 2 rows */
@media (max-width: 720px) {
    .agent-row__head {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "identity signal"
            "metrics  metrics";
        gap: 8px;
    }
    .agent-row__identity { grid-area: identity; }
    .agent-row__signal-wrap { grid-area: signal; }
    .agent-row__metric { grid-area: metrics; }
    .agent-row__metric--mcap { grid-column: 1; grid-row: 2; }
    .agent-row__metric--rev { grid-column: 2; grid-row: 2; }
    .agent-row__metric--scouts { display: none; }
    .agent-row__quality { display: none; }
    .agent-row__chevron { display: none; }

    .agent-row__stats { grid-template-columns: repeat(2, 1fr); }
    .agent-row__grid { grid-template-columns: 1fr; }
}

/* Top traders table — Tier-3 drawer block. Sourced from wallet_intel.json
   via base-l2-vm.buildAgentViewModel (a.topTraders[] up to 8). */
.agent-row__tt-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono, monospace);
    font-size: 0.74rem;
    margin-top: 4px;
}
.agent-row__tt-table thead th {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted, #9ca3af);
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.agent-row__tt-row td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary, #d1d5db);
    vertical-align: middle;
}
.agent-row__tt-row:hover td {
    background: rgba(255, 255, 255, 0.02);
}
.agent-row__tt-addr { white-space: nowrap; }
.agent-row__tt-bs,
.agent-row__tt-buy,
.agent-row__tt-pnl {
    text-align: right;
    white-space: nowrap;
}
.agent-row__tt-pnl { font-weight: 600; }
/* Phase C-1 (round 11): tones moved to shared/modules/pnl-cell.css. PnlCell
   emits `<span class="pnl-cell pnl-cell--*">` inside the `<td>` — color
   applies via the inner span. The three rules below kept as aliases
   for any fixture or external CSS that still grep the old selectors. */
.agent-row__tt-pnl--positive { color: #22c55e; }
.agent-row__tt-pnl--negative { color: #ef4444; }
.agent-row__tt-pnl--muted    { color: #94a3b8; }
.agent-row__tt-xref {
    display: inline-block;
    margin-left: 4px;
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    font-size: 0.58rem;
    padding: 1px 4px;
    border-radius: 2px;
    vertical-align: middle;
}

@media (max-width: 720px) {
    .agent-row__tt-buy { display: none; }
}

/* Empty state for the Top Traders block — never silently hide the
   section, always tell the operator why it's empty. */
.agent-row__tt-empty {
    padding: 12px 8px;
    color: var(--color-text-muted, #9ca3af);
    font-size: 0.74rem;
    font-style: italic;
    text-align: center;
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 4px;
}

/* Round-16: per-agent smart-money aggregate (VWAP entry + holdings tile). */
.agent-row__block--smartmoney { /* visual delimiter — slightly stronger */
    border-left: 2px solid rgba(34, 197, 94, 0.18);
    padding-left: 8px;
    margin-left: -10px;
}
.agent-row__sma-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 4px 0;
}
.agent-row__sma-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.agent-row__sma-label {
    font-family: var(--font-mono, monospace);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted, #9ca3af);
}
.agent-row__sma-value {
    font-family: var(--font-mono, monospace);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text-primary, #f3f4f6);
}
.agent-row__sma-sub {
    font-family: var(--font-mono, monospace);
    font-size: 0.62rem;
    color: var(--color-text-muted, #9ca3af);
}
@media (max-width: 720px) {
    .agent-row__sma-grid { grid-template-columns: repeat(2, 1fr); }
}
