/* RewriteForge — Main Stylesheet */

:root {
    --rf-primary:   #4f46e5;   /* indigo */
    --rf-secondary: #7c3aed;   /* violet */
    --rf-success:   #059669;
    --rf-danger:    #dc2626;
    --rf-bg:        #f8f9ff;
    --rf-card:      #ffffff;
    --rf-border:    #e2e8f0;
    --rf-text:      #1e293b;
    --rf-muted:     #64748b;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--rf-bg);
    color: var(--rf-text);
    margin: 0;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.rf-header {
    background: linear-gradient(135deg, var(--rf-primary), var(--rf-secondary));
    color: #fff;
    padding: 1.25rem 2rem;
}
.rf-header-inner {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}
.rf-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
}
.rf-header-text h1 {
    margin: 0 0 0.15rem;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.rf-header-text p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.rf-container {
    max-width: 820px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.rf-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--rf-border);
}
.rf-tab {
    padding: 0.6rem 1.4rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--rf-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.rf-tab:hover { color: var(--rf-primary); }
.rf-tab.active {
    color: var(--rf-primary);
    border-bottom-color: var(--rf-primary);
}

/* ── Panel ───────────────────────────────────────────────────────────────────── */
.rf-panel { display: none; }
.rf-panel.active { display: block; }

/* ── Card ────────────────────────────────────────────────────────────────────── */
.rf-card {
    background: var(--rf-card);
    border: 1px solid var(--rf-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* ── Form elements ───────────────────────────────────────────────────────────── */
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rf-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
textarea {
    width: 100%;
    min-height: 160px;
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--rf-text);
    resize: vertical;
    transition: border-color 0.15s;
    background: #fafbff;
}
textarea:focus {
    outline: none;
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
select {
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--rf-text);
    background: #fafbff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
select:focus { outline: none; border-color: var(--rf-primary); }

.rf-form-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* ── Button ──────────────────────────────────────────────────────────────────── */
.rf-btn {
    padding: 0.6rem 1.6rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}
.rf-btn:hover  { opacity: 0.9; }
.rf-btn:active { transform: scale(0.98); }
.rf-btn-primary {
    background: linear-gradient(135deg, var(--rf-primary), var(--rf-secondary));
    color: #fff;
}
.rf-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Result box ──────────────────────────────────────────────────────────────── */
.rf-result {
    margin-top: 1rem;
    display: none;
}
.rf-result.visible { display: block; }

.rf-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.rf-badge-ai     { background: #fef2f2; color: var(--rf-danger); }
.rf-badge-human  { background: #f0fdf4; color: var(--rf-success); }
.rf-badge-info   { background: #eff6ff; color: #2563eb; }

.rf-confidence {
    font-size: 0.85rem;
    color: var(--rf-muted);
    margin-bottom: 0.75rem;
}

.rf-score-bar {
    height: 6px;
    background: var(--rf-border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.rf-score-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.rf-score-fill.ai    { background: var(--rf-danger); }
.rf-score-fill.human { background: var(--rf-success); }

.rf-rewrite-output {
    background: #fafbff;
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.rf-meta {
    font-size: 0.8rem;
    color: var(--rf-muted);
    margin-top: 0.5rem;
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.rf-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rf-btn.loading .rf-spinner { display: inline-block; }
.rf-btn.loading .rf-btn-text { opacity: 0.7; }

/* ── Error ───────────────────────────────────────────────────────────────────── */
.rf-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--rf-danger);
    font-size: 0.9rem;
}

/* ── Dual scan result ────────────────────────────────────────────────────────── */
.rf-dual-scans {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.rf-scan-section {
    padding: 0.85rem 0;
}
.rf-scan-section + .rf-scan-section {
    border-top: 1px solid var(--rf-border);
}
.rf-scan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.rf-scan-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rf-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rf-scan-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.rf-scan-stat {
    display: grid;
    grid-template-columns: 3.5rem 1fr 2.8rem;
    align-items: center;
    gap: 0.5rem;
}
.rf-scan-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
}
.rf-scan-stat-label.ai    { color: var(--rf-danger); }
.rf-scan-stat-label.human { color: var(--rf-success); }
.rf-scan-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.rf-scan-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.rf-scan-fill.ai    { background: var(--rf-danger); }
.rf-scan-fill.human { background: var(--rf-success); }
.rf-scan-stat-val {
    font-size: 0.75rem;
    font-weight: 700;
    text-align: right;
}
.rf-scan-stat-val.ai    { color: var(--rf-danger); }
.rf-scan-stat-val.human { color: var(--rf-success); }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.rf-footer {
    text-align: center;
    color: var(--rf-muted);
    font-size: 0.8rem;
    padding: 2rem 0;
}

/* ── Word counter ────────────────────────────────────────────────────────────── */
.rf-textarea-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.4rem;
    min-height: 1.2em;
}
.rf-word-count {
    font-size: 0.8rem;
    color: var(--rf-muted);
    white-space: nowrap;
}
.rf-word-count.rf-count-warn { color: #d97706; }
.rf-word-count.rf-count-over { color: var(--rf-danger); font-weight: 600; }

.rf-word-hint {
    font-size: 0.8rem;
    color: var(--rf-muted);
}
.rf-word-hint.rf-hint-warn  { color: #d97706; }
.rf-word-hint.rf-hint-error { color: var(--rf-danger); }

/* ── Notice (info box) ───────────────────────────────────────────────────────── */
.rf-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    color: #1d4ed8;
    margin-bottom: 0.75rem;
}

/* ── Sentence editor ─────────────────────────────────────────────────────────── */
.rf-edit-summary-text {
    font-size: 0.9rem;
    color: var(--rf-muted);
    margin-bottom: 1rem;
}

.rf-edit-clean {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--rf-success);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.rf-sentence-card {
    background: var(--rf-card);
    border: 1px solid #fed7aa;
    border-left: 4px solid #f97316;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.rf-sentence-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.rf-sentence-num {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f97316;
    white-space: nowrap;
}

.rf-sentence-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.rf-chip {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid;
}
.rf-chip-pattern {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.rf-chip-pattern:hover { background: #fde68a; }
.rf-chip-structural {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.rf-chip-structural:hover { background: #dbeafe; }
.rf-chip.rf-chip-resolved {
    background: #f0fdf4;
    border-color: #86efac;
    color: var(--rf-success);
    text-decoration: line-through;
    opacity: 0.7;
}

.rf-sentence-preview {
    font-size: 0.88rem;
    line-height: 1.65;
    padding: 0.4rem 0 0.6rem;
    border-bottom: 1px solid var(--rf-border);
    margin-bottom: 0.5rem;
    color: var(--rf-text);
}

mark.rf-mark-pattern {
    background: #fef08a;
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
    cursor: help;
}

mark.rf-mark-structural {
    background: #bfdbfe;
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
    cursor: help;
}

.rf-sentence-ta {
    width: 100%;
    min-height: 60px;
    border: 1px solid var(--rf-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--rf-text);
    resize: vertical;
    background: #fafbff;
}
.rf-sentence-ta:focus {
    outline: none;
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

/* ── Live preview box ────────────────────────────────────────────────────────── */
.rf-preview-box {
    background: var(--rf-card);
    border: 1px solid var(--rf-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.rf-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.rf-preview-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--rf-text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow-y: auto;
    min-height: 2em;
}

.rf-copy-assembled-btn {
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    background: var(--rf-border);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--rf-muted);
    font-weight: 600;
}
.rf-copy-assembled-btn:hover { background: #cbd5e1; }

#edit-check-btn { margin: 0.5rem 0 0.75rem; }
#edit-check-result { margin-top: 0.5rem; }

/* ── Synonym popup ───────────────────────────────────────────────────────────── */
.rf-synonym-popup {
    position: fixed;
    background: #fff;
    border: 1px solid var(--rf-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    padding: 0.75rem;
    z-index: 1000;
    min-width: 180px;
    max-width: 280px;
}

.rf-popup-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rf-muted);
    margin-bottom: 0.5rem;
}

.rf-popup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

.rf-popup-chip {
    padding: 0.22rem 0.6rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #1d4ed8;
    cursor: pointer;
    transition: background 0.15s;
}
.rf-popup-chip:hover { background: #dbeafe; }

.rf-popup-keep {
    font-size: 0.78rem;
    color: var(--rf-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0;
    text-decoration: underline;
    display: block;
}

.rf-popup-tip {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rf-text);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.rf-popup-advice {
    font-size: 0.8rem;
    color: var(--rf-muted);
    line-height: 1.5;
    margin-bottom: 0.4rem;
}

.rf-popup-loading,
.rf-popup-none { font-size: 0.82rem; color: var(--rf-muted); }

/* ── Two-pane rewrite result ─────────────────────────────────────────────────── */
.rf-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.rf-analysis-pane,
.rf-rewrite-pane {
    background: var(--rf-card);
    border: 1px solid var(--rf-border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    min-width: 0;
}

.rf-pane-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rf-muted);
    margin-bottom: 0.75rem;
}

.rf-highlighted-text {
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow-y: auto;
}

mark.rf-highlight {
    background: #fef08a;
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
}

.rf-pattern-count {
    font-size: 0.8rem;
    color: var(--rf-muted);
    margin-top: 0.6rem;
}

@media (max-width: 600px) {
    .rf-result-grid { grid-template-columns: 1fr; }
}

/* ── Copy button ─────────────────────────────────────────────────────────────── */
.rf-copy-btn {
    float: right;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    background: var(--rf-border);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--rf-muted);
    font-weight: 600;
}
.rf-copy-btn:hover { background: #cbd5e1; }

/* ── Phrase Check tab ────────────────────────────────────────────────────────── */

/* Risk summary row */
.rf-pc-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.rf-pc-counts {
    font-size: 0.82rem;
    color: var(--rf-muted);
}

/* Risk badge */
.rf-pc-risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}
.rf-pc-risk-none      { background: #f0fdf4; color: #059669; }
.rf-pc-risk-low       { background: #eff6ff; color: #2563eb; }
.rf-pc-risk-medium    { background: #fffbeb; color: #d97706; }
.rf-pc-risk-high      { background: #fff7ed; color: #ea580c; }
.rf-pc-risk-very-high { background: #fef2f2; color: #dc2626; }

/* Highlighted text */
.rf-pc-preview-text {
    font-size: 0.9rem;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 0.75rem;
}
mark.rf-pc-mark-3 { background: #fecaca; color: inherit; border-radius: 3px; padding: 0 2px; cursor: help; }
mark.rf-pc-mark-2 { background: #fef3c7; color: inherit; border-radius: 3px; padding: 0 2px; cursor: help; }
mark.rf-pc-mark-1 { background: #dbeafe; color: inherit; border-radius: 3px; padding: 0 2px; cursor: help; }

/* Legend */
.rf-pc-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rf-pc-legend-item {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
}

/* Phrase cards */
.rf-pc-card {
    background: var(--rf-card);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.rf-pc-card-sev-3 { border: 1px solid #fca5a5; border-left: 4px solid #dc2626; }
.rf-pc-card-sev-2 { border: 1px solid #fcd34d; border-left: 4px solid #d97706; }
.rf-pc-card-sev-1 { border: 1px solid #93c5fd; border-left: 4px solid #2563eb; }

.rf-pc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.rf-pc-phrase {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--rf-text);
}

/* Category badges */
.rf-pc-cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}
.rf-pc-cat-cliche     { background: #fce7f3; color: #9d174d; }
.rf-pc-cat-transition { background: #ede9fe; color: #5b21b6; }
.rf-pc-cat-hedge      { background: #fff7ed; color: #c2410c; }
.rf-pc-cat-corporate  { background: #ecfdf5; color: #065f46; }
.rf-pc-cat-conclusion { background: #fef3c7; color: #78350f; }
.rf-pc-cat-filler     { background: #f0f9ff; color: #075985; }
.rf-pc-cat-ai_self    { background: #fef2f2; color: #7f1d1d; }

.rf-pc-card-body {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}
.rf-pc-sev {
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}
.rf-pc-sev-3 { background: #fecaca; color: #7f1d1d; }
.rf-pc-sev-2 { background: #fef3c7; color: #78350f; }
.rf-pc-sev-1 { background: #dbeafe; color: #1e40af; }

.rf-pc-note {
    font-size: 0.83rem;
    color: var(--rf-muted);
    line-height: 1.4;
}
.rf-pc-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rf-muted);
}

/* Phrase Check — severity chips on sentence cards */
.rf-pc-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-pc-chip-sev-3 { background: #fecaca; border-color: #f87171; color: #7f1d1d; }
.rf-pc-chip-sev-3:hover { background: #fca5a5; }
.rf-pc-chip-sev-2 { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
.rf-pc-chip-sev-2:hover { background: #fde68a; }
.rf-pc-chip-sev-1 { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.rf-pc-chip-sev-1:hover { background: #bfdbfe; }
#phrase-check-btn { margin: 0.5rem 0 0.75rem; }
#phrase-check-result { margin-top: 0.5rem; }

/* ── Text Stats tab ──────────────────────────────────────────────────────────── */
.rf-stats-intro {
    font-size: 0.85rem;
    color: var(--rf-muted);
    line-height: 1.55;
    margin-bottom: 1rem;
}
.rf-stats-intro strong { color: var(--rf-text); }

.rf-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rf-stat-card {
    background: var(--rf-card);
    border: 1px solid var(--rf-border);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.rf-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.35rem;
}

.rf-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rf-muted);
}

.rf-stat-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}
.rf-stat-good { background: #dcfce7; color: #166534; }
.rf-stat-warn { background: #fef9c3; color: #854d0e; }
.rf-stat-bad  { background: #fee2e2; color: #991b1b; }

.rf-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rf-text);
    margin-bottom: 0.3rem;
}

.rf-stat-tip {
    font-size: 0.76rem;
    color: var(--rf-muted);
    line-height: 1.4;
}

.rf-stats-note {
    font-size: 0.78rem;
    color: var(--rf-muted);
}

/* Edit tab compact stats bar */
.rf-edit-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.rf-edit-stat {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--rf-muted);
    border: 1px solid var(--rf-border);
}
.rf-edit-stat-good { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.rf-edit-stat-warn { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.rf-edit-stat-bad  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

@media (max-width: 480px) {
    .rf-stats-grid { grid-template-columns: 1fr 1fr; }
}
