:root {
    --primary-emerald: #0f5132;
    --dark-emerald: #093621;
    --accent-gold: #d4af37;
    --bg-sand: #f8f9fa;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg-sand); color: var(--text-dark); display: flex; flex-direction: column; min-height: 100vh; }

.sf-navbar {
    background: var(--dark-emerald); color: white; padding: 0.85rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 3px solid var(--accent-gold); flex-wrap: wrap; gap: 1rem;
}
.sf-logo { font-weight: 700; font-size: 1.25rem; color: var(--accent-gold); }
.sf-tagline { font-size: 0.85rem; margin-left: 0.5rem; color: #cbd5e1; }
.sf-links a { color: white; text-decoration: none; margin-left: 1.2rem; font-size: 0.9rem; }
.sf-links a:hover { color: var(--accent-gold); }

.toolbar {
    background: white; padding: 0.8rem 2rem; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.toolbar-group { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.toolbar label { font-weight: 600; font-size: 0.9rem; }
select, input { padding: 0.5rem 0.75rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.9rem; }

.btn-primary { background: var(--primary-emerald); color: white; border: none; padding: 0.55rem 1rem; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-secondary { background: #e2e8f0; color: var(--text-dark); border: none; padding: 0.55rem 1rem; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-gold { background: var(--accent-gold); color: var(--dark-emerald); border: none; padding: 0.55rem 1rem; border-radius: 6px; font-weight: 700; cursor: pointer; }

.builder-bar {
    background: #ecfdf5; padding: 0.75rem 2rem; border-bottom: 1px solid #a7f3d0;
    display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
}
.builder-bar.hidden { display: none; }

.workspace { display: grid; grid-template-columns: 1fr 340px; flex: 1; min-height: 72vh; }
@media (max-width: 850px) { .workspace { grid-template-columns: 1fr; } }

.canvas-container { position: relative; display: flex; flex-direction: column; background: #ffffff; border-right: 1px solid var(--border-color); }
.hadith-banner {
    padding: 0.85rem 1.5rem; background: #f8fafc; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.verdict-pill { padding: 0.25rem 0.7rem; border-radius: 12px; font-size: 0.75rem; font-weight: 800; }
.verdict-pill.sahih { background: #dcfce7; color: #166534; }
.verdict-pill.daif { background: #fee2e2; color: #991b1b; }
#hadith-text { font-size: 0.9rem; font-weight: 500; color: var(--text-dark); }

#cy { flex: 1; width: 100%; min-height: 460px; }

.legend {
    padding: 0.6rem 1.5rem; background: #f8fafc; border-top: 1px solid var(--border-color);
    display: flex; gap: 1.2rem; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.dot.prophet { background: #d4af37; }
.dot.sahabi { background: #0f5132; }
.dot.thiqah { background: #16a34a; }
.dot.saduq { background: #0284c7; }
.dot.daif { background: #dc2626; }

.inspector { padding: 1.5rem; background: var(--bg-sand); }
.inspector h2 { font-size: 1.1rem; color: var(--dark-emerald); margin-bottom: 0.4rem; }
.inspector-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.2rem; line-height: 1.4; }
.inspector-card { background: white; padding: 1.25rem; border-radius: 10px; border: 1px solid var(--border-color); box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.inspector-card.hidden { display: none; }
.badge-row { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.rank-tag { background: #e2e8f0; color: var(--text-dark); font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 4px; }
.grade-tag { background: #dcfce7; color: #166534; font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 4px; }
.inspector-card h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }
.dates { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.divider { height: 1px; background: var(--border-color); margin: 0.9rem 0; }
.inspector-card h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.3rem; }
.bio, .continuity { font-size: 0.9rem; line-height: 1.45; margin-bottom: 0.9rem; }

.sf-footer { text-align: center; padding: 0.9rem; font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid var(--border-color); background: white; }
