/* =============================================================================
   📊 CONFIDENCE GAUGE — unified math trust meter CSS.
   Half-circle gauge + component breakdown bars.
   ============================================================================= */

.panel-confidence-gauge {
    background:
        radial-gradient(ellipse at top right, rgba(255,216,107,0.10), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(176,149,245,0.06), transparent 60%),
        linear-gradient(180deg, rgba(28,20,55,0.94), rgba(10,8,24,0.97));
    border: 1px solid rgba(255,216,107,0.25);
    border-radius: 16px;
    padding: 22px 26px;
    margin-top: 18px;
    box-shadow:
        0 12px 36px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,216,107,0.10);
}

.cg-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-top: 14px;
    margin-bottom: 16px;
    align-items: center;
}

/* ── GAUGE (SVG half-circle) ───────────────────────────────────────────── */

.cg-gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cg-gauge-svg {
    width: 100%;
    max-width: 260px;
    height: auto;
    display: block;
}

.cg-gauge-bg {
    transition: stroke 0.3s ease;
}

.cg-gauge-fg {
    /* The dasharray animates the arc fill */
    transition: stroke-dasharray 0.7s cubic-bezier(0.25, 1.1, 0.4, 1),
                stroke 0.4s ease;
    filter: drop-shadow(0 0 6px currentColor);
}

.cg-gauge-score {
    font-family: "Times New Roman", Georgia, serif;
    font-weight: 600;
    font-size: 36px;
    fill: #ffd86b;
    transition: fill 0.4s ease;
}

.cg-gauge-out-of {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    font-style: italic;
    fill: #888aa0;
    letter-spacing: 1.5px;
}

.cg-gauge-ticks line {
    stroke: rgba(212,175,55,0.30);
    stroke-width: 1.5;
}

.cg-level-strip {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    color: #b095f5;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.cg-level-label {
    font-style: italic;
}

.cg-level-value {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffd86b;
    transition: color 0.4s ease;
}

/* ── BREAKDOWN ─────────────────────────────────────────────────────────── */

.cg-breakdown {
    background: rgba(10,8,24,0.50);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 10px;
    padding: 14px 16px;
}

.cg-breakdown-title {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888aa0;
    margin-bottom: 10px;
    font-style: italic;
}

.cg-component-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cg-component-item {
    /* per-component --comp-hue set by JS */
    --comp-hue: #ffd86b;

    display: grid;
    grid-template-columns: 160px 1fr 60px;
    align-items: center;
    gap: 10px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11.5px;
    cursor: help;
    transition: transform 0.15s ease;
}

.cg-component-item:hover {
    transform: translateX(2px);
}

.cg-component-label {
    color: #ddc88a;
    font-style: italic;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg-component-bar {
    position: relative;
    height: 8px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px;
    overflow: hidden;
}

.cg-component-bar-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: linear-gradient(90deg,
                color-mix(in srgb, var(--comp-hue) 50%, transparent),
                var(--comp-hue));
    border-radius: 4px;
    box-shadow: 0 0 6px color-mix(in srgb, var(--comp-hue) 70%, transparent);
    transition: width 0.7s cubic-bezier(0.25, 1.1, 0.4, 1);
}

.cg-component-pts {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--comp-hue);
    font-weight: 600;
    font-size: 11.5px;
}

/* ── INTERPRETATION ────────────────────────────────────────────────────── */

.cg-interp {
    background: linear-gradient(90deg, rgba(255,216,107,0.06), transparent 80%);
    border-left: 3px solid rgba(255,216,107,0.50);
    border-radius: 0 8px 8px 0;
    padding: 10px 16px;
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 13px;
    color: #ddc88a;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* ── FOOTER ────────────────────────────────────────────────────────────── */

.cg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212,175,55,0.16);
}

.cg-refresh-btn {
    background: rgba(255,216,107,0.10);
    color: #ffd86b;
    border: 1px solid rgba(255,216,107,0.30);
    border-radius: 999px;
    padding: 5px 14px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, transform 0.15s;
}

.cg-refresh-btn:hover:not(:disabled) {
    background: rgba(255,216,107,0.20);
    transform: translateY(-1px);
}

.cg-refresh-btn:disabled { opacity: 0.55; cursor: progress; }

.cg-foot-note {
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 11px;
    color: #888aa0;
}

/* ── RESPONSIVE ────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .cg-row { grid-template-columns: 1fr; }
    .cg-gauge-wrap { max-width: 280px; margin: 0 auto; }
    .cg-component-item { grid-template-columns: 130px 1fr 50px; font-size: 11px; }
}
