/* =========================================================
   File-Based Limitations Widget - Chapter 11.01
   ========================================================= */
.file-risk-widget {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.fr-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.fr-tab {
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fr-tab:hover,
.fr-tab.active {
    background: #0f172a;
    border-color: #0f172a;
    color: white;
    transform: translateY(-1px);
}

.fr-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.fr-panel {
    padding: 1rem;
    border-radius: 22px;
    background: white;
    border: 1px solid #e2e8f0;
}

.fr-file-panel {
    border-color: #fed7aa;
    background: #fff7ed;
}

.fr-db-panel {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.fr-label {
    display: inline-block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #64748b;
}

.fr-panel h3 {
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.fr-file-lines {
    display: grid;
    gap: 0.45rem;
    margin: 0.8rem 0;
}

.fr-file-lines p {
    margin: 0;
    padding: 0.45rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.28);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
}

.fr-arrow {
    align-self: center;
    justify-self: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: white;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.fr-score-box {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.fr-score-box span {
    font-weight: 800;
    color: #334155;
}

.fr-meter {
    margin-top: 0.55rem;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.fr-meter span {
    display: block;
    height: 100%;
    width: 88%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f97316, #e6004f);
    transition: width 0.35s ease;
}

.fr-explanation {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    color: #581c87;
    font-weight: 650;
    line-height: 1.6;
}

@media (max-width: 780px) {
    .fr-layout {
        grid-template-columns: 1fr;
    }
    .fr-arrow {
        transform: rotate(90deg);
    }
}
