/* ── Quiz Intelligence Engine UI ─────────────────────────────── */
/* Color system sourced from index.html (pqc scan):
   Background:  #080c12
   Surface-1:   rgba(15,23,42,0.45)   (detail-panel / card level)
   Surface-2:   rgba(15,23,42,0.65)   (toolbar / chart)
   Surface-3:   rgba(15,23,42,0.7)    (stat-card / intel-panel)
   Border-dim:  rgba(148,163,184,0.18–0.22)
   Border-med:  rgba(148,163,184,0.28)
   Text-bright: #f8fafc
   Text-base:   #e2e8f0
   Text-muted:  #94a3b8
   Text-faint:  #64748b
   Text-ghost:  #4f6475
   Accent-amber:#F0A500  / #f59e0b  (primary accent)
   Accent-green:#10b981  / #34d399
   Accent-red:  #ef4444
   Accent-cyan: #22d3ee
   Accent-violet:#a78bfa
*/

.intel-panel {
    background: #0d1520;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px; padding: 14px 16px;
    margin-bottom: 14px;
}
.intel-panel-title {
    font-size: 0.73em; font-weight: 600; color: #64748b; margin-bottom: 10px;
}
.intel-flags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.intel-flag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 3px;
    font-size: 0.74em; font-weight: 700; letter-spacing: 0;
    cursor: default;
}
/* Align flag colors exactly to index.html risk-badge / lane-urgency tokens */
.intel-flag-positive { background: rgba(16,185,129,0.1);  color: #10b981; }
.intel-flag-warning  { background: rgba(245,158,11,0.1);  color: #d97706; }
.intel-flag-critical { background: rgba(239,68,68,0.1);   color: #ef4444; }
.intel-flag-info     { background: rgba(148,163,184,0.1); color: #94a3b8; }
.intel-flag-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.intel-flag-positive .intel-flag-dot { background: #10b981; }
.intel-flag-warning  .intel-flag-dot { background: #f59e0b; }
.intel-flag-critical .intel-flag-dot { background: #ef4444; }
.intel-flag-info     .intel-flag-dot { background: #94a3b8; }

/* Confidence row - matches exec-dial panel row styling */
.confidence-row {
    display: grid; grid-template-columns: 90px 1fr 48px;
    align-items: center; gap: 9px;
    font-size: 0.76em; color: #94a3b8;
}
.confidence-track {
    height: 5px; border-radius: 999px;
    background: rgba(255,255,255,0.07); overflow: hidden;
}
.confidence-fill { height: 100%; border-radius: inherit; transition: width 0.7s ease; }

/* HNDL alerts - uses same token set as risk-badge + lane-urgency */
.hndl-alert {
    border-radius: 0 4px 4px 0; padding: 12px 15px; margin-bottom: 14px;
    border-left: 3px solid;
}
.hndl-alert-critical { background: rgba(239,68,68,0.07); border-color: #ef4444; }
.hndl-alert-high     { background: rgba(245,158,11,0.06); border-color: #d97706; }
.hndl-alert-title { font-weight: 800; font-size: 0.87em; margin-bottom: 4px; }
.hndl-alert-critical .hndl-alert-title { color: #fca5a5; }
.hndl-alert-high     .hndl-alert-title { color: #fde68a; }
.hndl-alert-body { font-size: 0.84em; color: #94a3b8; line-height: 1.55; }

/* Resource cards - matches finding-item card style */
.resource-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
    gap: 8px; margin-top: 8px;
}
.resource-card {
    background: #0d1520;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px; padding: 11px 12px;
    text-decoration: none; color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column; gap: 3px;
}
.resource-card:hover {
    border-color: rgba(240,165,0,0.4);
}
.resource-card-source { font-size: 0.72em; color: #64748b; }
.resource-card-title  { font-size: 0.85em; font-weight: 700; color: #f8fafc; line-height: 1.35; }
.resource-card-desc   { font-size: 0.78em; color: #4f6475; line-height: 1.45; margin-top: 1px; }

/* Dimension breakdown row - matches dim-row grid */
.dim-row {
    display: grid;
    grid-template-columns: 168px 1fr 60px 90px;
    align-items: center; gap: 10px;
    padding: 5px 2px; font-size: 0.85em; color: #cbd5e1;
}
.dim-row > div:last-child {
    display: flex; justify-content: flex-end;
}
.dim-bar-track {
    height: 9px; border-radius: 999px;
    background: rgba(255,255,255,0.07); overflow: hidden; position: relative;
}
.dim-bar-fill { height: 100%; border-radius: inherit; transition: width 0.7s ease; }

/* Reliability badge - matches cbom-mode-btn / filter-chip tokens */
.dim-rel-badge {
    font-size: 0.67em; padding: 2px 6px; border-radius: 3px;
    font-weight: 700; text-align: center;
    white-space: nowrap; flex-shrink: 0;
}
.dim-rel-high   { background: rgba(148,163,184,0.1); color: #94a3b8; }
.dim-rel-medium { background: rgba(148,163,184,0.08); color: #64748b; }
.dim-rel-low    { background: rgba(239,68,68,0.1); color: #ef4444; }

/* Score label badges - matches risk-badge token scale */
.dim-high   { background: rgba(34,197,94,0.1);   color: #22c55e; }
.dim-medium { background: rgba(245,158,11,0.1);  color: #d97706; }
.dim-low    { background: rgba(239,68,68,0.1);   color: #ef4444; }

/* Quiz result header - matches exec-overview grid */
.quiz-result-header {
    display: grid; grid-template-columns: 200px 1fr;
    gap: 12px; margin-bottom: 14px;
}
.quiz-score-dial-wrap {
    background: #0d1520;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px; padding: 16px;
    display: flex; flex-direction: column; align-items: center;
}
.quiz-maturity-wrap {
    background: #0d1520;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px; padding: 16px;
}

/* Maturity badge - matches detail-action / cbom-mode-btn.active */
.quiz-maturity-badge {
    display: inline-block; padding: 2px 7px; border-radius: 3px;
    font-size: 0.79em; font-weight: 700; margin-bottom: 7px;
    background: rgba(148,163,184,0.1);
    color: #94a3b8;
}
.quiz-maturity-name { font-size: 1.08em; font-weight: 800; color: #f8fafc; margin-bottom: 5px; }
.quiz-maturity-desc { font-size: 0.84em; color: #64748b; line-height: 1.5; }

.coherence-note { font-size: 0.74em; color: #f59e0b; margin-top: 6px; }

/* Compliance Calculator selection cards */
.calc-card {
    display: flex; align-items: center; gap: 0;
    cursor: pointer; padding: 9px 13px;
    background: #0d1520;
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid transparent;
    border-radius: 3px;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}
.calc-card:hover {
    border-color: rgba(255,255,255,0.12);
    border-left-color: rgba(240,165,0,0.3);
}
.calc-card:has(input:checked) {
    border-color: rgba(240,165,0,0.35);
    border-left-color: #F0A500;
    background: rgba(240,165,0,0.06);
}
.calc-card input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
.calc-card-label-name {
    font-size: 0.86em; font-weight: 600; color: #f8fafc;
}
.calc-card-label-sub {
    font-size: 0.72em; color: #4f6475; margin-top: 1px;
}

@media (max-width: 768px) {
    .quiz-result-header { grid-template-columns: 1fr; }
    .dim-row { grid-template-columns: 1fr 1fr; }
    .dim-row > :first-child { grid-column: 1/-1; }
    .resource-grid { grid-template-columns: 1fr; }
}