/* ═══════════════════════════════════════════════════════════════
   InspectorTokens.css — Shared visual atoms for tool inspectors
   ═══════════════════════════════════════════════════════════════
   Canonical design language extracted from:
     • PlatformHamiltonian popover (inline styles → classes)
     • ContextVisualizerTool inspector panels
     • Graph Inspector field layout

   All tools should use these classes instead of inline styles.
   Token namespace: .tool-*
   ═══════════════════════════════════════════════════════════════ */


/* ── Section Header ──────────────────────────────────────────
   The canonical section divider. UPPERCASE, 10px, 800 weight.
   Matches Hamiltonian section headers exactly.
   Usage: <div class="tool-section-title">KINETIC ENERGY (T)</div>
   ──────────────────────────────────────────────────────────── */

.tool-section-title {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    margin-bottom: 2px;
}

.tool-section-title .tool-section-score {
    margin-left: auto;
    font-family: var(--font-mono, monospace);
    font-size: 9px;
    opacity: 0.6;
    letter-spacing: 0;
    text-transform: none;
}


/* ── Section Description ─────────────────────────────────────
   Muted explainer text below a section title.
   ──────────────────────────────────────────────────────────── */

.tool-section-desc {
    font-size: 9px;
    opacity: 0.25;
    line-height: 1.4;
    padding: 0 12px;
    margin-bottom: 4px;
}


/* ── Tool Card ───────────────────────────────────────────────
   The canonical container panel used throughout inspectors.
   Dark inset, subtle border, rounded corners.
   ──────────────────────────────────────────────────────────── */

.tool-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 12px;
}

.tool-card.flush {
    padding: 0;
}

.tool-card.interactive {
    cursor: pointer;
    transition: background 0.15s;
}

.tool-card.interactive:hover {
    background: rgba(0, 0, 0, 0.22);
}


/* ── Hero Value ──────────────────────────────────────────────
   Large centered score display (e.g. H = 82, Score = 95).
   ──────────────────────────────────────────────────────────── */

.tool-hero {
    text-align: center;
    padding: 10px 12px;
    margin: 0 12px 4px;
}

.tool-hero-equation {
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    opacity: 0.3;
    margin-bottom: 6px;
}

.tool-hero-value {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    font-family: var(--font-mono, monospace);
}

.tool-hero-unit {
    font-size: 12px;
    opacity: 0.15;
    font-weight: 700;
    margin-left: 3px;
}

.tool-hero-caption {
    font-size: 9px;
    opacity: 0.3;
    margin-top: 6px;
    line-height: 1.4;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}


/* ── Stat Bar ────────────────────────────────────────────────
   Horizontal row of stat cells (AVG, SPREAD, ERRORS, etc.)
   ──────────────────────────────────────────────────────────── */

.tool-stat-bar {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
}

.tool-stat-cell {
    flex: 1;
    text-align: center;
}

.tool-stat-label {
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.4;
}

.tool-stat-value {
    font-size: 15px;
    font-weight: 900;
    font-family: var(--font-mono, monospace);
}


/* ── Energy Terms / KPI Grid ─────────────────────────────────
   3-column (or N-column) grid of mini-stat boxes with colored
   accent borders; used for T/V/S in Hamiltonian, KPIs elsewhere.
   ──────────────────────────────────────────────────────────── */

.tool-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 4px 12px;
    margin-bottom: 2px;
}

.tool-kpi-cell {
    text-align: center;
    padding: 8px 6px;
    border-radius: 6px;
    cursor: default;
}

.tool-kpi-label {
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 2px;
}

.tool-kpi-value {
    font-size: 20px;
    font-weight: 900;
    font-family: var(--font-mono, monospace);
}


/* ── Data Row ────────────────────────────────────────────────
   Grid row for observable/metric lists. 4-column:
   label | progress bar | detail | percentage.
   ──────────────────────────────────────────────────────────── */

.tool-data-row {
    display: grid;
    grid-template-columns: 110px 1fr 36px 36px;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    font-size: 10px;
    cursor: default;
    border-radius: 4px;
    transition: background 0.15s;
}

.tool-data-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tool-data-label {
    opacity: 0.55;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tool-data-bar-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.tool-data-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-data-detail {
    text-align: right;
    font-family: var(--font-mono, monospace);
    font-size: 8px;
    opacity: 0.3;
}

.tool-data-pct {
    text-align: right;
    font-family: var(--font-mono, monospace);
    font-size: 8px;
    font-weight: 700;
}


/* ── Status Dot ──────────────────────────────────────────────
   Small circular indicator (pass/warn/error/neutral).
   ──────────────────────────────────────────────────────────── */

.tool-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tool-dot.pass {
    background: #34d399;
}

.tool-dot.warn {
    background: #fbbf24;
}

.tool-dot.error {
    background: #fb7185;
}

.tool-dot.info {
    background: #60a5fa;
}

.tool-dot.neutral {
    background: rgba(255, 255, 255, 0.15);
}


/* ── Status Pill ─────────────────────────────────────────────
   Tiny pill badge for labels (e.g. "3 errors", "ON TRACK").
   ──────────────────────────────────────────────────────────── */

.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 700;
}

