/* =============================================================================
   🧠 FRISTON · Active Inference Lab panel CSS
   ============================================================================= */

.panel-friston {
    background:
        radial-gradient(ellipse at top right, rgba(176,149,245,0.10), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(136,216,176,0.05), transparent 60%),
        linear-gradient(180deg, rgba(28,20,55,0.94), rgba(10,8,24,0.97));
    border: 1px solid rgba(176,149,245,0.30);
    border-radius: 14px;
    padding: 22px 26px;
    margin-top: 18px;
    box-shadow:
        0 10px 32px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(176,149,245,0.12);
}

/* ── HEADLINE ROW ───────────────────────────────────────────────────────── */

.fr-headline-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 12px 0 16px;
}

.fr-headline-card {
    background: linear-gradient(180deg, rgba(176,149,245,0.06), rgba(10,8,24,0.50));
    border: 1px solid rgba(176,149,245,0.20);
    border-radius: 10px;
    padding: 12px 14px;
}

.fr-optimal-card {
    border-color: rgba(255,216,107,0.45);
    background: linear-gradient(180deg, rgba(255,216,107,0.10), rgba(10,8,24,0.55));
    box-shadow: 0 0 18px rgba(255,216,107,0.15);
}

.fr-headline-label {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 10.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #b095f5;
    margin-bottom: 4px;
}

.fr-optimal-card .fr-headline-label {
    color: #ffd86b;
}

.fr-headline-value {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 22px;
    font-weight: 600;
    color: #b095f5;
    line-height: 1.2;
    letter-spacing: 0.8px;
}

.fr-optimal-card .fr-headline-value {
    color: #ffd86b;
    font-size: 24px;
    letter-spacing: 1.5px;
    text-shadow: 0 0 12px rgba(255,216,107,0.40);
}

.fr-headline-sub {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    color: #888aa0;
    font-style: italic;
    margin-top: 4px;
}

/* ── BELIEF + POLICIES ROW ─────────────────────────────────────────────── */

.fr-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.fr-belief-card,
.fr-policies-card {
    background: rgba(10,8,24,0.55);
    border: 1px solid rgba(212,175,55,0.14);
    border-radius: 10px;
    padding: 14px 16px;
}

.fr-card-title {
    font-family: "Times New Roman", Georgia, serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888aa0;
    font-style: italic;
    margin-bottom: 10px;
}

/* Belief list */
.fr-belief-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fr-belief-item {
    --fr-mood-hue: #b095f5;

    display: grid;
    grid-template-columns: 80px 1fr 50px;
    align-items: center;
    gap: 8px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
}

.fr-belief-name {
    color: var(--fr-mood-hue);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fr-belief-bar {
    position: relative;
    height: 9px;
    background: rgba(255,255,255,0.04);
    border-radius: 4.5px;
    overflow: hidden;
}

.fr-belief-bar-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: linear-gradient(90deg,
                color-mix(in srgb, var(--fr-mood-hue) 50%, transparent),
                var(--fr-mood-hue));
    border-radius: 4.5px;
    box-shadow: 0 0 4px var(--fr-mood-hue);
    transition: width 0.7s cubic-bezier(0.25, 1.1, 0.4, 1);
}

.fr-belief-pct {
    text-align: right;
    color: #ddc88a;
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    font-weight: 600;
}

/* Policy table */
.fr-policy-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
}

.fr-policy-table thead th {
    color: #888aa0;
    font-style: italic;
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-align: left;
    padding: 4px 8px 8px 0;
    font-weight: normal;
    border-bottom: 1px dashed rgba(212,175,55,0.18);
}

.fr-th-num { text-align: right; }

.fr-policy-table tbody tr {
    border-bottom: 1px dashed rgba(212,175,55,0.07);
}
.fr-policy-table tbody tr:last-child { border-bottom: none; }

.fr-policy-row {
    --fr-row-hue: #888aa0;
    transition: background 0.18s ease;
}

.fr-policy-row.fr-optimal-row {
    --fr-row-hue: #ffd86b;
    background: linear-gradient(90deg, rgba(255,216,107,0.05), transparent 80%);
}

.fr-policy-table td {
    padding: 6px 8px 6px 0;
    color: #ddc88a;
}

.fr-policy-action {
    color: var(--fr-row-hue);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fr-policy-row.fr-optimal-row .fr-policy-action::before {
    content: "★ ";
    color: #ffd86b;
}

.fr-policy-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
}

.fr-policy-efe {
    color: var(--fr-row-hue);
    font-weight: 600;
}

.fr-policy-epist  { color: #88d8b0; }
.fr-policy-pragm  { color: #b095f5; }
.fr-policy-soft   { color: #ddc88a; }

/* ── INTERPRETATION ────────────────────────────────────────────────────── */

.fr-interp {
    background: linear-gradient(90deg, rgba(176,149,245,0.08), transparent 80%);
    border-left: 2px solid rgba(176,149,245,0.50);
    border-radius: 0 6px 6px 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 ────────────────────────────────────────────────────────────── */

.fr-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212,175,55,0.14);
}

.fr-refresh-btn {
    background: rgba(176,149,245,0.10);
    color: #b095f5;
    border: 1px solid rgba(176,149,245,0.30);
    border-radius: 999px;
    padding: 5px 14px;
    font-family: "Times New Roman", Georgia, serif;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.fr-refresh-btn:hover:not(:disabled) {
    background: rgba(176,149,245,0.20);
    transform: translateY(-1px);
}
.fr-refresh-btn:disabled { opacity: 0.55; cursor: progress; }

.fr-foot-note {
    font-family: "Times New Roman", Georgia, serif;
    font-style: italic;
    font-size: 11px;
    color: #888aa0;
}

@media (max-width: 900px) {
    .fr-headline-row { grid-template-columns: 1fr; }
    .fr-row { grid-template-columns: 1fr; }
    .fr-policy-table { font-size: 11px; }
}
