:root {
    --t-ink: #0f1e36;
    --t-ink-2: #172a4a;
    --t-navy: #1b3a6b;
    --t-navy-2: #264b84;
    --t-gold: #a8802f;
    --t-gold-soft: #f5edda;
    --t-canvas: #f3f4f7;
    --t-surface: #ffffff;
    --t-line: #dde2ea;
    --t-line-soft: #eceff4;
    --t-text: #172033;
    --t-muted: #5b6577;
    --t-ok: #1f7a4d;
    --t-bad: #b42318;
    --t-warn: #9a6408;
    --t-radius-s: 6px;
    --t-radius: 8px;
    --t-radius-l: 12px;
    --t-shadow: 0 1px 2px rgba(15, 30, 54, .06), 0 1px 1px rgba(15, 30, 54, .03);
    --t-shadow-lift: 0 10px 30px rgba(15, 30, 54, .10);

    --font-sans: 'IBM Plex Sans', 'IBM Plex Sans Devanagari', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --navy: var(--t-navy);
    --navy-deep: var(--t-ink);
    --navy-soft: var(--t-navy-2);
    --brass: var(--t-gold);
    --brass-light: #d9c08a;
    --brass-pale: var(--t-gold-soft);
    --canvas: var(--t-canvas);
    --paper: var(--t-canvas);
    --ink: var(--t-text);
    --ink-muted: var(--t-muted);
    --line: var(--t-line);
    --success: var(--t-ok);
    --danger: var(--t-bad);

    --bs-primary: #1b3a6b;   --bs-primary-rgb: 27, 58, 107;
    --bs-success: #1f7a4d;   --bs-success-rgb: 31, 122, 77;
    --bs-danger: #b42318;    --bs-danger-rgb: 180, 35, 24;
    --bs-info: #1f6f8b;      --bs-info-rgb: 31, 111, 139;
    --bs-warning: #9a6408;   --bs-warning-rgb: 154, 100, 8;
    --bs-secondary: #5b6577; --bs-secondary-rgb: 91, 101, 119;
    --bs-body-color: var(--t-text);
    --bs-border-color: var(--t-line);
    --bs-link-color: var(--t-navy-2);
    --bs-link-color-rgb: 38, 75, 132;

    --stat-primary: #1b3a6b;   --stat-primary-soft: #e8edf6;
    --stat-success: #1f7a4d;   --stat-success-soft: #e6f2ec;
    --stat-danger:  #b42318;   --stat-danger-soft:  #fbeceb;
    --stat-info:    #1f6f8b;   --stat-info-soft:    #e6f1f5;
    --stat-gold:    #9a6408;   --stat-gold-soft:    #f7efdd;
    --stat-violet:  #4b3f8f;   --stat-violet-soft:  #eeecf7;
}
html body, html body *, html body *::before, html body *::after { font-family: var(--font-sans) !important; }
html body code, html body kbd, html body pre, html body .font-monospace { font-family: var(--font-mono) !important; }
html body .fa-ico { font-family: inherit !important; }