.tool-pill.pass {
    background: rgba(52, 211, 153, 0.08);
    color: #34d399;
}

.tool-pill.warn {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.tool-pill.error {
    background: rgba(251, 113, 133, 0.12);
    color: #fb7185;
}

.tool-pill.info {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

.tool-pill.live {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border-radius: 99px;
}


/* ── Tab Bar ─────────────────────────────────────────────────
   Horizontal row of small ghost tabs (Hamiltonian lens pattern).
   ──────────────────────────────────────────────────────────── */

.tool-tab-bar {
    display: flex;
    gap: 2px;
    padding: 4px 12px 6px;
    margin-bottom: 2px;
}

.tool-tab {
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.35;
    transition: background 0.15s, opacity 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tool-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    opacity: 0.6;
}

.tool-tab.active {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
}

.tool-tab:disabled,
.tool-tab.disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}


/* ── Tool Footer ─────────────────────────────────────────────
   Bottom bar with timestamp metadata and ghost action buttons.
   ──────────────────────────────────────────────────────────── */

.tool-footer {
    margin-top: 8px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tool-footer-meta {
    font-size: 8px;
    opacity: 0.12;
    font-family: var(--font-mono, monospace);
}

.tool-footer-actions {
    display: flex;
    gap: 4px;
}


/* ── Explainer ───────────────────────────────────────────────
   Introductory description text below the header area.
   ──────────────────────────────────────────────────────────── */

.tool-explainer {
    padding: 0 12px 8px;
    font-size: 10px;
    line-height: 1.5;
    opacity: 0.3;
}


/* ── Header Row ──────────────────────────────────────────────
   Top bar with title + version badge. Matches Hamiltonian header.
   ──────────────────────────────────────────────────────────── */

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 2px;
}

.tool-header-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-header-version {
    font-size: 8px;
    opacity: 0.15;
    font-family: var(--font-mono, monospace);
}


/* ── Inspector Field ─────────────────────────────────────────
   Key-value pair row used in right-side inspectors.
   Canonical from CViz inspector.
   ──────────────────────────────────────────────────────────── */

.tool-field {
    padding: 8px;
}

.tool-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.tool-field-icon {
    opacity: 0.4;
    flex-shrink: 0;
}

.tool-field-label {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    flex-shrink: 0;
}

.tool-field-value {
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    text-align: right;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-field-value.empty {
    opacity: 0.3;
    font-style: italic;
}


/* ── Divider ─────────────────────────────────────────────────
   Thin horizontal separator.
   ──────────────────────────────────────────────────────────── */

.tool-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 0;
}


/* ── Form Input (canonical) ──────────────────────────────────
   Text inputs, textareas inside tool panels.
   Uses glass tokens instead of hardcoded colors.
   ──────────────────────────────────────────────────────────── */

.tool-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--lb-glass-tint, rgba(10, 15, 28, 0.55));
    border: 1px solid var(--lb-glass-border, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    color: var(--lb-on-surface, #e2e8f0);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.tool-input:focus {
    border-color: var(--lb-primary, #60a5fa);
}

.tool-input.mono {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 11px;
}

textarea.tool-input {
    resize: vertical;
}


/* ── Form Label ──────────────────────────────────────────────
   Small uppercase label above form fields.
   ──────────────────────────────────────────────────────────── */

.tool-label {
    font-size: 10px;
    opacity: 0.4;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}


/* ── Check Row ───────────────────────────────────────────────
   Pass/fail checklist item (icon + label + detail).
   ──────────────────────────────────────────────────────────── */

.tool-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 11px;
}

.tool-check-row.pass .tool-check-icon {
    color: #34d399;
}

.tool-check-row.fail .tool-check-icon {
    color: #fb7185;
}

.tool-check-label {
    font-weight: 600;
    flex: 1;
}

.tool-check-detail {
    font-size: 10px;
    opacity: 0.4;
    max-width: 200px;
    text-align: right;
}


/* ── Issue Row ───────────────────────────────────────────────
   Error/warning line item.
   ──────────────────────────────────────────────────────────── */

.tool-issue {
    font-size: 11px;
    padding: 3px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.tool-issue.error {
    color: #fb7185;
}

.tool-issue.warn {
    color: #fbbf24;
}


/* ── Weight Dots ─────────────────────────────────────────────
   Small visual weight indicator (from Hamiltonian rows).
   ──────────────────────────────────────────────────────────── */

.tool-weight {
    opacity: 0.2;
    font-size: 7px;
    letter-spacing: -1px;
}