/* Styles for /sample-assessment and its per-vertical wrapper pages. */

body { font-family: 'Inter', sans-serif; }

.step-num {
    width: 2.25rem; height: 2.25rem; flex-shrink: 0;
    border-radius: 9999px; background: #D80650; color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

.json-block {
    background: #0E0129; color: #e2e8f0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.78rem; line-height: 1.6;
    padding: 1.25rem; border-radius: 0.75rem;
    overflow-x: auto; white-space: pre;
}
.json-key   { color: #93c5fd; }
.json-str   { color: #86efac; }
.json-num   { color: #fbbf24; }
.json-comm  { color: #64748b; font-style: italic; }

/* Per-control factor-decomposition table (step 3 of the sample assessment). */
.factor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: auto;
}

/* Numeric columns (Raw / Weight / Contribution): width:1% collapses each
   column to its content width so the NOTE column absorbs all extra space.
   Without this, table-layout:auto over-sizes the numeric columns and the
   values drift right of where their headers sit. */
.factor-table thead th.num-col,
.factor-table td.num {
    width: 1%;
    white-space: nowrap;
}

.factor-table thead th {
    background: #f3f4f6;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.7rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.factor-table thead th.num-col,
.factor-table tfoot th.ft-sum { text-align: right; }

.factor-table tbody tr {
    background: white;
    border-bottom: 1px solid #f3f4f6;
}
.factor-table tbody tr:last-child { border-bottom: 0; }
.factor-table tbody tr:hover { background: #fafbfc; }

.factor-table td {
    padding: 0.75rem 1.1rem;
    vertical-align: top;
}

/* Factor cell: badge + name as proper flex children so `gap` guarantees
   they never collide. Previously used inline-flex + margin-right which
   visually merged the badge with the first letter of the name on rows
   where both started with the same character (D/Dependency, R/Regulatory). */
.factor-table .factor-cell {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    white-space: nowrap;
}
.factor-table .factor-name {
    font-weight: 600;
    color: #1f2937;
}

.factor-table .factor-note {
    color: #4b5563;
    font-size: 0.82rem;
    line-height: 1.55;
}

.factor-table .num {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.factor-table .num-raw          { color: #374151; font-weight: 600; }
.factor-table .num-weight       { color: #9ca3af; font-size: 0.82rem; }
.factor-table .num-contribution {
    color: #D80650;
    font-weight: 700;
    font-size: 1rem;
}

.factor-table tfoot th {
    background: #fafbfc;
    padding: 0.85rem 1.1rem;
    border-top: 2px solid #e5e7eb;
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: normal;
}
.factor-table tfoot th.ft-label {
    color: #4b5563;
    font-weight: 600;
}
.factor-table tfoot th.ft-sum {
    width: 1%;
    white-space: nowrap;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-variant-numeric: tabular-nums;
    color: #D80650;
    font-weight: 700;
    font-size: 1.1rem;
}

@media (max-width: 640px) {
    .factor-table { font-size: 0.78rem; }
    .factor-table thead th,
    .factor-table td,
    .factor-table tfoot th { padding: 0.55rem 0.7rem; }
    .factor-table .factor-cell { gap: 0.5rem; }
    .factor-table .num-contribution { font-size: 0.9rem; }
}

/* Uniform letter badges across all seven factors. Block sizing inside the
   flex factor-cell guarantees identical shape regardless of color. */
.factor-letter {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.4rem;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}
.fl-t { background: #ef4444; }
.fl-d { background: #3b82f6; }
.fl-e { background: #10b981; }
.fl-b { background: #f59e0b; }
.fl-r { background: #8b5cf6; }
.fl-c { background: #0891b2; }  /* darker cyan; previous #06b6d4 read as low-contrast */
.fl-a { background: #ec4899; }

.vertical-picker {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: white;
    font-size: 0.9rem; font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.vertical-picker:focus { outline: 2px solid #D80650; outline-offset: 2px; }

#pageLoader.fade-out { opacity: 0; pointer-events: none; }
@keyframes fmPulse { 0%,100% { opacity: 1 } 50% { opacity: 0.5 } }