html body { background: var(--t-canvas); color: var(--t-text); letter-spacing: 0; font-feature-settings: "tnum" 0; }
html body h1, html body h2, html body h3,
html body .modal-title, html body .display-serif,
html body .admin-tab-content > h3, html body .inst-tab-content > h3,
html body .admin-tab-content h4.fw-bold, html body .inst-tab-content h4.fw-bold {
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    color: var(--t-ink);
}
html body h5, html body h6, html body .card-title { letter-spacing: 0; color: var(--t-ink); }
html body .text-dark { color: var(--t-text) !important; }
html body .text-muted { color: var(--t-muted) !important; }
html body .table td, html body .dashboard-card h2, html body .ra-stat-value, html body .badge { font-variant-numeric: tabular-nums; }
html body .table thead th, html body .table thead.table-light th {
    font-family: var(--font-sans) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    color: var(--t-muted) !important;
    background: #f7f8fa !important;
    border-bottom: 1px solid var(--t-line) !important;
}
html body .dashboard-card h6.text-uppercase, html body .ra-stat .ra-stat-label {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: var(--fs-sm) !important;
    font-weight: 500 !important;
    color: var(--t-muted) !important;
}
html body .header-strip { background: var(--t-ink) !important; border-bottom: 1px solid rgba(255,255,255,.06); color: rgba(255,255,255,.72); }
html body .header-strip a { color: rgba(255,255,255,.78) !important; }
html body .header-strip a:hover { color: #fff !important; }
html body #mainNav, html body .navbar-glass {
    background: var(--t-ink-2) !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: 2px solid var(--t-gold);
}
html body #mainNav .nav-link { color: rgba(255,255,255,.80) !important; border-radius: var(--t-radius-s); }
html body #mainNav .nav-link:hover, html body #mainNav .nav-link:focus-visible { color: #fff !important; background: rgba(255,255,255,.07); }
html body .navbar-brand .display-serif { font-family: var(--font-display) !important; font-size: 1.28rem; font-weight: 600 !important; color: #fff !important; }
html body .navbar-brand small { color: #d9c08a !important; opacity: 1 !important; letter-spacing: .08em !important; }
html body .crest-mark { background: var(--t-gold) !important; box-shadow: none !important; border-radius: 50% !important; color: var(--t-ink) !important; }
html body .sidebar { background: var(--t-ink) !important; border-right: 1px solid rgba(255,255,255,.04); }
html body .sidebar .nav-link {
    color: rgba(255,255,255,.70) !important;
    border-radius: 0 var(--t-radius-s) var(--t-radius-s) 0 !important;
    border: 0 !important;
    border-left: 3px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 1px 10px 1px 0 !important;
}
html body .sidebar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.05) !important; }
html body .sidebar .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.08) !important;
    border-left-color: var(--t-gold) !important;
    font-weight: 600 !important;
}
html body .sidebar .nav-link.active .fa-ico { color: #e1c98f !important; }
html body .sidebar .badge.bg-primary, html body .sidebar .badge.bg-primary-blue { background: var(--t-gold) !important; color: var(--t-ink) !important; }
html body .card { border: 1px solid var(--t-line) !important; border-radius: var(--t-radius-l) !important; box-shadow: var(--t-shadow) !important; background: var(--t-surface); }
html body .card.shadow-sm, html body .card.shadow { box-shadow: var(--t-shadow) !important; }
html body .dashboard-card { transition: border-color .15s; }
html body .dashboard-card:hover { transform: none !important; border-color: #c9d1dd !important; box-shadow: var(--t-shadow) !important; }
html body .dashboard-card h2 { font-weight: 600 !important; color: var(--t-ink) !important; }
html body .modal-content { border: 0; border-radius: var(--t-radius-l) !important; box-shadow: var(--t-shadow-lift); }
html body .modal-header.bg-dark, html body .modal-header.bg-primary, html body .modal-header.bg-primary-blue { background: var(--t-ink) !important; }
html body .dropdown-menu { border: 1px solid var(--t-line) !important; border-radius: var(--t-radius) !important; box-shadow: var(--t-shadow-lift) !important; }
html body .btn { border-radius: var(--t-radius) !important; font-weight: 500; letter-spacing: 0; box-shadow: none !important; transform: none !important; }
html body .btn-primary, html body .btn-primary-blue {
    background: var(--t-navy) !important; border-color: var(--t-navy) !important; color: #fff !important;
}
html body .btn-primary:hover, html body .btn-primary-blue:hover { background: var(--t-ink-2) !important; border-color: var(--t-ink-2) !important; }
html body .btn-outline-primary { color: var(--t-navy) !important; border-color: #b6c3da !important; }
html body .btn-outline-primary:hover { background: #eef2f8 !important; color: var(--t-ink) !important; }
html body .btn-success { background: var(--t-ok) !important; border-color: var(--t-ok) !important; }
html body .btn-danger { background: var(--t-bad) !important; border-color: var(--t-bad) !important; }
html body .btn-warning { background: var(--t-gold) !important; border-color: var(--t-gold) !important; color: #fff !important; }
html body .btn-warning:hover { background: #8e6a24 !important; border-color: #8e6a24 !important; }
html body .btn-light { background: #fff !important; border-color: var(--t-line) !important; color: var(--t-navy) !important; }
html body .form-control, html body .form-select {
    border: 1px solid #cfd6e0 !important; border-radius: var(--t-radius) !important; background-color: #fff;
    color: var(--t-text); box-shadow: none !important;
}
html body .form-control:focus, html body .form-select:focus {
    border-color: var(--t-navy-2) !important; box-shadow: 0 0 0 3px rgba(38, 75, 132, .16) !important;
}
html body .form-label { color: var(--t-text); font-weight: 500 !important; }
html body .form-check-input:checked { background-color: var(--t-navy); border-color: var(--t-navy); }
html body .input-group-text { background: #f7f8fa; border-color: #cfd6e0; }
html body :focus-visible { outline: 2px solid var(--t-navy-2); outline-offset: 2px; }
html body .nav-tabs .nav-link.active { color: var(--t-ink) !important; border-bottom-color: #fff; font-weight: 600; }
html body .nav-tabs .nav-link { color: var(--t-muted); }
html body .progress { background: #e7ebf1; border-radius: 99px; }
html body .progress-bar { background: var(--t-navy); }
html body .table { --bs-table-hover-bg: #f6f8fb; color: var(--t-text); }
html body .table > :not(caption) > * > * { border-bottom-color: var(--t-line-soft); padding-top: .65rem; padding-bottom: .65rem; }
html body .badge { border-radius: 99px; font-weight: 600; letter-spacing: 0; }
html body .badge.bg-primary, html body .badge.bg-primary-blue { background: var(--t-navy) !important; }
html body .hero-banner {
    background: var(--t-ink) !important;
    background-image: radial-gradient(circle at 78% 52%, rgba(168, 128, 47, .16), transparent 42%) !important;
}
html body .hero-mesh-grid, html body .hero-spotlight, html body .hero-aurora, html body .hero-shard { display: none !important; }
html body .hero-banner h1 {
    font-family: var(--font-display) !important; font-weight: 600 !important; color: #fff !important;
    letter-spacing: -0.02em; line-height: 1.05;
}
html body .hero-banner .accent-word {
    background: none !important; -webkit-text-fill-color: currentColor !important; color: #fff !important;
    font-style: normal !important; text-shadow: none !important; filter: none !important;
}
html body .hero-banner .btn-warning { color: var(--t-ink) !important; background: #d9b566 !important; border-color: #d9b566 !important; }

html body footer, html body .site-footer { background: var(--t-ink) !important; }
.qb-fill { border-left: 3px solid var(--t-gold) !important; }
.qb-source { border: 1px solid var(--t-line); border-radius: var(--t-radius); padding: 12px; background: #fbfcfd; height: 100%; }
.qbf-log { max-height: 260px; overflow: auto; border-top: 1px solid var(--t-line-soft); padding-top: 8px; }
.qbf-log li { padding: 5px 0 5px 14px; border-bottom: 1px solid var(--t-line-soft); position: relative; }
.qbf-log li::before { content: ""; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--t-ok); }
.qbf-log li.qbf-err::before { background: var(--t-bad); }
.qbf-log li.qbf-skip::before { background: #aab2bf; }
.qb-item { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border: 1px solid var(--t-line); border-radius: var(--t-radius); padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.qb-item.is-review { border-color: #e5cf9c; background: #fffcf4; }
.qb-item-q { font-weight: 600; font-size: var(--fs-base); color: var(--t-ink); }
.qb-item-opts { margin: 6px 0 4px; padding-left: 1.3rem; list-style: upper-alpha; font-size: var(--fs-sm); color: var(--t-muted); columns: 2; column-gap: 24px; }
.qb-item-opts li { font-size: var(--fs-sm) !important; }
.qb-item-opts li.is-correct { color: var(--t-ok); font-weight: 600; }
.qb-item-meta { font-size: .68rem; color: #8a93a3; }

@media (prefers-reduced-motion: reduce) {
    html body *, html body *::before, html body *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

html body .hero-banner h1 .accent-word,
html body #heroBanner h1 span.accent-word { color: #fff !important; -webkit-text-fill-color: #fff !important; background: none !important; font-family: var(--font-display) !important; font-style: normal !important; font-weight: 600 !important; text-shadow: none !important; animation: none !important; padding: 0 !important; }
html body .hero-banner .btn::before, html body .hero-banner .btn::after { display: none !important; }
html body .hero-banner .btn { box-shadow: none !important; }
html body .hero-exam-btn { border-color: rgba(255,255,255,.35) !important; color: #fff !important; background: transparent !important; }
html body .hero-exam-btn:hover { background: rgba(255,255,255,.08) !important; }
html body .hcf-name { font-family: 'Cormorant Garamond', Georgia, serif !important; font-style: italic; font-weight: 600; }
html body .hcf-title, html body .hmf-title { font-family: 'Cinzel', Georgia, serif !important; }
html body .hero-banner h1 .accent-word { -webkit-background-clip: border-box !important; background-clip: border-box !important; filter: none !important; display: inline !important; transform: none !important; }
html body .dashboard-card h2, html body .ra-stat-value { font-family: var(--font-sans) !important; font-weight: 600 !important; letter-spacing: -0.01em; }
html body .sidebar .nav-link { font-weight: 500 !important; }
.qbf-log li { font-size: var(--fs-sm) !important; }
.qb-server-state { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid #d6dde7; background: #f6f8fb; color: #475569; }
.qb-server-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.qb-server-state.is-ok { background: #ecfdf3; border-color: #a7e3bf; color: #116b3a; }
.qb-server-state.is-ok .dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.qb-server-state.is-bad { background: #fef2f2; border-color: #f3c0c0; color: #a11d1d; }
.qb-server-state.is-bad .dot { background: #dc2626; }
.qbf-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.qbf-stat { border: 1px solid var(--t-line); border-radius: 10px; padding: 8px 10px; background: #fff; text-align: center; }
.qbf-stat .v { font-size: 1.25rem; font-weight: 800; line-height: 1.1; color: #0f172a; font-variant-numeric: tabular-nums; }
.qbf-stat .l { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; font-weight: 700; }
.qbf-stat.is-ok .v { color: #15803d; } .qbf-stat.is-dup .v { color: #b45309; } .qbf-stat.is-warn .v { color: #7c3aed; } .qbf-stat.is-bad .v { color: #dc2626; }
@media (max-width: 767px) { .qbf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
