.tags-explorer,
.writers-scope {
    --discovery-accent: #f94d00;
    --discovery-border: var(--vr-border-color, #e5e7eb);
    --discovery-surface: var(--vr-body-bg, #fff);
    --discovery-text: var(--vr-text-main, #212529);
    --discovery-muted: var(--vr-text-muted, #6c757d);
    color: var(--discovery-text);
}

[data-bs-theme="dark"] .tags-explorer,
[data-bs-theme="dark"] .writers-scope {
    --discovery-border: #343a40;
    --discovery-surface: #17191d;
    --discovery-text: #f1f3f5;
    --discovery-muted: #adb5bd;
}

.discovery-heading .text-uppercase { color: var(--discovery-accent); letter-spacing: .08em; }
.discovery-heading .text-muted { color: var(--discovery-muted) !important; }
.discovery-panel {
    padding: 1rem;
    border: 1px solid var(--discovery-border);
    border-radius: .75rem;
    background: var(--discovery-surface);
}
.tags-explorer .form-control,
.writers-scope .form-control {
    min-height: 44px;
    background-color: var(--discovery-surface);
    border-color: var(--discovery-border);
    color: var(--discovery-text);
}
.tags-explorer .form-control:focus,
.writers-scope .form-control:focus {
    border-color: var(--discovery-accent);
    box-shadow: 0 0 0 .2rem rgb(249 77 0 / 15%);
}
.tags-explorer .btn-custom,
.writers-scope .btn-custom { background: var(--discovery-accent); border-color: var(--discovery-accent); }
.tag-period-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-period-filter {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: .45rem .85rem;
    border: 1px solid var(--discovery-border);
    border-radius: 999px;
    background: var(--discovery-surface);
    color: var(--discovery-muted);
    font-size: .9rem;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.tag-period-filter:hover,
.tag-period-filter.active { border-color: var(--discovery-accent); background: var(--discovery-accent); color: #fff; }
.tag-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .75rem; }
.tag-directory-item {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    border: 1px solid var(--discovery-border);
    border-radius: .65rem;
    background: var(--discovery-surface);
    color: var(--discovery-text);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.tag-directory-item:hover { border-color: var(--discovery-accent); color: var(--discovery-accent); transform: translateY(-1px); }
.tag-directory-name { font-weight: 600; overflow-wrap: anywhere; }
.tag-directory-count { color: var(--discovery-muted); font-size: .85rem; white-space: nowrap; }
.discovery-empty {
    padding: 1.25rem;
    border: 1px dashed var(--discovery-border);
    border-radius: .65rem;
    color: var(--discovery-muted);
    text-align: center;
}
