/* ============================================================
   Sistema de Ajuda - Regulatorio BACEN
   Light Theme - Professional Banking Design
   ============================================================ */

:root {
    --primary: #1a56db;
    --primary-light: #e8eefb;
    --primary-dark: #1444af;
    --secondary: #0f172a;
    --accent: #2563eb;

    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-input: #ffffff;

    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --cat-operacional: #2563eb;
    --cat-contabil: #059669;
    --cat-risco: #dc2626;
    --cat-credito: #d97706;
    --cat-fiscal: #7c3aed;
    --cat-cambio: #0891b2;

    --freq-diario: #dc2626;
    --freq-semanal: #ea580c;
    --freq-mensal: #2563eb;
    --freq-trimestral: #7c3aed;
    --freq-semestral: #0891b2;
    --freq-anual: #059669;
    --freq-sob-demanda: #6b7280;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Layout ---- */
.app-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Header ---- */
.site-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.95);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.header-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.header-brand .brand-text h1 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--secondary);
}

.header-brand .brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-item .stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Header Nav ---- */
.header-nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-link i { font-size: 18px; }

/* ---- BiBlue Header CTA ---- */
.header-biblue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.header-biblue:hover {
    background: var(--bg-hover);
}

.biblue-logo {
    height: 28px;
    width: auto;
}

.biblue-cta {
    font-size: 0.6875rem;
    color: var(--primary);
    font-weight: 600;
    white-space: nowrap;
}

.header-biblue:hover .biblue-cta {
    text-decoration: underline;
}

/* ---- Search ---- */
.search-section {
    padding: 32px 0 24px;
}

.search-box {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 1rem;
    font-family: var(--font);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light), var(--shadow);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-hint {
    text-align: center;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.search-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
}

/* ---- Filters ---- */
.filters-section {
    padding-bottom: 24px;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

.filter-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-pill .pill-count {
    font-size: 0.6875rem;
    background: rgba(0,0,0,0.08);
    padding: 1px 7px;
    border-radius: 100px;
    font-weight: 600;
}

.filter-pill.active .pill-count {
    background: rgba(255,255,255,0.25);
}

.filter-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    align-self: center;
    margin: 0 4px;
}

/* ---- Results Info ---- */
.results-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.results-info strong {
    color: var(--text);
}

/* ---- Card Grid ---- */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding-bottom: 48px;
}

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.topic-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.topic-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.topic-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.topic-card-title {
    flex: 1;
    min-width: 0;
}

.topic-card-title h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 4px;
}

.topic-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.topic-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.topic-card-footer .area {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
    line-height: 1.6;
}

.badge-cat {
    color: white;
}

.badge-freq {
    background: var(--bg-hover);
}

.badge-outline {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
}

/* ---- Detail Page ---- */
.detail-page {
    padding: 32px 0 64px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .sep {
    font-size: 0.75rem;
}

.detail-header {
    margin-bottom: 32px;
}

.detail-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.detail-badges .badge {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.detail-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.detail-card-header i {
    color: var(--primary);
    font-size: 18px;
}

.detail-card-body {
    padding: 20px;
}

.detail-card-body p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Download button */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-download:hover {
    background: var(--primary);
    color: white;
}

.btn-download i {
    font-size: 16px;
}

/* Example box */
.example-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    position: relative;
}

.example-box::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 3px 0 0 3px;
}

/* Info table */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid var(--border-light);
}

.info-table tr:last-child {
    border-bottom: none;
}

.info-table th {
    text-align: left;
    padding: 10px 16px 10px 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    width: 140px;
    vertical-align: top;
}

.info-table td {
    padding: 10px 0;
    font-size: 0.875rem;
    color: var(--text);
}

/* Sidebar */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.sidebar-card h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.related-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.related-list li a:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.related-list li a i {
    font-size: 16px;
    color: var(--text-muted);
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: all 0.15s ease;
}

.back-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ---- Mark (search highlight) ---- */
mark {
    background: #fef08a;
    color: inherit;
    padding: 1px 2px;
    border-radius: 2px;
}

/* ---- Canal de Envio ---- */
.canal-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8125rem;
    word-break: break-all;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.canal-link:hover { text-decoration: underline; }

.endpoint-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    flex-wrap: wrap;
}

.endpoint-box code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: #059669;
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.canal-topicos-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.canal-topico-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.canal-topico-item:hover {
    background: var(--bg-hover);
}

.canal-topico-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.canal-topico-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.canal-topico-nome {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canal-topico-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Canal internal nav */
.canal-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    position: sticky;
    top: 68px;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.canal-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 100px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.canal-nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.canal-nav-item i { font-size: 14px; }

/* Canal content prose */
.canal-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Formatted content */
.content-toc {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.content-toc-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.content-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.content-toc li a {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    display: block;
    transition: background 0.15s;
}

.content-toc li a:hover {
    background: var(--primary-light);
}

.content-toc li.toc-sub a {
    padding-left: 24px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.content-body .content-h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    scroll-margin-top: 140px;
}

.content-body .content-h2:first-child {
    margin-top: 0;
}

.content-body .content-h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    margin: 16px 0 8px;
    scroll-margin-top: 140px;
}

.content-body .content-p {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.content-body .content-ol,
.content-body .content-ul {
    margin: 8px 0 12px;
    padding-left: 20px;
}

.content-body .content-ol li,
.content-body .content-ul li {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 3px 0;
}

.content-body .content-ul-nested {
    padding-left: 36px;
    margin: 4px 0;
}

.content-body .content-ul-nested li.nested {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.content-body .content-code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 4px;
    color: #059669;
}

/* Scroll target offset */
.detail-card[id] {
    scroll-margin-top: 130px;
}

/* Canal badge in topico.php */
.canal-envio-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s ease;
}

.canal-envio-link:hover {
    background: var(--primary);
    color: white;
}

.canal-envio-link i { font-size: 16px; }

/* ---- Glossário Tags (sidebar) ---- */
.glossario-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.glossario-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid transparent;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.glossario-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---- Glossário ---- */
.alpha-index {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 20px;
}

.alpha-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
}

.alpha-letter:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.glossario-group {
    margin-bottom: 32px;
}

.glossario-letter {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    padding: 8px 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 12px;
    scroll-margin-top: 80px;
}

.glossario-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 12px;
}

.glossario-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glossario-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.glossario-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.glossario-termo {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-mono);
}

.glossario-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.glossario-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 4px;
    border-top: 1px solid var(--border-light);
}

.glossario-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.glossario-meta code, .glossario-meta span {
    font-family: var(--font-mono);
}

/* Glossario link in example */
.glossario-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    cursor: help;
}

.glossario-link:hover {
    background: var(--primary-light);
    border-bottom-style: solid;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-brand { flex: 1; }

    .header-biblue {
        flex-direction: row;
        padding: 6px 12px;
    }

    .header-biblue .biblue-logo { height: 22px; }

    .header-stats {
        display: none !important;
    }

    .topics-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .filter-divider {
        display: none;
    }

    .detail-header h1 {
        font-size: 1.375rem;
    }
}

@media (max-width: 480px) {
    .app-wrapper {
        padding: 0 16px;
    }

    .header-inner {
        padding: 0 16px;
    }

    .search-box input {
        font-size: 16px; /* prevent zoom on iOS */
    }
}

/* ---- Loading skeleton ---- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border-light) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---- Print ---- */
@media print {
    .site-header,
    .search-section,
    .filters-section,
    .site-footer,
    .back-link { display: none; }

    .detail-grid { grid-template-columns: 1fr; }

    .topic-card { break-inside: avoid; }

    body { background: white; }
}